diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index 4ba927c1db..b7b54d5cd0 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -1,4 +1,5 @@ -using CalamityMod.NPCs.CeaselessVoid; +using CalamityMod.NPCs.AstrumAureus; +using CalamityMod.NPCs.CeaselessVoid; using CalamityMod.NPCs.Crabulon; using CalamityMod.NPCs.ExoMechs.Apollo; using CalamityMod.NPCs.ExoMechs.Artemis; @@ -39,6 +40,9 @@ namespace CalamityMod.Balancing IBalancingRule ResistTrueMelee(float f) => new ClassResistBalancingRule(f, TrueMeleeDamageClass.Instance); // Declare specific filters. + bool BigGaelsSkullFilter(Projectile p) => + p.type == ProjectileType() && p.ai[1] == 1; + bool DragonRageFilter(Projectile p) => p.type == ProjectileType() || p.type == ProjectileType() || (p.type == ProjectileType() && p.CountsAsClass()); @@ -48,12 +52,6 @@ namespace CalamityMod.Balancing bool MushroomSpearFilter(Projectile p) => p.type == ProjectileID.Mushroom && Main.player[p.owner].ActiveItem().type == ItemID.MushroomSpear; - bool TrueNightsEdgeFilter(Projectile p) => - p.type == ProjectileID.NightBeam && Main.player[p.owner].ActiveItem().type == ItemID.TrueNightsEdge; - - bool TerraBladeFilter(Projectile p) => - p.type == ProjectileID.TerraBeam && Main.player[p.owner].ActiveItem().type == ItemID.TerraBlade; - bool SpectreMaskSetBonusFilter(Projectile p) => p.type == ProjectileID.SpectreWrath && Main.player[p.owner].ghostHurt; @@ -71,12 +69,6 @@ namespace CalamityMod.Balancing // Nerf Cursed Dart flames by 50%. Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CursedDartFlame)), - // Nerf True Night's Edge projectiles by 33% to cancel out the 1.5x multiplier it gets. - Do(new ProjectileSpecificRequirementBalancingRule(1f / 3f * 2f, TrueNightsEdgeFilter)), - - // Nerf Terra Blade projectiles by 33% to cancel out the 1.5x multiplier it gets. - Do(new ProjectileSpecificRequirementBalancingRule(1f / 3f * 2f, TerraBladeFilter)), - // Nerf Mushroom Spear projectiles by 50%. Do(new ProjectileSpecificRequirementBalancingRule(0.5f, MushroomSpearFilter)), @@ -148,6 +140,11 @@ namespace CalamityMod.Balancing NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType())))); #endregion + #region Astrum Aureus + //35% resist to The Ballista's greatarrows. + NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); + #endregion + #region Ravager // 50% resist to true melee. NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), ResistTrueMelee(0.5f))); @@ -158,6 +155,11 @@ namespace CalamityMod.Balancing NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.DukeFishron, Do(new ProjectileResistBalancingRule(1.35f, ProjectileType(), ProjectileType())))); #endregion + #region Empress of Light + // 30% resist to Plague Tainted SMG's drones. + NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.HallowBoss, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + #endregion + #region Lunatic Cultist // 25% resist to Resurrection Butterfly. NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.CultistBoss, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType(), ProjectileType())))); @@ -210,8 +212,8 @@ namespace CalamityMod.Balancing // 50% resist to Elemental Axes. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); - // 50% resist to Pristine Fury. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + // 50% resist to Pristine Fury's alt fire. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 50% resist to Tactician's Trump Card explosions. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); @@ -241,8 +243,6 @@ namespace CalamityMod.Balancing // 10% resist to Old Reaper. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.9f, ProjectileType())))); - // 5% resist to Phantasmal Ruin. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.95f, ProjectileType(), ProjectileType(), ProjectileType())))); #endregion #region Exo Mechs: Ares @@ -255,6 +255,9 @@ namespace CalamityMod.Balancing // 30% resist to the Spin Throw part of the Ark of the Cosmos' combo. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.7f, AotCThrowCombo)))); + // 25% resist to Aetherflux Cannon. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); + // 25% resist to Murasama. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); @@ -320,9 +323,6 @@ namespace CalamityMod.Balancing // 40% resist to Rancor. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType())))); - // 35% resist to Zenith. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.FinalFractal)))); - // 30% resist to the Spin Throw part of the Ark of the Cosmos' combo. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.7f, AotCThrowCombo)))); @@ -344,16 +344,21 @@ namespace CalamityMod.Balancing // 25% resist to Dragon Rage projectiles. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, DragonRageFilter)))); + // 25% resist to Gael's Greatsword's big skulls. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, BigGaelsSkullFilter)))); + // 25% resist to Godslayer Slugs. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); // 25% resist to Luminite Bullets. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileID.MoonlordBullet)))); + // 25% resist to Zenith. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileID.FinalFractal)))); + // 20% resist to Blood Boiler fire. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); - // 20% resist to Eradicator beams. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); @@ -383,12 +388,15 @@ namespace CalamityMod.Balancing // 85% resist to Chicken Cannon. NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.15f, ProjectileType()))); - // 40% resist to Subsuming Vortex. - NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.6f, ProjectileType(), ProjectileType(), ProjectileType()))); + // 50% resist to Subsuming Vortex. + NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.5f, ProjectileType(), ProjectileType(), ProjectileType()))); // 30% resist to Murasama. NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.7f, ProjectileType()))); + // 30% resist to Zenith. + NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.7f, ProjectileID.FinalFractal))); + // 25% resist to Yharim's Crystal. NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.75f, ProjectileType()))); diff --git a/Balancing/BalancingConstants.cs b/Balancing/BalancingConstants.cs index b97bf0b3f2..292d411c7d 100644 --- a/Balancing/BalancingConstants.cs +++ b/Balancing/BalancingConstants.cs @@ -59,7 +59,18 @@ // Rogue stealth // If stealth is too weak, increase this number. If stealth is too strong, decrease this number. // This value is intentionally not readonly. - public static double UniversalStealthStrikeDamageFactor = 0.5; + public static double UniversalStealthStrikeDamageFactor = 0.41; + // Shade - 07/09/2023 + // Universal Stealth dmg factor was nerfed to 0.41 from 0.5 + // Stealth damage prefixes were bugged, causing that stealth strikes with the Mighty, Hefty and most importantly Flawless + // dealt less damage than intended; idk how long this thing has been for but looking at #bug-reports and #known-bugs its + // likely at least 7 months old, buried deep beneath a lot other bugs due to being in the port and forgotten about. + // Due to how impactful the fix was, the change had to happen and thus the nerf was made. + // + // This nerf should be reversed once the stealth -> focus rogue rework or rogue/stealth III or however you want to call it occurs, + // as of today summoner is the priority class now but once we're done with the Summoner minion culling and its Whip Hell we should + // probably start working on rogue afterwards. + internal static readonly float BaseStealthGenTime = 4f; // 4 seconds internal static readonly float MovingStealthGenRatio = 0.5f; diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index 91248359b2..0beee06514 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -182,7 +182,20 @@ namespace CalamityMod.Buffs case BuffID.Mining: tip = tip.Replace("25", "15"); break; - + + case BuffID.MonsterBanner: //Vanilla's wording is unclear and nondescript + var tooltipLines = tip.Split("\n"); + var result = ""; + foreach (var tooltip in tooltipLines) + { + if (tooltip == tooltipLines[0]) + result += CalamityUtils.GetText("Vanilla.BuffDescription.Banner"); + else + result += "\n" + tooltip; + } + tip = result; + break; + case BuffID.NebulaUpDmg1: tip = tip.Replace("15", "7.5"); break; diff --git a/Buffs/DamageOverTime/RiptideDebuff.png b/Buffs/DamageOverTime/RiptideDebuff.png index 4f0a50c3f2..e61eb2a105 100644 Binary files a/Buffs/DamageOverTime/RiptideDebuff.png and b/Buffs/DamageOverTime/RiptideDebuff.png differ diff --git a/Buffs/Potions/AstralInjectionBuff.png b/Buffs/Potions/AstralInjectionBuff.png index d9a30ea457..4f6075a4fe 100644 Binary files a/Buffs/Potions/AstralInjectionBuff.png and b/Buffs/Potions/AstralInjectionBuff.png differ diff --git a/Buffs/Potions/PhotosynthesisBuff.png b/Buffs/Potions/PhotosynthesisBuff.png index 9ce34e8e9a..6b3afa0129 100644 Binary files a/Buffs/Potions/PhotosynthesisBuff.png and b/Buffs/Potions/PhotosynthesisBuff.png differ diff --git a/Buffs/StatBuffs/AbsorberRegen.png b/Buffs/StatBuffs/AbsorberRegen.png index e0432a84a8..7d645ee1ab 100644 Binary files a/Buffs/StatBuffs/AbsorberRegen.png and b/Buffs/StatBuffs/AbsorberRegen.png differ diff --git a/Buffs/StatBuffs/AmidiasBlessing.png b/Buffs/StatBuffs/AmidiasBlessing.png index 135deaa5fb..eaf49a5c46 100644 Binary files a/Buffs/StatBuffs/AmidiasBlessing.png and b/Buffs/StatBuffs/AmidiasBlessing.png differ diff --git a/Buffs/StatBuffs/GreenJellyRegen.png b/Buffs/StatBuffs/GreenJellyRegen.png index b5cd1f4743..069b673358 100644 Binary files a/Buffs/StatBuffs/GreenJellyRegen.png and b/Buffs/StatBuffs/GreenJellyRegen.png differ diff --git a/Buffs/StatBuffs/PinkJellyRegen.png b/Buffs/StatBuffs/PinkJellyRegen.png index 6dd75f8c34..1105ca95c7 100644 Binary files a/Buffs/StatBuffs/PinkJellyRegen.png and b/Buffs/StatBuffs/PinkJellyRegen.png differ diff --git a/Buffs/Summon/BlackHawkBuff.png b/Buffs/Summon/BlackHawkBuff.png index 51a530a48a..8c7dfa3f39 100644 Binary files a/Buffs/Summon/BlackHawkBuff.png and b/Buffs/Summon/BlackHawkBuff.png differ diff --git a/Buffs/Summon/BloodClot.png b/Buffs/Summon/BloodClot.png deleted file mode 100644 index 833f2c1dc9..0000000000 Binary files a/Buffs/Summon/BloodClot.png and /dev/null differ diff --git a/Buffs/Summon/Calamari.cs b/Buffs/Summon/Calamari.cs deleted file mode 100644 index acbcf6d2dc..0000000000 --- a/Buffs/Summon/Calamari.cs +++ /dev/null @@ -1,34 +0,0 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Projectiles.Summon; -using Terraria; -using Terraria.ModLoader; -namespace CalamityMod.Buffs.Summon -{ - public class Calamari : ModBuff - { - public override void SetStaticDefaults() - { - Main.buffNoTimeDisplay[Type] = true; - Main.buffNoSave[Type] = true; - //Main.persistentBuff[Type] = true; - } - - public override void Update(Player player, ref int buffIndex) - { - CalamityPlayer modPlayer = player.Calamity(); - if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) - { - modPlayer.calamari = true; - } - if (!modPlayer.calamari) - { - player.DelBuff(buffIndex); - buffIndex--; - } - else - { - player.buffTime[buffIndex] = 18000; - } - } - } -} diff --git a/Buffs/Summon/BloodClot.cs b/Buffs/Summon/CalamarisLamentBuff.cs similarity index 78% rename from Buffs/Summon/BloodClot.cs rename to Buffs/Summon/CalamarisLamentBuff.cs index 248011746a..1d02c46246 100644 --- a/Buffs/Summon/BloodClot.cs +++ b/Buffs/Summon/CalamarisLamentBuff.cs @@ -1,11 +1,11 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Summon { - public class BloodClot : ModBuff + public class CalamarisLamentBuff : ModBuff { public override void SetStaticDefaults() { @@ -17,11 +17,11 @@ namespace CalamityMod.Buffs.Summon public override void Update(Player player, ref int buffIndex) { CalamityPlayer modPlayer = player.Calamity(); - if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) { - modPlayer.bClot = true; + modPlayer.CalamarisLament = true; } - if (!modPlayer.bClot) + if (!modPlayer.CalamarisLament) { player.DelBuff(buffIndex); buffIndex--; diff --git a/Buffs/Summon/Calamari.png b/Buffs/Summon/CalamarisLamentBuff.png similarity index 100% rename from Buffs/Summon/Calamari.png rename to Buffs/Summon/CalamarisLamentBuff.png diff --git a/Buffs/Summon/MiniatureEyeofCthulhu.png b/Buffs/Summon/MiniatureEyeofCthulhu.png index eaf73dcf4e..8085911d76 100644 Binary files a/Buffs/Summon/MiniatureEyeofCthulhu.png and b/Buffs/Summon/MiniatureEyeofCthulhu.png differ diff --git a/Buffs/Summon/PlantationBuff.cs b/Buffs/Summon/PlantationStaffBuff.cs similarity index 75% rename from Buffs/Summon/PlantationBuff.cs rename to Buffs/Summon/PlantationStaffBuff.cs index 391d25c5a2..9e64b840e2 100644 --- a/Buffs/Summon/PlantationBuff.cs +++ b/Buffs/Summon/PlantationStaffBuff.cs @@ -1,11 +1,12 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Summon { - public class PlantationBuff : ModBuff + [LegacyName("PlantationBuff")] + public class PlantationStaffBuff : ModBuff { public override void SetStaticDefaults() { @@ -17,11 +18,11 @@ namespace CalamityMod.Buffs.Summon public override void Update(Player player, ref int buffIndex) { CalamityPlayer modPlayer = player.Calamity(); - if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) { - modPlayer.plantera = true; + modPlayer.PlantationSummon = true; } - if (!modPlayer.plantera) + if (!modPlayer.PlantationSummon) { player.DelBuff(buffIndex); buffIndex--; diff --git a/Buffs/Summon/PlantationBuff.png b/Buffs/Summon/PlantationStaffBuff.png similarity index 100% rename from Buffs/Summon/PlantationBuff.png rename to Buffs/Summon/PlantationStaffBuff.png diff --git a/Buffs/Summon/ProfanedBabs.cs b/Buffs/Summon/ProfanedSoulGuardians.cs similarity index 83% rename from Buffs/Summon/ProfanedBabs.cs rename to Buffs/Summon/ProfanedSoulGuardians.cs index e8712c90f9..06c742fc52 100644 --- a/Buffs/Summon/ProfanedBabs.cs +++ b/Buffs/Summon/ProfanedSoulGuardians.cs @@ -4,7 +4,7 @@ using Terraria.ModLoader; namespace CalamityMod.Buffs.Summon { - public class ProfanedBabs : ModBuff //Buff name is reference to how I refer to the guardians as my babs ~Amber + public class ProfanedSoulGuardians : ModBuff { public override void SetStaticDefaults() { @@ -15,7 +15,7 @@ namespace CalamityMod.Buffs.Summon public override void Update(Player player, ref int buffIndex) { CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.donutBabs || modPlayer.profanedCrystalBuffs) + if (!modPlayer.pSoulGuardians || modPlayer.profanedCrystalBuffs) { player.DelBuff(buffIndex); buffIndex--; diff --git a/Buffs/Summon/ProfanedBabs.png b/Buffs/Summon/ProfanedSoulGuardians.png similarity index 100% rename from Buffs/Summon/ProfanedBabs.png rename to Buffs/Summon/ProfanedSoulGuardians.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 99a0003650..d6240557af 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -41,7 +41,7 @@ using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; -using CalamityMod.Projectiles.Typless; +using CalamityMod.Projectiles.Healing; using CalamityMod.UI; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -370,13 +370,13 @@ namespace CalamityMod.CalPlayer #endregion #region Energy Shields - public bool HasAnyEnergyShield => roverDrive || lunicCorpsSet || sponge; + public bool HasAnyEnergyShield => roverDrive || lunicCorpsSet || ((pSoulArtifact && !profanedCrystal) || profanedCrystalBuffs) || sponge; public bool freeDodgeFromShieldAbsorption = false; public bool drawnAnyShieldThisFrame = false; // TODO -- Some way to show the player their total shield points. - public int TotalEnergyShielding => RoverDriveShieldDurability + LunicCorpsShieldDurability + SpongeShieldDurability; - public int TotalMaxShieldDurability => (roverDrive ? RoverDrive.ShieldDurabilityMax : 0) + (lunicCorpsSet ? LunicCorpsHelmet.ShieldDurabilityMax : 0) + (sponge ? TheSponge.ShieldDurabilityMax : 0); + public int TotalEnergyShielding => RoverDriveShieldDurability + LunicCorpsShieldDurability + pSoulShieldDurability + SpongeShieldDurability; + public int TotalMaxShieldDurability => (roverDrive ? RoverDrive.ShieldDurabilityMax : 0) + (lunicCorpsSet ? LunicCorpsHelmet.ShieldDurabilityMax : 0) + (profanedCrystalBuffs ? ProfanedSoulCrystal.ShieldDurabilityMax : ((pSoulArtifact && !profanedCrystal) ? ProfanedSoulArtifact.ShieldDurabilityMax : 0)) + (sponge ? TheSponge.ShieldDurabilityMax : 0); public int RoverDriveShieldDurability = 0; public int LunicCorpsShieldDurability = 0; @@ -389,6 +389,12 @@ namespace CalamityMod.CalPlayer // Lunic Corps shield comes from an armor set and its visibility is non optional internal float lunicCorpsShieldPartialRechargeProgress = 0f; internal bool playedLunicCorpsShieldSound = false; + + //Profaned soul shield applies to psa and psc, with differing max hps for each + public int pSoulShieldDurability = 0; + public bool pSoulShieldVisible = false; + internal bool playedProfanedSoulShieldSound = false; + internal float pSoulShieldPartialRechargeProgress = 0f; public bool sponge = false; public bool spongeShieldVisible = false; @@ -497,7 +503,6 @@ namespace CalamityMod.CalPlayer public bool tracersElysian = false; public bool tracersSeraph = false; public bool frostFlare = false; - public bool beeResist = false; public bool uberBees = false; public bool evolution = false; public int evolutionLifeRegenCounter = 0; @@ -550,7 +555,7 @@ namespace CalamityMod.CalPlayer public bool eArtifact = false; public bool dArtifact = false; public bool auricSArtifact = false; - public bool pArtifact = false; + public bool pSoulArtifact = false; public bool giantPearl = false; public bool normalityRelocator = false; public bool flameLickedShell = false; @@ -926,7 +931,7 @@ namespace CalamityMod.CalPlayer public bool herring = false; public bool blackhawk = false; public bool cosmicViper = false; - public bool calamari = false; + public bool CalamarisLament = false; public bool cEyes = false; public bool cSlime = false; public bool cSlime2 = false; @@ -944,9 +949,9 @@ namespace CalamityMod.CalPlayer public bool cLamp = false; public bool pGuy = false; public bool sandnado = false; - public bool plantera = false; + public bool PlantationSummon = false; public bool astralProbe = false; - public bool donutBabs = false; + public bool pSoulGuardians = false; public bool cEnergy = false; public int healCounter = 300; public bool shellfish = false; @@ -1453,6 +1458,9 @@ namespace CalamityMod.CalPlayer LunicCorpsShieldDurability = 0; if (!sponge) SpongeShieldDurability = 0; + if (!pSoulArtifact) + pSoulShieldDurability = 0; + pSoulShieldVisible = false; roverDrive = false; roverDriveShieldVisible = false; sponge = false; @@ -1589,7 +1597,6 @@ namespace CalamityMod.CalPlayer aBrain = false; amalgam = false; frostFlare = false; - beeResist = false; uberBees = false; evolution = false; nanotech = false; @@ -1636,7 +1643,7 @@ namespace CalamityMod.CalPlayer eArtifact = false; dArtifact = false; auricSArtifact = false; - pArtifact = false; + pSoulArtifact = false; giantPearl = false; normalityRelocator = false; flameLickedShell = false; @@ -1929,7 +1936,7 @@ namespace CalamityMod.CalPlayer herring = false; blackhawk = false; cosmicViper = false; - calamari = false; + CalamarisLament = false; cEyes = false; cSlime = false; cSlime2 = false; @@ -1951,7 +1958,7 @@ namespace CalamityMod.CalPlayer cLamp = false; pGuy = false; cEnergy = false; - donutBabs = false; + pSoulGuardians = false; sWaifu = false; dWaifu = false; cWaifu = false; @@ -1963,7 +1970,7 @@ namespace CalamityMod.CalPlayer sCrystal = false; sGod = false; sandnado = false; - plantera = false; + PlantationSummon = false; astralProbe = false; victideSnail = false; cSpirit = false; @@ -2501,6 +2508,7 @@ namespace CalamityMod.CalPlayer RoverDriveShieldDurability = 0; LunicCorpsShieldDurability = 0; SpongeShieldDurability = 0; + pSoulShieldDurability = 0; #endregion #region UI @@ -3134,34 +3142,7 @@ namespace CalamityMod.CalPlayer #endregion #region TeleportMethods - public static Vector2? GetJunglePosition(Player player) - { - bool canSpawn = false; - int teleportStartX = Abyss.AtLeftSideOfWorld ? (int)(Main.maxTilesX * 0.65) : (int)(Main.maxTilesX * 0.2); - int teleportRangeX = (int)(Main.maxTilesX * 0.15); - int teleportStartY = (int)Main.worldSurface - 75; - int teleportRangeY = 50; - - Player.RandomTeleportationAttemptSettings settings = new Player.RandomTeleportationAttemptSettings - { - mostlySolidFloor = true, - avoidAnyLiquid = true, - avoidLava = true, - avoidHurtTiles = true, - avoidWalls = true, - attemptsBeforeGivingUp = 1000, - maximumFallDistanceFromOrignalPoint = 30 - }; - - Vector2 vector = player.CheckForGoodTeleportationSpot(ref canSpawn, teleportStartX, teleportRangeX, teleportStartY, teleportRangeY, settings); - - if (canSpawn) - { - return (Vector2?)vector; - } - return null; - } - + // Used for Boss Rush WoF public static Vector2? GetUnderworldPosition(Player player) { bool canSpawn = false; @@ -3598,7 +3579,7 @@ namespace CalamityMod.CalPlayer public override bool CanSellItem(NPC vendor, Item[] shopInventory, Item item) { if (item.type == ModContent.ItemType()) - return DownedBossSystem.downedCalamitas; //no easy moneycoins for post doggo/yhar + return DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs; //no easy moneycoins for post doggo/yhar return base.CanSellItem(vendor, shopInventory, item); } @@ -3613,6 +3594,7 @@ namespace CalamityMod.CalPlayer (lunicCorpsLegs ? 0.1f : 0f) + (shadowSpeed ? 0.5f : 0f) + (stressPills ? 0.05f : 0f) + + (aeroStone && Player.equippedWings != null && Player.wingTime == 0f ? 0.5f : 0f) + ((abyssalDivingSuit && Player.IsUnderwater()) ? 0.05f : 0f) + (aquaticHeartWaterBuff ? 0.15f : 0f) + ((frostFlare && Player.statLife < (int)(Player.statLifeMax2 * 0.25)) ? 0.15f : 0f) + @@ -3709,7 +3691,7 @@ namespace CalamityMod.CalPlayer { // Apply weapon modifier stealth strike damage bonus if (item.Calamity().StealthStrikePrefixBonus != 0f && StealthStrikeAvailable()) - damage += 1f - item.Calamity().StealthStrikePrefixBonus; + damage += 1f + item.Calamity().StealthStrikePrefixBonus; } } @@ -4657,31 +4639,23 @@ namespace CalamityMod.CalPlayer if (Player.whoAmI == Main.myPlayer && !endoCooper && randAmt > 0 && Main.rand.NextBool(randAmt) && chaseable) { int spearsFired = 0; + for (int i = 0; i < Main.projectile.Length; i++) { if (spearsFired == 2) break; if (Main.projectile[i].owner == Player.whoAmI && Main.projectile[i].friendly) { - bool attack = Main.projectile[i].owner == Player.whoAmI && Main.projectile[i].type == ModContent.ProjectileType(); - bool defense = Main.projectile[i].owner == Player.whoAmI && Main.projectile[i].type == ModContent.ProjectileType(); - if (attack || defense) + bool attack = Main.projectile[i].owner == Player.whoAmI && Main.projectile[i].type == ModContent.ProjectileType(); + if (attack) { - int numSpears = attack ? 12 : 6; - int dam = Main.projectile[i].originalDamage; - if (!attack) - dam = (int)(dam * 0.5f); - float angleVariance = MathHelper.TwoPi / (float)numSpears; - float spinOffsetAngle = MathHelper.Pi / (2f * numSpears); + int numSpears = profanedCrystalBuffs ? 12 : 6; + int dam = (int)(Main.projectile[i].originalDamage * (profanedCrystalBuffs ? 1f : 0.25f)); for (int x = 0; x < numSpears; x++) { - Vector2 posVec = new Vector2(8f, 0f).RotatedByRandom(MathHelper.TwoPi); - posVec = posVec.RotatedBy(angleVariance); - Vector2 velocity = new Vector2(posVec.X, posVec.Y).RotatedBy(spinOffsetAngle); - velocity.Normalize(); - velocity *= 8f; - int proj = Projectile.NewProjectile(source, Main.projectile[i].Center + posVec, velocity, ModContent.ProjectileType(), dam, 0f, Player.whoAmI, 0f, 0f); + float angle = MathHelper.TwoPi / numSpears * x; + int proj = Projectile.NewProjectile(source, Main.projectile[i].Center, angle.ToRotationVector2().RotatedBy(Math.Atan(-45f)) * 8f, ModContent.ProjectileType(), dam, 0f, Player.whoAmI, 0f, 0f); Main.projectile[proj].originalDamage = dam; } spearsFired++; @@ -4730,7 +4704,6 @@ namespace CalamityMod.CalPlayer public override void PostUpdate() //needs to be here else it doesn't work properly, otherwise i'd have stuck it with the wing anim stuffs { - ProfanedSoulCrystal.DetermineTransformationEligibility(Player); if (!profanedCrystalHide && (profanedCrystal || profanedCrystalForce) && Player.legs == EquipLoader.GetEquipSlot(Mod, "ProfanedSoulCrystal", EquipType.Legs)) { bool usingCarpet = Player.carpetTime > 0 && Player.controlJump; //doesn't make sense for carpet to use jump frame since you have solid ground @@ -4747,6 +4720,7 @@ namespace CalamityMod.CalPlayer #endregion #region Misc Stuff + private static int musicModDisplayDelay = -1; // Triggers effects that must occur when the player enters the world. This sends a bunch of packets in multiplayer. // It also starts the speedrun timer if applicable. @@ -4765,6 +4739,12 @@ namespace CalamityMod.CalPlayer CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.WikiStatus1"); CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.WikiStatus2"); } + + // Set a random delay between 12 and 20 seconds. When this delay hits zero, the music mod reminder message displays + if (CalamityMod.Instance.musicMod is null && CalamityConfig.Instance.MusicModReminderMessage) + { + musicModDisplayDelay = Main.rand.Next(CalamityUtils.SecondsToFrames(12), CalamityUtils.SecondsToFrames(20) + 1); + } } /// diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index 4910050608..4fd3d1f91c 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -666,7 +666,7 @@ namespace CalamityMod.CalPlayer ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 3fc7d17598..864b42070a 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -25,6 +25,7 @@ using CalamityMod.NPCs.Abyss; using CalamityMod.NPCs.ExoMechs.Apollo; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.Other; +using CalamityMod.NPCs.ProfanedGuardians; using CalamityMod.NPCs.Providence; using CalamityMod.NPCs.SunkenSea; using CalamityMod.NPCs.SupremeCalamitas; @@ -764,12 +765,6 @@ namespace CalamityMod.CalPlayer npc.Calamity().relicOfResilienceWeakness = 0; } - if (beeResist) - { - if (CalamityLists.beeEnemyList.Contains(npc.type)) - contactDamageReduction += 0.25; - } - if (eskimoSet) { if (npc.coldDamage) @@ -1027,12 +1022,6 @@ namespace CalamityMod.CalPlayer projectileDamageReduction += 0.5; } - if (beeResist) - { - if (CalamityLists.beeProjectileList.Contains(proj.type)) - projectileDamageReduction += 0.25; - } - if (trinketOfChiBuff) projectileDamageReduction += 0.1; @@ -1537,6 +1526,12 @@ namespace CalamityMod.CalPlayer SoundEngine.PlaySound(TheSponge.ShieldHurtSound, Player.Center); hurtSoundTimer = 20; } + else if (((pSoulArtifact && !profanedCrystal) || profanedCrystalBuffs) && pSoulShieldDurability > 0) + { + modifiers.DisableSound(); + SoundEngine.PlaySound(ProfanedGuardianDefender.ShieldDeathSound); + hurtSoundTimer = 20; + } else if ((profanedCrystal || profanedCrystalForce) && !profanedCrystalHide) { modifiers.DisableSound(); @@ -1644,6 +1639,7 @@ namespace CalamityMod.CalPlayer // Currently implemented energy shields: // - Rover Drive // - Lunic Corps Armor set bonus + // - Profaned Soul Artifact/Crystal // - The Sponge // // If the shield(s) completely absorb the hit, iframes are granted on the spot and the hit is marked to be dodged. @@ -1721,6 +1717,39 @@ namespace CalamityMod.CalPlayer // Actually remove damage from the incoming hit, so that later shields have less damage incoming. info.Damage -= masterChefDamageBlocked; } + + // PSA + if (pSoulArtifact && pSoulShieldDurability > 0 && !shieldsFullyAbsorbedHit) + { + // Check whether this shield can fully absorb the incoming hit (or what's left of it). + bool thisShieldCanFullyAbsorb = pSoulShieldDurability >= info.Damage; + + // Tally up how much damage was blocked by this shield. + int pSoulDamageBlocked = Math.Min(pSoulShieldDurability, info.Damage); + totalDamageBlocked += pSoulDamageBlocked; + + // Deal all incoming damage to this shield, because it is available. + pSoulShieldDurability -= info.Damage; + shieldsTookHit = true; + + // Hits which break the PSA shield cause a sound and slight screen shake. + // Multiple shields breaking simultaneously has slightly stronger screen shake. + if (pSoulShieldDurability <= 0) + { + pSoulShieldDurability = 0; + SoundEngine.PlaySound(SoundID.Lavafall, Player.Center); + Player.Calamity().GeneralScreenShakePower += anyShieldBroke ? 0.5f : 2f; + anyShieldBroke = true; + } + + // Mark the hit as being canceled if this shield has enough durability to fully absorb it. + // This prevents further shields from attempting to absorb the hit. + if (thisShieldCanFullyAbsorb) + shieldsFullyAbsorbedHit = true; + + // Actually remove damage from the incoming hit, so that later shields have less damage incoming. + info.Damage -= pSoulDamageBlocked; + } // THE SPONGE if (sponge && SpongeShieldDurability > 0 && !shieldsFullyAbsorbedHit) @@ -1768,20 +1797,33 @@ namespace CalamityMod.CalPlayer // Spawn particles when hit with the shields up, regardless of whether or not the shields broke. // More particles spawn if a shield broke. - int numParticles = Main.rand.Next(2, 6) + (anyShieldBroke ? 6 : 0); - for (int i = 0; i < numParticles; i++) + if (pSoulArtifact) { - // Rover Drive has slightly higher particle velocity - float maxVelocity = roverDrive ? 14f : 7f; - Vector2 velocity = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(3f, maxVelocity); - velocity.X += 5f * info.HitDirection; + for (int i = 0; i < Main.rand.Next(4, 8); i++) //very light dust + { + Dust dust = Dust.NewDustDirect(Player.position, Player.width, Player.height, (int)CalamityDusts.ProfanedFire); + dust.velocity = Main.rand.NextVector2Circular(3.5f, 3.5f); + dust.velocity.Y -= Main.rand.NextFloat(1f, 3f); + dust.scale = Main.rand.NextFloat(1.15f, 1.45f); + } + } + else + { + int numParticles = Main.rand.Next(2, 6) + (anyShieldBroke ? 6 : 0); + for (int i = 0; i < numParticles; i++) + { + // Rover Drive has slightly higher particle velocity + float maxVelocity = roverDrive ? 14f : 7f; + Vector2 velocity = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(3f, maxVelocity); + velocity.X += 5f * info.HitDirection; - float scale = Main.rand.NextFloat(2.5f, 3f); - Color particleColor = Main.rand.NextBool() ? new Color(99, 255, 229) : new Color(25, 132, 247); - int lifetime = 25; + float scale = Main.rand.NextFloat(2.5f, 3f); + Color particleColor = Main.rand.NextBool() ? new Color(99, 255, 229) : new Color(25, 132, 247); + int lifetime = 25; - var shieldParticle = new TechyHoloysquareParticle(Player.Center, velocity, scale, particleColor, lifetime); - GeneralParticleHandler.SpawnParticle(shieldParticle); + var shieldParticle = new TechyHoloysquareParticle(Player.Center, velocity, scale, particleColor, lifetime); + GeneralParticleHandler.SpawnParticle(shieldParticle); + } } // Update Rover Drive durability on the cooldown rack. @@ -1792,6 +1834,10 @@ namespace CalamityMod.CalPlayer if (lunicCorpsSet && cooldowns.TryGetValue(Cooldowns.LunicCorpsShieldDurability.ID, out var masterChefDurabilityCD)) masterChefDurabilityCD.timeLeft = LunicCorpsShieldDurability; + // Update PSA/PSC durability on the cooldown rack + if ((pSoulArtifact && (!profanedCrystal || profanedCrystalBuffs)) && cooldowns.TryGetValue(Cooldowns.ProfanedSoulShield.ID, out var profanedSoulDurabilityCD)) + profanedSoulDurabilityCD.timeLeft = pSoulShieldDurability; + // Update Sponge durability on the cooldown rack. if (sponge && cooldowns.TryGetValue(SpongeDurability.ID, out var spongeDurabilityCD)) spongeDurabilityCD.timeLeft = SpongeShieldDurability; @@ -1809,6 +1855,9 @@ namespace CalamityMod.CalPlayer if (lunicCorpsSet) Player.AddCooldown(LunicCorpsShieldRecharge.ID, LunicCorpsHelmet.ShieldRechargeDelay, true); + if (pSoulArtifact && (!profanedCrystal || profanedCrystalBuffs)) + Player.AddCooldown(ProfanedSoulShieldRecharge.ID, profanedCrystalBuffs ? (60 * 5) : (60 * 10), true); // 5 seconds psc, 10 seconds psa + // Set The Sponge's recharge delay to full. Override any existing cooldown instance. if (sponge) Player.AddCooldown(SpongeRecharge.ID, TheSponge.ShieldRechargeDelay, true); @@ -2186,9 +2235,6 @@ namespace CalamityMod.CalPlayer #region Post Hurt public override void PostHurt(Player.HurtInfo hurtInfo) { - if (pArtifact && !profanedCrystal) - Player.AddCooldown(Cooldowns.ProfanedSoulArtifact.ID, CalamityUtils.SecondsToFrames(5)); - // Silver Armor medkit timer if (silverMedkit && hurtInfo.Damage >= SilverArmorSetChange.SetBonusMinimumDamageToHeal) silverMedkitTimer = SilverArmorSetChange.SetBonusHealTime; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 9c195f13ba..2a62c20776 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -139,6 +139,9 @@ namespace CalamityMod.CalPlayer // Potions (Quick Buff && Potion Sickness) HandlePotions(); + // Display the Music Mod Reminder text in chat. + HandleTextChatMessages(); + // Check if schematics are present on the mouse, for the sake of registering their recipes. CheckIfMouseItemIsSchematic(); @@ -1037,19 +1040,13 @@ namespace CalamityMod.CalPlayer Player.GetCritChance() += critUp; } - bool profanedSoulBuffs = profanedCrystalBuffs || (!profanedCrystal && pArtifact) || (profanedCrystal && DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs); + bool profanedSoulBuffs = profanedCrystalBuffs || (!profanedCrystal && pSoulArtifact) || (profanedCrystal && DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs); - // Offense bonus. You always get the max minions, even during the effect of the burnout debuff + // Guardian bonuses if (profanedSoulBuffs) - Player.maxMinions++; - - // Guardian bonuses if not burnt out - if (profanedSoulBuffs && !Player.HasCooldown(Cooldowns.ProfanedSoulArtifact.ID)) { - // Defender bonus - Player.moveSpeed += 0.1f; - Player.endurance += 0.05f; - + // Offense bonus + Player.maxMinions++; // Healer bonus if (healCounter > 0) healCounter--; @@ -1152,7 +1149,7 @@ namespace CalamityMod.CalPlayer if (instance.timeLeft < 0) { handler.OnCompleted(); - if (handler.EndSound != null) + if (handler.EndSound != null && handler.ShouldPlayEndSound) SoundEngine.PlaySound(handler.EndSound.GetValueOrDefault()); expiredCooldowns.Add(id); } @@ -1563,8 +1560,8 @@ namespace CalamityMod.CalPlayer // Absorber bonus if (absorber) { - Player.moveSpeed += 0.1f; - Player.jumpSpeedBoost += 0.5f; + Player.moveSpeed += 0.12f; + Player.jumpSpeedBoost += 0.6f; Player.thorns += 3.5f; } @@ -2376,6 +2373,11 @@ namespace CalamityMod.CalPlayer if (baroclaw) Player.GetDamage() += 0.1f; + if (aeroStone) + { + Player.moveSpeed += (Player.equippedWings != null && Player.wingTime == 0f ? 0.25f : 0f); + } + if (gShell) { if (giantShellPostHit == 1) @@ -2419,7 +2421,6 @@ namespace CalamityMod.CalPlayer if (eGauntlet) { Player.kbGlove = true; - Player.magmaStone = true; Player.GetDamage() += 0.15f; Player.GetCritChance() += 5; } @@ -2578,7 +2579,6 @@ namespace CalamityMod.CalPlayer (ZoneAstral ? 0.05 : 0D) + (harpyRing ? 0.2 : 0D) + (reaverSpeed ? 0.1 : 0D) + - (aeroStone ? 0.1 : 0D) + (angelTreads ? 0.1 : 0D) + (blueCandle ? 0.1 : 0D) + (soaring ? 0.1 : 0D) + @@ -2586,9 +2586,6 @@ namespace CalamityMod.CalPlayer (plagueReaper ? 0.05 : 0D) + (Player.empressBrooch ? 0.25 : 0D); - if (harpyRing) - Player.moveSpeed += 0.1f; - if (blueCandle) Player.moveSpeed += 0.1f; @@ -3004,15 +3001,15 @@ namespace CalamityMod.CalPlayer if (auricSArtifact && Player.FindBuffIndex(ModContent.BuffType()) != -1) Player.maxMinions += Player.ownedProjectileCounts[ModContent.ProjectileType()]; - if (pArtifact) + if (pSoulArtifact) { if (Player.whoAmI == Main.myPlayer) { - var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); - if (Player.FindBuffIndex(ModContent.BuffType()) == -1) - Player.AddBuff(ModContent.BuffType(), 3600, true); + var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); + if (Player.FindBuffIndex(ModContent.BuffType()) == -1) + Player.AddBuff(ModContent.BuffType(), 3600, true); - donutBabs = true; + pSoulGuardians = true; int guardianAmt = 1; float babCheck = profanedCrystal ? 1f : 0f; @@ -3029,7 +3026,8 @@ namespace CalamityMod.CalPlayer if (Player.ownedProjectileCounts[ModContent.ProjectileType()] < guardianAmt) { - var babO = Projectile.NewProjectileDirect(source, Player.Center, Vector2.UnitY * -1f, ModContent.ProjectileType(), 1, 1f, Main.myPlayer, babCheck); + float spearCounter = profanedCrystal ? 0f : 15f; + var babO = Projectile.NewProjectileDirect(source, Player.Center, Vector2.UnitY * -1f, ModContent.ProjectileType(), 1, 1f, Main.myPlayer, babCheck, spearCounter); babO.originalDamage = babDamage; } } @@ -3068,7 +3066,7 @@ namespace CalamityMod.CalPlayer Lighting.AddLight(Player.Center, enrage ? 1.2f : offenseBuffs ? 1f : 0.2f, enrage ? 0.21f : offenseBuffs ? 0.2f : 0.01f, 0); if (enrage) { - bool special = Player.name == "Amber" || Player.name == "Nincity" || Player.name == "IbanPlay" || Player.name == "Chen"; //People who either helped create the item or test it. + bool special = ProfanedSoulCrystal.testerNames.Any(name => name.Equals(Player.name)); for (int i = 0; i < 3; i++) { int fire = Dust.NewDust(Player.position, Player.width, Player.height, special ? 231 : (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, special ? Color.DarkRed : default, 1f); @@ -3533,6 +3531,66 @@ namespace CalamityMod.CalPlayer } } + // If PSA/PSC is not equipped, obliterate its durability cooldown. + // The recharge cooldown is intentionally left in place to prevent hot swapping to recharge the shield + if (!pSoulArtifact) + { + if (cooldowns.TryGetValue(Cooldowns.ProfanedSoulShield.ID, out var cdDurability)) + cdDurability.timeLeft = 0; + + // As PSA/PSC's shield can be left in a partially recharged state, this is for safety. + // If the player does not have the accessory equipped for even one frame, discharge all shields. + pSoulShieldDurability = 0; + } + // Stuff to do if PSA/PSC is equipped + else + { + //Force check if profaned crystal buffs are active + ProfanedSoulCrystal.DetermineTransformationEligibility(Player); + int maxDurability = profanedCrystalBuffs + ? ProfanedSoulCrystal.ShieldDurabilityMax + : ProfanedSoulArtifact.ShieldDurabilityMax; + + if (pSoulShieldDurability == 0 && !cooldowns.ContainsKey(Cooldowns.ProfanedSoulShieldRecharge.ID)) + Player.AddCooldown(ProfanedSoulShieldRecharge.ID, ProfanedSoulArtifact.ShieldRechargeDelay); + + // If the shield has greater than zero durability but that durability is not on the cooldown rack, add it to the cooldown rack. + if (pSoulShieldDurability > 0 && !cooldowns.ContainsKey(Cooldowns.ProfanedSoulShield.ID)) + { + var durabilityCooldown = Player.AddCooldown(Cooldowns.ProfanedSoulShield.ID, maxDurability); + durabilityCooldown.timeLeft = pSoulShieldDurability; + } + + // If the shield has greater than zero durability and isn't in its recharge delay, actively replenish shield points. + // Play a sound on the first frame this occurs. + if (pSoulShieldDurability > 0 && !cooldowns.ContainsKey(ProfanedSoulShieldRecharge.ID)) + { + if (!playedProfanedSoulShieldSound) + SoundEngine.PlaySound(ProvidenceBoss.BurnStartSound, Player.Center); + playedProfanedSoulShieldSound = true; + + // This number is not an integer, and stores exact per-frame recharge progress. + pSoulShieldPartialRechargeProgress += maxDurability / (float)ProfanedSoulArtifact.TotalShieldRechargeTime; + + // Floor the value to get whole number of shield points recharged this frame. + int pointsActuallyRecharged = (int)MathF.Floor(pSoulShieldPartialRechargeProgress); + + // Give those points to the real shield durability, capping the result. Then remove them from recharge progress. + pSoulShieldDurability = Math.Min(pSoulShieldDurability + pointsActuallyRecharged, maxDurability); + pSoulShieldPartialRechargeProgress -= pointsActuallyRecharged; + + // Update the cooldown rack's durability indicator. + if (cooldowns.TryGetValue(Cooldowns.ProfanedSoulShield.ID, out var cdDurability)) + cdDurability.timeLeft = pSoulShieldDurability; + } + + // Add light if this shield is currently active + if (pSoulShieldDurability > 0 && !shieldAddedLight) + { + Lighting.AddLight(Player.Center, Color.Orange.ToVector3() * 0.4f); + shieldAddedLight = true; + } + } // If the Lunic Corps armor is not equipped, obliterate its durability cooldown. // The recharge cooldown is intentionally left in place to prevent hot swapping to recharge the shield if (!lunicCorpsSet) @@ -3612,7 +3670,6 @@ namespace CalamityMod.CalPlayer { CooldownInstance durabilityCooldown = Player.AddCooldown(WulfrumRoverDriveDurability.ID, RoverDrive.ShieldDurabilityMax); durabilityCooldown.timeLeft = RoverDriveShieldDurability; - SoundEngine.PlaySound(RoverDrive.ActivationSound, Player.Center); } // Add light if this shield is currently active @@ -3902,6 +3959,22 @@ namespace CalamityMod.CalPlayer } #endregion + #region Text Chat Messages + private void HandleTextChatMessages() + { + if (Player.whoAmI != Main.myPlayer || Main.netMode == NetmodeID.Server) + return; + + if (musicModDisplayDelay >= 0) + { + if (musicModDisplayDelay == 0) + CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.MusicModReminder"); + + --musicModDisplayDelay; + } + } + #endregion + #region Mouse Item Checks public void CheckIfMouseItemIsSchematic() { diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 6a85e5abc7..128b868ba5 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -143,15 +143,6 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffID.Poisoned, 240); break; - case ItemID.NightsEdge: - target.AddBuff(BuffID.ShadowFlame, 120); - break; - - case ItemID.TrueNightsEdge: - target.AddBuff(BuffID.CursedInferno, 60); - target.AddBuff(BuffID.ShadowFlame, 120); - break; - case ItemID.IceSickle: case ItemID.Frostbrand: target.AddBuff(BuffID.Frostburn, 300); @@ -338,11 +329,6 @@ namespace CalamityMod.CalPlayer if (Main.rand.NextBool()) target.AddBuff(BuffID.Frostburn, 60); break; - - case ProjectileID.NightBeam: - target.AddBuff(BuffID.CursedInferno, 60); - target.AddBuff(BuffID.ShadowFlame, 120); - break; } if ((proj.arrow && Player.hasMoltenQuiver) || hellfireTreads) @@ -831,7 +817,7 @@ namespace CalamityMod.CalPlayer } } - if (modProj.stealthStrike && rogueCrownCooldown <= 0 && modProj.stealthStrikeHitCount < 5) + if (modProj.stealthStrike && rogueCrownCooldown <= 0 && modProj.stealthStrikeHitCount < 3) { bool spawnedFeathers = false; if (nanotech) @@ -840,7 +826,7 @@ namespace CalamityMod.CalPlayer { Vector2 source = new Vector2(position.X + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); Vector2 velocity = (position - source) / 40f; - int damage = (int)Player.GetTotalDamage().ApplyTo(125); + int damage = (int)Player.GetTotalDamage().ApplyTo(120); Projectile.NewProjectile(spawnSource, source, velocity, ProjectileType(), damage, 3f, proj.owner); } } @@ -865,7 +851,7 @@ namespace CalamityMod.CalPlayer float speedX = (position.X - source.X) / 30f; float speedY = (position.Y - source.Y) * 8; Vector2 velocity = new Vector2(speedX, speedY); - int featherDamage = (int)Player.GetTotalDamage().ApplyTo(15); + int featherDamage = (int)Player.GetTotalDamage().ApplyTo(25); int feather = Projectile.NewProjectile(spawnSource, source, velocity, ProjectileType(), featherDamage, 3f, proj.owner); if (feather.WithinBounds(Main.maxProjectiles)) { @@ -878,7 +864,7 @@ namespace CalamityMod.CalPlayer rogueCrownCooldown = spawnedFeathers ? 15 : 60; } - if (forbiddenCirclet && modProj.stealthStrike && forbiddenCooldown <= 0 && modProj.stealthStrikeHitCount < 5) + if (forbiddenCirclet && modProj.stealthStrike && forbiddenCooldown <= 0 && modProj.stealthStrikeHitCount < 3) { for (int index2 = 0; index2 < 6; index2++) { @@ -894,7 +880,7 @@ namespace CalamityMod.CalPlayer } } - if (titanHeartSet && modProj.stealthStrike && titanCooldown <= 0 && modProj.stealthStrikeHitCount < 5) + if (titanHeartSet && modProj.stealthStrike && titanCooldown <= 0 && modProj.stealthStrikeHitCount < 3) { int damage = (int)Player.GetTotalDamage().ApplyTo(50); Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType(), damage, proj.knockBack, proj.owner, 1f, 0f); @@ -910,7 +896,7 @@ namespace CalamityMod.CalPlayer titanCooldown = 15; } - if (corrosiveSpine && modProj.stealthStrikeHitCount < 5) + if (corrosiveSpine && modProj.stealthStrikeHitCount < 3) { for (int i = 0; i < 3; i++) { @@ -942,7 +928,7 @@ namespace CalamityMod.CalPlayer } } - if (shadow && shadowPotCooldown <= 0 && modProj.stealthStrikeHitCount < 5) + if (shadow && shadowPotCooldown <= 0 && modProj.stealthStrikeHitCount < 3) { int randrot = Main.rand.Next(-30, 391); Vector2 SoulSpeed = new Vector2(13f, 13f).RotatedBy(MathHelper.ToRadians(randrot)); @@ -971,7 +957,7 @@ namespace CalamityMod.CalPlayer int umbraBlastDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.25, 50); Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType(), umbraBlastDamage, 0f, Player.whoAmI); } - if (electricianGlove && modProj.stealthStrike && modProj.stealthStrikeHitCount < 5) + if (electricianGlove && modProj.stealthStrike && modProj.stealthStrikeHitCount < 3) { for (int s = 0; s < 3; s++) { @@ -1065,7 +1051,7 @@ namespace CalamityMod.CalPlayer } if (summon) { - if (pArtifact && !profanedCrystal) + if (pSoulArtifact && !profanedCrystal) target.AddBuff(BuffType(), 300); if (profanedCrystalBuffs) diff --git a/CalamityConfig.cs b/CalamityConfig.cs index e7d4e623b1..ba16655a34 100644 --- a/CalamityConfig.cs +++ b/CalamityConfig.cs @@ -1,24 +1,11 @@ -using System.Collections.Generic; -using System.ComponentModel; -using System.Reflection; +using System.ComponentModel; using System.Runtime.Serialization; -using CalamityMod.Items.Accessories; -using CalamityMod.Items.DifficultyItems; -using CalamityMod.Items.DraedonMisc; -using CalamityMod.Items.Dyes.HairDye; -using CalamityMod.Items.Potions; -using CalamityMod.Items.Weapons.DraedonsArsenal; using CalamityMod.UI; -using Terraria; -using Terraria.ID; -using Terraria.Localization; -using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod.Items.PermanentBoosters; -using CalamityMod.UI.Rippers; using CalamityMod.UI.DraedonsArsenal; +using CalamityMod.UI.Rippers; using CalamityMod.UI.SulphurousWaterMeter; -using CalamityMod.Items.Tools.ClimateChange; +using Terraria; +using Terraria.ModLoader.Config; namespace CalamityMod { @@ -64,19 +51,23 @@ namespace CalamityMod [BackgroundColor(192, 54, 64, 192)] [DefaultValue(true)] public bool StealthInvisibility { get; set; } - - [BackgroundColor(192, 54, 64, 192)] - [DefaultValue(true)] - public bool ShopNewAlert { get; set; } - - [BackgroundColor(192, 54, 64, 192)] - [DefaultValue(true)] - public bool WikiStatusMessage { get; set; } #endregion #region UI Changes [Header("UI")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(true)] + public bool MusicModReminderMessage { get; set; } + + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(true)] + public bool WikiStatusMessage { get; set; } + + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(true)] + public bool ShopNewAlert { get; set; } + [BackgroundColor(192, 54, 64, 192)] [DefaultValue(true)] public bool BossHealthBarExtraInfo { get; set; } diff --git a/CalamityLists.cs b/CalamityLists.cs index f9d71c9bb7..eddcc27405 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -83,8 +83,6 @@ namespace CalamityMod public static List dungeonEnemyBuffList; public static List dungeonProjectileBuffList; public static List bossHPScaleList; - public static List beeEnemyList; - public static List beeProjectileList; public static List friendlyBeeList; public static List hardModeNerfList; public static List debuffList; @@ -1051,33 +1049,6 @@ namespace CalamityMod NPCID.MoonLordHand }; - beeEnemyList = new List() - { - NPCID.GiantMossHornet, - NPCID.BigMossHornet, - NPCID.LittleMossHornet, - NPCID.TinyMossHornet, - NPCID.MossHornet, - NPCID.VortexHornetQueen, - NPCID.VortexHornet, - NPCID.Bee, - NPCID.BeeSmall, - NPCID.QueenBee, - NPCType(), - NPCType(), - NPCType(), - NPCType() - }; - - beeProjectileList = new List() - { - ProjectileID.Stinger, - ProjectileID.HornetStinger, - ProjectileType(), - ProjectileType(), - ProjectileType() - }; - friendlyBeeList = new List() { ProjectileID.GiantBee, @@ -1983,64 +1954,68 @@ namespace CalamityMod pierceResistExceptionList = new List() { - ProjectileID.FlyingKnife, ProjectileID.Arkhalis, - ProjectileID.Terragrim, - ProjectileID.MonkStaffT3, - ProjectileID.LastPrismLaser, ProjectileID.ChargedBlasterLaser, - ProjectileID.PiercingStarlight, ProjectileID.FinalFractal, - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), + ProjectileID.FlyingKnife, + ProjectileID.LastPrismLaser, + ProjectileID.MechanicalPiranha, + ProjectileID.MonkStaffT3, + ProjectileID.PiercingStarlight, + ProjectileID.Terragrim, ProjectileType(), - ProjectileType(), + ProjectileType(), + ProjectileType(), ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), ProjectileType(), + ProjectileType(), + ProjectileType(), ProjectileType(), + ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType(), + ProjectileType(), ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), + ProjectileType(), ProjectileType(), + ProjectileType(), ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), + ProjectileType(), ProjectileType(), - ProjectileType(), - ProjectileType(), ProjectileType(), - ProjectileType(), - ProjectileType(), ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), }; // Lists of enemies that resist piercing to some extent (mostly worms). @@ -2744,9 +2719,7 @@ namespace CalamityMod dungeonEnemyBuffList = null; dungeonProjectileBuffList = null; bossHPScaleList = null; - beeEnemyList = null; friendlyBeeList = null; - beeProjectileList = null; hardModeNerfList = null; debuffList = null; fireDebuffList = null; diff --git a/CalamityMod.cs b/CalamityMod.cs index 15188a5ff9..d381d849c2 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -4,8 +4,6 @@ using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; -using System.Linq; -using CalamityMod.Systems; using CalamityMod.Balancing; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; @@ -16,11 +14,9 @@ using CalamityMod.DataStructures; using CalamityMod.Effects; using CalamityMod.Events; using CalamityMod.FluidSimulation; -using CalamityMod.ILEditing; using CalamityMod.Items; using CalamityMod.Items.Dyes.HairDye; using CalamityMod.Items.VanillaArmorChanges; -using CalamityMod.NPCs.PrimordialWyrm; using CalamityMod.NPCs.AquaticScourge; using CalamityMod.NPCs.AstrumAureus; using CalamityMod.NPCs.AstrumDeus; @@ -38,10 +34,12 @@ using CalamityMod.NPCs.ExoMechs.Artemis; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.NPCs.HiveMind; using CalamityMod.NPCs.Leviathan; +using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.OldDuke; using CalamityMod.NPCs.Perforator; using CalamityMod.NPCs.PlaguebringerGoliath; using CalamityMod.NPCs.Polterghast; +using CalamityMod.NPCs.PrimordialWyrm; using CalamityMod.NPCs.ProfanedGuardians; using CalamityMod.NPCs.Providence; using CalamityMod.NPCs.Ravager; @@ -61,7 +59,6 @@ using CalamityMod.UI.CalamitasEnchants; using CalamityMod.UI.DraedonsArsenal; using CalamityMod.UI.Rippers; using CalamityMod.Waters; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -73,8 +70,6 @@ using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Config; -using Terraria.DataStructures; -using CalamityMod.NPCs.NormalNPCs; [assembly: InternalsVisibleTo("CalTestHelpers")] [assembly: InternalsVisibleTo("InfernumMode")] @@ -150,11 +145,13 @@ namespace CalamityMod internal Mod musicMod = null; // This is Calamity's official music mod, CalamityModMusic internal bool MusicAvailable => !(musicMod is null); + // Please keep this in alphabetical order so it's easy to read internal Mod ancientsAwakened = null; internal Mod bossChecklist = null; internal Mod crouchMod = null; internal Mod dialogueTweak = null; internal Mod fargos = null; + internal Mod magicStorage = null; internal Mod overhaul = null; internal Mod redemption = null; internal Mod soa = null; @@ -187,6 +184,8 @@ namespace CalamityMod ModLoader.TryGetMod("DialogueTweak", out dialogueTweak); fargos = null; ModLoader.TryGetMod("Fargowiltas", out fargos); + magicStorage = null; + ModLoader.TryGetMod("MagicStorage", out magicStorage); overhaul = null; ModLoader.TryGetMod("TerrariaOverhaul", out overhaul); redemption = null; @@ -418,6 +417,7 @@ namespace CalamityMod crouchMod = null; dialogueTweak = null; fargos = null; + magicStorage = null; overhaul = null; redemption = null; soa = null; diff --git a/Cooldowns/CooldownHandler.cs b/Cooldowns/CooldownHandler.cs index 4fe1a63e97..f9d83b7837 100644 --- a/Cooldowns/CooldownHandler.cs +++ b/Cooldowns/CooldownHandler.cs @@ -49,6 +49,11 @@ namespace CalamityMod.Cooldowns /// When the cooldown instance ends, this sound is played. Leave at null for no sound. /// public virtual SoundStyle? EndSound => null; + + /// + /// Set this to true to have the cooldown instance end sound play upon expiration. Defaults to true + /// + public virtual bool ShouldPlayEndSound => true; #endregion #region Display & Rendering diff --git a/Cooldowns/CooldownRegistry.cs b/Cooldowns/CooldownRegistry.cs index e8b078d334..28504bc654 100644 --- a/Cooldowns/CooldownRegistry.cs +++ b/Cooldowns/CooldownRegistry.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Cooldowns //var permafrostConcoction = Register(PermafrostConcoction.ID); //var plagueBlackout = Register(PlagueBlackout.ID); //var prismaticLaser = Register(PrismaticLaser.ID); - //var profanedSoulArtifact = Register(ProfanedSoulArtifact.ID); + //var profanedSoulArtifact = Register(ProfanedSoulShield.ID); //var relicOfResilience = Register(RelicOfResilience.ID); //var rogueBooster = Register(RogueBooster.ID); //var sandCloak = Register(SandCloak.ID); diff --git a/Cooldowns/LunicCorpsShieldCooldowns.cs b/Cooldowns/LunicCorpsShieldCooldowns.cs index 8834314338..dbee30e4a1 100644 --- a/Cooldowns/LunicCorpsShieldCooldowns.cs +++ b/Cooldowns/LunicCorpsShieldCooldowns.cs @@ -90,6 +90,7 @@ namespace CalamityMod.Cooldowns public override Color CooldownStartColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion); public override Color CooldownEndColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion); public override SoundStyle? EndSound => LunicCorpsHelmet.ActivationSound; + public override bool ShouldPlayEndSound => instance.player.Calamity().lunicCorpsSet; public override void Tick() => instance.player.Calamity().playedLunicCorpsShieldSound = false; // When the recharge period completes, grant 1 point of shielding immediately so the rest my refill normally. diff --git a/Cooldowns/ProfanedSoulArtifact.cs b/Cooldowns/ProfanedSoulArtifact.cs deleted file mode 100644 index dc672a0d47..0000000000 --- a/Cooldowns/ProfanedSoulArtifact.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria.Localization; - -namespace CalamityMod.Cooldowns -{ - public class ProfanedSoulArtifact : CooldownHandler - { - public static new string ID => "ProfanedSoulArtifact"; - public override bool ShouldDisplay => true; - public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}"); - public override string Texture => "CalamityMod/Cooldowns/ProfanedSoulArtifact"; - public override Color OutlineColor => new Color(255, 191, 73); - public override Color CooldownStartColor => new Color(181, 136, 177); - public override Color CooldownEndColor => new Color(255, 194, 161); - } -} diff --git a/Cooldowns/ProfanedSoulShield.cs b/Cooldowns/ProfanedSoulShield.cs new file mode 100644 index 0000000000..2955b1b30d --- /dev/null +++ b/Cooldowns/ProfanedSoulShield.cs @@ -0,0 +1,127 @@ +using System; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Accessories; +using CalamityMod.NPCs.Providence; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; +using Terraria.Localization; +using static CalamityMod.CalamityUtils; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Cooldowns +{ + public class ProfanedSoulShield : CooldownHandler + { + + private CalamityPlayer CalPlayer => instance.player.Calamity(); + private int CorrectMaxDurability => CalPlayer.profanedCrystalBuffs + ? ProfanedSoulCrystal.ShieldDurabilityMax + : ProfanedSoulArtifact.ShieldDurabilityMax; + + //Slightly more readable and actually works which is nice + private Color GetColor(bool start) + { + Color result; + if (start) + { + result = CalPlayer.profanedCrystalBuffs ? new Color(247, 172, 131) : new Color(235, 178, 96); + } + else + { + result = CalPlayer.profanedCrystalBuffs ? new Color(255, 194, 161) : new Color(219, 179, 121); + } + return result; + } + + private float AdjustedCompletion => instance.timeLeft / (float)CorrectMaxDurability; + + public static new string ID => "ProfanedSoulShieldDurability"; + public override bool CanTickDown => !CalPlayer.pSoulArtifact || instance.timeLeft <= 0; + public override bool ShouldDisplay => (CalPlayer.pSoulArtifact && !CalPlayer.profanedCrystal) || CalPlayer.profanedCrystalBuffs; + public override LocalizedText DisplayName => GetText($"UI.Cooldowns.{ID}"); + public override string Texture => "CalamityMod/Cooldowns/ProfanedSoulShieldActive"; + public override string OutlineTexture => "CalamityMod/Cooldowns/ProfanedSoulShieldOutline"; + public override string OverlayTexture => "CalamityMod/Cooldowns/ProfanedSoulShieldOverlay"; + public override Color OutlineColor => new Color(255, 191, 73); + public override Color CooldownStartColor => Color.Lerp(GetColor(true), GetColor(false), instance.Completion); + public override Color CooldownEndColor => Color.Lerp(GetColor(true), GetColor(false), instance.Completion); + public override bool SavedWithPlayer => false; + public override bool PersistsThroughDeath => false; + + public override void ApplyBarShaders(float opacity) + { + // Use the adjusted completion + GameShaders.Misc["CalamityMod:CircularBarShader"].UseOpacity(opacity); + GameShaders.Misc["CalamityMod:CircularBarShader"].UseSaturation(AdjustedCompletion); + GameShaders.Misc["CalamityMod:CircularBarShader"].UseColor(CooldownStartColor); + GameShaders.Misc["CalamityMod:CircularBarShader"].UseSecondaryColor(CooldownEndColor); + GameShaders.Misc["CalamityMod:CircularBarShader"].Apply(); + } + + public override void DrawExpanded(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) + { + base.DrawExpanded(spriteBatch, position, opacity, scale); + + float Xoffset = instance.timeLeft > 9 ? -10f : -5; + DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, instance.timeLeft.ToString(), position + new Vector2(Xoffset, 4) * scale, Color.Lerp(GetColor(true), Color.OrangeRed, 1 - instance.Completion), Color.Black, scale); + } + + public override void DrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) + { + Texture2D sprite = Request(Texture).Value; + Texture2D outline = Request(OutlineTexture).Value; + Texture2D overlay = Request(OverlayTexture).Value; + + // Draw the outline + spriteBatch.Draw(outline, position, null, OutlineColor * opacity, 0, outline.Size() * 0.5f, scale, SpriteEffects.None, 0f); + + // Draw the icon + spriteBatch.Draw(sprite, position, null, Color.White * opacity, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f); + + // Draw the small overlay + int lostHeight = (int)Math.Ceiling(overlay.Height * AdjustedCompletion); + Rectangle crop = new Rectangle(0, lostHeight, overlay.Width, overlay.Height - lostHeight); + spriteBatch.Draw(overlay, position + Vector2.UnitY * lostHeight * scale, crop, OutlineColor * opacity * 0.9f, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f); + + float Xoffset = instance.timeLeft > 9 ? -10f : -5; + DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, instance.timeLeft.ToString(), position + new Vector2(Xoffset, 4) * scale, Color.Lerp(GetColor(true), Color.OrangeRed, 1 - instance.Completion), Color.Black, scale); + } + } + + public class ProfanedSoulShieldRecharge : CooldownHandler + { + private static Color ringColorLerpStart = new Color(217, 159, 78); + private static Color ringColorLerpEnd = new Color(214, 185, 144); + + public static new string ID => "ProfanedSoulShieldRecharge"; + public override bool ShouldDisplay => true; + public override LocalizedText DisplayName => GetText($"UI.Cooldowns.{ID}"); + public override string Texture => "CalamityMod/Cooldowns/ProfanedSoulShieldRecharge"; + public override string OutlineTexture => "CalamityMod/Cooldowns/ProfanedSoulShieldOutline"; + public override string OverlayTexture => "CalamityMod/Cooldowns/ProfanedSoulShieldOverlay"; + public override bool SavedWithPlayer => false; + public override bool PersistsThroughDeath => false; + public override Color OutlineColor => new Color(57, 195, 237); + public override Color CooldownStartColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion); + public override Color CooldownEndColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion); + + public override void Tick() => instance.player.Calamity().playedProfanedSoulShieldSound = false; + + public override SoundStyle? EndSound => Providence.BurnStartSound; + + public override bool ShouldPlayEndSound => instance.player.Calamity().pSoulArtifact; + + // When the recharge period completes, grant 1 point of shielding immediately so the rest my refill normally. + // The shield durability cooldown is added elsewhere, in Misc Effects. + public override void OnCompleted() + { + CalamityPlayer modPlayer = instance.player.Calamity(); + if (modPlayer.pSoulShieldDurability <= 0) + modPlayer.pSoulShieldDurability = 1; + } + } +} diff --git a/Cooldowns/ProfanedSoulArtifact.png b/Cooldowns/ProfanedSoulShieldActive.png similarity index 100% rename from Cooldowns/ProfanedSoulArtifact.png rename to Cooldowns/ProfanedSoulShieldActive.png diff --git a/Cooldowns/ProfanedSoulArtifactOutline.png b/Cooldowns/ProfanedSoulShieldOutline.png similarity index 100% rename from Cooldowns/ProfanedSoulArtifactOutline.png rename to Cooldowns/ProfanedSoulShieldOutline.png diff --git a/Cooldowns/ProfanedSoulArtifactOverlay.png b/Cooldowns/ProfanedSoulShieldOverlay.png similarity index 100% rename from Cooldowns/ProfanedSoulArtifactOverlay.png rename to Cooldowns/ProfanedSoulShieldOverlay.png diff --git a/Cooldowns/ProfanedSoulShieldRecharge.png b/Cooldowns/ProfanedSoulShieldRecharge.png new file mode 100644 index 0000000000..149dd14662 Binary files /dev/null and b/Cooldowns/ProfanedSoulShieldRecharge.png differ diff --git a/Cooldowns/SpongeCooldowns.cs b/Cooldowns/SpongeCooldowns.cs index 6484749021..b9429b1bac 100644 --- a/Cooldowns/SpongeCooldowns.cs +++ b/Cooldowns/SpongeCooldowns.cs @@ -90,6 +90,7 @@ namespace CalamityMod.Cooldowns public override Color CooldownStartColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion); public override Color CooldownEndColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion); public override SoundStyle? EndSound => TheSponge.ActivationSound; + public override bool ShouldPlayEndSound => instance.player.Calamity().sponge; public override void Tick() => instance.player.Calamity().playedSpongeShieldSound = false; // When the recharge period completes, grant 1 point of shielding immediately so the rest my refill normally. diff --git a/Cooldowns/WulfrumRoverDriveCooldowns.cs b/Cooldowns/WulfrumRoverDriveCooldowns.cs index 894e7dd7f9..e4c6485992 100644 --- a/Cooldowns/WulfrumRoverDriveCooldowns.cs +++ b/Cooldowns/WulfrumRoverDriveCooldowns.cs @@ -98,6 +98,7 @@ namespace CalamityMod.Cooldowns if (modPlayer.roverDrive) modPlayer.RoverDriveShieldDurability = RoverDrive.ShieldDurabilityMax; } - public override SoundStyle? EndSound => null; + public override SoundStyle? EndSound => RoverDrive.ActivationSound; + public override bool ShouldPlayEndSound => instance.player.Calamity().roverDrive; } } diff --git a/ExtraTextures/GreyscaleOpenCircleButBigger.png b/ExtraTextures/GreyscaleOpenCircleButBigger.png new file mode 100644 index 0000000000..ef44fad2b9 Binary files /dev/null and b/ExtraTextures/GreyscaleOpenCircleButBigger.png differ diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index ea6e399f55..58c334d8b9 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -1,6 +1,9 @@ using System; using CalamityMod.Balancing; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Placeables.FurniturePlagued; +using CalamityMod.Items.Potions; +using CalamityMod.NPCs.DraedonLabThings; using Mono.Cecil.Cil; using MonoMod.Cil; using Terraria; @@ -11,7 +14,7 @@ namespace CalamityMod.ILEditing { public partial class ILChanges { - #region Rod of Harmony Changes + #region Shimmer Changes private static bool AdjustShimmerRequirements(On_Item.orig_CanShimmer orig, Item item) { @@ -20,6 +23,7 @@ namespace CalamityMod.ILEditing { return DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs; } + return orig(item); } @@ -70,49 +74,6 @@ namespace CalamityMod.ILEditing } #endregion - #region Magiluminescence Changes - private static void NerfMagiluminescence(ILContext il) - { - // Nerf the run acceleration boost from 1.75x to 1.25x. - var cursor = new ILCursor(il); - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdfld("hasMagiluminescence"))) - { - LogFailure("Magiluminescence Nerf", "Could not locate the Magiluminescence bool."); - return; - } - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(1.75f))) - { - LogFailure("Magiluminescence Nerf", "Could not locate the Magiluminescence run acceleration multiplier."); - return; - } - cursor.Next.Operand = 1.25f; - - // Nerf the max run speed boost from 1.15x to 1.05x. - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(1.15f))) - { - LogFailure("Magiluminescence Nerf", "Could not locate the Magiluminescence max run speed multiplier."); - return; - } - cursor.Next.Operand = 1.05f; - - // Nerf the acc run speed boost from 1.15x to 1.05x. - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(1.15f))) - { - LogFailure("Magiluminescence Nerf", "Could not locate the Magiluminescence acc run speed multiplier."); - return; - } - cursor.Next.Operand = 1.05f; - - // Nerf the run slowdown boost from 1.75x to 1.25x. - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(1.75f))) - { - LogFailure("Magiluminescence Nerf", "Could not locate the Magiluminescence run slowdown multiplier."); - return; - } - cursor.Next.Operand = 1.25f; - } - #endregion - #region Jump Height Changes private static void FixJumpHeightBoosts(ILContext il) { diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index dbbe474782..adc92a662e 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -55,6 +55,7 @@ namespace CalamityMod.ILEditing // Please order these hooks in the ordering priority you want energy shields to have On_Main.DrawInfernoRings += RoverDrive.DrawRoverDriveShields; On_Main.DrawInfernoRings += LunicCorpsHelmet.DrawHaloShields; + On_Main.DrawInfernoRings += ProfanedSoulArtifact.DrawProfanedSoulShields; //both psa and psc On_Main.DrawInfernoRings += TheSponge.DrawSpongeShields; // NPC behavior @@ -101,7 +102,6 @@ namespace CalamityMod.ILEditing IL_Player.UpdateJumpHeight += FixJumpHeightBoosts; IL_Player.Update += BaseJumpHeightAdjustment; IL_Player.Update += RunSpeedAdjustments; - IL_Player.Update += NerfMagiluminescence; IL_Player.Update += NerfSoaringInsigniaRunAcceleration; IL_Player.WingMovement += RemoveSoaringInsigniaInfiniteWingTime; diff --git a/Items/Accessories/AeroStone.cs b/Items/Accessories/AeroStone.cs index 7904b7e0f4..110a2a9a84 100644 --- a/Items/Accessories/AeroStone.cs +++ b/Items/Accessories/AeroStone.cs @@ -21,16 +21,16 @@ namespace CalamityMod.Items.Accessories { Item.width = 40; Item.height = 50; - Item.value = CalamityGlobalItem.Rarity2BuyPrice; - Item.rare = ItemRarityID.Green; + Item.value = CalamityGlobalItem.Rarity3BuyPrice; + Item.rare = ItemRarityID.Orange; Item.accessory = true; } public override void UpdateAccessory(Player player, bool hideVisual) { player.Calamity().aeroStone = true; - player.moveSpeed += 0.1f; - player.jumpSpeedBoost += 0.5f; + player.wingTimeMax += 45; + } public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) diff --git a/Items/Accessories/Calamity.cs b/Items/Accessories/Calamity.cs index 18c1ec014a..4a123ca7c2 100644 --- a/Items/Accessories/Calamity.cs +++ b/Items/Accessories/Calamity.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Accessories/ChaosStone.cs b/Items/Accessories/ChaosStone.cs index 047a98711a..79e9693ba6 100644 --- a/Items/Accessories/ChaosStone.cs +++ b/Items/Accessories/ChaosStone.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 7)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 7)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Accessories/CleansingJelly.cs b/Items/Accessories/CleansingJelly.cs index 3a1611de7a..108837fd19 100644 --- a/Items/Accessories/CleansingJelly.cs +++ b/Items/Accessories/CleansingJelly.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { - Item.width = 20; - Item.height = 24; + Item.width = 18; + Item.height = 40; Item.value = CalamityGlobalItem.Rarity1BuyPrice; Item.rare = ItemRarityID.Blue; Item.accessory = true; diff --git a/Items/Accessories/CleansingJelly.png b/Items/Accessories/CleansingJelly.png index 8bcaebe54d..9e57bf762a 100644 Binary files a/Items/Accessories/CleansingJelly.png and b/Items/Accessories/CleansingJelly.png differ diff --git a/Items/Accessories/CoreOfTheBloodGod.cs b/Items/Accessories/CoreOfTheBloodGod.cs index 03da4c4953..d9206d691d 100644 --- a/Items/Accessories/CoreOfTheBloodGod.cs +++ b/Items/Accessories/CoreOfTheBloodGod.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 4)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 4)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Accessories/CryoStone.cs b/Items/Accessories/CryoStone.cs index 0ca12500ad..98883c4d04 100644 --- a/Items/Accessories/CryoStone.cs +++ b/Items/Accessories/CryoStone.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(4, 4)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(4, 4)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Accessories/DarkGodsSheath.cs b/Items/Accessories/DarkMatterSheath.cs similarity index 92% rename from Items/Accessories/DarkGodsSheath.cs rename to Items/Accessories/DarkMatterSheath.cs index cf7df4f8ab..c52b1649e1 100644 --- a/Items/Accessories/DarkGodsSheath.cs +++ b/Items/Accessories/DarkMatterSheath.cs @@ -6,7 +6,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class DarkGodsSheath : ModItem, ILocalizedModType + [LegacyName("DarkGodsSheath")] + public class DarkMatterSheath : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() diff --git a/Items/Accessories/DarkGodsSheath.png b/Items/Accessories/DarkMatterSheath.png similarity index 100% rename from Items/Accessories/DarkGodsSheath.png rename to Items/Accessories/DarkMatterSheath.png diff --git a/Items/Accessories/EclipseMirror.cs b/Items/Accessories/EclipseMirror.cs index 107311b7c1..c96bc0e7e5 100644 --- a/Items/Accessories/EclipseMirror.cs +++ b/Items/Accessories/EclipseMirror.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Accessories { CreateRecipe(). AddIngredient(). - AddIngredient(). + AddIngredient(). AddIngredient(20). AddTile(). Register(); diff --git a/Items/Accessories/FrostFlare.cs b/Items/Accessories/FrostFlare.cs index e1ca0e72da..d93792e7c0 100644 --- a/Items/Accessories/FrostFlare.cs +++ b/Items/Accessories/FrostFlare.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 4)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 4)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Accessories/GloveOfRecklessness.cs b/Items/Accessories/GloveOfRecklessness.cs index ba7c5937de..94bdebab89 100644 --- a/Items/Accessories/GloveOfRecklessness.cs +++ b/Items/Accessories/GloveOfRecklessness.cs @@ -24,7 +24,8 @@ namespace CalamityMod.Items.Accessories modPlayer.gloveOfRecklessness = true; modPlayer.stealthGenStandstill += 0.15f; modPlayer.stealthGenMoving += 0.15f; - player.GetDamage() -= 0.13f; + player.GetDamage() -= 0.10f; + player.GetCritChance() -= 10; player.GetAttackSpeed() += 0.15f; } } diff --git a/Items/Accessories/GloveofPrecision.cs b/Items/Accessories/GloveofPrecision.cs index 3c5889b1cb..47c01a918a 100644 --- a/Items/Accessories/GloveofPrecision.cs +++ b/Items/Accessories/GloveofPrecision.cs @@ -22,9 +22,9 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.gloveOfPrecision = true; - player.GetDamage() += 0.13f; + player.GetDamage() += 0.10f; player.GetCritChance() += 15; - modPlayer.rogueVelocity += 0.25f; + modPlayer.rogueVelocity += 0.15f; player.GetAttackSpeed() -= 0.15f; } } diff --git a/Items/Accessories/GrandGelatin.cs b/Items/Accessories/GrandGelatin.cs index 2668c59e0d..17aa96c5d1 100644 --- a/Items/Accessories/GrandGelatin.cs +++ b/Items/Accessories/GrandGelatin.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { - Item.width = 20; - Item.height = 24; + Item.width = 34; + Item.height = 52; Item.value = CalamityGlobalItem.Rarity5BuyPrice; Item.rare = ItemRarityID.Pink; Item.accessory = true; @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.GrandGelatin = true; - player.moveSpeed += 0.1f; - player.jumpSpeedBoost += 0.5f; + player.moveSpeed += 0.12f; + player.jumpSpeedBoost += 0.6f; } public override void AddRecipes() diff --git a/Items/Accessories/GrandGelatin.png b/Items/Accessories/GrandGelatin.png index fc9bbcb868..3bfd95b68d 100644 Binary files a/Items/Accessories/GrandGelatin.png and b/Items/Accessories/GrandGelatin.png differ diff --git a/Items/Accessories/HarpyRing.cs b/Items/Accessories/HarpyRing.cs index c074b73bca..fc30d1aaba 100644 --- a/Items/Accessories/HarpyRing.cs +++ b/Items/Accessories/HarpyRing.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.harpyRing = true; + player.moveSpeed += 0.1f; } public override void AddRecipes() diff --git a/Items/Accessories/HeartofDarkness.cs b/Items/Accessories/HeartofDarkness.cs index 7696bf3189..9a6f05e082 100644 --- a/Items/Accessories/HeartofDarkness.cs +++ b/Items/Accessories/HeartofDarkness.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 4)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 4)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Accessories/HeartoftheElements.cs b/Items/Accessories/HeartoftheElements.cs index f4cca0430d..342811f679 100644 --- a/Items/Accessories/HeartoftheElements.cs +++ b/Items/Accessories/HeartoftheElements.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 8)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 8)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Accessories/HowlsHeart.cs b/Items/Accessories/HowlsHeart.cs index 8a5dea9000..df2308cfff 100644 --- a/Items/Accessories/HowlsHeart.cs +++ b/Items/Accessories/HowlsHeart.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 4)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 4)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Accessories/LifeJelly.cs b/Items/Accessories/LifeJelly.cs index 0c4d0719e6..fc53a320f1 100644 --- a/Items/Accessories/LifeJelly.cs +++ b/Items/Accessories/LifeJelly.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { - Item.width = 20; - Item.height = 24; + Item.width = 18; + Item.height = 40; Item.value = CalamityGlobalItem.Rarity1BuyPrice; Item.rare = ItemRarityID.Blue; Item.accessory = true; diff --git a/Items/Accessories/LifeJelly.png b/Items/Accessories/LifeJelly.png index a037663085..67c9364a04 100644 Binary files a/Items/Accessories/LifeJelly.png and b/Items/Accessories/LifeJelly.png differ diff --git a/Items/Accessories/LumenousAmulet.cs b/Items/Accessories/LumenousAmulet.cs index 7502b1f6ff..4d9b3acba9 100644 --- a/Items/Accessories/LumenousAmulet.cs +++ b/Items/Accessories/LumenousAmulet.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.abyssalAmulet = true; modPlayer.lumenousAmulet = true; + player.buffImmune[ModContent.BuffType()] = true; player.buffImmune[ModContent.BuffType()] = true; } diff --git a/Items/Accessories/PhantomicArtifact.cs b/Items/Accessories/PhantomicArtifact.cs index 3f066831da..74368d77d6 100644 --- a/Items/Accessories/PhantomicArtifact.cs +++ b/Items/Accessories/PhantomicArtifact.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 7)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 7)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Accessories/ProfanedSoulArtifact.cs b/Items/Accessories/ProfanedSoulArtifact.cs index 67a60d3da3..bbd8401e12 100644 --- a/Items/Accessories/ProfanedSoulArtifact.cs +++ b/Items/Accessories/ProfanedSoulArtifact.cs @@ -1,24 +1,148 @@ -using CalamityMod.CalPlayer; +using System; +using System.Linq; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Plates; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Rarities; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.DataStructures; +using Terraria.Graphics.Effects; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class ProfanedSoulArtifact : ModItem, ILocalizedModType //My precious babs <3 ~Amber + public class ProfanedSoulArtifact : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + public static Asset HeatTex; + + public static int ShieldRechargeDelay = CalamityUtils.SecondsToFrames(5); + public static int TotalShieldRechargeTime = CalamityUtils.SecondsToFrames(2); + + public static int ShieldDurabilityMax = 25; public override void SetStaticDefaults() { Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); ItemID.Sets.AnimatesAsSoul[Type] = true; } + // Complex drawcode which draws Profaned Soul shields on ALL players who have it available. Supposedly. + // This is applied as IL (On hook) which draws right before Inferno Ring. + internal static void DrawProfanedSoulShields(On_Main.orig_DrawInfernoRings orig, Main mainObj) + { + // TODO -- Control flow analysis indicates that this hook is not stable (as it was copied from Rover Drive). + // Profaned Soul shields will be drawn for each player with the Profaned Soul artifact/crystal, yes. + // But there is no guarantee that the shields will be in the right condition for each player. + // Visibility is not net synced, for example. + bool alreadyDrawnShieldForPlayer = false; + + for (int i = 0; i < Main.maxPlayers; i++) + { + Player player = Main.player[i]; + if (player is null || !player.active || player.outOfRange || player.dead) + continue; + + CalamityPlayer modPlayer = player.Calamity(); + + // Do not render the shield if its visibility is off (or it does not exist) + bool isVanityOnly = modPlayer.pSoulShieldVisible && !modPlayer.pSoulArtifact; + bool shieldExists = isVanityOnly || modPlayer.pSoulShieldDurability > 0; + if (!modPlayer.pSoulShieldVisible || modPlayer.drawnAnyShieldThisFrame || !shieldExists) + continue; + + // Scale the shield is drawn at. + // The "i" parameter is to make different player's shields not be perfectly synced. + float scale = 0.15f + 0.03f * (0.5f + 0.5f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 0.5f + i * 0.2f)); + + if (!alreadyDrawnShieldForPlayer) + { + CalamityPlayer localModPlayer = Main.LocalPlayer.Calamity(); + var psc = localModPlayer.profanedCrystalBuffs; + scale += psc ? 0.025f : 0f; + float visualShieldStrength = 1f; + if (!isVanityOnly) + { + float max = psc ? ProfanedSoulCrystal.ShieldDurabilityMax : ShieldDurabilityMax; + float shieldDurabilityRatio = localModPlayer.pSoulShieldDurability / (float)ShieldDurabilityMax; + visualShieldStrength = MathF.Pow(shieldDurabilityRatio, 0.5f); + } + + // The scale used for the noise overlay polygons also grows and shrinks + // This is intentionally out of sync with the shield, and intentionally desynced per player + // Don't put this anywhere less than 0.25f or higher than 1f. The higher it is, the denser / more zoomed out the noise overlay is. + float noiseScale = MathHelper.Lerp(0.4f, 0.8f, (float)Math.Sin(Main.GlobalTimeWrappedHourly * 0.3f) * 0.5f + 0.5f); + + // Define shader parameters + Effect shieldEffect = Filters.Scene["CalamityMod:RoverDriveShield"].GetShader().Shader; + shieldEffect.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly * 0.058f); // Scrolling speed of polygonal overlay + shieldEffect.Parameters["blowUpPower"].SetValue(2.8f); + shieldEffect.Parameters["blowUpSize"].SetValue(0.4f); + shieldEffect.Parameters["noiseScale"].SetValue(noiseScale); + + // Shield opacity multiplier slightly changes, this is independent of current shield strength + float baseShieldOpacity = 0.9f + 0.1f * MathF.Sin(Main.GlobalTimeWrappedHourly * 1.95f); + float minShieldStrengthOpacityMultiplier = 0.5f; + float finalShieldOpacity = baseShieldOpacity * MathHelper.Lerp(minShieldStrengthOpacityMultiplier, 1f, visualShieldStrength); + shieldEffect.Parameters["shieldOpacity"].SetValue(finalShieldOpacity); + shieldEffect.Parameters["shieldEdgeBlendStrenght"].SetValue(4f); + + // Profaned Soul shields are not team specific + Color shieldColor = new Color(231, 160, 56); + if (psc && ProfanedSoulCrystal.testerNames.Any(name => name.Equals(localModPlayer.Player.name))) + shieldColor = CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25), 4f); + else if (psc) + shieldColor = new Color(255, 110, 56); + + Color primaryEdgeColor = new Color(230, 199, 102) * 0.8f; + Color secondaryEdgeColor = new Color(249, 231, 217) * 0.8f; + Color edgeColor = CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly * 0.2f, primaryEdgeColor, secondaryEdgeColor); + + // Define shader parameters for shield color + shieldEffect.Parameters["shieldColor"].SetValue(shieldColor.ToVector3()); + shieldEffect.Parameters["shieldEdgeColor"].SetValue(edgeColor.ToVector3()); + + // GOD I LOVE END BEGIN CAN THIS GAME PLEASE BE SWALLOWED BY THE FIRES OF HELL THANKS + // yes I copy pasted that comment, I hate end begin that much + // I also copy pasted that comment, this time for consistency :hdfailure: + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, shieldEffect, Main.GameViewMatrix.TransformationMatrix); + // Fetch shield heat overlay texture (this is the neutrons fed to the shader) + HeatTex ??= ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/Neurons2"); + Vector2 pos = player.MountedCenter + player.gfxOffY * Vector2.UnitY - Main.screenPosition; + Texture2D tex = HeatTex.Value; + Main.spriteBatch.Draw(tex, pos, null, Color.White, 0, tex.Size() / 2f, scale, 0, 0); + + //The border circle MUST be drawn after otherwise it becomes visually fucked. + float shieldScale = scale * 1.75f; + Texture2D shieldTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleOpenCircle").Value; + Rectangle shieldFrame = shieldTexture.Frame(); + Vector2 origin = shieldFrame.Size() * 0.5f; + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.Draw(shieldTexture, pos, shieldFrame, shieldColor * 0.5f, player.fullRotation, origin, shieldScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(shieldTexture, pos, shieldFrame, secondaryEdgeColor * 0.5f, player.fullRotation, origin, shieldScale * 0.95f, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(shieldTexture, pos, shieldFrame, shieldColor * 0.5f, player.fullRotation, origin, shieldScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(shieldTexture, pos, shieldFrame, secondaryEdgeColor * 0.5f, player.fullRotation, origin, shieldScale * 0.95f, SpriteEffects.None, 0f); + } + + alreadyDrawnShieldForPlayer = true; + modPlayer.drawnAnyShieldThisFrame = true; + } + + if (alreadyDrawnShieldForPlayer) + { + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.Transform); + } + + orig(mainObj); + } + public override void SetDefaults() { Item.width = 32; @@ -29,15 +153,21 @@ namespace CalamityMod.Items.Accessories Item.Calamity().donorItem = true; } - public override bool CanEquipAccessory(Player player, int slot, bool modded) + public override bool CanAccessoryBeEquippedWith(Item equippedItem, Item incomingItem, Player player) { - return !player.Calamity().pArtifact; + return incomingItem.type != ModContent.ItemType(); } public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.pArtifact = true; + modPlayer.pSoulArtifact = true; + modPlayer.pSoulShieldVisible = !hideVisual; + } + + public override void UpdateVanity(Player player) + { + player.Calamity().pSoulShieldVisible = true; } public override void AddRecipes() diff --git a/Items/Accessories/ProfanedSoulCrystal.cs b/Items/Accessories/ProfanedSoulCrystal.cs index 7b74065c7f..33c9795789 100644 --- a/Items/Accessories/ProfanedSoulCrystal.cs +++ b/Items/Accessories/ProfanedSoulCrystal.cs @@ -18,7 +18,12 @@ namespace CalamityMod.Items.Accessories //Developer item, dedicatee: Mishiro Usui/Amber Sienna public class ProfanedSoulCrystal : ModItem, ILocalizedModType { + public static string[] testerNames = new[] { "IbanPlay", "Chen", "Nincity", "Amber", "Mishiro" }; + public static int ShieldDurabilityMax = 125; public new string LocalizationCategory => "Items.Accessories"; + + internal const int maxMinionRequirement = 10; + /** * Notes: Drops from providence if the only damage source during the fight is from typeless damage or the profaned soul and the owners of those babs do not have profaned crystal. * All projectiles are in ProfanedSoulCrystalProjectiles.cs in the summon projectile directory @@ -67,9 +72,9 @@ namespace CalamityMod.Items.Accessories Item.Calamity().devItem = true; } - public override bool CanEquipAccessory(Player player, int slot, bool modded) + public override bool CanAccessoryBeEquippedWith(Item equippedItem, Item incomingItem, Player player) { - return !player.Calamity().pArtifact; + return incomingItem.type != ModContent.ItemType(); } public override void ModifyTooltips(List tooltips) @@ -97,22 +102,26 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.pArtifact = true; + modPlayer.pSoulArtifact = true; modPlayer.profanedCrystal = true; - if (hideVisual) - modPlayer.profanedCrystalHide = true; + modPlayer.profanedCrystalHide = hideVisual; + modPlayer.pSoulShieldVisible = !hideVisual; + + DetermineTransformationEligibility(player); } public override void UpdateVanity(Player player) { player.Calamity().profanedCrystalHide = false; player.Calamity().profanedCrystalForce = true; + player.Calamity().pSoulShieldVisible = true; } internal static void DetermineTransformationEligibility(Player player) { - if (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs && (player.maxMinions - player.slotsMinions) >= 10 && !player.Calamity().profanedCrystalForce && player.HasBuff()) + //short circuit immediately if profanedcrystalbuffs has already been set + if (!player.Calamity().profanedCrystalBuffs && DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs && (player.maxMinions - player.slotsMinions) >= 10 && !player.Calamity().profanedCrystalForce && player.HasBuff()) { player.Calamity().profanedCrystalBuffs = true; } diff --git a/Items/Accessories/Purity.cs b/Items/Accessories/Purity.cs index a0d2242d05..ca44f6c28c 100644 --- a/Items/Accessories/Purity.cs +++ b/Items/Accessories/Purity.cs @@ -4,6 +4,8 @@ using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -12,6 +14,12 @@ namespace CalamityMod.Items.Accessories public class Purity : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + public override void SetStaticDefaults() + { + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 7)); + ItemID.Sets.AnimatesAsSoul[Type] = true; + } + public override void SetDefaults() { Item.defense = 8; @@ -45,8 +53,8 @@ namespace CalamityMod.Items.Accessories CreateRecipe(). AddIngredient(). AddIngredient(). - AddIngredient(4). - AddIngredient(5). + AddIngredient(5). + AddIngredient(4). AddTile(ModContent.TileType()). Register(); } diff --git a/Items/Accessories/Purity.png b/Items/Accessories/Purity.png index c710af531d..c07a9cf112 100644 Binary files a/Items/Accessories/Purity.png and b/Items/Accessories/Purity.png differ diff --git a/Items/Accessories/RampartofDeities.cs b/Items/Accessories/RampartofDeities.cs index c994cc1856..b3dfb4b051 100644 --- a/Items/Accessories/RampartofDeities.cs +++ b/Items/Accessories/RampartofDeities.cs @@ -17,10 +17,10 @@ namespace CalamityMod.Items.Accessories { Item.width = 64; Item.height = 62; - Item.value = CalamityGlobalItem.Rarity14BuyPrice; + Item.value = CalamityGlobalItem.Rarity15BuyPrice; Item.defense = 18; Item.accessory = true; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override void UpdateAccessory(Player player, bool hideVisual) @@ -57,8 +57,7 @@ namespace CalamityMod.Items.Accessories CreateRecipe(). AddIngredient(ItemID.FrozenShield). AddIngredient(). - AddIngredient(10). - AddIngredient(10). + AddIngredient(5). AddIngredient(4). AddTile(). Register(); diff --git a/Items/Accessories/SigilofCalamitas.cs b/Items/Accessories/SigilofCalamitas.cs index c017de0936..464b2168b0 100644 --- a/Items/Accessories/SigilofCalamitas.cs +++ b/Items/Accessories/SigilofCalamitas.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 8)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 8)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Accessories/StatisCurse.cs b/Items/Accessories/StatisCurse.cs index 3ed0ecb34b..3a325984c3 100644 --- a/Items/Accessories/StatisCurse.cs +++ b/Items/Accessories/StatisCurse.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 4)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 4)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Accessories/StatisVoidSash.cs b/Items/Accessories/StatisVoidSash.cs index 4b56534bd2..61a24863a2 100644 --- a/Items/Accessories/StatisVoidSash.cs +++ b/Items/Accessories/StatisVoidSash.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 3)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 3)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Accessories/TheAbsorber.cs b/Items/Accessories/TheAbsorber.cs index 87c9f5fe19..508d72d7fc 100644 --- a/Items/Accessories/TheAbsorber.cs +++ b/Items/Accessories/TheAbsorber.cs @@ -34,6 +34,7 @@ namespace CalamityMod.Items.Accessories AddIngredient(). AddIngredient(). AddIngredient(5). + AddIngredient(6). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Accessories/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index 947b3f4ceb..e191f1cba1 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(9, 6)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(9, 6)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Accessories/TheFirstShadowflame.cs b/Items/Accessories/TheFirstShadowflame.cs index 590df0cdb7..1715ac0e4a 100644 --- a/Items/Accessories/TheFirstShadowflame.cs +++ b/Items/Accessories/TheFirstShadowflame.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Accessories/TheSponge.cs b/Items/Accessories/TheSponge.cs index 99a96e5c64..d6d5e03a1f 100644 --- a/Items/Accessories/TheSponge.cs +++ b/Items/Accessories/TheSponge.cs @@ -33,9 +33,9 @@ namespace CalamityMod.Items.Accessories public static int ShieldRechargeDelay = CalamityUtils.SecondsToFrames(9); // was 6 public static int TotalShieldRechargeTime = CalamityUtils.SecondsToFrames(6); - // While active, The Sponge gives 30 defense and 30% DR + // While active, The Sponge gives 30 defense and 10% DR public static int ShieldActiveDefense = 30; - public static float ShieldActiveDamageReduction = 0.3f; + public static float ShieldActiveDamageReduction = 0.1f; public override void SetStaticDefaults() diff --git a/Items/Accessories/TheTransformer.cs b/Items/Accessories/TheTransformer.cs index 8a11e230cd..cf26d29d44 100644 --- a/Items/Accessories/TheTransformer.cs +++ b/Items/Accessories/TheTransformer.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 16)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 16)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Accessories/UnstableGraniteCore.cs b/Items/Accessories/UnstableGraniteCore.cs index 29d2a8153b..448d9e0d04 100644 --- a/Items/Accessories/UnstableGraniteCore.cs +++ b/Items/Accessories/UnstableGraniteCore.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(7, 5)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(7, 5)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Accessories/VitalJelly.cs b/Items/Accessories/VitalJelly.cs index 445249fa27..53f47b3a40 100644 --- a/Items/Accessories/VitalJelly.cs +++ b/Items/Accessories/VitalJelly.cs @@ -9,8 +9,8 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { - Item.width = 20; - Item.height = 24; + Item.width = 18; + Item.height = 40; Item.value = CalamityGlobalItem.Rarity1BuyPrice; Item.rare = ItemRarityID.Blue; Item.accessory = true; @@ -18,8 +18,8 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.moveSpeed += 0.1f; - player.jumpSpeedBoost += 0.5f; + player.moveSpeed += 0.12f; + player.jumpSpeedBoost += 0.6f; } } } diff --git a/Items/Accessories/VitalJelly.png b/Items/Accessories/VitalJelly.png index c8f1e9bd96..c9c23ef423 100644 Binary files a/Items/Accessories/VitalJelly.png and b/Items/Accessories/VitalJelly.png differ diff --git a/Items/Accessories/WarbanneroftheSun.cs b/Items/Accessories/WarbanneroftheSun.cs index dec37c29ba..0b3a5a05cd 100644 --- a/Items/Accessories/WarbanneroftheSun.cs +++ b/Items/Accessories/WarbanneroftheSun.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 5)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 5)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Accessories/Wings/DrewsWings.cs b/Items/Accessories/Wings/DrewsWings.cs index d6372e7c95..b07eb19d9e 100644 --- a/Items/Accessories/Wings/DrewsWings.cs +++ b/Items/Accessories/Wings/DrewsWings.cs @@ -12,9 +12,10 @@ namespace CalamityMod.Items.Accessories.Wings public class DrewsWings : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories.Wings"; + public override void SetStaticDefaults() { - ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(361, 12f, 3f); + ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(361, 11.5f, 2.9f); } public override void SetDefaults() @@ -49,11 +50,11 @@ namespace CalamityMod.Items.Accessories.Wings public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) { - ascentWhenFalling = 1f; //0.85 - ascentWhenRising = 0.175f; //0.15 - maxCanAscendMultiplier = 1.2f; //1 - maxAscentMultiplier = 3.25f; //3 - constantAscend = 0.15f; //0.135 + ascentWhenFalling = 1f; + ascentWhenRising = 0.17f; + maxCanAscendMultiplier = 1.2f; + maxAscentMultiplier = 3.25f; + constantAscend = 0.15f; } } } diff --git a/Items/Accessories/Wings/ElysianWings.cs b/Items/Accessories/Wings/ElysianWings.cs index 0e90800707..f0a92e6256 100644 --- a/Items/Accessories/Wings/ElysianWings.cs +++ b/Items/Accessories/Wings/ElysianWings.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Items.Accessories.Wings public class ElysianWings : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories.Wings"; + public override void SetStaticDefaults() { ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(240, 9.5f, 2.7f); diff --git a/Items/Accessories/Wings/ExodusWings.cs b/Items/Accessories/Wings/ExodusWings.cs index 357f7137db..8e521e5065 100644 --- a/Items/Accessories/Wings/ExodusWings.cs +++ b/Items/Accessories/Wings/ExodusWings.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.Accessories.Wings public class ExodusWings : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories.Wings"; + public override void SetStaticDefaults() { ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(180, 9f, 2.5f); diff --git a/Items/Accessories/Wings/SilvaWings.cs b/Items/Accessories/Wings/SilvaWings.cs index c17192dfd0..5fdbd66c83 100644 --- a/Items/Accessories/Wings/SilvaWings.cs +++ b/Items/Accessories/Wings/SilvaWings.cs @@ -16,9 +16,10 @@ namespace CalamityMod.Items.Accessories.Wings public class SilvaWings : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories.Wings"; + public override void SetStaticDefaults() { - ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(270, 11f, 2.8f); + ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(270, 10.5f, 2.8f); } public override void SetDefaults() @@ -59,11 +60,11 @@ namespace CalamityMod.Items.Accessories.Wings public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) { - ascentWhenFalling = 1f; //0.85 - ascentWhenRising = 0.16f; //0.15 - maxCanAscendMultiplier = 1.2f; //1 - maxAscentMultiplier = 3.25f; //3 - constantAscend = 0.14f; //0.135 + ascentWhenFalling = 0.95f; + ascentWhenRising = 0.16f; + maxCanAscendMultiplier = 1.1f; + maxAscentMultiplier = 3.2f; + constantAscend = 0.145f; } public override void AddRecipes() diff --git a/Items/Accessories/Wings/TarragonWings.cs b/Items/Accessories/Wings/TarragonWings.cs index 93502370c6..12e4b084a3 100644 --- a/Items/Accessories/Wings/TarragonWings.cs +++ b/Items/Accessories/Wings/TarragonWings.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.Accessories.Wings public class TarragonWings : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories.Wings"; + public override void SetStaticDefaults() { ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(250, 9.5f, 2.5f); diff --git a/Items/Accessories/Wings/TracersCelestial.cs b/Items/Accessories/Wings/TracersCelestial.cs index 559aaebff1..b53473ca63 100644 --- a/Items/Accessories/Wings/TracersCelestial.cs +++ b/Items/Accessories/Wings/TracersCelestial.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.Accessories.Wings public class TracersCelestial : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories.Wings"; + public override void SetStaticDefaults() { ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(140, 9f, 2.6f); @@ -48,8 +49,8 @@ namespace CalamityMod.Items.Accessories.Wings Main.dust[num60].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player); } CalamityPlayer modPlayer = player.Calamity(); - player.accRunSpeed = 8.5f; - player.moveSpeed += 0.16f; + player.accRunSpeed = 8f; + player.moveSpeed += 0.14f; player.iceSkate = true; player.waterWalk = true; player.fireWalk = true; diff --git a/Items/Accessories/Wings/TracersElysian.cs b/Items/Accessories/Wings/TracersElysian.cs index 4547d9d49c..06dddf9908 100644 --- a/Items/Accessories/Wings/TracersElysian.cs +++ b/Items/Accessories/Wings/TracersElysian.cs @@ -18,9 +18,10 @@ namespace CalamityMod.Items.Accessories.Wings public class TracersElysian : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories.Wings"; + public override void SetStaticDefaults() { - ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(180, 10.5f, 2.75f); + ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(180, 10f, 2.7f); } public override void SetDefaults() @@ -51,8 +52,8 @@ namespace CalamityMod.Items.Accessories.Wings Main.dust[num60].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player); } CalamityPlayer modPlayer = player.Calamity(); - player.accRunSpeed = 9.25f; - player.moveSpeed += 0.2f; + player.accRunSpeed = 8.5f; + player.moveSpeed += 0.16f; player.iceSkate = true; player.waterWalk = true; player.fireWalk = true; @@ -66,10 +67,10 @@ namespace CalamityMod.Items.Accessories.Wings public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) { - ascentWhenFalling = 0.95f; //0.85 + ascentWhenFalling = 0.85f; ascentWhenRising = 0.15f; - maxCanAscendMultiplier = 1.1f; //1 - maxAscentMultiplier = 3.15f; //3 + maxCanAscendMultiplier = 1.1f; + maxAscentMultiplier = 2.7f; constantAscend = 0.135f; } diff --git a/Items/Accessories/Wings/TracersSeraph.cs b/Items/Accessories/Wings/TracersSeraph.cs index fffabfba2c..7c5e5f8782 100644 --- a/Items/Accessories/Wings/TracersSeraph.cs +++ b/Items/Accessories/Wings/TracersSeraph.cs @@ -18,9 +18,10 @@ namespace CalamityMod.Items.Accessories.Wings public class TracersSeraph : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories.Wings"; + public override void SetStaticDefaults() { - ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(250, 12f, 3f); + ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(250, 11f, 2.8f); } public override void SetDefaults() @@ -51,8 +52,8 @@ namespace CalamityMod.Items.Accessories.Wings Main.dust[num60].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player); } CalamityPlayer modPlayer = player.Calamity(); - player.accRunSpeed = 10f; - player.moveSpeed += 0.24f; + player.accRunSpeed = 9f; + player.moveSpeed += 0.18f; player.iceSkate = true; player.waterWalk = true; player.fireWalk = true; @@ -66,11 +67,11 @@ namespace CalamityMod.Items.Accessories.Wings public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) { - ascentWhenFalling = 1f; //0.85 - ascentWhenRising = 0.175f; //0.15 - maxCanAscendMultiplier = 1.2f; //1 - maxAscentMultiplier = 3.25f; //3 - constantAscend = 0.15f; //0.135 + ascentWhenFalling = 0.95f; + ascentWhenRising = 0.16f; + maxCanAscendMultiplier = 1.2f; + maxAscentMultiplier = 2.9f; + constantAscend = 0.145f; } public override void AddRecipes() diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index d4ded9bc69..e124f2eb55 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -36,7 +36,6 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.IO; using Terraria.Utilities; -using CalamityMod.Projectiles.Typless; namespace CalamityMod.Items { @@ -625,7 +624,7 @@ namespace CalamityMod.Items if (player.HasBuff(BuffID.ParryDamageBuff)) { - if (item.type != ItemID.DD2SquireDemonSword) + if (item.type != ItemID.DD2SquireDemonSword && item.type != ItemID.BouncingShield) { player.parryDamageBuff = false; player.ClearBuff(BuffID.ParryDamageBuff); @@ -653,6 +652,9 @@ namespace CalamityMod.Items NPC closest = Main.MouseWorld.ClosestNPCAt(1000f, true); if (closest != null) { + //TODO look into this, it does not work as expected! + //Does not draw the ring, mostly, which leads to uncertainty of it's functionality + //Maybe just move it to a whip transform :wires: player.MinionAttackTargetNPC = closest.whoAmI; player.UpdateMinionTarget(); } @@ -788,7 +790,8 @@ namespace CalamityMod.Items } // Conversion for Profaned Soul Crystal - ProfanedSoulCrystal.DetermineTransformationEligibility(player); + // DO NOT CHECK TRANSFORM ELIGIBILITY HERE + // It causes issues with actually restricting the transformed attacks when the player fails the ~~vibe check~~ minion requirement check if (modPlayer.profanedCrystalBuffs && item.pick == 0 && item.axe == 0 && item.hammer == 0 && item.autoReuse && (item.CountsAsClass() || item.CountsAsClass() || item.CountsAsClass() || item.CountsAsClass())) return player.altFunctionUse == 0 ? ProfanedSoulCrystal.TransformItemUsage(item, player) : AltFunctionUse(item, player); diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index c7ebc3d180..9c8e4b6600 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -442,7 +442,7 @@ namespace CalamityMod.Items // Palladium if (item.type == ItemID.PalladiumSword || item.type == ItemID.PalladiumPike) - EditTooltipByName("Knockback", (line) => line.Text += "\nIncreases life regen on hit"); + EditTooltipByName("Knockback", (line) => line.Text += "\nIncreases natural life regen on hit"); // Mythril if (item.type == ItemID.MythrilSword || item.type == ItemID.MythrilHalberd) @@ -478,9 +478,6 @@ namespace CalamityMod.Items if (item.type == ItemID.AntlionClaw || item.type == ItemID.BoneSword || item.type == ItemID.BreakerBlade) EditTooltipByName("Knockback", (line) => line.Text += "\nIgnores 50% of enemy defense"); - if (item.type == ItemID.NightsEdge || item.type == ItemID.TrueNightsEdge) - EditTooltipByName("Knockback", (line) => line.Text += "\nInflicts Shadowflame on hit"); - if (item.type == ItemID.DeathSickle) EditTooltipByNum(0, (line) => line.Text += "\nInflicts Whispering Death on hit"); #endregion @@ -588,7 +585,7 @@ namespace CalamityMod.Items // Fairy Boots buff. if (item.type == ItemID.FairyBoots) EditTooltipByNum(2, (line) => line.Text += "\nFairies can spawn at any time on the surface and spawn far more frequently\n" + - "Nearby fairies grant increased life regen, defense and movement speed\n" + + "Nearby fairies grant +2 HP/s life regen, 10 defense and 10% movement speed\n" + "Fairies are immune to damage and will no longer flee"); // Armor Crunch immunity pre-Golem. @@ -623,8 +620,8 @@ namespace CalamityMod.Items // Magiluminescence nerf and clear explanation of what it actually does. if (item.type == ItemID.Magiluminescence) - EditTooltipByNum(0, (line) => line.Text = "Increases movement acceleration and deceleration by 1.25x\n" + - "Increases movement speed by 1.05x. This bonus applies to running boot accessories"); + EditTooltipByNum(0, (line) => line.Text = "Increases movement acceleration and deceleration by 1.75x\n" + + "Increases movement speed by 1.15x. This bonus applies to running boot accessories"); // Soaring Insignia nerf and clear explanation of what it actually does. if (item.type == ItemID.EmpressFlightBooster) @@ -729,7 +726,7 @@ namespace CalamityMod.Items if (item.type == ItemID.TinHelmet) AddTooltip("3% increased critical strike chance"); if (item.type == ItemID.TinChainmail) - AddTooltip("+1 life regen"); + AddTooltip("+0.5 HP/s life regen"); if (item.type == ItemID.TinGreaves) AddTooltip("5% increased movement speed"); @@ -745,7 +742,7 @@ namespace CalamityMod.Items if (item.type == ItemID.SilverHelmet) AddTooltip("5% increased critical strike chance"); if (item.type == ItemID.SilverChainmail) - AddTooltip("+2 life regen"); + AddTooltip("+1 HP/s life regen"); if (item.type == ItemID.SilverGreaves) AddTooltip("8% increased movement speed"); @@ -753,7 +750,7 @@ namespace CalamityMod.Items if (item.type == ItemID.TungstenHelmet) AddTooltip("7% increased damage"); if (item.type == ItemID.TungstenChainmail) - AddTooltip("+1 life regen"); + AddTooltip("+0.5 HP/s life regen"); if (item.type == ItemID.TungstenGreaves) AddTooltip("8% increased movement speed"); @@ -782,7 +779,7 @@ namespace CalamityMod.Items { EditTooltipByNum(0, (line) => { string newTooltip = line.Text.Replace("2%", "5%"); - newTooltip += "\n+1 life regen"; + newTooltip += "\n+0.5 HP/s life regen"; line.Text = newTooltip; }); } @@ -945,7 +942,7 @@ namespace CalamityMod.Items AddWingStats(3f, 1f, 0, 25); if (item.type == ItemID.AngelWings) - AddWingStats(6.25f, 1f, 1, 100, "+20 max life, +10 defense and +2 life regen"); + AddWingStats(6.25f, 1f, 1, 100, "+20 max life, +10 defense and +1 HP/s life regen"); if (item.type == ItemID.DemonWings) AddWingStats(6.25f, 1f, 1, 100, "5% increased damage and critical strike chance"); diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 99081780c9..782acf588f 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items { ItemID.AntlionClaw, Do(UseExact(14)) }, // Mandible Blade { ItemID.Bananarang, Do(DamageExact(98), UseExact(14)) }, { ItemID.BatScepter, Do(DamageExact(56)) }, - { ItemID.BeamSword, Do(UseMeleeSpeed, DamageExact(200), UseAnimationExact(60), ShootSpeedExact(23f)) }, + { ItemID.BeamSword, Do(UseMeleeSpeed, UseTurn, DamageExact(180), UseAnimationExact(60), ShootSpeedExact(23f)) }, { ItemID.BeeGun, Do(DamageExact(11)) }, { ItemID.BeesKnees, Do(PointBlank, DamageExact(18), UseExact(38)) }, { ItemID.Bladetongue, Do(UseTurn, UseRatio(0.8f), DamageExact(120), ScaleRatio(1.75f)) }, @@ -145,7 +145,7 @@ namespace CalamityMod.Items { ItemID.MagnetSphere, Do(DamageRatio(1.1f)) }, { ItemID.Marrow, Do(PointBlank, DamageExact(69)) }, { ItemID.MedusaHead, Do(ManaExact(6), DamageRatio(1.2f)) }, - { ItemID.Meowmere, Do(UseMeleeSpeed/*, DamageRatio(1.33f) */) }, + { ItemID.Meowmere, Do(UseMeleeSpeed, DamageExact(240)/*, DamageRatio(1.33f) */) }, { ItemID.MeteorStaff, Do(DamageExact(58), ManaExact(7), ShootSpeedExact(13f)) }, { ItemID.Minishark, Do(PointBlank, DamageExact(4)) }, { ItemID.MoltenFury, Do(PointBlank, UseExact(29), AutoReuse) }, @@ -173,6 +173,7 @@ namespace CalamityMod.Items { ItemID.PearlwoodSword, Do(UseTurn, DamageRatio(1.5f)) }, { ItemID.PewMaticHorn, Do(DamageExact(24)) }, { ItemID.PhoenixBlaster, Do(AutoReuse, PointBlank, UseExact(18)) }, + { ItemID.PiranhaGun, Do(DamageExact(48)) }, { ItemID.PlatinumBow, Do(PointBlank, DamageExact(12)) }, { ItemID.PlatinumShortsword, Do(AutoReuse, TrueMelee, DamageExact(18)) }, { ItemID.PoisonStaff, Do(DamageExact(57)) }, @@ -188,6 +189,7 @@ namespace CalamityMod.Items { ItemID.RedRyder, Do(PointBlank, DamageExact(24)) }, { ItemID.RocketIII, Do(DamageRatio(0.75f)) }, { ItemID.RocketIV, Do(DamageRatio(0.75f)) }, + { ItemID.Sandgun, Do(PointBlank, DamageExact(22), UseExact(20)) }, { ItemID.SapphireStaff, Do(DamageExact(25)) }, { ItemID.Seedler, Do(UseMeleeSpeed, DamageRatio(1.5f)) }, { ItemID.ShadowbeamStaff, Do(DamageExact(100)) }, @@ -220,7 +222,7 @@ namespace CalamityMod.Items { ItemID.TendonBow, Do(PointBlank, DamageExact(17), AutoReuse) }, // Vanilla damage 190. After fixing iframes so yoyo and shots can hit simultaneously, // Terrarian is extremely overpowered and requires a heavy nerf. - { ItemID.Terrarian, Do(AutoReuse, DamageExact(94)) }, + { ItemID.Terrarian, Do(AutoReuse, DamageExact(86)) }, { ItemID.TheRottedFork, Do(AutoReuse, TrueMelee, DamageExact(20)) }, { ItemID.TheUndertaker, Do(PointBlank, AutoReuse, DamageExact(15)) }, { ItemID.ThunderSpear, Do(AutoReuse, UseMeleeSpeed) }, // Storm Spear @@ -247,6 +249,7 @@ namespace CalamityMod.Items { ItemID.Xenopopper, Do(DamageRatio(0.75f)) }, { ItemID.YellowPhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) }, { ItemID.YellowPhasesaber, Do(ScaleRatio(1.5f), DamageExact(60)) }, + { ItemID.Zenith, Do(DamageExact(210)) }, { ItemID.ZombieArm, Do(AutoReuse, UseTurn, ScaleRatio(1.25f), KnockbackExact(12f)) }, #endregion @@ -282,31 +285,31 @@ namespace CalamityMod.Items #region CATEGORY 3: Tool Balancing { ItemID.AcornAxe, Do(AxePower(125)) }, // Axe of Regrowth - { ItemID.AdamantiteChainsaw, Do(TrueMeleeNoSpeed, AxePower(90), UseTimeExact(4), TileBoostExact(+0)) }, - { ItemID.AdamantiteDrill, Do(TrueMeleeNoSpeed, PickPower(180), UseTimeExact(4), TileBoostExact(+1)) }, + { ItemID.AdamantiteChainsaw, Do(TrueMeleeNoSpeed, AxePower(90), UseTimeExact(4), TileBoostExact(+0), DamageExact(75)) }, + { ItemID.AdamantiteDrill, Do(TrueMeleeNoSpeed, PickPower(180), UseTimeExact(4), TileBoostExact(+1), DamageExact(32)) }, { ItemID.AdamantitePickaxe, Do(PickPower(180), UseTimeExact(8), TileBoostExact(+1)) }, { ItemID.AdamantiteWaraxe, Do(AxePower(160), UseTimeExact(10), TileBoostExact(+1)) }, { ItemID.BloodLustCluster, Do(AxePower(100), UseTimeExact(13), TileBoostExact(+0)) }, { ItemID.BonePickaxe, Do(PickPower(55), UseTimeExact(6)) }, { ItemID.BorealWoodHammer, Do(HammerPower(25), UseTimeExact(11), TileBoostExact(+0)) }, - { ItemID.ButchersChainsaw, Do(TrueMeleeNoSpeed, AxePower(150), UseTimeExact(3), TileBoostExact(+0)) }, + { ItemID.ButchersChainsaw, Do(TrueMeleeNoSpeed, AxePower(150), UseTimeExact(3), TileBoostExact(+0), DamageExact(194)) }, { ItemID.CactusPickaxe, Do(PickPower(34), UseTimeExact(9)) }, { ItemID.CnadyCanePickaxe, Do(PickPower(55), UseTimeExact(9), TileBoostExact(+1)) }, // Candy Cane Pickaxe - { ItemID.ChlorophyteChainsaw, Do(TrueMeleeNoSpeed, AxePower(120), UseTimeExact(3), TileBoostExact(+0)) }, - { ItemID.ChlorophyteDrill, Do(TrueMeleeNoSpeed, PickPower(200), UseTimeExact(4), TileBoostExact(+2)) }, + { ItemID.ChlorophyteChainsaw, Do(TrueMeleeNoSpeed, AxePower(120), UseTimeExact(3), TileBoostExact(+0), DamageExact(112)) }, + { ItemID.ChlorophyteDrill, Do(TrueMeleeNoSpeed, PickPower(200), UseTimeExact(4), TileBoostExact(+2), DamageExact(43)) }, { ItemID.ChlorophyteGreataxe, Do(AxePower(165), UseTimeExact(7), TileBoostExact(+2)) }, { ItemID.ChlorophyteJackhammer, Do(TrueMeleeNoSpeed, HammerPower(90), UseTimeExact(5), TileBoostExact(+0)) }, { ItemID.ChlorophytePickaxe, Do(PickPower(200), UseTimeExact(7), TileBoostExact(+2)) }, { ItemID.ChlorophyteWarhammer, Do(HammerPower(90), UseTimeExact(8), TileBoostExact(+2)) }, - { ItemID.CobaltChainsaw, Do(TrueMeleeNoSpeed, AxePower(70), UseTimeExact(4), TileBoostExact(-1)) }, - { ItemID.CobaltDrill, Do(TrueMeleeNoSpeed, PickPower(130), UseTimeExact(5)) }, + { ItemID.CobaltChainsaw, Do(TrueMeleeNoSpeed, AxePower(70), UseTimeExact(4), TileBoostExact(-1), DamageExact(51)) }, + { ItemID.CobaltDrill, Do(TrueMeleeNoSpeed, PickPower(130), UseTimeExact(5), DamageExact(21)) }, { ItemID.CobaltPickaxe, Do(PickPower(130), UseTimeExact(9)) }, { ItemID.CobaltWaraxe, Do(AxePower(125), UseTimeExact(12), TileBoostExact(+0)) }, { ItemID.CopperAxe, Do(AxePower(50), UseTimeExact(16), TileBoostExact(+0)) }, { ItemID.CopperHammer, Do(HammerPower(35), UseTimeExact(12), TileBoostExact(+0)) }, { ItemID.CopperPickaxe, Do(PickPower(35), UseTimeExact(10), TileBoostExact(+0)) }, { ItemID.DeathbringerPickaxe, Do(PickPower(70), UseTimeExact(10)) }, - { ItemID.Drax, Do(TrueMeleeNoSpeed, PickPower(200), AxePower(110), UseTimeExact(4), TileBoostExact(+1)) }, + { ItemID.Drax, Do(TrueMeleeNoSpeed, PickPower(200), AxePower(110), UseTimeExact(4), TileBoostExact(+1), DamageExact(80)) }, { ItemID.EbonwoodHammer, Do(HammerPower(25), UseTimeExact(9), TileBoostExact(+0)) }, { ItemID.FleshGrinder, Do(HammerPower(70), UseTimeExact(13), TileBoostExact(+0)) }, { ItemID.GoldAxe, Do(AxePower(80), UseTimeExact(14), TileBoostExact(+0)) }, @@ -316,7 +319,7 @@ namespace CalamityMod.Items { ItemID.IronAxe, Do(AxePower(60), UseTimeExact(15), TileBoostExact(+0)) }, { ItemID.IronHammer, Do(HammerPower(45), UseTimeExact(11), TileBoostExact(+0)) }, { ItemID.IronPickaxe, Do(PickPower(40), UseTimeExact(8)) }, - { ItemID.LaserDrill, Do(PickPower(220), AxePower(120), UseTimeExact(4)) }, + { ItemID.LaserDrill, Do(PickPower(220), AxePower(120), UseTimeExact(4), DamageExact(54)) }, { ItemID.LeadAxe, Do(AxePower(60), UseTimeExact(15), TileBoostExact(+0)) }, { ItemID.LeadHammer, Do(HammerPower(45), UseTimeExact(11), TileBoostExact(+0)) }, { ItemID.LeadPickaxe, Do(PickPower(40), UseTimeExact(8)) }, @@ -328,20 +331,20 @@ namespace CalamityMod.Items { ItemID.MeteorHamaxe, Do(HammerPower(70), AxePower(100), UseTimeExact(16), TileBoostExact(+0)) }, { ItemID.MoltenHamaxe, Do(HammerPower(75), AxePower(125), UseTimeExact(14), TileBoostExact(+0)) }, { ItemID.MoltenPickaxe, Do(PickPower(100), UseTimeExact(10)) }, - { ItemID.MythrilChainsaw, Do(TrueMeleeNoSpeed, AxePower(80), UseTimeExact(4), TileBoostExact(-1)) }, - { ItemID.MythrilDrill, Do(TrueMeleeNoSpeed, PickPower(160), UseTimeExact(4)) }, + { ItemID.MythrilChainsaw, Do(TrueMeleeNoSpeed, AxePower(80), UseTimeExact(4), TileBoostExact(-1), DamageExact(63)) }, + { ItemID.MythrilDrill, Do(TrueMeleeNoSpeed, PickPower(160), UseTimeExact(4), DamageExact(26)) }, { ItemID.MythrilPickaxe, Do(PickPower(160), UseTimeExact(8)) }, { ItemID.MythrilWaraxe, Do(AxePower(140), UseTimeExact(11), TileBoostExact(+0)) }, - { ItemID.NebulaDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4)) }, + { ItemID.NebulaDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, { ItemID.NebulaPickaxe, Do(PickPower(225), UseTimeExact(6), TileBoostExact(+4)) }, { ItemID.NettleBurst, Do(ManaExact(10), DamageExact(43)) }, { ItemID.NightmarePickaxe, Do(PickPower(66), UseTimeExact(9)) }, - { ItemID.OrichalcumChainsaw, Do(TrueMeleeNoSpeed, AxePower(80), UseTimeExact(4), TileBoostExact(-1)) }, - { ItemID.OrichalcumDrill, Do(TrueMeleeNoSpeed, PickPower(160), UseTimeExact(4)) }, + { ItemID.OrichalcumChainsaw, Do(TrueMeleeNoSpeed, AxePower(80), UseTimeExact(4), TileBoostExact(-1), DamageExact(63)) }, + { ItemID.OrichalcumDrill, Do(TrueMeleeNoSpeed, PickPower(160), UseTimeExact(4), DamageExact(26)) }, { ItemID.OrichalcumPickaxe, Do(PickPower(160), UseTimeExact(8)) }, { ItemID.OrichalcumWaraxe, Do(AxePower(140), UseTimeExact(11), TileBoostExact(+0)) }, - { ItemID.PalladiumChainsaw, Do(TrueMeleeNoSpeed, AxePower(70), UseTimeExact(4), TileBoostExact(-1)) }, - { ItemID.PalladiumDrill, Do(TrueMeleeNoSpeed, PickPower(130), UseTimeExact(5)) }, + { ItemID.PalladiumChainsaw, Do(TrueMeleeNoSpeed, AxePower(70), UseTimeExact(4), TileBoostExact(-1), DamageExact(51)) }, + { ItemID.PalladiumDrill, Do(TrueMeleeNoSpeed, PickPower(130), UseTimeExact(5), DamageExact(21)) }, { ItemID.PalladiumPickaxe, Do(PickPower(130), UseTimeExact(9)) }, { ItemID.PalladiumWaraxe, Do(AxePower(125), UseTimeExact(12), TileBoostExact(+0)) }, { ItemID.PalmWoodHammer, Do(HammerPower(25), UseTimeExact(11), TileBoostExact(+0)) }, @@ -361,25 +364,25 @@ namespace CalamityMod.Items { ItemID.SilverAxe, Do(AxePower(70), UseTimeExact(14), TileBoostExact(+0)) }, { ItemID.SilverHammer, Do(HammerPower(55), UseTimeExact(10), TileBoostExact(+0)) }, { ItemID.SilverPickaxe, Do(PickPower(50), UseTimeExact(11)) }, - { ItemID.SolarFlareDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4)) }, + { ItemID.SolarFlareDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, { ItemID.SolarFlarePickaxe, Do(PickPower(225), UseTimeExact(6), TileBoostExact(+4)) }, { ItemID.SpectreHamaxe, Do(HammerPower(90), AxePower(170), TileBoostExact(+4)) }, { ItemID.SpectrePickaxe, Do(PickPower(200), TileBoostExact(+4)) }, - { ItemID.StardustDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4)) }, + { ItemID.StardustDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, { ItemID.StardustPickaxe, Do(PickPower(225), UseTimeExact(6), TileBoostExact(+4)) }, { ItemID.TheAxe, Do(HammerPower(100), AxePower(175), UseTimeExact(7), TileBoostExact(+1)) }, { ItemID.TheBreaker, Do(HammerPower(70), UseTimeExact(13), TileBoostExact(+0)) }, { ItemID.TinAxe, Do(AxePower(50), UseTimeExact(16), TileBoostExact(+0)) }, { ItemID.TinHammer, Do(HammerPower(35), UseTimeExact(12), TileBoostExact(+0)) }, { ItemID.TinPickaxe, Do(PickPower(35), UseTimeExact(10), TileBoostExact(+0)) }, - { ItemID.TitaniumChainsaw, Do(TrueMeleeNoSpeed, AxePower(90), UseTimeExact(4), TileBoostExact(+0)) }, - { ItemID.TitaniumDrill, Do(TrueMeleeNoSpeed, PickPower(180), UseTimeExact(4), TileBoostExact(+1)) }, + { ItemID.TitaniumChainsaw, Do(TrueMeleeNoSpeed, AxePower(90), UseTimeExact(4), TileBoostExact(+0), DamageExact(75)) }, + { ItemID.TitaniumDrill, Do(TrueMeleeNoSpeed, PickPower(180), UseTimeExact(4), TileBoostExact(+1), DamageExact(32)) }, { ItemID.TitaniumPickaxe, Do(PickPower(180), UseTimeExact(8), TileBoostExact(+1)) }, { ItemID.TitaniumWaraxe, Do(AxePower(160), UseTimeExact(10), TileBoostExact(+1)) }, { ItemID.TungstenAxe, Do(AxePower(70), UseTimeExact(14), TileBoostExact(+0)) }, { ItemID.TungstenHammer, Do(HammerPower(55), UseTimeExact(10), TileBoostExact(+0)) }, { ItemID.TungstenPickaxe, Do(PickPower(50), UseTimeExact(11)) }, - { ItemID.VortexDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4)) }, + { ItemID.VortexDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, { ItemID.VortexPickaxe, Do(PickPower(225), UseTimeExact(6), TileBoostExact(+4)) }, { ItemID.WarAxeoftheNight, Do(AxePower(100), UseTimeExact(13), TileBoostExact(+0)) }, { ItemID.WoodenHammer, Do(HammerPower(25), UseTimeExact(11), TileBoostExact(+0)) }, @@ -429,7 +432,6 @@ namespace CalamityMod.Items { ItemID.QuadBarrelShotgun, pointBlank }, { ItemID.Revolver, Do(PointBlank, AutoReuse) }, { ItemID.RichMahoganyBow, pointBlank }, - { ItemID.Sandgun, pointBlank }, { ItemID.SDMG, pointBlank }, { ItemID.ShadewoodBow, pointBlank }, { ItemID.SilverBow, pointBlank }, diff --git a/Items/Critters/BabyCannonballJellyfishItem.cs b/Items/Critters/BabyCannonballJellyfishItem.cs new file mode 100644 index 0000000000..511727fc22 --- /dev/null +++ b/Items/Critters/BabyCannonballJellyfishItem.cs @@ -0,0 +1,33 @@ +using CalamityMod.NPCs.Abyss; +using Terraria; +using Terraria.ModLoader; +using Terraria.ID; + +namespace CalamityMod.Items.Critters +{ + public class BabyCannonballJellyfishItem : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Misc"; + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 5; + } + //Intentionally NOT bait due to bestiary entry on them being used as ammunition, although dynamite fishing in terraria does sound pretty fun + public override void SetDefaults() + { + Item.useStyle = ItemUseStyleID.Swing; + Item.autoReuse = true; + Item.useTurn = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.maxStack = 9999; + Item.consumable = true; + Item.noUseGraphic = true; + Item.value = Item.buyPrice(0, 0, 30, 0); + Item.width = 26; + Item.height = 24; + Item.makeNPC = (short)ModContent.NPCType(); + Item.rare = ItemRarityID.Green; + } + } +} diff --git a/Items/Critters/BabyCannonballJellyfishItem.png b/Items/Critters/BabyCannonballJellyfishItem.png new file mode 100644 index 0000000000..7fc4c1bfe6 Binary files /dev/null and b/Items/Critters/BabyCannonballJellyfishItem.png differ diff --git a/Items/Materials/BeetleJuice.cs b/Items/Materials/BeetleJuice.cs deleted file mode 100644 index 5468830dbc..0000000000 --- a/Items/Materials/BeetleJuice.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Terraria; -using Terraria.ModLoader; -using Terraria.ID; - -namespace CalamityMod.Items.Materials -{ - public class BeetleJuice : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Materials"; - public override void SetStaticDefaults() - { - Item.ResearchUnlockCount = 5; - } - - public override void SetDefaults() - { - Item.width = 20; - Item.height = 20; - Item.maxStack = 9999; - Item.value = Item.sellPrice(silver: 1); - Item.rare = ItemRarityID.Blue; - } - } -} diff --git a/Items/Materials/BeetleJuice.png b/Items/Materials/BeetleJuice.png deleted file mode 100644 index 57ca3e1d8a..0000000000 Binary files a/Items/Materials/BeetleJuice.png and /dev/null differ diff --git a/Items/Materials/TrapperBulb.cs b/Items/Materials/TrapperBulb.cs index 0f3cf782a8..8871e45749 100644 --- a/Items/Materials/TrapperBulb.cs +++ b/Items/Materials/TrapperBulb.cs @@ -19,5 +19,6 @@ namespace CalamityMod.Items.Materials Item.maxStack = 9999; Item.value = Item.sellPrice(silver: 16); Item.rare = ItemRarityID.LightRed; - } } + } + } } diff --git a/Items/Placeables/Banners/BabyCannonballJellyfishBanner.cs b/Items/Placeables/Banners/BabyCannonballJellyfishBanner.cs new file mode 100644 index 0000000000..d283eb1494 --- /dev/null +++ b/Items/Placeables/Banners/BabyCannonballJellyfishBanner.cs @@ -0,0 +1,28 @@ +using CalamityMod.Tiles; +using Terraria; +using Terraria.ModLoader; +using Terraria.ID; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class BabyCannonballJellyfishBanner : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.width = 10; + Item.height = 24; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.rare = ItemRarityID.Blue; + Item.value = Item.buyPrice(0, 0, 10, 0); + Item.createTile = ModContent.TileType(); + Item.placeStyle = 128; + } + } +} diff --git a/Items/Placeables/Banners/BabyCannonballJellyfishBanner.png b/Items/Placeables/Banners/BabyCannonballJellyfishBanner.png new file mode 100644 index 0000000000..6f46d7ec01 Binary files /dev/null and b/Items/Placeables/Banners/BabyCannonballJellyfishBanner.png differ diff --git a/Items/Placeables/Banners/CannonballJellyfishBanner.cs b/Items/Placeables/Banners/CannonballJellyfishBanner.cs new file mode 100644 index 0000000000..ce3a005cf3 --- /dev/null +++ b/Items/Placeables/Banners/CannonballJellyfishBanner.cs @@ -0,0 +1,28 @@ +using CalamityMod.Tiles; +using Terraria; +using Terraria.ModLoader; +using Terraria.ID; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class CannonballJellyfishBanner : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.width = 10; + Item.height = 24; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.rare = ItemRarityID.Blue; + Item.value = Item.buyPrice(0, 0, 10, 0); + Item.createTile = ModContent.TileType(); + Item.placeStyle = 127; + } + } +} diff --git a/Items/Placeables/Banners/CannonballJellyfishBanner.png b/Items/Placeables/Banners/CannonballJellyfishBanner.png new file mode 100644 index 0000000000..29f93d3ada Binary files /dev/null and b/Items/Placeables/Banners/CannonballJellyfishBanner.png differ diff --git a/Items/Placeables/EutrophicSand.cs b/Items/Placeables/EutrophicSand.cs index da19d9b25c..25b1db4512 100644 --- a/Items/Placeables/EutrophicSand.cs +++ b/Items/Placeables/EutrophicSand.cs @@ -28,11 +28,6 @@ namespace CalamityMod.Items.Placeables AddIngredient(4). AddTile(TileID.WorkBenches). Register(); - - CreateRecipe(). - AddIngredient(4). - AddTile(TileID.WorkBenches). - Register(); } } } diff --git a/Items/Placeables/Furniture/BabyCannonballJellyfishBowl.cs b/Items/Placeables/Furniture/BabyCannonballJellyfishBowl.cs new file mode 100644 index 0000000000..e980a584f0 --- /dev/null +++ b/Items/Placeables/Furniture/BabyCannonballJellyfishBowl.cs @@ -0,0 +1,30 @@ +using CalamityMod.Tiles.Furniture; +using CalamityMod.Items.Critters; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Furniture +{ + public class BabyCannonballJellyfishBowl : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.width = 34; + Item.height = 32; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + CreateRecipe(1).AddIngredient(ModContent.ItemType()).AddIngredient(ItemID.BottledWater).Register(); + } + } +} diff --git a/Items/Placeables/Furniture/BabyCannonballJellyfishBowl.png b/Items/Placeables/Furniture/BabyCannonballJellyfishBowl.png new file mode 100644 index 0000000000..0d0376c841 Binary files /dev/null and b/Items/Placeables/Furniture/BabyCannonballJellyfishBowl.png differ diff --git a/Items/Placeables/Furniture/BabyGhostBellJar.cs b/Items/Placeables/Furniture/BabyGhostBellJar.cs index 641b111c48..d5984cb99b 100644 --- a/Items/Placeables/Furniture/BabyGhostBellJar.cs +++ b/Items/Placeables/Furniture/BabyGhostBellJar.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Placeables.Furniture public override void AddRecipes() { - CreateRecipe(1).AddIngredient(ModContent.ItemType()).AddIngredient(ItemID.Bottle).Register(); + CreateRecipe(1).AddIngredient(ModContent.ItemType()).AddIngredient(ItemID.BottledWater).Register(); } } } diff --git a/Items/Placeables/Furniture/BossRelics/CalamitasCloneRelic.png b/Items/Placeables/Furniture/BossRelics/CalamitasCloneRelic.png index 3f9728e8ff..730e0e9c11 100644 Binary files a/Items/Placeables/Furniture/BossRelics/CalamitasCloneRelic.png and b/Items/Placeables/Furniture/BossRelics/CalamitasCloneRelic.png differ diff --git a/Items/Placeables/Furniture/BossRelics/CryogenRelic.png b/Items/Placeables/Furniture/BossRelics/CryogenRelic.png index 6c5a445cc8..d82e93259b 100644 Binary files a/Items/Placeables/Furniture/BossRelics/CryogenRelic.png and b/Items/Placeables/Furniture/BossRelics/CryogenRelic.png differ diff --git a/Items/Placeables/Furniture/BossRelics/DragonfollyRelic.png b/Items/Placeables/Furniture/BossRelics/DragonfollyRelic.png index addffbaa58..37b87f6286 100644 Binary files a/Items/Placeables/Furniture/BossRelics/DragonfollyRelic.png and b/Items/Placeables/Furniture/BossRelics/DragonfollyRelic.png differ diff --git a/Items/Placeables/FurniturePlagued/PlaguedContainmentBrick.cs b/Items/Placeables/FurniturePlagued/PlaguedContainmentBrick.cs index 4063ba6b47..50b2c5e678 100644 --- a/Items/Placeables/FurniturePlagued/PlaguedContainmentBrick.cs +++ b/Items/Placeables/FurniturePlagued/PlaguedContainmentBrick.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Walls; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurniturePlagued @@ -34,6 +35,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlagued AddRecipeGroup("AnyStoneBlock", 50). AddIngredient(). AddTile(). + AddDecraftCondition(Condition.DownedGolem). Register(); CreateRecipe(). AddIngredient(4). diff --git a/Items/Placeables/Navystone.cs b/Items/Placeables/Navystone.cs index 16f1377d7f..154971ba93 100644 --- a/Items/Placeables/Navystone.cs +++ b/Items/Placeables/Navystone.cs @@ -35,11 +35,6 @@ namespace CalamityMod.Items.Placeables AddTile(TileID.WorkBenches). Register(); - CreateRecipe(). - AddIngredient(4). - AddTile(TileID.WorkBenches). - Register(); - CreateRecipe(). AddIngredient(2). AddTile(). diff --git a/Items/Placeables/Walls/EutrophicSandWall.cs b/Items/Placeables/Walls/EutrophicSandWall.cs index 315934659c..02e418d447 100644 --- a/Items/Placeables/Walls/EutrophicSandWall.cs +++ b/Items/Placeables/Walls/EutrophicSandWall.cs @@ -10,6 +10,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void SetStaticDefaults() { Item.ResearchUnlockCount = 400; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() @@ -25,10 +26,5 @@ namespace CalamityMod.Items.Placeables.Walls Item.consumable = true; Item.createWall = ModContent.WallType(); } - - public override void AddRecipes() - { - CreateRecipe(4).AddIngredient(ModContent.ItemType()).AddTile(TileID.WorkBenches).Register(); - } } } diff --git a/Items/Placeables/Walls/EutrophicSandWallSafe.cs b/Items/Placeables/Walls/EutrophicSandWallSafe.cs index 3f399439aa..083cb750e7 100644 --- a/Items/Placeables/Walls/EutrophicSandWallSafe.cs +++ b/Items/Placeables/Walls/EutrophicSandWallSafe.cs @@ -10,6 +10,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void SetStaticDefaults() { Item.ResearchUnlockCount = 400; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Placeables/Walls/NavystoneWall.cs b/Items/Placeables/Walls/NavystoneWall.cs index 4e33e4c5ea..855ca72460 100644 --- a/Items/Placeables/Walls/NavystoneWall.cs +++ b/Items/Placeables/Walls/NavystoneWall.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void SetStaticDefaults() { Item.ResearchUnlockCount = 400; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() @@ -24,10 +25,5 @@ namespace CalamityMod.Items.Placeables.Walls Item.consumable = true; Item.createWall = ModContent.WallType(); } - - public override void AddRecipes() - { - CreateRecipe(4).AddIngredient(ModContent.ItemType()).AddTile(TileID.WorkBenches).Register(); - } } } diff --git a/Items/Placeables/Walls/NavystoneWallSafe.cs b/Items/Placeables/Walls/NavystoneWallSafe.cs index 2ab3e44900..71cb6b2195 100644 --- a/Items/Placeables/Walls/NavystoneWallSafe.cs +++ b/Items/Placeables/Walls/NavystoneWallSafe.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void SetStaticDefaults() { Item.ResearchUnlockCount = 400; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Potions/PhotosynthesisPotion.cs b/Items/Potions/PhotosynthesisPotion.cs index 4a9941f9b7..dbd2b5d766 100644 --- a/Items/Potions/PhotosynthesisPotion.cs +++ b/Items/Potions/PhotosynthesisPotion.cs @@ -39,6 +39,7 @@ namespace CalamityMod.Items.Potions AddIngredient(). AddTile(TileID.AlchemyTable). AddConsumeItemCallback(Recipe.ConsumptionRules.Alchemy). + AddDecraftCondition(Condition.Hardmode). Register(); CreateRecipe(). diff --git a/Items/TreasureBags/AstrumDeusBag.cs b/Items/TreasureBags/AstrumDeusBag.cs index 667f6e64f9..9c88f5712e 100644 --- a/Items/TreasureBags/AstrumDeusBag.cs +++ b/Items/TreasureBags/AstrumDeusBag.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Items.TreasureBags ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType() })); diff --git a/Items/TreasureBags/PerforatorBag.cs b/Items/TreasureBags/PerforatorBag.cs index d7441cbec8..e227cb4e02 100644 --- a/Items/TreasureBags/PerforatorBag.cs +++ b/Items/TreasureBags/PerforatorBag.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Items.TreasureBags ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), + ModContent.ItemType(), new WeightedItemStack(ModContent.ItemType(), 1f, 50, 75), })); diff --git a/Items/VanillaArmorChanges/PlatinumArmorSetChange.cs b/Items/VanillaArmorChanges/PlatinumArmorSetChange.cs index 9f7cd286e1..bdfc2e50d1 100644 --- a/Items/VanillaArmorChanges/PlatinumArmorSetChange.cs +++ b/Items/VanillaArmorChanges/PlatinumArmorSetChange.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.VanillaArmorChanges public const float ChestCrit = 5f; public const float LegsMoveSpeed = 0.1f; public const float SetBonusLifeRegenPerDefense = 0.1f; // 10 defense = +1 life regen - public const float SetBonusDamagePerDefense = 0.1f; // 10 defense = +1% damage + public const float SetBonusDamagePerDefense = 0.001f; // 10 defense = +1% damage public const float SetBonusCritPerDefense = 0.1f; // 10 defense = +1% crit chance public const int SetBonusDefenseCap = 40; diff --git a/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs b/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs index f575b6ff3e..89fe934f19 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs @@ -26,12 +26,12 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.width = 22; Item.height = 28; - Item.damage = 1000; + Item.damage = 900; Item.noMelee = true; Item.noUseGraphic = true; Item.consumable = false; Item.useStyle = ItemUseStyleID.Swing; - Item.useAnimation = Item.useTime = 27; + Item.useAnimation = Item.useTime = 30; Item.knockBack = 3f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal modItem.ChargePerUse = 0.25f; } - public override float StealthDamageMultiplier => 1.2f; + public override float StealthDamageMultiplier => 0.9f; public override float StealthVelocityMultiplier => 1.2f; public override float StealthKnockbackMultiplier => 1.5f; diff --git a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs index 332f2a1250..d772febbae 100644 --- a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs +++ b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public class TeslaCannon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; - private int BaseDamage = 1360; + private int BaseDamage = 1220; public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/TeslaCannonFire"); @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.useTime = 90; Item.useAnimation = 90; Item.autoReuse = true; - Item.mana = 30; + Item.mana = 60; Item.useStyle = ItemUseStyleID.Shoot; Item.UseSound = FireSound; diff --git a/Items/Weapons/Magic/AetherfluxCannon.cs b/Items/Weapons/Magic/AetherfluxCannon.cs index 9468601e3f..9e7e57759f 100644 --- a/Items/Weapons/Magic/AetherfluxCannon.cs +++ b/Items/Weapons/Magic/AetherfluxCannon.cs @@ -18,9 +18,9 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - Item.damage = 247; + Item.damage = 285; Item.DamageType = DamageClass.Magic; - Item.mana = 8; + Item.mana = 7; Item.width = 94; Item.height = 54; Item.useTime = Item.useAnimation = UseTime; diff --git a/Items/Weapons/Magic/AlphaRay.cs b/Items/Weapons/Magic/AlphaRay.cs index f801c897f4..14350ef07e 100644 --- a/Items/Weapons/Magic/AlphaRay.cs +++ b/Items/Weapons/Magic/AlphaRay.cs @@ -21,9 +21,9 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - Item.damage = 130; + Item.damage = 160; Item.DamageType = DamageClass.Magic; - Item.mana = 5; + Item.mana = 8; Item.width = 84; Item.height = 74; Item.useTime = Item.useAnimation = 4; diff --git a/Items/Weapons/Magic/CarnageRay.cs b/Items/Weapons/Magic/CarnageRay.cs deleted file mode 100644 index 5715458b8d..0000000000 --- a/Items/Weapons/Magic/CarnageRay.cs +++ /dev/null @@ -1,50 +0,0 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Magic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Magic -{ - public class CarnageRay : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Weapons.Magic"; - public override void SetStaticDefaults() - { - Item.staff[Item.type] = true; - } - - public override void SetDefaults() - { - Item.damage = 24; - Item.DamageType = DamageClass.Magic; - Item.mana = 10; - Item.width = 44; - Item.height = 46; - Item.useTime = 20; - Item.useAnimation = 20; - Item.useStyle = ItemUseStyleID.Shoot; - Item.noMelee = true; - Item.knockBack = 3.25f; - Item.value = CalamityGlobalItem.Rarity4BuyPrice; - Item.rare = ItemRarityID.LightRed; - Item.UseSound = SoundID.Item72; - Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 6f; - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.CrimsonRod). - AddIngredient(ItemID.MagicMissile). - AddIngredient(ItemID.WandofSparking). - AddIngredient(ItemID.AmberStaff). - AddIngredient(10). - AddTile(TileID.DemonAltar). - Register(); - } - } -} diff --git a/Items/Weapons/Magic/DarkSpark.cs b/Items/Weapons/Magic/DarkSpark.cs index ba600904a5..1c43fb6ff3 100644 --- a/Items/Weapons/Magic/DarkSpark.cs +++ b/Items/Weapons/Magic/DarkSpark.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 4)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 4)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Weapons/Magic/Effervescence.cs b/Items/Weapons/Magic/Effervescence.cs index 869c451ca8..9ad52333c9 100644 --- a/Items/Weapons/Magic/Effervescence.cs +++ b/Items/Weapons/Magic/Effervescence.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() { - Item.damage = 64; + Item.damage = 60; Item.DamageType = DamageClass.Magic; - Item.mana = 17; + Item.mana = 20; Item.width = 56; Item.height = 26; Item.useTime = 15; diff --git a/Items/Weapons/Magic/EventHorizon.cs b/Items/Weapons/Magic/EventHorizon.cs index 7aa74a1c95..5bd44b9a8e 100644 --- a/Items/Weapons/Magic/EventHorizon.cs +++ b/Items/Weapons/Magic/EventHorizon.cs @@ -16,8 +16,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 40; Item.height = 46; - - Item.damage = 275; + Item.damage = 200; Item.knockBack = 3.5f; Item.noMelee = true; Item.DamageType = DamageClass.Magic; diff --git a/Items/Weapons/Magic/GrandStaffoftheNebulaMage.cs b/Items/Weapons/Magic/GrandStaffoftheNebulaMage.cs index b9fcf9a3cc..f0e3b2863c 100644 --- a/Items/Weapons/Magic/GrandStaffoftheNebulaMage.cs +++ b/Items/Weapons/Magic/GrandStaffoftheNebulaMage.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.damage = 510; Item.DamageType = DamageClass.Magic; - Item.mana = 30; + Item.mana = 60; Item.width = 120; Item.height = 124; Item.useTime = 30; diff --git a/Items/Weapons/Magic/HeliumFlash.cs b/Items/Weapons/Magic/HeliumFlash.cs index 6ae6e8ffc1..1e59d3a127 100644 --- a/Items/Weapons/Magic/HeliumFlash.cs +++ b/Items/Weapons/Magic/HeliumFlash.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.DamageType = DamageClass.Magic; Item.damage = 1800; Item.knockBack = 9.5f; - Item.mana = 26; + Item.mana = 40; Item.useAnimation = 40; Item.useTime = 40; Item.autoReuse = true; diff --git a/Items/Weapons/Magic/Heresy.cs b/Items/Weapons/Magic/Heresy.cs index 198faa78e5..af3dadaef4 100644 --- a/Items/Weapons/Magic/Heresy.cs +++ b/Items/Weapons/Magic/Heresy.cs @@ -18,9 +18,9 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - Item.damage = 990; + Item.damage = 960; Item.DamageType = DamageClass.Magic; - Item.mana = 10; + Item.mana = 15; Item.width = 38; Item.height = 40; Item.useTime = Item.useAnimation = 120; diff --git a/Items/Weapons/Magic/LightGodsBrilliance.cs b/Items/Weapons/Magic/LightGodsBrilliance.cs index 27155f73d8..94b7b99a31 100644 --- a/Items/Weapons/Magic/LightGodsBrilliance.cs +++ b/Items/Weapons/Magic/LightGodsBrilliance.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() { - Item.damage = 100; + Item.damage = 111; Item.DamageType = DamageClass.Magic; - Item.mana = 4; + Item.mana = 6; Item.width = 42; Item.height = 48; Item.useTime = Item.useAnimation = 4; diff --git a/Items/Weapons/Magic/MagnaCannon.cs b/Items/Weapons/Magic/MagnaCannon.cs deleted file mode 100644 index f5404ca9da..0000000000 --- a/Items/Weapons/Magic/MagnaCannon.cs +++ /dev/null @@ -1,54 +0,0 @@ -using CalamityMod.Projectiles.Magic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Magic -{ - public class MagnaCannon : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Weapons.Magic"; - public override void SetDefaults() - { - Item.damage = 26; - Item.DamageType = DamageClass.Magic; - Item.mana = 12; - Item.width = 56; - Item.height = 34; - Item.useTime = 32; - Item.useAnimation = 32; - Item.useStyle = ItemUseStyleID.Shoot; - Item.noMelee = true; - Item.knockBack = 3.5f; - Item.value = CalamityGlobalItem.Rarity2BuyPrice; - Item.rare = ItemRarityID.Green; - Item.UseSound = SoundID.Item117; - Item.autoReuse = true; - Item.shootSpeed = 12f; - Item.shoot = ModContent.ProjectileType(); - } - - 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) - { - for (int index = 0; index < 3; ++index) - { - Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 0f); - } - return false; - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.Granite, 25). - AddIngredient(ItemID.Obsidian, 15). - AddIngredient(ItemID.Amber, 5). - AddTile(TileID.Anvils). - Register(); - } - } -} diff --git a/Items/Weapons/Magic/NanoPurge.cs b/Items/Weapons/Magic/NanoPurge.cs index 86223d8a75..b1c5540417 100644 --- a/Items/Weapons/Magic/NanoPurge.cs +++ b/Items/Weapons/Magic/NanoPurge.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - Item.damage = 73; + Item.damage = 60; Item.DamageType = DamageClass.Magic; - Item.mana = 6; + Item.mana = 8; Item.width = 62; Item.height = 34; Item.useTime = Item.useAnimation = UseTime; diff --git a/Items/Weapons/Magic/PhantasmalFury.cs b/Items/Weapons/Magic/PhantasmalFury.cs index 6910551bfb..5a582e413c 100644 --- a/Items/Weapons/Magic/PhantasmalFury.cs +++ b/Items/Weapons/Magic/PhantasmalFury.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - Item.damage = 220; + Item.damage = 260; Item.DamageType = DamageClass.Magic; Item.mana = 20; Item.width = 62; diff --git a/Items/Weapons/Magic/PhoenixFlameBarrage.cs b/Items/Weapons/Magic/PhoenixFlameBarrage.cs index 7426f21de6..130180ddb8 100644 --- a/Items/Weapons/Magic/PhoenixFlameBarrage.cs +++ b/Items/Weapons/Magic/PhoenixFlameBarrage.cs @@ -19,9 +19,9 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - Item.damage = 150; + Item.damage = 140; Item.DamageType = DamageClass.Magic; - Item.mana = 20; + Item.mana = 35; Item.width = 106; Item.height = 140; Item.useTime = 15; diff --git a/Items/Weapons/Magic/PrimordialAncient.cs b/Items/Weapons/Magic/PrimordialAncient.cs index bc01942a6b..8315ab6b84 100644 --- a/Items/Weapons/Magic/PrimordialAncient.cs +++ b/Items/Weapons/Magic/PrimordialAncient.cs @@ -12,9 +12,9 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() { - Item.damage = 170; + Item.damage = 145; Item.DamageType = DamageClass.Magic; - Item.mana = 20; + Item.mana = 16; Item.width = 40; Item.height = 56; Item.useTime = 18; diff --git a/Items/Weapons/Magic/PrimordialEarth.cs b/Items/Weapons/Magic/PrimordialEarth.cs index 7b5ef6d978..d8bdc4063b 100644 --- a/Items/Weapons/Magic/PrimordialEarth.cs +++ b/Items/Weapons/Magic/PrimordialEarth.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() { - Item.damage = 60; + Item.damage = 46; Item.DamageType = DamageClass.Magic; Item.mana = 19; Item.width = 36; diff --git a/Items/Weapons/Magic/Rancor.cs b/Items/Weapons/Magic/Rancor.cs index 6efd18cacd..de80fd6cb6 100644 --- a/Items/Weapons/Magic/Rancor.cs +++ b/Items/Weapons/Magic/Rancor.cs @@ -13,11 +13,11 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() { - Item.damage = 250; + Item.damage = 220; Item.DamageType = DamageClass.Magic; Item.noUseGraphic = true; Item.channel = true; - Item.mana = 10; + Item.mana = 20; Item.width = 66; Item.height = 82; Item.useTime = 25; diff --git a/Items/Weapons/Magic/RecitationoftheBeast.cs b/Items/Weapons/Magic/RecitationoftheBeast.cs index 27fc577b06..35bf41c739 100644 --- a/Items/Weapons/Magic/RecitationoftheBeast.cs +++ b/Items/Weapons/Magic/RecitationoftheBeast.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() { - Item.mana = 24; + Item.mana = 17; Item.width = 38; Item.height = 54; Item.damage = 128; diff --git a/Items/Weapons/Magic/ShiftingSands.cs b/Items/Weapons/Magic/ShiftingSands.cs index d011e82b34..772baabb79 100644 --- a/Items/Weapons/Magic/ShiftingSands.cs +++ b/Items/Weapons/Magic/ShiftingSands.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() { - Item.damage = 92; + Item.damage = 76; Item.knockBack = 5f; Item.useTime = Item.useAnimation = 30; Item.mana = 20; diff --git a/Items/Weapons/Magic/SoulPiercer.cs b/Items/Weapons/Magic/SoulPiercer.cs index 8f137f0399..c0a66eb210 100644 --- a/Items/Weapons/Magic/SoulPiercer.cs +++ b/Items/Weapons/Magic/SoulPiercer.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - Item.damage = 270; + Item.damage = 310; Item.DamageType = DamageClass.Magic; Item.mana = 19; Item.width = 64; diff --git a/Items/Weapons/Magic/SubsumingVortex.cs b/Items/Weapons/Magic/SubsumingVortex.cs index e8f91b17a0..61cc7f2d32 100644 --- a/Items/Weapons/Magic/SubsumingVortex.cs +++ b/Items/Weapons/Magic/SubsumingVortex.cs @@ -45,11 +45,11 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - Item.damage = 483; + Item.damage = 466; Item.DamageType = DamageClass.Magic; Item.useTime = Item.useAnimation = 20; Item.shootSpeed = 7f; - Item.mana = 12; + Item.mana = 25; Item.knockBack = 5f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Magic/TearsofHeaven.cs b/Items/Weapons/Magic/TearsofHeaven.cs index ca5fabfbbd..176c36a0b0 100644 --- a/Items/Weapons/Magic/TearsofHeaven.cs +++ b/Items/Weapons/Magic/TearsofHeaven.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() { - Item.damage = 54; + Item.damage = 45; Item.DamageType = DamageClass.Magic; Item.mana = 18; Item.width = 38; diff --git a/Items/Weapons/Magic/TerraRay.cs b/Items/Weapons/Magic/TerraRay.cs index 3101d05973..0250a56571 100644 --- a/Items/Weapons/Magic/TerraRay.cs +++ b/Items/Weapons/Magic/TerraRay.cs @@ -52,12 +52,6 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(12). AddTile(TileID.MythrilAnvil). Register(); - CreateRecipe(). - AddIngredient(). - AddIngredient(). - AddIngredient(12). - AddTile(TileID.MythrilAnvil). - Register(); } } } diff --git a/Items/Weapons/Magic/TheSwarmer.cs b/Items/Weapons/Magic/TheSwarmer.cs index 48a24da63b..26ae6be1e2 100644 --- a/Items/Weapons/Magic/TheSwarmer.cs +++ b/Items/Weapons/Magic/TheSwarmer.cs @@ -11,13 +11,13 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() { - Item.damage = 40; + Item.damage = 36; Item.DamageType = DamageClass.Magic; - Item.mana = 7; + Item.mana = 14; Item.width = 60; Item.height = 52; - Item.useTime = 8; - Item.useAnimation = 8; + Item.useTime = 12; + Item.useAnimation = 12; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.value = CalamityGlobalItem.Rarity10BuyPrice; diff --git a/Items/Weapons/Magic/VividClarity.cs b/Items/Weapons/Magic/VividClarity.cs index d6f9240147..aa4956a485 100644 --- a/Items/Weapons/Magic/VividClarity.cs +++ b/Items/Weapons/Magic/VividClarity.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - Item.damage = 155; + Item.damage = 133; Item.DamageType = DamageClass.Magic; Item.mana = 42; Item.width = 90; diff --git a/Items/Weapons/Magic/VoltaicClimax.cs b/Items/Weapons/Magic/VoltaicClimax.cs index a5fe250d7e..69fc4223af 100644 --- a/Items/Weapons/Magic/VoltaicClimax.cs +++ b/Items/Weapons/Magic/VoltaicClimax.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - Item.damage = 100; + Item.damage = 123; Item.DamageType = DamageClass.Magic; Item.mana = 30; Item.width = 78; diff --git a/Items/Weapons/Melee/ArkoftheCosmos.cs b/Items/Weapons/Melee/ArkoftheCosmos.cs index 5a37045429..91875cf480 100644 --- a/Items/Weapons/Melee/ArkoftheCosmos.cs +++ b/Items/Weapons/Melee/ArkoftheCosmos.cs @@ -199,13 +199,15 @@ namespace CalamityMod.Items.Weapons.Melee var barFG = Request("CalamityMod/UI/MiscTextures/GenericBarFront").Value; float barScale = 3f; - - Vector2 drawPos = position + Vector2.UnitY * (frame.Height - 8) * scale + Vector2.UnitX * (frame.Width - barBG.Width * barScale) * scale * 0.5f; + Vector2 barOrigin = barBG.Size() * 0.5f; + float xOffset = frame.Width * 0.25f - barBG.Width * 0.5f; + float yOffset = frame.Height * 0.7f - barBG.Height; + Vector2 drawPos = position + Vector2.UnitX * scale * xOffset + Vector2.UnitY * scale * yOffset; Rectangle frameCrop = new Rectangle(0, 0, (int)(Charge / 10f * barFG.Width), barFG.Height); Color color = Main.hslToRgb((Main.GlobalTimeWrappedHourly * 0.6f) % 1, 1, 0.75f + (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3f) * 0.1f); - spriteBatch.Draw(barBG, drawPos, null, color, 0f, origin, scale * barScale, 0f, 0f); - spriteBatch.Draw(barFG, drawPos, frameCrop, color * 0.8f, 0f, origin, scale * barScale, 0f, 0f); + spriteBatch.Draw(barBG, drawPos, null, color, 0f, barOrigin, scale * barScale, 0f, 0f); + spriteBatch.Draw(barFG, drawPos, frameCrop, color * 0.8f, 0f, barOrigin, scale * barScale, 0f, 0f); } public override void AddRecipes() diff --git a/Items/Weapons/Melee/ArkoftheElements.cs b/Items/Weapons/Melee/ArkoftheElements.cs index 8c24fa7418..a763b8c8bf 100644 --- a/Items/Weapons/Melee/ArkoftheElements.cs +++ b/Items/Weapons/Melee/ArkoftheElements.cs @@ -215,13 +215,15 @@ namespace CalamityMod.Items.Weapons.Melee var barFG = Request("CalamityMod/UI/MiscTextures/GenericBarFront").Value; float barScale = 3.5f; - - Vector2 drawPos = position + Vector2.UnitY * (frame.Height - 10) * scale + Vector2.UnitX * (frame.Width - barBG.Width * barScale) * scale * 0.5f; + Vector2 barOrigin = barBG.Size() * 0.5f; + float xOffset = frame.Width * 0.25f - barBG.Width * 0.5f; + float yOffset = frame.Height * 0.7f - barBG.Height; + Vector2 drawPos = position + Vector2.UnitX * scale * xOffset + Vector2.UnitY * scale * yOffset; Rectangle frameCrop = new Rectangle(0, 0, (int)(Charge / 10f * barFG.Width), barFG.Height); Color color = Main.hslToRgb(((float)Math.Sin(Main.GlobalTimeWrappedHourly * 0.6f) * 0.5f + 0.5f) * 0.15f, 1, 0.85f + (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3f) * 0.1f); - spriteBatch.Draw(barBG, drawPos, null, color, 0f, origin, scale * barScale, 0f, 0f); - spriteBatch.Draw(barFG, drawPos, frameCrop, color * 0.8f, 0f, origin, scale * barScale, 0f, 0f); + spriteBatch.Draw(barBG, drawPos, null, color, 0f, barOrigin, scale * barScale, 0f, 0f); + spriteBatch.Draw(barFG, drawPos, frameCrop, color * 0.8f, 0f, barOrigin, scale * barScale, 0f, 0f); } public override void AddRecipes() diff --git a/Items/Weapons/Melee/CosmicShiv.cs b/Items/Weapons/Melee/CosmicShiv.cs index af799c26d7..3bc4eaa726 100644 --- a/Items/Weapons/Melee/CosmicShiv.cs +++ b/Items/Weapons/Melee/CosmicShiv.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.useTime = 18; Item.width = 44; Item.height = 44; - Item.damage = 218; + Item.damage = 109; Item.knockBack = 9f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Weapons/Melee/Devastation.cs b/Items/Weapons/Melee/Devastation.cs index bc46f0b8f6..f835a9b20a 100644 --- a/Items/Weapons/Melee/Devastation.cs +++ b/Items/Weapons/Melee/Devastation.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 11)); - ItemID.Sets.AnimatesAsSoul[Type] = true; + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 11)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/EmpyreanKnives.cs b/Items/Weapons/Melee/EmpyreanKnives.cs index 61af6ce656..76fa47e506 100644 --- a/Items/Weapons/Melee/EmpyreanKnives.cs +++ b/Items/Weapons/Melee/EmpyreanKnives.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.width = 18; - Item.damage = 207; + Item.damage = 230; Item.DamageType = DamageClass.MeleeNoSpeed; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/Exoblade.cs b/Items/Weapons/Melee/Exoblade.cs index 01cc6b6f82..0576af4659 100644 --- a/Items/Weapons/Melee/Exoblade.cs +++ b/Items/Weapons/Melee/Exoblade.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 138; Item.height = 184; - Item.damage = 825; + Item.damage = 915; Item.useStyle = ItemUseStyleID.Swing; Item.useTime = BaseUseTime; Item.useAnimation = BaseUseTime; diff --git a/Items/Weapons/Melee/FracturedArk.cs b/Items/Weapons/Melee/FracturedArk.cs index 4b5ffb090f..d3944f779a 100644 --- a/Items/Weapons/Melee/FracturedArk.cs +++ b/Items/Weapons/Melee/FracturedArk.cs @@ -126,12 +126,15 @@ namespace CalamityMod.Items.Weapons.Melee var barBG = Request("CalamityMod/UI/MiscTextures/GenericBarBack").Value; var barFG = Request("CalamityMod/UI/MiscTextures/GenericBarFront").Value; - Vector2 drawPos = position + Vector2.UnitY * (frame.Height - 2) * scale + Vector2.UnitX * (frame.Width - barBG.Width * barScale) * scale * 0.5f; + Vector2 barOrigin = barBG.Size() * 0.5f; + float xOffset = frame.Width * 0.25f - barBG.Width * 0.5f; + float yOffset = frame.Height * 0.8f - barBG.Height; + Vector2 drawPos = position + Vector2.UnitX * scale * xOffset + Vector2.UnitY * scale * yOffset; Rectangle frameCrop = new Rectangle(0, 0, (int)(Charge / 10f * barFG.Width), barFG.Height); Color color = Main.hslToRgb((Main.GlobalTimeWrappedHourly * 0.6f) % 1, 1, 0.85f + (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3f) * 0.1f); - spriteBatch.Draw(barBG, drawPos, null, color , 0f, origin, scale * barScale, 0f, 0f); - spriteBatch.Draw(barFG, drawPos, frameCrop, color * 0.8f, 0f, origin, scale * barScale, 0f, 0f); + spriteBatch.Draw(barBG, drawPos, null, color , 0f, barOrigin, scale * barScale, 0f, 0f); + spriteBatch.Draw(barFG, drawPos, frameCrop, color * 0.8f, 0f, barOrigin, scale * barScale, 0f, 0f); } public override void AddRecipes() diff --git a/Items/Weapons/Melee/GaelsGreatsword.cs b/Items/Weapons/Melee/GaelsGreatsword.cs index dbf24f1ac4..f67c782dab 100644 --- a/Items/Weapons/Melee/GaelsGreatsword.cs +++ b/Items/Weapons/Melee/GaelsGreatsword.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee { public new string LocalizationCategory => "Items.Weapons.Melee"; // Weapon attribute constants - public static readonly int BaseDamage = 650; + public static readonly int BaseDamage = 670; public static readonly float GiantSkullDamageMultiplier = 1.5f; // Weapon projectile attribute constants @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.height = 102; Item.damage = BaseDamage; Item.DamageType = DamageClass.Melee; - Item.useAnimation = Item.useTime = 12; + Item.useAnimation = Item.useTime = 13; Item.useTurn = true; Item.knockBack = 9; Item.UseSound = SoundID.Item1; @@ -126,8 +126,8 @@ namespace CalamityMod.Items.Weapons.Melee break; //Giant, slow, fading skull case 1: - int largeSkullDmg = (int)(damage * 1.5f); - int projectileIndex = Projectile.NewProjectile(source, position, velocity * 0.5f, type, largeSkullDmg, knockback, player.whoAmI, ai1:1f); + int largeSkullDmg = (int)(damage * GiantSkullDamageMultiplier); + int projectileIndex = Projectile.NewProjectile(source, position, velocity * 0.6f, type, largeSkullDmg, knockback, player.whoAmI, ai1:1f); Main.projectile[projectileIndex].scale = 1.75f; break; } diff --git a/Items/Weapons/Melee/GalileoGladius.cs b/Items/Weapons/Melee/GalileoGladius.cs index d0cd2f03f0..4671c584be 100644 --- a/Items/Weapons/Melee/GalileoGladius.cs +++ b/Items/Weapons/Melee/GalileoGladius.cs @@ -16,11 +16,11 @@ namespace CalamityMod.Items.Weapons.Melee { Item.useStyle = ItemUseStyleID.Rapier; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 8; - Item.useTime = 8; + Item.useAnimation = 10; + Item.useTime = 10; Item.width = 44; Item.height = 44; - Item.damage = 110; + Item.damage = 92; Item.knockBack = 10f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Weapons/Melee/Murasama.cs b/Items/Weapons/Melee/Murasama.cs index 311509c8ef..7a409e5a71 100644 --- a/Items/Weapons/Melee/Murasama.cs +++ b/Items/Weapons/Melee/Murasama.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 13)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 13)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Weapons/Melee/Nebulash.cs b/Items/Weapons/Melee/Nebulash.cs index af58c393d6..f677385279 100644 --- a/Items/Weapons/Melee/Nebulash.cs +++ b/Items/Weapons/Melee/Nebulash.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 16; Item.height = 16; - Item.damage = 78; + Item.damage = 60; Item.rare = ItemRarityID.Lime; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/SpineOfThanatos.cs b/Items/Weapons/Melee/SpineOfThanatos.cs index fae99a01c2..57bdf30542 100644 --- a/Items/Weapons/Melee/SpineOfThanatos.cs +++ b/Items/Weapons/Melee/SpineOfThanatos.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.width = Item.height = 28; - Item.damage = 150; + Item.damage = 128; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.rare = ModContent.RarityType(); Item.noMelee = true; diff --git a/Items/Weapons/Melee/TheBurningSky.cs b/Items/Weapons/Melee/TheBurningSky.cs index 905f0037e4..8f059f59a4 100644 --- a/Items/Weapons/Melee/TheBurningSky.cs +++ b/Items/Weapons/Melee/TheBurningSky.cs @@ -26,14 +26,14 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 102; Item.height = 146; - Item.damage = 134; + Item.damage = 147; Item.knockBack = 2.5f; Item.DamageType = DamageClass.Melee; Item.noMelee = true; - Item.useTime = 9; - Item.useAnimation = 9; + Item.useTime = 8; + Item.useAnimation = 8; Item.useStyle = ItemUseStyleID.Shoot; Item.autoReuse = true; Item.UseSound = SoundID.Item105; diff --git a/Items/Weapons/Melee/TrueArkoftheAncients.cs b/Items/Weapons/Melee/TrueArkoftheAncients.cs index 8c27ed48dc..21d38eb4e7 100644 --- a/Items/Weapons/Melee/TrueArkoftheAncients.cs +++ b/Items/Weapons/Melee/TrueArkoftheAncients.cs @@ -156,13 +156,15 @@ namespace CalamityMod.Items.Weapons.Melee var barFG = Request("CalamityMod/UI/MiscTextures/GenericBarFront").Value; float barScale = 1.5f; - - Vector2 drawPos = position + Vector2.UnitY * ( frame.Height - 2f ) * scale + Vector2.UnitX * (frame.Width - barBG.Width * barScale) * scale * 0.5f; + Vector2 barOrigin = barBG.Size() * 0.5f; + float xOffset = frame.Width * 0.25f - barBG.Width * 0.5f; + float yOffset = frame.Height * 0.8f - barBG.Height; + Vector2 drawPos = position + Vector2.UnitX * scale * xOffset + Vector2.UnitY * scale * yOffset; Rectangle frameCrop = new Rectangle(0, 0, (int)(Charge / 10f * barFG.Width), barFG.Height); Color color = Main.hslToRgb((Main.GlobalTimeWrappedHourly * 0.6f) % 1, 1, 0.85f + (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3f) * 0.1f); - spriteBatch.Draw(barBG, drawPos, null, color, 0f, origin, scale * barScale, 0f, 0f); - spriteBatch.Draw(barFG, drawPos, frameCrop, color * 0.8f, 0f, origin, scale * barScale, 0f, 0f); + spriteBatch.Draw(barBG, drawPos, null, color, 0f, barOrigin, scale * barScale, 0f, 0f); + spriteBatch.Draw(barFG, drawPos, frameCrop, color * 0.8f, 0f, barOrigin, scale * barScale, 0f, 0f); } public override void AddRecipes() diff --git a/Items/Weapons/Melee/UrchinFlail.cs b/Items/Weapons/Melee/UrchinFlail.cs index a48cf899bd..8cedafc9d1 100644 --- a/Items/Weapons/Melee/UrchinFlail.cs +++ b/Items/Weapons/Melee/UrchinFlail.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetDefaults() { - Item.damage = 33; + Item.damage = 20; Item.DamageType = DamageClass.MeleeNoSpeed; Item.width = 44; Item.height = 36; @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.autoReuse = true; Item.channel = true; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 12f; + Item.shootSpeed = 16f; } } } diff --git a/Items/Weapons/Ranged/ArcNovaDiffuser.cs b/Items/Weapons/Ranged/ArcNovaDiffuser.cs new file mode 100644 index 0000000000..8691f737f8 --- /dev/null +++ b/Items/Weapons/Ranged/ArcNovaDiffuser.cs @@ -0,0 +1,75 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Ranged +{ + [LegacyName("MagnaStriker")] + public class ArcNovaDiffuser : ModItem, ILocalizedModType + { + public static readonly SoundStyle ChargeLV1 = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeLV1") { Volume = 0.6f }; + public static readonly SoundStyle ChargeLV2 = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeLV2") { Volume = 0.6f }; + public static readonly SoundStyle ChargeStart = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeStart") { Volume = 0.6f }; + public static readonly SoundStyle ChargeLoop = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeLoop") { Volume = 0.6f }; + internal static readonly int ChargeLoopSoundFrames = 151; + public static readonly SoundStyle SmallShot = new("CalamityMod/Sounds/Item/ArcNovaDiffuserSmallShot") { PitchVariance = 0.3f, Volume = 0.5f }; + public static readonly SoundStyle BigShot = new("CalamityMod/Sounds/Item/ArcNovaDiffuserBigShot") { PitchVariance = 0.3f, Volume = 0.8f }; + + public static int AftershotCooldownFrames = 9; + public static int Charge1Frames = 156; + public static int Charge2Frames = 308; + + public new string LocalizationCategory => "Items.Weapons.Ranged"; + public override void SetDefaults() + { + Item.damage = 138; + Item.DamageType = DamageClass.Ranged; + Item.width = 72; + Item.height = 38; + Item.useTime = Item.useAnimation = AftershotCooldownFrames; + Item.noMelee = true; + Item.channel = true; + Item.useStyle = ItemUseStyleID.Shoot; + Item.knockBack = 4f; + Item.value = CalamityGlobalItem.Rarity8BuyPrice; + Item.rare = ItemRarityID.Yellow; + Item.UseSound = null; + Item.autoReuse = false; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 12f; + Item.Calamity().canFirePointBlankShots = true; + } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-5, 0); + } + public override void HoldItem(Player player) + { + Item.noUseGraphic = true; + } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + Vector2 shootVelocity = velocity; + Vector2 shootDirection = shootVelocity.SafeNormalize(Vector2.UnitX * player.direction); + Projectile.NewProjectile(source, position, shootDirection, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + return false; + } + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(). + AddIngredient(). + AddIngredient(3). + AddIngredient(ItemID.MartianConduitPlating, 15). + AddTile(TileID.MythrilAnvil). + Register(); + } + } +} diff --git a/Items/Weapons/Ranged/ArcNovaDiffuser.png b/Items/Weapons/Ranged/ArcNovaDiffuser.png new file mode 100644 index 0000000000..e761b7033e Binary files /dev/null and b/Items/Weapons/Ranged/ArcNovaDiffuser.png differ diff --git a/Items/Weapons/Ranged/ArterialAssault.cs b/Items/Weapons/Ranged/ArterialAssault.cs index 9bd1950f75..b20e90be72 100644 --- a/Items/Weapons/Ranged/ArterialAssault.cs +++ b/Items/Weapons/Ranged/ArterialAssault.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Projectiles; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using System; @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 128; + Item.damage = 110; Item.DamageType = DamageClass.Ranged; Item.width = 44; Item.height = 100; @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.rare = ModContent.RarityType(); Item.UseSound = SoundID.Item102; Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ProjectileID.WoodenArrowFriendly; Item.shootSpeed = 30f; Item.useAmmo = AmmoID.Arrow; } @@ -76,16 +76,12 @@ namespace CalamityMod.Items.Weapons.Ranged num79 *= num80; float speedX4 = num78; float speedY5 = num79; - if (CalamityUtils.CheckWoodenAmmo(type, player)) - { - int bloodfire = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 80f); - Main.projectile[bloodfire].tileCollide = false; - } - else - { - int num121 = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockback, player.whoAmI); - Main.projectile[num121].noDropItem = true; - } + int shotArrow = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockback, player.whoAmI); + Main.projectile[shotArrow].noDropItem = true; + Main.projectile[shotArrow].tileCollide = false; + Main.projectile[shotArrow].timeLeft = (int)(Main.projectile[shotArrow].timeLeft * Main.projectile[shotArrow].MaxUpdates * 0.55f); + CalamityGlobalProjectile cgp = Main.projectile[shotArrow].Calamity(); + cgp.allProjectilesHome = true; return false; } diff --git a/Items/Weapons/Ranged/AstralRepeater.cs b/Items/Weapons/Ranged/AstralRepeater.cs index 5047220b67..01e32a4f66 100644 --- a/Items/Weapons/Ranged/AstralRepeater.cs +++ b/Items/Weapons/Ranged/AstralRepeater.cs @@ -10,13 +10,13 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 99; + Item.damage = 92; Item.DamageType = DamageClass.Ranged; Item.width = 38; Item.height = 78; - Item.useTime = 5; - Item.useAnimation = 15; - Item.reuseDelay = 15; + Item.useTime = 6; + Item.useAnimation = 18; + Item.reuseDelay = 18; Item.useLimitPerAnimation = 3; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; diff --git a/Items/Weapons/Ranged/BarracudaGun.cs b/Items/Weapons/Ranged/BarracudaGun.cs index 2a96c992ce..48deaa932e 100644 --- a/Items/Weapons/Ranged/BarracudaGun.cs +++ b/Items/Weapons/Ranged/BarracudaGun.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 63; + Item.damage = 56; Item.channel = true; Item.DamageType = DamageClass.Ranged; Item.width = 54; diff --git a/Items/Weapons/Ranged/BladedgeGreatbow.cs b/Items/Weapons/Ranged/BladedgeGreatbow.cs index 655119760d..00d8ab463a 100644 --- a/Items/Weapons/Ranged/BladedgeGreatbow.cs +++ b/Items/Weapons/Ranged/BladedgeGreatbow.cs @@ -12,12 +12,12 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 35; + Item.damage = 30; Item.DamageType = DamageClass.Ranged; Item.width = 74; Item.height = 24; - Item.useTime = 26; - Item.useAnimation = 26; + Item.useTime = 29; + Item.useAnimation = 29; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 3.5f; diff --git a/Items/Weapons/Ranged/BlossomFlux.cs b/Items/Weapons/Ranged/BlossomFlux.cs index 5ce6e69dcb..ff46680d95 100644 --- a/Items/Weapons/Ranged/BlossomFlux.cs +++ b/Items/Weapons/Ranged/BlossomFlux.cs @@ -52,8 +52,8 @@ namespace CalamityMod.Items.Weapons.Ranged } else { - Item.useTime = 2; - Item.useAnimation = 16; + Item.useTime = 3; + Item.useAnimation = 15; Item.UseSound = SoundID.Item5; } return base.CanUseItem(player); @@ -63,7 +63,7 @@ namespace CalamityMod.Items.Weapons.Ranged { if (player.altFunctionUse == 2) { - Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), (int)(damage * 4D), knockback * 60f, player.whoAmI); + Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), (int)(damage * 3.15f), knockback * 60f, player.whoAmI); } else { diff --git a/Items/Weapons/Ranged/Condemnation.cs b/Items/Weapons/Ranged/Condemnation.cs index df1f5868c7..b3e2829a8d 100644 --- a/Items/Weapons/Ranged/Condemnation.cs +++ b/Items/Weapons/Ranged/Condemnation.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 2400; + Item.damage = 2130; Item.DamageType = DamageClass.Ranged; Item.width = 130; Item.height = 42; diff --git a/Items/Weapons/Ranged/ContinentalGreatbow.cs b/Items/Weapons/Ranged/ContinentalGreatbow.cs index e60265df42..ffeb621ef6 100644 --- a/Items/Weapons/Ranged/ContinentalGreatbow.cs +++ b/Items/Weapons/Ranged/ContinentalGreatbow.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Items.Weapons.Ranged Item.DamageType = DamageClass.Ranged; Item.width = 18; Item.height = 36; - Item.useTime = 20; - Item.useAnimation = 20; + Item.useTime = 24; + Item.useAnimation = 24; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 4f; @@ -62,7 +62,6 @@ namespace CalamityMod.Items.Weapons.Ranged float SpeedY = velocity.Y + (float)Main.rand.Next(-10, 11) * 0.05f; type = Utils.SelectRandom(Main.rand, new int[] { - ProjectileID.CursedArrow, ProjectileID.HellfireArrow, ProjectileID.IchorArrow }); diff --git a/Items/Weapons/Ranged/DaemonsFlame.cs b/Items/Weapons/Ranged/DaemonsFlame.cs index 908cf8e33e..854416737d 100644 --- a/Items/Weapons/Ranged/DaemonsFlame.cs +++ b/Items/Weapons/Ranged/DaemonsFlame.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 135; + Item.damage = 150; Item.width = 62; Item.height = 128; Item.useTime = 12; diff --git a/Items/Weapons/Ranged/GodsBellows.cs b/Items/Weapons/Ranged/DeadSunsWind.cs similarity index 93% rename from Items/Weapons/Ranged/GodsBellows.cs rename to Items/Weapons/Ranged/DeadSunsWind.cs index 97962bbb4c..b107626c62 100644 --- a/Items/Weapons/Ranged/GodsBellows.cs +++ b/Items/Weapons/Ranged/DeadSunsWind.cs @@ -7,8 +7,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged { - [LegacyName("TheEmpyrean")] - public class GodsBellows : ModItem, ILocalizedModType + [LegacyName("TheEmpyrean", "GodsBellows")] + public class DeadSunsWind : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() diff --git a/Items/Weapons/Ranged/GodsBellows.png b/Items/Weapons/Ranged/DeadSunsWind.png similarity index 100% rename from Items/Weapons/Ranged/GodsBellows.png rename to Items/Weapons/Ranged/DeadSunsWind.png diff --git a/Items/Weapons/Ranged/ElementalEruption.cs b/Items/Weapons/Ranged/ElementalEruption.cs index 8e955fe049..07b4755e46 100644 --- a/Items/Weapons/Ranged/ElementalEruption.cs +++ b/Items/Weapons/Ranged/ElementalEruption.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.Rarity11BuyPrice; Item.rare = ItemRarityID.Purple; Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; Item.useAmmo = AmmoID.Gel; } diff --git a/Items/Weapons/Ranged/EternalBlizzard.cs b/Items/Weapons/Ranged/EternalBlizzard.cs index 2d7b081f10..ed46aaf315 100644 --- a/Items/Weapons/Ranged/EternalBlizzard.cs +++ b/Items/Weapons/Ranged/EternalBlizzard.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged } public override void SetDefaults() { - Item.damage = 80; + Item.damage = 67; Item.DamageType = DamageClass.Ranged; Item.width = 72; Item.height = 36; diff --git a/Items/Weapons/Ranged/FlakToxicannon.cs b/Items/Weapons/Ranged/FlakToxicannon.cs index c7d8a65e26..d98eba6f8e 100644 --- a/Items/Weapons/Ranged/FlakToxicannon.cs +++ b/Items/Weapons/Ranged/FlakToxicannon.cs @@ -15,11 +15,11 @@ namespace CalamityMod.Items.Weapons.Ranged } public override void SetDefaults() { - Item.damage = 60; + Item.damage = 51; Item.DamageType = DamageClass.Ranged; Item.width = 88; Item.height = 28; - Item.useTime = Item.useAnimation = 8; + Item.useTime = Item.useAnimation = 11; Item.useStyle = ItemUseStyleID.Shoot; Item.useTurn = false; Item.noMelee = true; @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { float angle = velocity.ToRotation() + MathHelper.PiOver2; - if (angle <= -MathHelper.PiOver4 || angle >= MathHelper.PiOver4) + if (angle <= -(MathHelper.Pi / 3) || angle >= (MathHelper.Pi / 3)) return false; Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); diff --git a/Items/Weapons/Ranged/HalleysInferno.cs b/Items/Weapons/Ranged/HalleysInferno.cs index 0354f8c769..974dbfc314 100644 --- a/Items/Weapons/Ranged/HalleysInferno.cs +++ b/Items/Weapons/Ranged/HalleysInferno.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 1350; + Item.damage = 1125; Item.knockBack = 5f; Item.DamageType = DamageClass.Ranged; Item.useTime = Item.useAnimation = 30; diff --git a/Items/Weapons/Ranged/HeavenlyGale.cs b/Items/Weapons/Ranged/HeavenlyGale.cs index 0cafcf0831..e469016528 100644 --- a/Items/Weapons/Ranged/HeavenlyGale.cs +++ b/Items/Weapons/Ranged/HeavenlyGale.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 221; + Item.damage = 215; Item.DamageType = DamageClass.Ranged; Item.width = 138; Item.height = 176; diff --git a/Items/Weapons/Ranged/HoarfrostBow.cs b/Items/Weapons/Ranged/HoarfrostBow.cs index 80a9e04a96..9f290e1709 100644 --- a/Items/Weapons/Ranged/HoarfrostBow.cs +++ b/Items/Weapons/Ranged/HoarfrostBow.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 56; + Item.damage = 37; Item.DamageType = DamageClass.Ranged; Item.width = 26; Item.height = 70; diff --git a/Items/Weapons/Ranged/MagnaCannon.cs b/Items/Weapons/Ranged/MagnaCannon.cs new file mode 100644 index 0000000000..9f68f3b5a4 --- /dev/null +++ b/Items/Weapons/Ranged/MagnaCannon.cs @@ -0,0 +1,67 @@ +using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Ranged +{ + public class MagnaCannon : ModItem, ILocalizedModType + { + public static readonly SoundStyle ChargeFull = new("CalamityMod/Sounds/Item/MagnaCannonChargeFull") { Volume = 0.5f }; + public static readonly SoundStyle ChargeLoop = new("CalamityMod/Sounds/Item/MagnaCannonChargeLoop") { Volume = 0.5f }; + internal static readonly int ChargeLoopSoundFrames = 153; + public static readonly SoundStyle ChargeStart = new("CalamityMod/Sounds/Item/MagnaCannonChargeStart") { Volume = 0.5f }; + public static readonly SoundStyle Fire = new("CalamityMod/Sounds/Item/MagnaCannonShot") { PitchVariance = 0.3f, Volume = 0.4f }; + + public static int AftershotCooldownFrames = 30; + public static int FullChargeFrames = 138; //126 frames is durration of charge sound + + public new string LocalizationCategory => "Items.Weapons.Ranged"; + public override void SetDefaults() + { + Item.damage = 30; + Item.DamageType = DamageClass.Ranged; + Item.width = 56; + Item.height = 34; + Item.useTime = Item.useAnimation = AftershotCooldownFrames; + Item.useStyle = ItemUseStyleID.Shoot; + Item.noMelee = true; + Item.channel = true; + Item.knockBack = 2.5f; + Item.value = CalamityGlobalItem.Rarity2BuyPrice; + Item.rare = ItemRarityID.Green; + Item.UseSound = null; + Item.autoReuse = false; + Item.shootSpeed = 10f; + Item.shoot = ModContent.ProjectileType(); + Item.Calamity().canFirePointBlankShots = true; + } + + public override Vector2? HoldoutOffset() => new Vector2(-15, 0); + public override void HoldItem(Player player) + { + Item.noUseGraphic = true; + } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + Vector2 shootVelocity = velocity; + Vector2 shootDirection = shootVelocity.SafeNormalize(Vector2.UnitX * player.direction); + Projectile.NewProjectile(source, position, shootDirection, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + return false; + } + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(ItemID.Granite, 25). + AddIngredient(ItemID.MeteoriteBar, 12). + AddIngredient(ItemID.Diamond, 3). + AddIngredient(ItemID.Sapphire, 5). + AddTile(TileID.Anvils). + Register(); + } + } +} diff --git a/Items/Weapons/Magic/MagnaCannon.png b/Items/Weapons/Ranged/MagnaCannon.png similarity index 100% rename from Items/Weapons/Magic/MagnaCannon.png rename to Items/Weapons/Ranged/MagnaCannon.png diff --git a/Items/Weapons/Ranged/MagnaStriker.cs b/Items/Weapons/Ranged/MagnaStriker.cs deleted file mode 100644 index 816a45b9ba..0000000000 --- a/Items/Weapons/Ranged/MagnaStriker.cs +++ /dev/null @@ -1,63 +0,0 @@ -using Terraria.DataStructures; -using CalamityMod.Items.Weapons.Magic; -using CalamityMod.Projectiles.Ranged; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Ranged -{ - public class MagnaStriker : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Weapons.Ranged"; - public override void SetDefaults() - { - Item.damage = 50; - Item.DamageType = DamageClass.Ranged; - Item.width = 72; - Item.height = 38; - Item.useTime = 5; - Item.useAnimation = 20; - Item.reuseDelay = 6; - Item.useLimitPerAnimation = 4; - Item.useStyle = ItemUseStyleID.Shoot; - Item.noMelee = true; - Item.knockBack = 2.25f; - Item.value = CalamityGlobalItem.Rarity8BuyPrice; - Item.rare = ItemRarityID.Yellow; - Item.UseSound = OpalStriker.FireSound; - Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 15f; - Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; - } - - public override Vector2? HoldoutOffset() - { - return new Vector2(-5, 0); - } - - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) - { - if (Main.rand.NextBool()) - { - Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); - return false; - } - return true; - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(). - AddIngredient(). - AddRecipeGroup("AnyAdamantiteBar", 6). - AddIngredient(ItemID.Ectoplasm, 5). - AddTile(TileID.MythrilAnvil). - Register(); - } - } -} diff --git a/Items/Weapons/Ranged/MagnaStriker.png b/Items/Weapons/Ranged/MagnaStriker.png deleted file mode 100644 index f841775c43..0000000000 Binary files a/Items/Weapons/Ranged/MagnaStriker.png and /dev/null differ diff --git a/Items/Weapons/Ranged/MarksmanBow.cs b/Items/Weapons/Ranged/MarksmanBow.cs index 2c6ce29a3a..b8bca544b7 100644 --- a/Items/Weapons/Ranged/MarksmanBow.cs +++ b/Items/Weapons/Ranged/MarksmanBow.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 30; + Item.damage = 35; Item.DamageType = DamageClass.Ranged; Item.width = 36; Item.height = 110; @@ -55,6 +55,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Main.projectile[arrow].localNPCHitCooldown = 10 * (randomExtraUpdates + 1); Main.projectile[arrow].usesLocalNPCImmunity = true; + Main.projectile[arrow].tileCollide = false; } } return false; diff --git a/Items/Weapons/Ranged/Meowthrower.cs b/Items/Weapons/Ranged/Meowthrower.cs index 41b0926619..a8b2a0b9ab 100644 --- a/Items/Weapons/Ranged/Meowthrower.cs +++ b/Items/Weapons/Ranged/Meowthrower.cs @@ -10,14 +10,15 @@ namespace CalamityMod.Items.Weapons.Ranged public class Meowthrower : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + private bool Fire2 = false; public override void SetDefaults() { - Item.damage = 48; + Item.damage = 37; Item.DamageType = DamageClass.Ranged; Item.width = 74; Item.height = 24; - Item.useTime = 5; - Item.useAnimation = 5; + Item.useTime = 8; + Item.useAnimation = 8; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 1.25f; @@ -44,24 +45,11 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int num6 = Main.rand.Next(1, 3); - for (int index = 0; index < num6; ++index) - { - float SpeedX = velocity.X + (float)Main.rand.Next(-15, 16) * 0.05f; - float SpeedY = velocity.Y + (float)Main.rand.Next(-15, 16) * 0.05f; - switch (Main.rand.Next(3)) - { - case 1: - type = ModContent.ProjectileType(); - break; - case 2: - type = ModContent.ProjectileType(); - break; - default: - break; - } - Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI, 0.0f, 0.0f); - } + float SpeedX = velocity.X + (float)Main.rand.Next(-15, 16) * 0.05f; + float SpeedY = velocity.Y + (float)Main.rand.Next(-15, 16) * 0.05f; + int projType = Fire2 ? ModContent.ProjectileType() : type; + Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, projType, damage, knockback, player.whoAmI, 0.0f, 0.0f); + Fire2 = !Fire2; return false; } } diff --git a/Items/Weapons/Ranged/OpalStriker.cs b/Items/Weapons/Ranged/OpalStriker.cs index 404c3240c1..dac61162bf 100644 --- a/Items/Weapons/Ranged/OpalStriker.cs +++ b/Items/Weapons/Ranged/OpalStriker.cs @@ -11,47 +11,57 @@ namespace CalamityMod.Items.Weapons.Ranged public class OpalStriker : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; - public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/OpalStrike"); + + public static readonly SoundStyle Charge = new("CalamityMod/Sounds/Item/OpalCharge") { Volume = 0.5f}; + public static readonly SoundStyle ChargeLoop = new("CalamityMod/Sounds/Item/OpalChargeLoop") { Volume = 0.5f}; + internal static readonly int ChargeLoopSoundFrames = 120; + public static readonly SoundStyle Fire = new("CalamityMod/Sounds/Item/OpalFire") { PitchVariance = 0.4f, Volume = 0.3f }; + public static readonly SoundStyle ChargedFire = new("CalamityMod/Sounds/Item/OpalChargedFire") { PitchVariance = 0.3f, Volume = 0.6f }; + + public static int AftershotCooldownFrames = 17; + public static int FullChargeFrames = 88; public override void SetDefaults() { - Item.damage = 9; + Item.damage = 30; Item.DamageType = DamageClass.Ranged; Item.width = 46; Item.height = 30; - Item.useTime = 5; - Item.useAnimation = 20; - Item.reuseDelay = 25; - Item.useLimitPerAnimation = 4; + Item.useTime = Item.useAnimation = AftershotCooldownFrames; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; - Item.knockBack = 0f; + Item.knockBack = 4f; Item.value = CalamityGlobalItem.Rarity2BuyPrice; Item.rare = ItemRarityID.Green; - Item.UseSound = FireSound; - Item.autoReuse = true; + Item.UseSound = null; + Item.autoReuse = false; + Item.channel = true; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 6f; - Item.useAmmo = AmmoID.Bullet; + Item.shootSpeed = 12f; Item.Calamity().canFirePointBlankShots = true; } - public override Vector2? HoldoutOffset() => new Vector2(-10, 0); - + public override Vector2? HoldoutOffset() => new Vector2(-15, 0); + public override void HoldItem(Player player) + { + Item.noUseGraphic = true; + } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + Vector2 shootVelocity = velocity; + Vector2 shootDirection = shootVelocity.SafeNormalize(Vector2.UnitX * player.direction); + Projectile.NewProjectile(source, position, shootDirection, ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } - public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.NextBool(); - public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.Marble, 20). - AddIngredient(ItemID.Amber, 5). + AddIngredient(ItemID.Marble, 25). + AddIngredient(ItemID.MeteoriteBar, 10). AddIngredient(ItemID.Diamond, 3). + AddIngredient(ItemID.Amber, 3). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Weapons/Ranged/PearlGod.cs b/Items/Weapons/Ranged/PearlGod.cs index 2a3ca19767..a165d38638 100644 --- a/Items/Weapons/Ranged/PearlGod.cs +++ b/Items/Weapons/Ranged/PearlGod.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 40; + Item.damage = 33; Item.DamageType = DamageClass.Ranged; Item.width = 80; Item.height = 46; diff --git a/Items/Weapons/Ranged/PestilentDefiler.cs b/Items/Weapons/Ranged/PestilentDefiler.cs index 04321cba0a..84c15ce0c1 100644 --- a/Items/Weapons/Ranged/PestilentDefiler.cs +++ b/Items/Weapons/Ranged/PestilentDefiler.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 135; + Item.damage = 110; Item.DamageType = DamageClass.Ranged; Item.width = 46; Item.height = 20; diff --git a/Items/Weapons/Ranged/PlagueTaintedSMG.cs b/Items/Weapons/Ranged/PlagueTaintedSMG.cs index 86bb183c37..be947589eb 100644 --- a/Items/Weapons/Ranged/PlagueTaintedSMG.cs +++ b/Items/Weapons/Ranged/PlagueTaintedSMG.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; @@ -24,11 +25,11 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 85; + Item.damage = 76; Item.DamageType = DamageClass.Ranged; Item.width = 98; Item.height = 50; - Item.useTime = Item.useAnimation = 10; + Item.useTime = Item.useAnimation = 12; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 2f; @@ -54,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Ranged return base.CanUseItem(player); } - public override float UseSpeedMultiplier(Player player) => player.altFunctionUse == 2 ? (1f / 6f) : 1f; + public override float UseSpeedMultiplier(Player player) => player.altFunctionUse == 2 ? (1f / 5f) : 1f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { @@ -64,8 +65,8 @@ namespace CalamityMod.Items.Weapons.Ranged // Fire drones to the left and right. for (int i = 0; i < 3; i++) { - Projectile.NewProjectile(source, barrelPosition, velocity.RotatedBy(-Spread * (i + 1)), ModContent.ProjectileType(), damage, knockback, player.whoAmI); - Projectile.NewProjectile(source, barrelPosition, velocity.RotatedBy(Spread * (i + 1)), ModContent.ProjectileType(), damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, barrelPosition, velocity.RotatedBy(-Spread * (i + 1)), ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, player.Calamity().alchFlask || player.Calamity().spiritOrigin ? 1f : 0f); + Projectile.NewProjectile(source, barrelPosition, velocity.RotatedBy(Spread * (i + 1)), ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, player.Calamity().alchFlask || player.Calamity().spiritOrigin ? 1f : 0f); } } else diff --git a/Items/Weapons/Ranged/Scorpio.cs b/Items/Weapons/Ranged/Scorpio.cs index d75e62a100..3edecc1ca4 100644 --- a/Items/Weapons/Ranged/Scorpio.cs +++ b/Items/Weapons/Ranged/Scorpio.cs @@ -36,10 +36,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useAmmo = AmmoID.Rocket; } - public override Vector2? HoldoutOffset() - { - return new Vector2(-20, 10); - } + public override Vector2? HoldoutOffset() => new Vector2(-20, 10); public override bool AltFunctionUse(Player player) { diff --git a/Items/Weapons/Ranged/Seadragon.cs b/Items/Weapons/Ranged/Seadragon.cs index 05672055dd..f89f67cf34 100644 --- a/Items/Weapons/Ranged/Seadragon.cs +++ b/Items/Weapons/Ranged/Seadragon.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 70; + Item.damage = 60; Item.DamageType = DamageClass.Ranged; Item.width = 90; Item.height = 38; @@ -67,7 +67,7 @@ namespace CalamityMod.Items.Weapons.Ranged // Rockets have their own more chaotic spread than bullets. if (fireRocket) { - int rocketDamage = damage * 5; + int rocketDamage = damage * 3; Projectile.NewProjectile(source, newPos, newVel * 1.2f, ModContent.ProjectileType(), rocketDamage, knockback, player.whoAmI); SoundEngine.PlaySound(SoundID.Item109, player.Center); } @@ -75,7 +75,7 @@ namespace CalamityMod.Items.Weapons.Ranged // Muzzle blasts are always directly in line with the gun's muzzle. if (muzzleBlast) { - int muzzleBlastDamage = damage * 25; // This might be too much but it's every 18th shot... + 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); diff --git a/Items/Weapons/Ranged/SeasSearing.cs b/Items/Weapons/Ranged/SeasSearing.cs index e78e08752e..79cc9ba272 100644 --- a/Items/Weapons/Ranged/SeasSearing.cs +++ b/Items/Weapons/Ranged/SeasSearing.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Items.Weapons.Ranged Item.width = 88; Item.height = 44; Item.useTime = 5; - Item.useAnimation = 15; - Item.reuseDelay = 20; + Item.useAnimation = 10; + Item.reuseDelay = 16; Item.useLimitPerAnimation = 3; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.UseSound = SoundID.Item11; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 11f; + Item.shootSpeed = 13f; Item.value = CalamityGlobalItem.Rarity5BuyPrice; Item.rare = ItemRarityID.Pink; @@ -60,8 +60,8 @@ namespace CalamityMod.Items.Weapons.Ranged else { Item.useTime = 5; - Item.useAnimation = 15; - Item.reuseDelay = 20; + Item.useAnimation = 10; + Item.reuseDelay = 16; } return base.CanUseItem(player); } diff --git a/Items/Weapons/Ranged/TheStorm.cs b/Items/Weapons/Ranged/TheStorm.cs index 32186be76f..48073d36a5 100644 --- a/Items/Weapons/Ranged/TheStorm.cs +++ b/Items/Weapons/Ranged/TheStorm.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 24; + Item.damage = 35; Item.DamageType = DamageClass.Ranged; Item.width = 34; Item.height = 50; @@ -56,12 +56,11 @@ namespace CalamityMod.Items.Weapons.Ranged num80 = num72 / num80; } - int num107 = 3; - for (int num108 = 0; num108 < num107; num108++) + for (int j = 0; j < 3; j++) { vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - vector2.Y -= (float)(100 * num108); + vector2.Y -= (float)(100 * j); num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; if (num79 < 0f) @@ -82,16 +81,13 @@ namespace CalamityMod.Items.Weapons.Ranged { Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5 * 0.9f, ModContent.ProjectileType(), damage, knockback, i); Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5 * 0.8f, ModContent.ProjectileType(), damage, knockback, i); - Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5 * 0.7f, ModContent.ProjectileType(), damage, knockback, i); } else { - int num121 = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5 * 0.9f, type, damage, knockback, i); - Main.projectile[num121].noDropItem = true; - int num122 = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5 * 0.8f, type, damage, knockback, i); - Main.projectile[num122].noDropItem = true; - int num123 = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5 * 0.7f, type, damage, knockback, i); - Main.projectile[num123].noDropItem = true; + int arrow1 = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5 * 0.9f, type, damage, knockback, i); + Main.projectile[arrow1].noDropItem = true; + int arrow2 = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5 * 0.8f, type, damage, knockback, i); + Main.projectile[arrow2].noDropItem = true; } } return false; diff --git a/Items/Weapons/Rogue/CursedDagger.cs b/Items/Weapons/Rogue/CursedDagger.cs index 3b792327a8..fbd9c8444a 100644 --- a/Items/Weapons/Rogue/CursedDagger.cs +++ b/Items/Weapons/Rogue/CursedDagger.cs @@ -4,16 +4,19 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using log4net.Core; +using Terraria.Audio; namespace CalamityMod.Items.Weapons.Rogue { public class CursedDagger : RogueWeapon { + public static readonly SoundStyle ThrowSound = new("CalamityMod/Sounds/Item/CursedDaggerThrow") { Volume = 0.3f, PitchVariance = 0.4f }; public override void SetDefaults() { - Item.damage = 34; - Item.useAnimation = Item.useTime = 8; - Item.shootSpeed = 12f; + Item.damage = 46; + Item.useAnimation = Item.useTime = 18; + Item.shootSpeed = 19f; Item.knockBack = 4.5f; Item.shoot = ModContent.ProjectileType(); @@ -22,16 +25,24 @@ namespace CalamityMod.Items.Weapons.Rogue Item.height = 48; Item.DamageType = RogueDamageClass.Instance; Item.useStyle = ItemUseStyleID.Swing; - Item.UseSound = SoundID.Item1; - Item.rare = ItemRarityID.Pink; - Item.value = CalamityGlobalItem.Rarity5BuyPrice; + Item.UseSound = ThrowSound; + Item.value = CalamityGlobalItem.Rarity4BuyPrice; + Item.rare = ItemRarityID.LightRed; Item.autoReuse = true; Item.noMelee = true; Item.noUseGraphic = true; } - + 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) { + Vector2 newVel = velocity.RotatedByRandom(MathHelper.ToRadians(23f)) * 0.6f; + Vector2 newVel2 = velocity.RotatedByRandom(MathHelper.ToRadians(23f)) * 0.8f; + if (!player.Calamity().StealthStrikeAvailable()) + { + Projectile.NewProjectile(source, position, newVel, type, damage / 2, knockback, player.whoAmI); + Projectile.NewProjectile(source, position, newVel2, type, damage / 2, knockback, player.whoAmI); + } + if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); diff --git a/Items/Weapons/Rogue/EclipsesFall.cs b/Items/Weapons/Rogue/EclipsesFall.cs index b914c5c93a..200e977b24 100644 --- a/Items/Weapons/Rogue/EclipsesFall.cs +++ b/Items/Weapons/Rogue/EclipsesFall.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Items.Weapons.Rogue { public override void SetDefaults() { - Item.damage = 540; + Item.damage = 500; Item.knockBack = 3.5f; - Item.useAnimation = Item.useTime = 21; + Item.useAnimation = Item.useTime = 22; Item.autoReuse = true; Item.DamageType = RogueDamageClass.Instance; Item.shootSpeed = 15f; diff --git a/Items/Weapons/Rogue/ExecutionersBlade.cs b/Items/Weapons/Rogue/ExecutionersBlade.cs index 3041d19896..26aea6c1b8 100644 --- a/Items/Weapons/Rogue/ExecutionersBlade.cs +++ b/Items/Weapons/Rogue/ExecutionersBlade.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetDefaults() { Item.width = 64; - Item.damage = 225; + Item.damage = 195; Item.noMelee = true; Item.noUseGraphic = true; Item.useTime = 3; diff --git a/Items/Weapons/Rogue/GodsParanoia.cs b/Items/Weapons/Rogue/GodsParanoia.cs index fb145a912f..411b0461c5 100644 --- a/Items/Weapons/Rogue/GodsParanoia.cs +++ b/Items/Weapons/Rogue/GodsParanoia.cs @@ -13,21 +13,19 @@ namespace CalamityMod.Items.Weapons.Rogue { public class GodsParanoia : RogueWeapon { - private static int damage = 98; - private static int knockBack = 5; public override void SetDefaults() { - Item.damage = damage; + Item.damage = 142; Item.DamageType = RogueDamageClass.Instance; Item.noMelee = true; Item.noUseGraphic = true; Item.width = 20; - Item.height = 18; - Item.useTime = 15; - Item.useAnimation = 15; + Item.height = 20; + Item.useTime = 20; + Item.useAnimation = 20; Item.useStyle = ItemUseStyleID.Swing; - Item.knockBack = knockBack; + Item.knockBack = 5; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; Item.rare = ModContent.RarityType(); Item.UseSound = SoundID.Item1; @@ -52,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Rogue } } - public override float StealthDamageMultiplier => 1f; + public override float StealthDamageMultiplier => 0.7f; 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/IchorSpear.cs b/Items/Weapons/Rogue/IchorSpear.cs index 01d6824127..549dce9289 100644 --- a/Items/Weapons/Rogue/IchorSpear.cs +++ b/Items/Weapons/Rogue/IchorSpear.cs @@ -1,33 +1,35 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Audio; namespace CalamityMod.Items.Weapons.Rogue { public class IchorSpear : RogueWeapon { + public static readonly SoundStyle ThrowSound = new("CalamityMod/Sounds/Item/IchorSpearThrow") { Volume = 0.2f, PitchVariance = 0.4f }; public override void SetDefaults() { Item.width = 52; - Item.damage = 84; + Item.damage = 132; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = Item.useTime = 20; + Item.useAnimation = Item.useTime = 39; Item.useStyle = ItemUseStyleID.Swing; - Item.knockBack = 6f; - Item.UseSound = SoundID.Item1; + Item.knockBack = 7f; + Item.UseSound = ThrowSound; Item.autoReuse = true; Item.height = 52; Item.value = CalamityGlobalItem.Rarity4BuyPrice; Item.rare = ItemRarityID.LightRed; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 20f; + Item.shootSpeed = 17f; Item.DamageType = RogueDamageClass.Instance; } - + 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) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/LuminousStriker.cs b/Items/Weapons/Rogue/LuminousStriker.cs deleted file mode 100644 index c7dd292705..0000000000 --- a/Items/Weapons/Rogue/LuminousStriker.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Terraria.DataStructures; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Rogue; -using Microsoft.Xna.Framework; - -namespace CalamityMod.Items.Weapons.Rogue -{ - public class LuminousStriker : RogueWeapon - { - public override void SetDefaults() - { - Item.width = 86; - Item.height = 102; - Item.damage = 186; - Item.noMelee = true; - Item.noUseGraphic = true; - Item.useAnimation = 30; - Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 30; - Item.knockBack = 6f; - Item.UseSound = SoundID.Item1; - Item.autoReuse = true; - Item.value = CalamityGlobalItem.Rarity10BuyPrice; - Item.rare = ItemRarityID.Red; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 20f; - Item.DamageType = RogueDamageClass.Instance; - } - - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) - { - int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(proj)) - Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); - return false; - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(). - AddIngredient(). - AddIngredient(ItemID.FragmentStardust, 6). - AddTile(TileID.LunarCraftingStation). - Register(); - } - } -} diff --git a/Items/Weapons/Rogue/MeteorFist.cs b/Items/Weapons/Rogue/MeteorFist.cs index e61c190509..c680c00d77 100644 --- a/Items/Weapons/Rogue/MeteorFist.cs +++ b/Items/Weapons/Rogue/MeteorFist.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Items.Weapons.Rogue Item.noMelee = true; Item.useTurn = true; Item.noUseGraphic = true; - Item.useAnimation = 30; + Item.useAnimation = 15; Item.useStyle = ItemUseStyleID.Shoot; - Item.useTime = 30; + Item.useTime = 15; Item.knockBack = 5.75f; Item.UseSound = SoundID.Item20; Item.autoReuse = true; @@ -30,16 +30,21 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } + public override float StealthDamageMultiplier => 3.8f; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) { - int proj = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 4f); + int proj = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 4f); if (proj.WithinBounds(Main.maxProjectiles)) Main.projectile[proj].Calamity().stealthStrike = true; - return false; } - return true; + else + { + Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 4f); + } + return false; } public override void AddRecipes() diff --git a/Items/Weapons/Rogue/NightsGaze.cs b/Items/Weapons/Rogue/NightsGaze.cs index 3ec957ff83..cfb744fc9f 100644 --- a/Items/Weapons/Rogue/NightsGaze.cs +++ b/Items/Weapons/Rogue/NightsGaze.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.DayBreak). + AddIngredient(). AddIngredient(7). AddIngredient(4). AddIngredient(12). diff --git a/Items/Weapons/Rogue/Penumbra.cs b/Items/Weapons/Rogue/Penumbra.cs index 6a80c3be80..b147956ca4 100644 --- a/Items/Weapons/Rogue/Penumbra.cs +++ b/Items/Weapons/Rogue/Penumbra.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Rogue { public class Penumbra : RogueWeapon { - public static float ShootSpeed = 8f; + public static float ShootSpeed = 9f; public override void SetDefaults() { Item.width = 46; @@ -24,12 +24,12 @@ namespace CalamityMod.Items.Weapons.Rogue Item.UseSound = SoundID.Item103; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.damage = 1008; + Item.damage = 830; Item.useAnimation = 40; Item.useTime = 40; Item.knockBack = 8f; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = ShootSpeed; + Item.shootSpeed = 9f; Item.rare = ModContent.RarityType(); Item.DamageType = RogueDamageClass.Instance; diff --git a/Items/Weapons/Rogue/PhantasmalRuin.cs b/Items/Weapons/Rogue/PhantasmalRuin.cs index 14c4a67902..f0996ca299 100644 --- a/Items/Weapons/Rogue/PhantasmalRuin.cs +++ b/Items/Weapons/Rogue/PhantasmalRuin.cs @@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Rogue; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -13,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Rogue { public override void SetDefaults() { - Item.damage = 955; + Item.damage = 145; Item.knockBack = 8f; Item.width = 102; @@ -21,19 +22,19 @@ namespace CalamityMod.Items.Weapons.Rogue Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.noUseGraphic = true; - Item.useTime = 35; - Item.useAnimation = 35; + Item.useTime = 30; + Item.useAnimation = 30; Item.autoReuse = true; - Item.shootSpeed = 14.5f; + Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); Item.UseSound = SoundID.Item1; Item.DamageType = RogueDamageClass.Instance; - Item.value = CalamityGlobalItem.Rarity13BuyPrice; - Item.rare = ModContent.RarityType(); + Item.value = CalamityGlobalItem.Rarity7BuyPrice; + Item.rare = ItemRarityID.Lime; } - public override float StealthDamageMultiplier => 1.22f; + public override float StealthDamageMultiplier => 1.85f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { @@ -42,6 +43,7 @@ namespace CalamityMod.Items.Weapons.Rogue int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; + Main.projectile[stealth].penetrate = 3; return false; } return true; @@ -50,11 +52,9 @@ namespace CalamityMod.Items.Weapons.Rogue public override void AddRecipes() { CreateRecipe(). - AddIngredient(). - AddIngredient(500). - AddIngredient(4). - AddIngredient(20). - AddTile(TileID.LunarCraftingStation). + AddIngredient(ItemID.SpectreBar, 15). + AddIngredient(ItemID.Bone, 35). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Rogue/PhantomLance.cs b/Items/Weapons/Rogue/PhantomLance.cs deleted file mode 100644 index e2259a0f70..0000000000 --- a/Items/Weapons/Rogue/PhantomLance.cs +++ /dev/null @@ -1,64 +0,0 @@ -using Terraria.DataStructures; -using CalamityMod.Projectiles.Rogue; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using Microsoft.Xna.Framework; - -namespace CalamityMod.Items.Weapons.Rogue -{ - public class PhantomLance : RogueWeapon - { - public override void SetStaticDefaults() - { - Item.ResearchUnlockCount = 99; - } - - public override void SetDefaults() - { - Item.damage = 70; - Item.knockBack = 5f; - - Item.width = 62; - Item.height = 68; - Item.useStyle = ItemUseStyleID.Swing; - Item.noMelee = true; - Item.noUseGraphic = true; - - Item.value = Item.buyPrice(0, 0, 50, 0); - Item.rare = ItemRarityID.Yellow; - Item.useTime = 23; - Item.useAnimation = 23; - Item.maxStack = 9999; - Item.UseSound = SoundID.Item1; - Item.consumable = true; - Item.DamageType = RogueDamageClass.Instance; - - Item.autoReuse = true; - Item.shootSpeed = 10f; - Item.shoot = ModContent.ProjectileType(); - } - - public override float StealthDamageMultiplier => 1.75f; - - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) - { - if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike - { - int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); - if (stealth.WithinBounds(Main.maxProjectiles)) - Main.projectile[stealth].Calamity().stealthStrike = true; - return false; - } - return true; - } - - public override void AddRecipes() - { - CreateRecipe(150). - AddIngredient(ItemID.SpectreBar). - AddTile(TileID.MythrilAnvil). - Register(); - } - } -} diff --git a/Items/Weapons/Rogue/PhantomLance.png b/Items/Weapons/Rogue/PhantomLance.png deleted file mode 100644 index 55db8c10ed..0000000000 Binary files a/Items/Weapons/Rogue/PhantomLance.png and /dev/null differ diff --git a/Items/Weapons/Rogue/RealityRupture.cs b/Items/Weapons/Rogue/RealityRupture.cs new file mode 100644 index 0000000000..7267ef024b --- /dev/null +++ b/Items/Weapons/Rogue/RealityRupture.cs @@ -0,0 +1,95 @@ +using Terraria.DataStructures; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using Terraria.Audio; +using CalamityMod.Rarities; + +namespace CalamityMod.Items.Weapons.Rogue +{ + [LegacyName("LuminousStriker")] + public class RealityRupture : RogueWeapon + { + public static readonly SoundStyle ThrowSound = new("CalamityMod/Sounds/Item/RealityRupture") { Volume = 0.3f, PitchVariance = 0.3f }; + public static readonly SoundStyle ThrowSound2 = new("CalamityMod/Sounds/Item/LanceofDestinyStrong") { Volume = 0.4f, PitchVariance = 0.3f }; + public static readonly SoundStyle ThrowSound3 = new("CalamityMod/Sounds/Item/RealityRuptureStealth") { Volume = 0.5f, PitchVariance = 0.3f }; + private bool BigSpear = false; + public override void SetDefaults() + { + Item.width = 86; + Item.height = 102; + Item.damage = 225; + Item.noMelee = true; + Item.noUseGraphic = true; + Item.useAnimation = 43; + Item.useStyle = ItemUseStyleID.Swing; + Item.useTime = 43; + Item.knockBack = 9f; + Item.UseSound = SoundID.Item1; + Item.autoReuse = true; + Item.value = CalamityGlobalItem.Rarity12BuyPrice; + Item.rare = ModContent.RarityType(); + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 10f; + Item.DamageType = RogueDamageClass.Instance; + } + public override float StealthDamageMultiplier => 3.9f; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + { + int stealth = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + SoundEngine.PlaySound(ThrowSound3, player.Center); + if (stealth.WithinBounds(Main.maxProjectiles)) + { + Main.projectile[stealth].Calamity().stealthStrike = true; + Main.projectile[stealth].usesLocalNPCImmunity = true; + } + return false; + } + else + { + int projType = BigSpear ? ModContent.ProjectileType() : type; + + if (!BigSpear) + SoundEngine.PlaySound(ThrowSound, player.Center); + else + SoundEngine.PlaySound(ThrowSound2, player.Center); + + if (BigSpear) + { + Projectile.NewProjectile(source, position, velocity, projType, BigSpear ? damage * 4 : damage, knockback * 1.5f, player.whoAmI); + } + int index = 4; + for (int i = -index; i <= index; i += index) + { + if (!BigSpear) + { + Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i)); + int spear = Projectile.NewProjectile(source, position, perturbedSpeed, projType, damage, knockback, player.whoAmI); + if (spear.WithinBounds(Main.maxProjectiles)) + Main.projectile[spear].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + } + } + + // Swap between firing small and big spears each throw. + BigSpear = !BigSpear; + return false; + } + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(). + AddIngredient(). + AddIngredient(). + AddIngredient(). + AddTile(TileID.LunarCraftingStation). + Register(); + } + } +} diff --git a/Items/Weapons/Rogue/LuminousStriker.png b/Items/Weapons/Rogue/RealityRupture.png similarity index 100% rename from Items/Weapons/Rogue/LuminousStriker.png rename to Items/Weapons/Rogue/RealityRupture.png diff --git a/Items/Weapons/Rogue/ScarletDevil.cs b/Items/Weapons/Rogue/ScarletDevil.cs index a3d3471546..17aa26466f 100644 --- a/Items/Weapons/Rogue/ScarletDevil.cs +++ b/Items/Weapons/Rogue/ScarletDevil.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Rogue { CreateRecipe(). AddIngredient(). - AddIngredient(). + AddIngredient(). AddIngredient(15). AddIngredient(ItemID.SoulofNight, 15). AddIngredient(5). diff --git a/Items/Weapons/Rogue/SpearofDestiny.cs b/Items/Weapons/Rogue/SpearofDestiny.cs index b6209ccdbe..f9b316085b 100644 --- a/Items/Weapons/Rogue/SpearofDestiny.cs +++ b/Items/Weapons/Rogue/SpearofDestiny.cs @@ -4,53 +4,100 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Audio; +using CalamityMod.Items.Accessories; namespace CalamityMod.Items.Weapons.Rogue { public class SpearofDestiny : RogueWeapon { + public static readonly SoundStyle ThrowSound = new("CalamityMod/Sounds/Item/SpearofDestiny") { Volume = 0.3f, PitchVariance = 0.3f }; + public static readonly SoundStyle ThrowSound2 = new("CalamityMod/Sounds/Item/LanceofDestiny") { Volume = 0.3f, PitchVariance = 0.3f }; + public static readonly SoundStyle ThrowSound3 = new("CalamityMod/Sounds/Item/LanceofDestinyStrong") { Volume = 0.5f, PitchVariance = 0.3f }; + private bool BigSpear = false; public override void SetDefaults() { Item.width = 52; - Item.damage = 26; + Item.damage = 53; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = 20; + Item.useAnimation = 45; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 20; + Item.useTime = 45; Item.knockBack = 2f; - Item.UseSound = SoundID.Item1; + Item.UseSound = ThrowSound; Item.autoReuse = true; Item.height = 52; Item.value = CalamityGlobalItem.Rarity6BuyPrice; Item.rare = ItemRarityID.LightPurple; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 20f; + Item.shootSpeed = 10f; Item.DamageType = RogueDamageClass.Instance; } + public override float StealthDamageMultiplier => 4f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int index = 7; - for (int i = -index; i <= index; i += index) + if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - int projType = (i != 0 || player.Calamity().StealthStrikeAvailable()) ? type : ModContent.ProjectileType(); - Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i)); - int spear = Projectile.NewProjectile(source, position, perturbedSpeed, projType, damage, knockback, player.whoAmI); - if (spear.WithinBounds(Main.maxProjectiles)) - Main.projectile[spear].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + int stealth = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + SoundEngine.PlaySound(ThrowSound3, player.Center); + if (stealth.WithinBounds(Main.maxProjectiles)) + { + Main.projectile[stealth].Calamity().stealthStrike = true; + Main.projectile[stealth].usesLocalNPCImmunity = true; + } + return false; + } + else + { + int projType = BigSpear ? ModContent.ProjectileType() : type; + + if (!BigSpear) + SoundEngine.PlaySound(ThrowSound, player.Center); + else + SoundEngine.PlaySound(ThrowSound2, player.Center); + + if (BigSpear) + { + Projectile.NewProjectile(source, position, velocity, projType, BigSpear ? damage * 3 : damage, knockback, player.whoAmI); + } + int index = 5; + for (int i = -index; i <= index; i += index) + { + if (!BigSpear) + { + Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i)); + int spear = Projectile.NewProjectile(source, position, perturbedSpeed, projType, damage, knockback, player.whoAmI); + if (spear.WithinBounds(Main.maxProjectiles)) + Main.projectile[spear].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + } + } + + // Swap between firing small and big spears each throw. + BigSpear = !BigSpear; + return false; } - return false; } public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.HallowedBar, 7). - AddIngredient(ItemID.SoulofLight, 5). - AddIngredient(ItemID.SoulofFright, 5). - AddTile(TileID.MythrilAnvil). - Register(); + AddIngredient(). + AddIngredient(ItemID.HallowedBar, 7). + AddIngredient(ItemID.SoulofFright, 5). + AddIngredient(ItemID.SoulofMight, 5). + AddIngredient(ItemID.SoulofSight, 5). + AddTile(TileID.MythrilAnvil). + Register(); + CreateRecipe(). + AddIngredient(). + AddIngredient(ItemID.HallowedBar, 7). + AddIngredient(ItemID.SoulofFright, 5). + AddIngredient(ItemID.SoulofMight, 5). + AddIngredient(ItemID.SoulofSight, 5). + AddTile(TileID.MythrilAnvil). + Register(); } } } diff --git a/Items/Weapons/Rogue/SpearofDestiny.png b/Items/Weapons/Rogue/SpearofDestiny.png index 3dae694b7d..4e198d9042 100644 Binary files a/Items/Weapons/Rogue/SpearofDestiny.png and b/Items/Weapons/Rogue/SpearofDestiny.png differ diff --git a/Items/Weapons/Rogue/StormfrontRazor.cs b/Items/Weapons/Rogue/StormfrontRazor.cs index 714c247f00..ff1ef37f07 100644 --- a/Items/Weapons/Rogue/StormfrontRazor.cs +++ b/Items/Weapons/Rogue/StormfrontRazor.cs @@ -12,13 +12,12 @@ namespace CalamityMod.Items.Weapons.Rogue { public class StormfrontRazor : RogueWeapon { - public static readonly SoundStyle LightningStrikeSound = new("CalamityMod/Sounds/Custom/LightningStrike"); public const float LightningDamageFactor = 1.5f; public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 4)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 4)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Weapons/Rogue/TheOldReaper.cs b/Items/Weapons/Rogue/TheOldReaper.cs index 0b282e6527..513eb4deb1 100644 --- a/Items/Weapons/Rogue/TheOldReaper.cs +++ b/Items/Weapons/Rogue/TheOldReaper.cs @@ -14,35 +14,33 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetDefaults() { Item.width = 106; - Item.damage = 122; + Item.damage = 180; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = 22; - Item.useTime = 22; + Item.useAnimation = 20; + Item.useTime = 20; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 4f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.height = 104; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 20f; + Item.shootSpeed = 16f; Item.DamageType = RogueDamageClass.Instance; Item.value = CalamityGlobalItem.Rarity13BuyPrice; Item.rare = ModContent.RarityType(); } - 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) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - int spread = 10; - for (int i = 0; i < 4; i++) + int spread = 15; + for (int i = 0; i < 3; i++) { - Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-3,4), velocity.Y + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread)); - int proj = Projectile.NewProjectile(source, position, perturbedspeed, type, damage, knockback, player.whoAmI); + Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-2,3), velocity.Y + Main.rand.Next(-2,3)).RotatedBy(MathHelper.ToRadians(spread)); + int proj = Projectile.NewProjectile(source, position, perturbedspeed, type, damage /2, knockback, player.whoAmI); if (proj.WithinBounds(Main.maxProjectiles)) { Main.projectile[proj].Calamity().stealthStrike = true; diff --git a/Items/Weapons/Rogue/ToxicantTwister.cs b/Items/Weapons/Rogue/ToxicantTwister.cs index 9782d49a43..f4e8bad9da 100644 --- a/Items/Weapons/Rogue/ToxicantTwister.cs +++ b/Items/Weapons/Rogue/ToxicantTwister.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 42; Item.height = 46; - Item.damage = 300; + Item.damage = 333; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 20; @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.rare = ModContent.RarityType(); } - public override float StealthDamageMultiplier => 1.35f; + public override float StealthDamageMultiplier => 1.25f; 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/DeificThunderbolt.cs b/Items/Weapons/Rogue/TwistingThunder.cs similarity index 93% rename from Items/Weapons/Rogue/DeificThunderbolt.cs rename to Items/Weapons/Rogue/TwistingThunder.cs index c3e7ab7b58..662885493c 100644 --- a/Items/Weapons/Rogue/DeificThunderbolt.cs +++ b/Items/Weapons/Rogue/TwistingThunder.cs @@ -9,7 +9,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class DeificThunderbolt : RogueWeapon + [LegacyName("DeificThunderbolt")] + public class TwistingThunder : RogueWeapon { public override void SetDefaults() { @@ -30,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.autoReuse = true; Item.shootSpeed = 13.69f; - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ModContent.ProjectileType(); } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Rogue/DeificThunderbolt.png b/Items/Weapons/Rogue/TwistingThunder.png similarity index 100% rename from Items/Weapons/Rogue/DeificThunderbolt.png rename to Items/Weapons/Rogue/TwistingThunder.png diff --git a/Items/Weapons/Rogue/UtensilPoker.cs b/Items/Weapons/Rogue/UtensilPoker.cs index 1ace51a26d..dba6b5b87e 100644 --- a/Items/Weapons/Rogue/UtensilPoker.cs +++ b/Items/Weapons/Rogue/UtensilPoker.cs @@ -5,6 +5,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Particles; namespace CalamityMod.Items.Weapons.Rogue { @@ -45,23 +46,23 @@ namespace CalamityMod.Items.Weapons.Rogue } else { - int utensil = ModContent.ProjectileType(); + type = ModContent.ProjectileType(); double dmgMult = 1D; float kbMult = 1f; - switch (Main.rand.Next(3)) + switch (counter) { case 0: - utensil = ModContent.ProjectileType(); + type = ModContent.ProjectileType(); dmgMult = 1.1; kbMult = 2f; break; case 1: - utensil = ModContent.ProjectileType(); + type = ModContent.ProjectileType(); dmgMult = 1.2; kbMult = 1f; break; case 2: - utensil = ModContent.ProjectileType(); + type = ModContent.ProjectileType(); dmgMult = 1D; kbMult = 1f; break; @@ -70,7 +71,8 @@ namespace CalamityMod.Items.Weapons.Rogue } damage = (int)(damage * dmgMult); knockback = knockback * kbMult; - } + + } } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) @@ -80,9 +82,8 @@ namespace CalamityMod.Items.Weapons.Rogue int idx = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); if (idx.WithinBounds(Main.maxProjectiles)) Main.projectile[idx].Calamity().stealthStrike = mp.StealthStrikeAvailable(); - counter++; - if (counter == 3) + if (counter >= 3) counter = 0; return false; } diff --git a/Items/Weapons/Summon/BlackHawkRemote.cs b/Items/Weapons/Summon/BlackHawkRemote.cs index 057601f3fc..0e2d713056 100644 --- a/Items/Weapons/Summon/BlackHawkRemote.cs +++ b/Items/Weapons/Summon/BlackHawkRemote.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Items.Weapons.Summon { Item.damage = 25; Item.mana = 10; - Item.width = 46; - Item.height = 28; + Item.width = 38; + Item.height = 40; Item.useTime = Item.useAnimation = 24; Item.useStyle = ItemUseStyleID.HoldUp; Item.noMelee = true; diff --git a/Items/Weapons/Summon/BlackHawkRemote.png b/Items/Weapons/Summon/BlackHawkRemote.png index e8010b62be..46c57edda5 100644 Binary files a/Items/Weapons/Summon/BlackHawkRemote.png and b/Items/Weapons/Summon/BlackHawkRemote.png differ diff --git a/Items/Weapons/Summon/BloodClotStaff.cs b/Items/Weapons/Summon/BloodClotStaff.cs deleted file mode 100644 index 0636ef149b..0000000000 --- a/Items/Weapons/Summon/BloodClotStaff.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Terraria.DataStructures; -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Summon; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Summon -{ - public class BloodClotStaff : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Weapons.Summon"; - public override void SetDefaults() - { - Item.damage = 9; - Item.mana = 10; - Item.width = 58; - Item.height = 64; - Item.useTime = Item.useAnimation = 30; - Item.useStyle = ItemUseStyleID.Swing; - Item.noMelee = true; - Item.knockBack = 2.25f; - Item.value = CalamityGlobalItem.Rarity3BuyPrice; - Item.rare = ItemRarityID.Orange; - Item.UseSound = SoundID.Item44; - Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; - Item.DamageType = DamageClass.Summon; - } - - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) - { - if (player.altFunctionUse != 2) - { - position = Main.MouseWorld; - velocity.X = 0; - velocity.Y = 0; - int p = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } - return false; - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.CrimtaneBar, 4). - AddIngredient(12). - AddIngredient(ItemID.Vertebrae, 4). - AddTile(TileID.DemonAltar). - Register(); - } - } -} diff --git a/Items/Weapons/Summon/BloodClotStaff.png b/Items/Weapons/Summon/BloodClotStaff.png deleted file mode 100644 index 8951c39fb4..0000000000 Binary files a/Items/Weapons/Summon/BloodClotStaff.png and /dev/null differ diff --git a/Items/Weapons/Summon/CalamarisLament.cs b/Items/Weapons/Summon/CalamarisLament.cs index c18a3a7441..f856ece019 100644 --- a/Items/Weapons/Summon/CalamarisLament.cs +++ b/Items/Weapons/Summon/CalamarisLament.cs @@ -1,8 +1,10 @@ -using Terraria.DataStructures; +using System.Collections.Generic; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -10,38 +12,57 @@ namespace CalamityMod.Items.Weapons.Summon { public class CalamarisLament : ModItem, ILocalizedModType { + public static readonly SoundStyle GFB = new("CalamityMod/Sounds/Item/Inkling", 5); public new string LocalizationCategory => "Items.Weapons.Summon"; + + #region Minion Stats + + public static float EnemyDistanceDetection = 8000f; // It's this high so it can target DoG reliably. + + public static float ShootingExtraTargettingSpeed = 10f; + public static float ShootingMinionDistance = 320f; + public static int ShootingFireRate = 30; // In frames. + public static float ShootingProjectileSpeed = 20f; + + public static float LatchingDistanceRequired = 400f; + public static float LatchingExtraTargettingSpeed = 30f; + public static float LatchingDamageMultiplier = 1.25f; + public static int LatchingIFrames = 30; // If the value is changed, respawn all minions. + + #endregion + + public override void SetStaticDefaults() + { + Item.staff[Type] = true; + } + public override void SetDefaults() { Item.damage = 110; - Item.mana = 10; - Item.width = 62; - Item.height = 62; - Item.useTime = Item.useAnimation = 10; - Item.useStyle = ItemUseStyleID.Swing; - Item.noMelee = true; - Item.knockBack = 2.5f; - Item.value = CalamityGlobalItem.Rarity13BuyPrice; - Item.UseSound = SoundID.Item83; - Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; + Item.shoot = ModContent.ProjectileType(); Item.DamageType = DamageClass.Summon; + + Item.useTime = Item.useAnimation = 10; + Item.mana = 10; + Item.width = 88; + Item.height = 108; + Item.noMelee = true; + Item.autoReuse = true; + Item.UseSound = SoundID.Item85; + Item.useStyle = ItemUseStyleID.Shoot; Item.rare = ModContent.RarityType(); + Item.value = CalamityGlobalItem.Rarity13BuyPrice; + + // This does nothing, it's just here so it's able to act like a staff. + Item.shootSpeed = 1f; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - position = Main.MouseWorld; - velocity.X = 0; - velocity.Y = 0; - int p = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + Projectile.NewProjectile(source, Main.MouseWorld, velocity, type, damage, knockback, player.whoAmI); return false; } + + public override void ModifyTooltips(List list) => list.FindAndReplace("[GFB]", this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal")); } } diff --git a/Items/Weapons/Summon/DeathstareRod.cs b/Items/Weapons/Summon/DeathstareRod.cs index 57418535a3..786af1ad05 100644 --- a/Items/Weapons/Summon/DeathstareRod.cs +++ b/Items/Weapons/Summon/DeathstareRod.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.damage = 33; Item.mana = 10; - Item.width = Item.height = 42; + Item.width = Item.height = 46; Item.useTime = Item.useAnimation = 35; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; diff --git a/Items/Weapons/Summon/DeathstareRod.png b/Items/Weapons/Summon/DeathstareRod.png index fdabc4bd48..59272ca7fe 100644 Binary files a/Items/Weapons/Summon/DeathstareRod.png and b/Items/Weapons/Summon/DeathstareRod.png differ diff --git a/Items/Weapons/Summon/FleshOfInfidelity.cs b/Items/Weapons/Summon/FleshOfInfidelity.cs index 810bd22662..72c6053fe4 100644 --- a/Items/Weapons/Summon/FleshOfInfidelity.cs +++ b/Items/Weapons/Summon/FleshOfInfidelity.cs @@ -1,53 +1,48 @@ -using Terraria.ModLoader; -using Terraria.ID; -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; -using Microsoft.Xna.Framework; +using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { public class FleshOfInfidelity : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetDefaults() { - Item.damage = 27; - Item.mana = 10; - Item.width = Item.height = 48; - Item.useTime = Item.useAnimation = 30; - Item.useStyle = ItemUseStyleID.Swing; - Item.noMelee = true; + Item.damage = 15; + Item.DamageType = DamageClass.Summon; + Item.shoot = ModContent.ProjectileType(); Item.knockBack = 1f; + + Item.useTime = Item.useAnimation = 10; + Item.mana = 10; + Item.width = 42; + Item.height = 42; + Item.noMelee = true; + Item.autoReuse = true; Item.value = CalamityGlobalItem.Rarity3BuyPrice; Item.rare = ItemRarityID.Orange; + Item.useStyle = ItemUseStyleID.Swing; Item.UseSound = SoundID.Zombie24; - Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; - Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, Main.MouseWorld, Vector2.UnitY * -1f, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + Projectile.NewProjectile(source, Main.MouseWorld, Vector2.UnitY * -1f, type, damage, knockback, player.whoAmI); return false; } public override void AddRecipes() { CreateRecipe(). - AddIngredient(). - AddIngredient(). - AddIngredient(). - AddIngredient(ItemID.ImpStaff). - AddIngredient(10). + AddIngredient(ItemID.CrimtaneBar, 4). + AddIngredient(12). + AddIngredient(ItemID.Vertebrae, 4). AddTile(TileID.DemonAltar). Register(); } diff --git a/Items/Weapons/Summon/HerringStaff.cs b/Items/Weapons/Summon/HerringStaff.cs index 4f18837d2d..28fdad0288 100644 --- a/Items/Weapons/Summon/HerringStaff.cs +++ b/Items/Weapons/Summon/HerringStaff.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public override void SetDefaults() { - Item.damage = 17; + Item.damage = 15; Item.knockBack = 1.25f; Item.mana = 10; diff --git a/Items/Weapons/Summon/PlantationStaff.cs b/Items/Weapons/Summon/PlantationStaff.cs index b071e01efe..42fdc08159 100644 --- a/Items/Weapons/Summon/PlantationStaff.cs +++ b/Items/Weapons/Summon/PlantationStaff.cs @@ -1,8 +1,8 @@ -using Terraria.DataStructures; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; -using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -11,62 +11,50 @@ namespace CalamityMod.Items.Weapons.Summon public class PlantationStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + + public static float EnemyDistanceDetection = 1600f; + public static float ChargingSpeed = 35f; + + public static int ThornballAmount = 2; + public static float ThornballFireRate = 90f; // In frames. + public static float ThornballSpeed = 20f; + + public static float SeedBurstDelay = 30f; // In frames. + public static float SeedBetweenBurstDelay = 10f; // In frames. + public static float SeedSpeed = 25f; + public static int SeedAmountPerBurst = 3; + public static int SeedBurstAmount = 3; + + public static float SporeStartVelocity = 3f; + + public static float TimeBeforeRamming = 15f; // In frames. + public static float RamTime = 240f; // In frames. + + public static float TentacleSpeed = 25f; + public override void SetDefaults() { - Item.damage = 55; - Item.mana = 10; - Item.width = 66; - Item.height = 70; - Item.useTime = Item.useAnimation = 20; - Item.useStyle = ItemUseStyleID.Swing; - Item.noMelee = true; + Item.damage = 58; + Item.DamageType = DamageClass.Summon; + Item.shoot = ModContent.ProjectileType(); Item.knockBack = 1f; + + Item.mana = 10; + Item.useTime = Item.useAnimation = 20; + Item.width = 46; + Item.height = 48; + Item.noMelee = true; Item.value = CalamityGlobalItem.Rarity8BuyPrice; Item.rare = ItemRarityID.Yellow; + Item.useStyle = ItemUseStyleID.Swing; Item.UseSound = SoundID.Item76; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; - Item.DamageType = DamageClass.Summon; } - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0 && player.maxMinions >= 3; + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - CalamityUtils.KillShootProjectileMany(player, new int[] { type, ModContent.ProjectileType() }); - - float speed = Item.shootSpeed; - player.itemTime = Item.useTime; - Vector2 playerPos = player.RotatedRelativePoint(player.MountedCenter, true); - float directionX = (float)Main.mouseX + Main.screenPosition.X - playerPos.X; - float directionY = (float)Main.mouseY + Main.screenPosition.Y - playerPos.Y; - if (player.gravDir == -1f) - { - directionY = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - playerPos.Y; - } - Vector2 spinningpoint = new Vector2(directionX, directionY); - float vectorDist = spinningpoint.Length(); - if ((float.IsNaN(spinningpoint.X) && float.IsNaN(spinningpoint.Y)) || (spinningpoint.X == 0f && spinningpoint.Y == 0f)) - { - spinningpoint.X = (float)player.direction; - spinningpoint.Y = 0f; - vectorDist = speed; - } - else - { - vectorDist = speed / vectorDist; - } - spinningpoint.X *= vectorDist; - spinningpoint.Y *= vectorDist; - playerPos.X = (float)Main.mouseX + Main.screenPosition.X; - playerPos.Y = (float)Main.mouseY + Main.screenPosition.Y; - spinningpoint = spinningpoint.RotatedBy(MathHelper.PiOver2, default); - int p = Projectile.NewProjectile(source, playerPos + spinningpoint, spinningpoint, type, damage, knockback, player.whoAmI, 0f, 0f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + Projectile.NewProjectile(source, Main.MouseWorld, Main.rand.NextVector2Circular(2f, 2f), type, damage, knockback, player.whoAmI); return false; } @@ -74,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Summon { CreateRecipe(). AddIngredient(). - AddIngredient(ItemID.Smolstar). //Blade Staff + AddIngredient(ItemID.Smolstar). // Blade Staff. AddIngredient(12). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Weapons/Summon/SandSharknadoStaff.cs b/Items/Weapons/Summon/SandSharknadoStaff.cs index 568f0131ee..4ad7821460 100644 --- a/Items/Weapons/Summon/SandSharknadoStaff.cs +++ b/Items/Weapons/Summon/SandSharknadoStaff.cs @@ -11,17 +11,17 @@ namespace CalamityMod.Items.Weapons.Summon public class SandSharknadoStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; - #region Other stats for easy modifcation + #region Other stats for easy modification - public const float ProjVel = 30f; + public const float ProjSpeed = 30f; - public const float FireSpeed = 120f; // In frames. 60 frames = 2 seconds. + public const float FireSpeed = 50f; // In frames. 60 frames = 1 second. #endregion public override void SetDefaults() { - Item.damage = 47; + Item.damage = 94; Item.knockBack = 2f; Item.mana = 10; diff --git a/Items/Weapons/Summon/Sirius.cs b/Items/Weapons/Summon/Sirius.cs index 0c2fe7d83c..8ce5f59d0f 100644 --- a/Items/Weapons/Summon/Sirius.cs +++ b/Items/Weapons/Summon/Sirius.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void AddRecipes() { CreateRecipe(). - AddIngredient(). + AddIngredient(). AddIngredient(5). AddIngredient(2). AddIngredient(12). diff --git a/Items/Weapons/Summon/GodspawnHelixStaff.cs b/Items/Weapons/Summon/StarspawnHelixStaff.cs similarity index 95% rename from Items/Weapons/Summon/GodspawnHelixStaff.cs rename to Items/Weapons/Summon/StarspawnHelixStaff.cs index b061a87027..fd98d1a8b1 100644 --- a/Items/Weapons/Summon/GodspawnHelixStaff.cs +++ b/Items/Weapons/Summon/StarspawnHelixStaff.cs @@ -7,7 +7,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class GodspawnHelixStaff : ModItem, ILocalizedModType + [LegacyName("GodspawnHelixStaff")] + public class StarspawnHelixStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; public override void SetDefaults() diff --git a/Items/Weapons/Summon/GodspawnHelixStaff.png b/Items/Weapons/Summon/StarspawnHelixStaff.png similarity index 100% rename from Items/Weapons/Summon/GodspawnHelixStaff.png rename to Items/Weapons/Summon/StarspawnHelixStaff.png diff --git a/Items/Weapons/Summon/UniverseSplitter.cs b/Items/Weapons/Summon/UniverseSplitter.cs index c7d1ffdbc9..7fc0d92333 100644 --- a/Items/Weapons/Summon/UniverseSplitter.cs +++ b/Items/Weapons/Summon/UniverseSplitter.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon public const float ItemUseDustMaxRadius = 36f; public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 14)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 14)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Weapons/Summon/SunGodStaff.cs b/Items/Weapons/Summon/VengefulSunStaff.cs similarity index 95% rename from Items/Weapons/Summon/SunGodStaff.cs rename to Items/Weapons/Summon/VengefulSunStaff.cs index d6aa53d93f..f899f99f52 100644 --- a/Items/Weapons/Summon/SunGodStaff.cs +++ b/Items/Weapons/Summon/VengefulSunStaff.cs @@ -8,7 +8,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class SunGodStaff : ModItem, ILocalizedModType + [LegacyName("SunGodStaff")] + public class VengefulSunStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; public override void SetDefaults() diff --git a/Items/Weapons/Summon/SunGodStaff.png b/Items/Weapons/Summon/VengefulSunStaff.png similarity index 100% rename from Items/Weapons/Summon/SunGodStaff.png rename to Items/Weapons/Summon/VengefulSunStaff.png diff --git a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson index 77baa3201a..3a8c273a02 100644 --- a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson +++ b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson @@ -1,7 +1,9 @@ //Abyss Enemies +BabyCannonballJellyfish: These creatures have been hunted for centuries now. They are widely used as ammunition in ships or even as normal bombs. Despite this, they never truly vanish, as if an external power kept this species alive. Bloatfish: More geological than biological, bloatfish have sticky glue-like skin that they use to cover their bodies in voidstone. Though it protects them from predators, their immense weight has sunk them to the deepest parts of the Abyss. BobbitWorm: Hiding away in the darkest corners of the void to strike at unsuspecting prey, bobbit worms take full advantage of the Abyss’ darkness. To live here, in the most extreme environment in the world, a creature must either be truly mighty, learn to use the environment to survive, or both. BoxJellyfish: Larger than the average jellyfish, the sting of these persistent pests packs a powerful punch. Though they can be found in most large bodies of water, they are locally extinct around Ilmeris after the Brimstone Witch turned her hexes against the kingdom. +CannonballJellyfish: These jellyfishes help keep the Abyss clean from the sulphuric poisoning. Unlike most hard-skinned creatures in the Sulphurous Sea, they instead use their stingers to drain the acid near them to later use it for self-defense. ChaoticPuffer: These creatures inhale trace amounts of scoria in the water while inflating, heating the liquid inside of them immensely. Hot enough to melt iron in this state, they cause horrific burns to those they make contact with, and predators attempting to consume them are boiled from the inside out. ColossalSquid: This species of squid has grown immensely in size and strength due to the effects Silva’s essence has had on them. As they are able to consume the growths she caused directly due to being herbivores in the past, more life flows within them than nearly every other Abyss creature. Cuttlefish: Using natural camouflage to hide from greater predators and catch unsuspecting prey, cuttlefish wait patiently on the ground for their time to strike. They chase other creatures relentlessly once disturbed, with ferocity enough to scare off any of their would-be predators. diff --git a/Localization/en-US/Mods.CalamityMod.BossChecklistIntegration.hjson b/Localization/en-US/Mods.CalamityMod.BossChecklistIntegration.hjson index 91c3126c8d..8e5ebbf729 100644 --- a/Localization/en-US/Mods.CalamityMod.BossChecklistIntegration.hjson +++ b/Localization/en-US/Mods.CalamityMod.BossChecklistIntegration.hjson @@ -1,19 +1,203 @@ AcidRainT1: { EntryName: Acid Rain - SpawnInfo: Use a [i:CalamityMod/CausticTear] or wait for the invasion to occur naturally after the Eye of Cthulhu is defeated. + SpawnInfo: Use a [i:CalamityMod/CausticTear] or wait for an acidic downpour to occur naturally after the Eye of Cthulhu is defeated. } AcidRainT2: { EntryName: Acid Rain (Tier 2) - SpawnInfo: Use a [i:CalamityMod/CausticTear] or wait for the invasion to occur naturally after the Aquatic Scourge is defeated + SpawnInfo: Use a [i:CalamityMod/CausticTear] or wait for an acidic downpour to occur naturally after the Aquatic Scourge is defeated. } AcidRainT3: { EntryName: Acid Rain (Tier 3) - SpawnInfo: Use a [i:CalamityMod/CausticTear] or wait for the invasion to occur naturally after the Polterghast is defeated + SpawnInfo: Use a [i:CalamityMod/CausticTear] or wait for an acidic downpour to occur naturally after Polterghast is defeated. +} + +AquaticScourge: { + EntryName: Aquatic Scourge + SpawnInfo: Use a [i:CalamityMod/Seafood] in the Sulphurous Sea, or wait for it to spawn naturally in the Sulphurous Sea. + DespawnMessage: "[c/F0E68C:The poisoned scourge swims back to the tranquil, open ocean.]" +} + +AstrumAureus: { + SpawnInfo: Use an [i:CalamityMod/AstralChunk] at night in the Astral Infection. + DespawnMessage: "[c/FFD700:Aureus has neutralized all threats. Resume prior reconnaissance.]" +} + +AstrumDeus: { + EntryName: Astrum Deus + SpawnInfo: Use a [i:CalamityMod/TitanHeart] or [i:CalamityMod/Starcore] as offering at an [i:CalamityMod/AstralBeaconItem]. + DespawnMessage: "[c/FFD700:The infected deity retreats to the heavens.]" } BossRush: { EntryName: Boss Rush - SpawnInfo: Use a [i:CalamityMod/Terminus] found at the bottom of the Abyss + SpawnInfo: Use the [i:CalamityMod/Terminus] found at the bottom of the Abyss. +} + +BrimstoneElemental: { + SpawnInfo: Use a [i:CalamityMod/CharredIdol] in the Brimstone Crags or Azafure. + DespawnMessage: "[c/DC143C:The elemental ever maintains her somber vigil over Azafure…]" +} + +Calamitas: { + EntryName: Supreme Witch, Calamitas + SpawnInfo: Use [i:CalamityMod/AshesofCalamity] or a [i:CalamityMod/CeremonialUrn] as offering at an [i:CalamityMod/AltarOfTheAccursedItem]. + DespawnMessage: "[c/FFA500:The Witch vanishes, leaving nothing but stifling heat in her wake.]" +} + +CalamitasClone: { + SpawnInfo: Use an [i:CalamityMod/EyeofDesolation] at night. + DespawnMessage: "[c/FFA500:The clone spits a bit of blood in disgust and vanishes.]" +} + +CeaselessVoid: { + EntryName: Ceaseless Void + SpawnInfo: Use a [i:CalamityMod/RuneofKos] in the dungeon. + DespawnMessage: "[c/4B0082:The ancient spatial rift slips away to places unknown.]" +} + +Crabulon: { + SpawnInfo: Use a [i:CalamityMod/DecapoditaSprout] in a Glowing Mushroom biome. + DespawnMessage: "[c/6495ED:The monstrous mycelial crab shuffles away…]" +} + +CragmawMire: { + SpawnInfo: + ''' + Spawns during the Acid Rain event after the Aquatic Scourge has been defeated. + Start an acidic downpour with a [i:CalamityMod/CausticTear] or wait for one to occur naturally. + ''' + DespawnMessage: "[c/F0E68C:The Cragmaw Mire buries itself within the sand.]" +} + +Cryogen: { + SpawnInfo: Use a [i:CalamityMod/CryoKey] in the tundra. + DespawnMessage: "[c/00FFFF:Cryogen disappears amidst the biting winds of the blizzard.]" +} + +DesertScourge: { + EntryName: Desert Scourge + SpawnInfo: Use a [i:CalamityMod/DesertMedallion] in the desert. + DespawnMessage: "[c/EEE8AA:The scourge of the desert delves back into the sand.]" +} + +DevourerofGods: { + EntryName: Devourer of Gods + SpawnInfo: Use a [i:CalamityMod/CosmicWorm]. + DespawnMessage: "[c/00FFFF:The Devourer of Gods haughtily returns to the depths of the Distortion.]" +} + +Dragonfolly: { + SpawnInfo: Use [i:CalamityMod/ExoticPheromones] in the jungle. + DespawnMessage: "[c/FFD700:The folly returns to its secluded roost.]" +} + +ExoMechs: { + EntryName: The Exo Mechs + SpawnInfo: Use a fully-powered Codebreaker to contact Draedon… + DespawnMessage: "[c/7FFFD4:An imperfection after all… what a shame.]" +} + +GiantClam: { + SpawnInfo: Spawns naturally underwater in the Sunken Sea. + DespawnMessage: "[c/7FFFD4:The Giant Clam returns into hiding in its grotto.]" +} + +GreatSandShark: { + SpawnInfo: Kill 10 Sand Sharks after defeating Plantera or use a [i:CalamityMod/SandstormsCore] in the desert. + DespawnMessage: "[c/DAA520:The apex predator of the sands disappears between the dunes.]" +} + +HiveMind: { + SpawnInfo: Kill a Hive Tumor in the Corruption or use a [i:CalamityMod/Teratoma] in the Corruption. + DespawnMessage: "[c/9400D3:The Hive Mind flits away to brood elsewhere.]" +} + +Leviathan: { + EntryName: Anahita & The Leviathan + SpawnInfo: Defeat an elusive singer in the ocean… + DespawnMessage: "[c/7FFFD4:The aquatic outcasts return to their lonesome company.]" +} + +Mauler: { + SpawnInfo: + ''' + Spawns during the Acid Rain event after Polterghast has been defeated. + Start an acidic downpour with a [i:CalamityMod/CausticTear] or wait for one to occur naturally. + ''' + DespawnMessage: "[c/F0E68C:The brutish shark looks elsewhere to turn its aggression.]" +} + +NuclearTerror: { + SpawnInfo: + ''' + Spawns during the Acid Rain event after Polterghast has been defeated. + Start an acidic downpour with a [i:CalamityMod/CausticTear] or wait for one to occur naturally. + ''' + DespawnMessage: "[c/F0E68C:The radioactive aberration fades away in a sickly light.]" +} + +OldDuke: { + EntryName: Old Duke + SpawnInfo: Finish the Tier 3 Acid Rain event, or fish using a [i:CalamityMod/BloodwormItem] as bait in the Sulphurous Sea. + DespawnMessage: "[c/F0E68C:The old duke retreats further into the acidic downpour.]" +} + +Perforators: { + EntryName: The Perforators + SpawnInfo: Kill a Perforator Cyst in the Crimson or use a [i:CalamityMod/BloodyWormFood] in the Crimson. + DespawnMessage: "[c/DC143C:The Perforators search for more hosts to gorge themselves on.]" +} + +PlaguebringerGoliath: { + SpawnInfo: Use an [i:CalamityMod/Abombination] in the jungle. + DespawnMessage: "[c/00FF00:SPECIMENS EUTHANIZED. EXITING COMBAT PROTOCOL.]" +} + +Polterghast: { + EntryName: Polterghast + SpawnInfo: Kill 30 Phantom Spirits or use a [i:CalamityMod/NecroplasmicBeacon] in the dungeon. + DespawnMessage: "[c/B0E0E6:The volatile phantasm disperses in an echoing wail.]" +} + +ProfanedGuardians: { + EntryName: Profaned Guardians + SpawnInfo: Use a [i:CalamityMod/ProfanedShard] in the hallow or in the underworld. + DespawnMessage: "[c/FFA500:The Guardians are recalled to their Goddess' side.]" +} + +Providence: { + SpawnInfo: Use a [i:CalamityMod/ProfanedCore] in the hallow or in the underworld. + DespawnMessage: "[c/FFA500:The Profaned Goddess veils herself in purifying flame, leaving only ashes behind…]" +} + +Ravager: { + EntryName: Ravager + SpawnInfo: Use a [i:CalamityMod/DeathWhistle]. + DespawnMessage: "[c/B22222:The Ravager resumes its aimless, horrific rampage.]" +} + +Signus: { + EntryName: Signus + SpawnInfo: Use a [i:CalamityMod/RuneofKos] in the underworld. + DespawnMessage: "[c/BA55D3:Signus inexplicably ceases to be where he once was.]" +} + +SlimeGod: { + EntryName: The Slime God + SpawnInfo: Use an [i:CalamityMod/OverloadedSludge]. + DespawnMessage: "[c/BA5533:The grimy, gelatinous God hops away, its vengeance achieved.]" +} + +StormWeaver: { + EntryName: Storm Weaver + SpawnInfo: Use a [i:CalamityMod/RuneofKos] high in the sky or in space. + DespawnMessage: "[c/EE82EE:Storm Weaver hides itself within the fierce anvilhead clouds.]" +} + +Yharon: { + EntryName: Yharon + SpawnInfo: Use a [i:CalamityMod/YharonEgg]. + DespawnMessage: "[c/FFA500:Yharon soars out of sight, his task fulfilled.]" } \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 23df2af9c8..7cfd0764de 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -754,7 +754,7 @@ KamiBuff: { Mushy: { DisplayName: Mushy - Description: Increased defense by 6 and life regen by 2 + Description: Increased defense by 6 and life regen by 1HP/s } PhantomicEmpowerment: { @@ -988,12 +988,12 @@ WitherDebuff: { AbandonedSlimeBuff: { DisplayName: Astral Jelly - Description: The mini astrageldon slime will protect you + Description: Back from the heavens just to protect you! } AncientMineralSharkBuff: { DisplayName: Ancient Mineral Shark - Description: Ancient yet so dangerous + Description: So ancient yet just as powerful } AquaticStar: { @@ -1051,7 +1051,7 @@ BrittleStar: { Description: The brittle star will protect you } -Calamari: { +CalamarisLamentBuff: { DisplayName: Calamari Description: The squid will protect you } @@ -1311,7 +1311,7 @@ Phantom: { Description: The phantom will protect you } -PlantationBuff: { +PlantationStaffBuff: { DisplayName: Plantation Description: The miniature Plantera will protect you } @@ -1321,10 +1321,10 @@ PoleWarperBuff: { Description: Sentient magnets are attracted to you } -ProfanedBabs: { +ProfanedSoulGuardians: { DisplayName: The Profaned Soul - Description: The Profaned Babs will fight for and defend you! - VanityDescription: The Profaned Babs will accompany you! + Description: The Profaned Soul Guardians will fight for and defend you! + VanityDescription: The Profaned Soul Guardians will accompany you! } PuffWarriorBuff: { @@ -1403,8 +1403,8 @@ SnakeEyesBuff: { } SolarGodSpiritBuff: { - DisplayName: Solar God Spirit - Description: The solar god spirit will protect you + DisplayName: Vengeful Solar Spirit + Description: A furious Sun spirit is ready to protect you } SolarSpirit: { @@ -1479,12 +1479,12 @@ WulfrumDroidBuff: { PinkJellyRegen: { DisplayName: Pink Jelly Regen - Description: The power of goo refreshes you, life regen increased by 4 + Description: The power of goo refreshes you, life regen increased by 2HP/s } GreenJellyRegen: { DisplayName: Green Jelly Regen - Description: The regenerative goo empowers you, life regen increased by 5 + Description: The regenerative goo empowers you, life regen increased by 2.5HP/s } AbsorberRegen: { @@ -1492,7 +1492,7 @@ AbsorberRegen: { Description: ''' You are blessed by the culmimation of nature's powers - Life regen increased by 6, damage increased by 8%, damage reduction increased by 5% + Life regen increased by 3HP/s, damage increased by 8%, damage reduction increased by 5% ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Configs.hjson b/Localization/en-US/Mods.CalamityMod.Configs.hjson index e15c05bcc1..fc74dd738b 100644 --- a/Localization/en-US/Mods.CalamityMod.Configs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Configs.hjson @@ -235,6 +235,15 @@ CalamityConfig: { ''' } + MusicModReminderMessage: { + Label: "[i:MusicBoxMartians] Music Mod Reminder Message" + Tooltip: + ''' + Enable or disable the status message which reminds users to install the Calamity Music Mod. + This message plays on world entry. + ''' + } + NerfExpertDebuffs: { Label: "[i:AnkhCharm] Remove Increased Debuff Duration" Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.GameTips.hjson b/Localization/en-US/Mods.CalamityMod.GameTips.hjson index 019ff8cc1f..6cc6a2295b 100644 --- a/Localization/en-US/Mods.CalamityMod.GameTips.hjson +++ b/Localization/en-US/Mods.CalamityMod.GameTips.hjson @@ -1,19 +1,19 @@ -SunkenSeaTip: Deep below the Underground Desert lie the ruined outskirts of a fallen kingdom. -ArsenalLabTip: Old labs can be found scattered throughout the Underground. -PlanetoidTip: You can find Planetoids in outer space! -AbyssTip: The Abyss can be found deep below the Sulphurous Sea. It's very difficult to explore without proper diving gear. -BanditTip: The Bandit is most interested in those who save up enough money worth to swindle. +SunkenSeaTip: Deep below in the Desert lies the ruined outskirts of a fallen kingdom. +ArsenalLabTip: Old and abandoned labs can be found scattered below the surface. +PlanetoidTip: You can find Planetoids high up in Space! +AbyssTip: The Abyss can be found deep below the Sulphurous Sea. Be sure to have proper diving gear when exploring it. +BanditTip: The Bandit won't steal from the poor. If you want to see them, you will need a lot of money to pique their attention. RefundTip: If you've been reforging a lot with the Goblin Tinkerer, it might pay off to give the Bandit a visit. DrunkPrincessTip: The Drunk Princess is great to party with. If you carry her favorite vodka, she might move in. SeaKingTip: The Sea King used to like clams. He changed his mind when he got eaten by one. AmidiasBlessingTip: The Sea King can provide a bubble to aid with breathing underwater to any who ask for help. -ArchmageTip: The Archmage can be freed if you destroy the very castle he was imprisoned in. -BrimstoneWitchTip: The Brimstone Witch can enchant items to grant them new powers. +ArchmageTip: The Archmage can be freed if you manage to destroy the cell he was imprisoned in. +BrimstoneWitchTip: The Brimstone Witch can enchant your items to grant them new powers. TitanHeartTip: Titan Hearts can be used as an offering at a Beacon found in the Astral Infection. -NightProvTip: Summoning the sun goddess under the light of the moon massively empowers her strength and endurance. -DayEoLTip: Summoning the fae goddess under the light of day will start a vicious and persistent battle. +NightProvTip: Summoning the Profaned Goddess under the light of the moon massively empowers her strength and endurance. +DayEoLTip: Summoning the fae monarch under the light of day will start a vicious and persistent battle. BossEnemyTip: Killing the most harmless of enemies can awaken the wrath of a much stronger monster. Slay them at your own risk! -RoDAbyssTip: Use the Rod of Discord in the Abyss at your own risk. The chaotic traces left behind may attract the attention of unwanted foes. +RoDAbyssTip: Use the Rod of Discord in the Abyss at your own risk. The light left behind may attract the attention of unwanted foes. TerminusTip: An ancient artifact resides at the bottom of the Abyss. Use with great caution. CodebreakerTip: The Codebreaker can be upgraded, allowing you to decrypt new schematics found in various labs around the world. ChargeTip: Certain weaponry requires charge to use. Weapons can be charged at a Charging Station with Draedon Power Cells. diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson index 53a9782fa8..b6ae9baf10 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson @@ -14,8 +14,8 @@ DrewsWings: { DisplayName: Drew's Wings Tooltip: ''' - Horizontal speed: 12.00 - Acceleration multiplier: 3.0 + Horizontal speed: 11.50 + Acceleration multiplier: 2.9 Excellent vertical speed Flight time: 361 'Absolutely Fabulous' @@ -93,7 +93,7 @@ SilvaWings: { DisplayName: Silva Wings Tooltip: ''' - Horizontal speed: 11.00 + Horizontal speed: 10.50 Acceleration multiplier: 2.8 Excellent vertical speed Flight time: 270 @@ -149,7 +149,7 @@ TarragonWings: { Acceleration multiplier: 2.5 Great vertical speed Flight time: 250 - +15 defense and +2 life regen while wearing the Tarragon Armor + +15 defense and +1 HP/s life regen while wearing the Tarragon Armor 'Born of the jungle' ''' } @@ -160,7 +160,7 @@ TracersCelestial: { ''' Counts as wings Horizontal speed: 9.00 - Acceleration multiplier: 2.5 + Acceleration multiplier: 2.6 Good vertical speed Flight time: 140 24% increased running acceleration and greater mobility on ice @@ -175,8 +175,8 @@ TracersElysian: { Tooltip: ''' Counts as wings - Horizontal speed: 10.50 - Acceleration multiplier: 2.75 + Horizontal speed: 10.00 + Acceleration multiplier: 2.7 Great vertical speed Flight time: 180 36% increased running acceleration and greater mobility on ice @@ -191,8 +191,8 @@ TracersSeraph: { Tooltip: ''' Counts as wings - Horizontal speed: 12.00 - Acceleration multiplier: 3.0 + Horizontal speed: 11.00 + Acceleration multiplier: 2.8 Excellent vertical speed Flight time: 250 50% increased running acceleration and greater mobility on ice diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index c678c3afb6..38ea640c70 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -65,8 +65,9 @@ AeroStone: { DisplayName: Aero Stone Tooltip: ''' - Increases flight time, movement speed and jump speed by 10% - One of the ancient relics + Provides an additional 45 flight time + Movement speed and acceleration are greatly increased when you are out of flight time + 'One of the ancient relics' ''' } @@ -240,25 +241,6 @@ AsgardsValor: { ''' } -Purity: { - DisplayName: Purity - Tooltip: - ''' - +100 max life - Grants +3 to +7 HP/s life regen based on missing health - Provides life regeneration equivalent to standing in Honey - Standing still grants extremely powerful regen - Grants 20 defense and continuous healing while afflicted with any debuff - The healing eventually slows down if debuffed for an extended period of time - Massively boosts natural life regen while afflicted with any debuff - Each debuff beyond the first grants 8 additional defense - Granted defense fades away slowly when not afflicted with any debuffs - Makes weak damage over time debuffs harmless and halves the duration of all but the strongest debuffs - You emit shining blue light if visibility is enabled - 'A once putrid crystal, now glimmering with immaculate purity' - ''' -} - BadgeofBravery: { DisplayName: Badge of Bravery Tooltip: @@ -332,7 +314,7 @@ BloomStone: { Both of these effects are maximized from noon to sunset Flowers grow if you are standing on grass Random dye plants will grow while standing on grassless dirt - One of the ancient relics + 'One of the ancient relics' ''' } @@ -359,20 +341,6 @@ Calamity: { ''' } -InfectedJewel: { - DisplayName: Infected Jewel - Tooltip: - ''' - +1 HP/s life regen - Grants 16 defense and +2 HP/s life regen while afflicted with any debuff - Massively boosts natural life regen while afflicted with any debuff - Granted defense fades away quickly when not afflicted with any debuffs - Each debuff beyond the first grants 5 additional defense - Makes the Astral Infection debuff harmless - 'A beautiful gemstone tarnished by spaceborne rot' - ''' -} - ChaosStone: { DisplayName: Chaos Stone Tooltip: @@ -380,7 +348,7 @@ ChaosStone: { Mana Sickness from drinking mana potions is replaced by Mana Burn Mana Burn deals damage over time relative to the intensity of the debuff This debuff does not reduce your magic damage - One of the ancient relics + 'One of the ancient relics' ''' } @@ -474,9 +442,9 @@ CryoStone: { DisplayName: Cryo Stone Tooltip: ''' - One of the ancient relics Multiplies all cold-based debuff damage by 1.5 Creates a rotating ice shield around you that damages and slows down enemies on contact + 'One of the ancient relics' ''' } @@ -497,7 +465,7 @@ DaawnlightSpiritOrigin: { ''' } -DarkGodsSheath: { +DarkMatterSheath: { DisplayName: Dark Matter Sheath Tooltip: ''' @@ -799,7 +767,7 @@ FungalSymbiote: { Tooltip: ''' You grow mushrooms on the grass beneath you - Consuming mushrooms provides the Mushy buff, increasing defense by 6 and granting 0.5 HP/s life regen + Consuming mushrooms provides the Mushy buff, increasing defense by 6 and granting 1 HP/s life regen All mushroom-based weapons deal 10% more damage and emit non-damaging mushrooms ''' } @@ -850,14 +818,14 @@ GladiatorsLocket: { GloveOfPrecision: { DisplayName: Glove of Precision - Tooltip: Decreases rogue attack speed by 15% but increases damage by 13%, crit by 15% and velocity by 25% + Tooltip: Decreases rogue attack speed by 15%, but increases damage by 10%, crit by 15% and velocity by 15% } GloveOfRecklessness: { DisplayName: Glove of Recklessness Tooltip: ''' - Increases rogue attack speed by 15% but decreases damage by 13% + Increases rogue attack speed by 15%, but decreases damage by 10% and crit by 10% 15% increased stealth regeneration Adds inaccuracy to rogue weapons ''' @@ -876,7 +844,7 @@ GrandGelatin: { DisplayName: Grand Gelatin Tooltip: ''' - 10% increased movement speed and jump speed + 12% increased movement speed and jump speed Using a healing potion will spawn a cleansing aura Walking into the aura removes all debuffs and defense damage one time The aura grants +2.5 HP/s life regen for all players inside for 8 seconds @@ -968,6 +936,20 @@ HowlsHeart: { ''' } +InfectedJewel: { + DisplayName: Infected Jewel + Tooltip: + ''' + +1 HP/s life regen + Grants 16 defense and +2 HP/s life regen while afflicted with any debuff + Massively boosts natural life regen while afflicted with any debuff + Granted defense fades away quickly when not afflicted with any debuffs + Each debuff beyond the first grants 5 additional defense + Makes the Astral Infection debuff harmless + 'A beautiful gemstone tarnished by spaceborne rot' + ''' +} + InkBomb: { DisplayName: Ink Bomb Tooltip: @@ -1039,7 +1021,7 @@ LumenousAmulet: { Tooltip: ''' Attacks inflict the Crush Depth debuff - Grants immunity to the Crush Depth debuff + Grants immunity to the Riptide and Crush Depth debuffs While in the abyss you gain 25% increased max life Provides a moderate amount of light in the abyss ''' @@ -1284,10 +1266,14 @@ ProfanedSoulArtifact: { DisplayName: Profaned Soul Artifact Tooltip: ''' - Summons a healer guardian, which heals for a certain amount of health every few seconds - Summons a defensive guardian, which boosts your movement speed and damage resistance - Summons an offensive guardian, which boosts your minion slots - If you get hit, most of their effects will disappear for 5 seconds + Summons a healer guardian, which heals for 15 health every few seconds + Summons a defensive guardian, which provides a weak shield reinforced by profaned rocks + Upon being depleted, the barrier implodes sending the profaned rocks hurtling outwards + The barrier starts recharging 5 seconds after being hit + Recharging from zero to full charge takes 2 seconds + Being hit again while recharging restarts the charge timer + Summons an offensive guardian, which boosts your minion slots by 1 + The offensive guardian will occasionally fire spears on hit Purity ''' } @@ -1318,13 +1304,32 @@ ProfanedSoulCrystal: { ''' } +Purity: { + DisplayName: Purity + Tooltip: + ''' + +100 max life + Grants +3 to +7 HP/s life regen based on missing health + Provides life regeneration equivalent to standing in Honey + Standing still grants extremely powerful regen + Grants 20 defense and continuous healing while afflicted with any debuff + The healing eventually slows down if debuffed for an extended period of time + Massively boosts natural life regen while afflicted with any debuff + Each debuff beyond the first grants 8 additional defense + Granted defense fades away slowly when not afflicted with any debuffs + Makes weak damage over time debuffs harmless and halves the duration of all but the strongest debuffs + You emit shining blue light if visibility is enabled + 'A once putrid crystal, now glimmering with immaculate purity' + ''' +} + QuiverofNihility: { DisplayName: Quiver of Nihility Tooltip: ''' 5% increased ranged critical strike chance Summons a ring of four void fields to orbit you - Arrows that pass through these fields gain a 100% damage boost and double the speed + Arrows that pass through these fields gain a 75% damage boost and double the speed 'Filled with a substance darker than the night sky' ''' } @@ -1389,7 +1394,7 @@ RoseStone: { Tooltip: ''' Summons a Brimstone Elemental to fight for you - One of the ancient relics + 'One of the ancient relics' ''' } @@ -1726,7 +1731,7 @@ TheAbsorber: { DisplayName: The Absorber Tooltip: ''' - 10% increased movement and jump speed + 12% increased movement and jump speed Enemies take immense damage when they touch you and are afflicted with a damaging sickeness debuff that reduces damage reduction significantly Using a healing potion will spawn a cleansing aura Walking into the aura removes all debuffs and defense damage one time @@ -1817,7 +1822,7 @@ TheSponge: { Tooltip: ''' Projects a quantum foam barrier that absorbs up to 180 damage - The barrier grants 30 defense and reduces damage taken by 30% while active + The barrier grants 30 defense and reduces damage taken by 10% while active The barrier starts recharging 9 seconds after being hit Recharging from zero to full charge takes 6 seconds Being hit again while recharging restarts the charge timer @@ -1917,7 +1922,7 @@ VeneratedLocket: { VitalJelly: { DisplayName: Vital Jelly - Tooltip: 10% increased movement and jump speed + Tooltip: 12% increased movement and jump speed } VoidofCalamity: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson index 1ef58d16aa..bbf839d654 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson @@ -105,7 +105,7 @@ BloodflareHeadMagic: { BloodflareHeadMelee: { DisplayName: Bloodflare Ram Mask - Tooltip: 10% increased melee damage + Tooltip: 10% increased melee damage and 5% increased melee critical strike chance SetBonus: ''' 18% increased melee speed diff --git a/Localization/en-US/Mods.CalamityMod.Items.DraedonItems.hjson b/Localization/en-US/Mods.CalamityMod.Items.DraedonItems.hjson index 1df30df184..248f67d08b 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.DraedonItems.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.DraedonItems.hjson @@ -25,7 +25,7 @@ AuricQuantumCoolingCell: { Can be placed in the Codebreaker, completing it Greatly decreases decryption time The completion of the Codebreaker allows you to make contact with its original creator - [c/8B00000:Attempting to do so may have dire consequences] + [c/8B00000:Its creator is ready, and he hopes you are too.] ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson index db8b94aaad..5291f16c9e 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson @@ -8,6 +8,11 @@ AndroombaItem: { ''' } +BabyCannonballJellyfishItem: { + DisplayName: "{$Mods.CalamityMod.NPCs.BabyCannonballJellyfish.DisplayName}" + Tooltip: "" +} + BabyFlakCrabItem: { DisplayName: "{$Mods.CalamityMod.NPCs.BabyFlakCrab.DisplayName}" Tooltip: "" diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index d2815713ef..992be9eeec 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -158,6 +158,11 @@ AtlasBanner: { Tooltip: "{$CommonItemTooltip.BannerBonus}Atlas" } +BabyCannonballJellyfishBanner: { + DisplayName: Baby Cannonball Jellyfish Banner + Tooltip: "{$CommonItemTooltip.BannerBonus}Baby Cannonball Jellyfish" +} + BabyFlakCrabBanner: { DisplayName: Baby Flak Crab Banner Tooltip: "{$CommonItemTooltip.BannerBonus}Baby Flak Crab" @@ -213,6 +218,11 @@ CalamityEyeBanner: { Tooltip: "{$CommonItemTooltip.BannerBonus}Calamity Eye" } +CannonballJellyfishBanner: { + DisplayName: Cannonball Jellyfish Banner + Tooltip: "{$CommonItemTooltip.BannerBonus}Cannonball Jellyfish" +} + ChaoticPufferBanner: { DisplayName: Chaotic Puffer Banner Tooltip: "{$CommonItemTooltip.BannerBonus}Chaotic Puffer" @@ -900,6 +910,11 @@ AuricToilet: { ''' } +BabyCannonballJellyfishBowl: { + DisplayName: Baby Cannonball Jellyfish Bowl + Tooltip: "" +} + BabyFlakCrabCage: { DisplayName: Baby Flak Crab Cage Tooltip: "" @@ -932,7 +947,7 @@ BrimstoneElementalRelic: { CalamitasCloneRelic: { DisplayName: Calamitas Clone Relic - Tooltip: A glimpse into what could have been... + Tooltip: "" } CalamitasRelic: { @@ -957,7 +972,7 @@ CragmawMireRelic: { CryogenRelic: { DisplayName: Cryogen Relic - Tooltip: A glimpse into what could have been... + Tooltip: "" } DesertScourgeRelic: { @@ -977,7 +992,7 @@ DraedonRelic: { DragonfollyRelic: { DisplayName: Dragonfolly Relic - Tooltip: A glimpse into what could have been... + Tooltip: "" } GiantClamRelic: { @@ -3930,70 +3945,98 @@ HardenedEutrophicSand: { FireTurret: { DisplayName: Fire Turret - Tooltip: "" + Tooltip: + ''' + Roasts nearby enemies with a flamethrower at full blast + Cannot attack while a boss is alive + ''' } HostileFireTurret: { DisplayName: Hostile Fire Turret - Tooltip: "" + Tooltip: Roasts nearby players with a flamethrower at full blast } HostileIceTurret: { DisplayName: Hostile Ice Turret - Tooltip: "" + Tooltip: Lobs fragile ice mist bombs at nearby players } HostileLabTurret: { DisplayName: Hostile Lab Turret - Tooltip: "" + Tooltip: Shoots laser beams at nearby players } HostileLaserTurret: { DisplayName: Hostile Laser Turret - Tooltip: "" + Tooltip: Blasts nearby players with lightning-fast laser beams } HostileOnyxTurret: { DisplayName: Hostile Onyx Turret - Tooltip: "" + Tooltip: Shoots a shotgun spread of bullets at nearby players } HostilePlagueTurret: { DisplayName: Hostile Plague Turret - Tooltip: "" + Tooltip: Ejects homing plague missiles towards nearby players } HostileWaterTurret: { DisplayName: Hostile Water Turret - Tooltip: "" + Tooltip: Shoots high-speed water blasts at nearby players } IceTurret: { DisplayName: Ice Turret - Tooltip: "" + Tooltip: + ''' + Lobs fragile ice mist bombs at nearby enemies + Cannot attack while a boss is alive + ''' } LabTurret: { DisplayName: Lab Turret - Tooltip: "" + Tooltip: + ''' + Shoots laser beams at nearby enemies + Cannot attack while a boss is alive + ''' } LaserTurret: { DisplayName: Laser Turret - Tooltip: "" + Tooltip: + ''' + Blasts nearby enemies with lightning-fast laser beams + Cannot attack while a boss is alive + ''' } OnyxTurret: { DisplayName: Onyx Turret - Tooltip: "" + Tooltip: + ''' + Shoots a shotgun spread of bullets at nearby enemies + Cannot attack while a boss is alive + ''' } PlagueTurret: { DisplayName: Plague Turret - Tooltip: "" + Tooltip: + ''' + Ejects homing plague missiles towards nearby enemies + Cannot attack while a boss is alive + ''' } WaterTurret: { DisplayName: Water Turret - Tooltip: "" + Tooltip: + ''' + Shoots high-speed water blasts at nearby enemies + Cannot attack while a boss is alive + ''' } \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index b694abfb31..b1e804aab3 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -180,7 +180,7 @@ BloodyMary: { Tooltip: ''' 10% increased damage and movement speed during a Blood Moon - Reduces life regen by 4 and defense by 4% + Reduces life regen by 2 HP/s and defense by 4% [c/B00BA5:'Extra spicy... and bloody!'] ''' } @@ -189,7 +189,7 @@ CaribbeanRum: { DisplayName: Caribbean Rum Tooltip: ''' - Increases life regen by 2, movement speed by 10% and wing flight time by 20% + Increases life regen by 1 HP/s, movement speed by 10% and wing flight time by 20% Makes you floaty and reduces defense by 10% [c/B00BA5:'Why is the rum gone?'] ''' @@ -210,7 +210,7 @@ Everclear: { Tooltip: ''' 25% increased damage - Reduces life regen by 10 and defense by 30% + Reduces life regen by 5 HP/s and defense by 30% [c/B00BA5:'This is the most potent booze I have, be careful with it.'] ''' } @@ -220,7 +220,7 @@ EvergreenGin: { Tooltip: ''' Multiplies all sickness and water-related debuff damage by 1.25x - Reduces life regen by 1 + Reduces life regen by 0.5 HP/s [c/B00BA5:'It tastes like a Christmas tree, if you can imagine that.'] ''' } @@ -240,7 +240,7 @@ Fireball: { Tooltip: ''' Multiplies all fire-based debuff damage by 1.25x - Reduces life regen by 1 + Reduces life regen by 0.5 HP/s [c/B00BA5:'A great-tasting cinnamon whiskey.'] ''' } @@ -259,7 +259,7 @@ Margarita: { Tooltip: ''' Halves the duration of most harmful debuffs - Reduces defense by 6% and life regen by 1 + Reduces defense by 6% and life regen by 0.5 HP/s 3 minute duration [c/B00BA5:'One of the best drinks ever created, enjoy it while it lasts.'] ''' @@ -270,7 +270,7 @@ Moonshine: { Tooltip: ''' Increases defense by 10 and damage reduction by 3% - Reduces life regen by 1 + Reduces life regen by 0.5 HP/s [c/B00BA5:'This stuff is pretty strong, but I'm sure you can handle it.'] ''' } @@ -280,7 +280,7 @@ MoscowMule: { Tooltip: ''' Increases damage by 9%, knockback by 50% and critical strike chance by 3% - Reduces life regen by 4 + Reduces life regen by 2 HP/s [c/B00BA5:'I once heard the copper mug can be toxic and I told 'em, 'listen dummy, I'm already poisoning myself!''] ''' } @@ -299,7 +299,7 @@ RedWine: { DisplayName: Red Wine Tooltip: ''' - Reduces life regen by 1 for 15 seconds + Reduces life regen by 0.5 HP/s for 15 seconds [c/B00BA5:'Too dry for my taste.'] ''' } @@ -308,7 +308,7 @@ Rum: { DisplayName: Rum Tooltip: ''' - Increases life regen by 2 and movement speed by 10% + Increases life regen by 1 HP/s and movement speed by 10% Reduces defense by 5% [c/B00BA5:'Sweet and potent, just how I like it.'] ''' @@ -319,7 +319,7 @@ Screwdriver: { Tooltip: ''' Multiplies piercing projectile damage by 1.05x - Reduces life regen by 1 + Reduces life regen by 0.5 HP/s [c/B00BA5:'Do you have a screw loose?'] ''' } @@ -330,7 +330,7 @@ StarBeamRye: { ''' Increases max mana by 50, magic damage by 8%, and reduces mana usage by 10% - Reduces defense by 6% and life regen by 2 + Reduces defense by 6% and life regen by 1 HP/s [c/B00BA5:'Made from some stuff I found near the Astral Meteor crash site. Don't worry, it's safe, trust me...'] ''' } @@ -340,7 +340,7 @@ Tequila: { Tooltip: ''' Increases knockback by 10%, crit chance by 4% and defense by 5 during daytime - Reduces life regen by 1 + Reduces life regen by 0.5 HP/s [c/B00BA5:'Great for mixing up daytime drinks.'] ''' } @@ -350,7 +350,7 @@ TequilaSunrise: { Tooltip: ''' Increases knockback by 20%, crit chance by 8% and defense by 10 during daytime - Reduces life regen by 2 + Reduces life regen by 1 HP/s [c/B00BA5:'The greatest daytime drink I've ever had.'] ''' } @@ -360,7 +360,7 @@ Vodka: { Tooltip: ''' Increases damage by 6% and critical strike chance by 2% - Reduces life regen by 1 and defense by 5% + Reduces life regen by 0.5 HP/s and defense by 5% [c/B00BA5:'The number one alcohol for creating great mixed drinks.'] ''' } @@ -380,7 +380,7 @@ WhiteWine: { Tooltip: ''' Increases magic damage by 8% - Reduces defense by 6% and life regen by 1 + Reduces defense by 6% and life regen by 0.5 HP/s [c/B00BA5:'I drank a full barrel of this stuff once in one night, I couldn't remember who I was the next day.'] ''' } \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson index 68e9863f99..1c300dcf4a 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson @@ -5,6 +5,7 @@ Abombination: { Summons the Plaguebringer Goliath when used in the Jungle Enrages outside the Jungle Not consumable + 'Radio capable of emitting a frequency recognized by the Plague nanovirus.' ''' } @@ -15,6 +16,7 @@ AstralChunk: { Summons Astrum Aureus when used in the Astral Infection Enrages during the day while outside the Astral Infection Not consumable + 'The Infection’s fortress has found another target.' ''' } @@ -34,6 +36,7 @@ BloodyWormFood: { Summons the Perforator Hive when used in the Crimson Enrages outside the Underground Crimson Not consumable + 'Do not play with your food, they won’t play with theirs.' ''' } @@ -43,6 +46,7 @@ CeremonialUrn: { ''' Use at the Altar of the Accursed to summon the Supreme Witch, Calamitas Not consumable + 'The Witch will not allow it to happen once again.' ''' } @@ -53,7 +57,7 @@ CharredIdol: { Summons the Brimstone Elemental when used in the Brimstone Crags Enrages outside the Brimstone Crags Not consumable - 'Use at your own risk' + 'Anything under her gaze shall be scorched beyond recognition.' ''' } @@ -63,6 +67,7 @@ CosmicWorm: { ''' Summons the Devourer of Gods Not consumable + 'The Nameless Serpent has set out for you.' ''' } @@ -74,6 +79,7 @@ CryoKey: { [SPAWN] Enrages outside the tundra Not consumable + 'A key for a glacial prison.' ''' SpawnNormal: Summons Cryogen when used in the tundra SpawnGFB: Summons Cryogen...? when used in the tundra @@ -85,7 +91,7 @@ DeathWhistle: { ''' Summons the Ravager Not consumable - A whistle soaked in blood + 'One of the few sounds the flesh golem still recognizes.' ''' } @@ -96,6 +102,7 @@ DecapoditaSprout: { Summons Crabulon when used in the Mushroom biome Enrages outside the Underground Mushroom biome Not consumable + 'Bristling with the spores of a unique, parasitic strain.' ''' } @@ -106,6 +113,7 @@ DesertMedallion: { Summons the Desert Scourge when used in the Desert Enrages outside the Desert Not consumable + 'The Scourge seeks for another meal.' ''' } @@ -115,6 +123,7 @@ EidolonTablet: { ''' Summons the Lunatic Cultist Not consumable + 'An aged artifact venerated by the Dragon Cult.' ''' } @@ -125,7 +134,7 @@ ExoticPheromones: { Summons The Dragonfolly when used in the Jungle Enrages outside the Jungle Not consumable - Specifically formulated to attract draconic offshoots + 'Pheromones used for hunting Draconic Offshoots.' ''' } @@ -137,6 +146,7 @@ EyeofDesolation: { Summons the Calamitas Clone when used during nighttime[GFB] Enrages during the day Not consumable + 'She is here.' ''' GFBInfo: Creates a square arena of blocks, with you at its center } @@ -166,7 +176,7 @@ NecroplasmicBeacon: { Summons Polterghast when used in the Dungeon Enrages in large spaces Not consumable - 'It's spooky' + 'The wails of the spirits disturbed something far more terrifying.' ''' } @@ -191,7 +201,7 @@ OverloadedSludge: { ''' Summons the Slime God Not consumable - 'It looks corrupted' + 'Writhing and bloated with the pus of Gods long dead.' ''' } @@ -213,7 +223,7 @@ ProfanedCore: { Unique drop changes depending on the biome fought in Enrages when fought during nighttime Not consumable - The core of the profaned flame + 'The heart of Her Guardians, Her wicked wrath shall burn upon whoever now wields it.' ''' } @@ -224,7 +234,7 @@ ProfanedShard: { [SPAWN] Enrage when not in the Hallow or Underworld Not consumable - A shard of the profaned flame + 'Her Guardians seek the holder of such vast stolen power.' ''' SpawnNormal: Summons the Profaned Guardians when used in the Hallow or Underworld during daytime SpawnRemix: Summons the Profaned Guardians when used in the Hallow or Underworld @@ -265,6 +275,7 @@ Seafood: { Summons the Aquatic Scourge when used in the Sulphurous Sea Enrages outside the Sulphurous Sea Not consumable + 'Large bait for a large catch. Beware the monsters of the seas.' ''' } @@ -285,6 +296,7 @@ Teratoma: { Summons the Hive Mind when used in the Corruption Enrages outside the Underground Corruption Not consumable + 'An exquisitely hideous tumor for those diseased in the head.' ''' } @@ -305,6 +317,6 @@ YharonEgg: { Summons Yharon, Dragon of Rebirth Enrages outside the fire walls Not consumable - An effigy of a Phoenix Dragon egg, used in worship + 'A symbol of the Dragon watching over and waiting for you.' ''' } \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index 9b7399e9de..6ef0ee197d 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -502,11 +502,6 @@ MadAlchemistsCocktailGlove: { ''' } -MagnaCannon: { - DisplayName: Magna Cannon - Tooltip: Fires a concentrated blast of energy -} - MagneticMeltdown: { DisplayName: Magnetic Meltdown Tooltip: Launches a diamond cross of supercharged magnet spheres diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 10f3da9a2c..56a9017121 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -120,11 +120,7 @@ ArkoftheElements: { You can parry projectiles to make them deal 100 less damage for a short period Parrying will empower the next 10 swings of the sword, letting you use both blades at once ''' - BlastInfo: - ''' - Pressing while holding UP with empowered charges will provoke a Big Rip in spacetime and use all charges - If more than 5 charges were used, you can dash across the rip by holding UP - ''' + BlastInfo: Pressing while holding UP with empowered charges will provoke a Big Rip in spacetime and use all charges } AstralBlade: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index b40cc452aa..1538fd125a 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -78,7 +78,7 @@ ArterialAssault: { Tooltip: ''' Fires a chain of 5 arrows from the sky - Wooden arrows are converted into homing bloodfire arrows + All arrows will rapidly home in on nearby enemies ''' } @@ -347,13 +347,9 @@ DarkechoGreatbow: { ''' } -DeepcoreGK2: { - DisplayName: Deepcore GK2 - Tooltip: - ''' - Bullets are twice as large and ignores 15 points of enemy defense - 'For rock and stone!' - ''' +DeadSunsWind: { + DisplayName: Dead Sun's Wind + Tooltip: 70% chance to save ammo } Deathwind: { @@ -365,6 +361,15 @@ Deathwind: { ''' } +DeepcoreGK2: { + DisplayName: Deepcore GK2 + Tooltip: + ''' + Bullets are twice as large and ignores 15 points of enemy defense + 'For rock and stone!' + ''' +} + Disseminator: { DisplayName: Disseminator Tooltip: @@ -466,7 +471,7 @@ FlakToxicannon: { Tooltip: ''' Fires angled shots in the direction of the cursor - Can only be shot in a cone direction above the player + Can only be shot in a wide cone above the player 'High IQ required' ''' } @@ -518,11 +523,6 @@ Galeforce: { Tooltip: Fires a spread of low-damage feathers } -GodsBellows: { - DisplayName: Dead Sun's Wind - Tooltip: 70% chance to save ammo -} - GoldenEagle: { DisplayName: Golden Eagle Tooltip: Fires 5 bullets at once @@ -647,9 +647,14 @@ LunarianBow: { ''' } -MagnaStriker: { - DisplayName: Magna Striker - Tooltip: Fires a string of opal and magna strikes +ArcNovaDiffuser: { + DisplayName: Arc Nova Diffuser + Tooltip: + ''' + Charges and fires a rapid burst of nova bolts + The first charging stage increases the fire rate of the burst + The second charging stage replaces the rapid burst with a devastating nova blast + ''' } MagnomalyCannon: { @@ -793,8 +798,8 @@ OpalStriker: { DisplayName: Opal Striker Tooltip: ''' - Fires a string of opal strikes - 50% chance to save ammo + Fires a chargeable heated energy bolt that pierces + Fully charged shots deal extra damage and move faster ''' } @@ -1285,4 +1290,14 @@ WulfrumBlunderbuss: { [c/83B87E:'The good thing about Wulfrum is that while it breaks fast, it can be reused even faster.] [c/83B87E:In fact, it is quite common for a robot to be turned into ammo right after it stops functioning.'] ''' +} + +MagnaCannon: { + DisplayName: Magna Cannon + Tooltip: + ''' + Charges up a rapid fire burst of crystal bolts + Charging for longer increases the number of bolts fired + Fully charged shots fire an even longer and more rapid burst + ''' } \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 69377fae41..4529ea1314 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -248,8 +248,8 @@ CursedDagger: { DisplayName: Cursed Dagger Tooltip: ''' - Throws bouncing daggers - Stealth strikes are showered in cursed fireballs + Throws a fast cursed dagger and two inaccurate weaker daggers + Stealth strikes throw a single dagger that bursts into a vortex of cursed flames ''' } @@ -282,17 +282,6 @@ DefectiveSphere: { ''' } -DeificThunderbolt: { - DisplayName: Twisting Thunder - Tooltip: - ''' - Fires a lightning bolt to electrocute enemies - The lightning bolt travels faster while it is raining - Summons lightning from the sky on impact - Stealth strikes summon more lightning and travel faster - ''' -} - DesecratedWater: { DisplayName: Desecrated Water Tooltip: @@ -607,8 +596,8 @@ IchorSpear: { DisplayName: Ichor Spear Tooltip: ''' - Throws an ichor tipped trident - Stealth strikes are showered in splashes of ichor + Throws a high-velocity ichor tipped javelin that pierces through enemies + Stealth strikes impale enemies and deal repeated damage ''' } @@ -704,14 +693,12 @@ Lionfish: { ''' } -LuminousStriker: { - DisplayName: Luminous Striker +RealityRupture: { + DisplayName: Reality Rupture Tooltip: ''' - Throws a stardust javelin trailed by rising stardust shards - Explodes into additional stardust shards upon hitting enemies - Stealth strikes cause the stardust shards to fly alongside the javelin instead of rising - 'Send the stars back to where they belong' + Cycles between throwing 3 small homing spears and throwing a single piercing lance + Stealth Strikes throw a high-velocity reality shattering lance that explodes on hit ''' } @@ -843,14 +830,14 @@ OrichalcumSpikedGemstone: { PalladiumJavelin: { DisplayName: Palladium Javelin - Tooltip: Stealth strikes split into more javelins and boost life regeneration on hits + Tooltip: Stealth strikes split into more javelins and boost natural life regeneration on hits } Penumbra: { DisplayName: Penumbra Tooltip: ''' - Throws a shadow bomb that explodes into homing souls + Throws a shadow bomb that explodes into homing souls and flames Stealth strikes make the bomb manifest on the cursor and explode into more souls ''' } @@ -859,9 +846,8 @@ PhantasmalRuin: { DisplayName: Phantasmal Ruin Tooltip: ''' - Fires an enormous ghost lance that emits lost souls as it flies - Explodes into tormented souls on enemy hits - Stealth strikes continuously leave spectral clones in their wake + Fires a large ghost lance that explodes into spirits on enemy hits + Stealth strikes pierce and summon many spirits from the depths on enemy hits ''' } @@ -1127,8 +1113,8 @@ SpearofDestiny: { DisplayName: Spear of Destiny Tooltip: ''' - Throws three spears with the outer two having homing capabilities - Stealth strikes cause all three spears to home in, ignore tiles, and pierce more + Cycles between throwing 3 small homing spears and throwing a single piercing lance + Stealth Strikes throw a high-velocity holy lance that explodes on hit ''' } @@ -1252,7 +1238,7 @@ TheOldReaper: { Tooltip: ''' Throws a homing reaper scythe that shreds enemies - Stealth strikes throw four at once + Stealth strikes throw three at once 'Slice 'n dice' ''' } @@ -1328,6 +1314,17 @@ Turbulance: { ''' } +TwistingThunder: { + DisplayName: Twisting Thunder + Tooltip: + ''' + Fires a lightning bolt to electrocute enemies + The lightning bolt travels faster while it is raining + Summons lightning from the sky on impact + Stealth strikes summon more lightning and travel faster + ''' +} + UrchinStinger: { DisplayName: Urchin Stinger Tooltip: Stealth strikes stick to enemies while releasing sulphuric bubbles @@ -1337,7 +1334,7 @@ UtensilPoker: { DisplayName: Utensil Poker Tooltip: ''' - Fires random utensils in bursts of three + Fires utensils in bursts of three Stealth strikes replace any utensil with a powerful butcher knife 'Space chickens, that is all' ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson index c41f64d8b5..0f1fb46e11 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -44,16 +44,16 @@ AtlasMunitionsBeacon: { DisplayName: Atlas Munitions Beacon Tooltip: ''' - [c/F2B629:Drops down a crate from the sky that houses a mounted, stationary cannon] - [c/F2B629:The cannon will fire at any enemies within its range] - [c/F27049:If an enemy is in close proximity, it will enter Overdrive mode] - [c/F27049:When in Overdrive mode the cannon uses three barrels that each collectively fire] - [c/F27049:The cannon also heats up the more it fires in overdrive mode] - [c/69F0DC:Press right click while holding this item to pick up the cannon and use it for yourself] - [c/69F0DC:When held, the cannon will always be in Overdrive mode] - [c/69F0DC:If the held cannon overheats due to Overdrive mode, you are forced to drop it] - [c/9AA4AE:Pressing right click allows you to drop it manually] - [c/9AA4AE:If the held cannon is dropped near the mount, it will re-attach automatically] + [c/F2B629:Brings forth an exo-powered, stationary cannon] + [c/F2B629:The cannon will fire at enemies within its range] + [c/F27049:If an enemy is in close proximity, it will enter Overdrive] + [c/F27049:When in Overdrive the cannon uses its full power to bring down any foe] + [c/F27049:The cannon heats up the more it fires during Overdrive] + [c/69F0DC:Press right click while holding this item to pick up the cannon and use it yourself] + [c/69F0DC:When held, the cannon will always be in Overdrive] + [c/69F0DC:If the cannon overheats while you hold it, you will be forced to drop it] + [c/9AA4AE:Pressing allows you to drop it manually] + [c/9AA4AE:If dropped near the base, it will re-attach automatically] 'It's surprisingly easy to pick up' ''' } @@ -95,7 +95,14 @@ CadaverousCarrion: { CalamarisLament: { DisplayName: Calamari's Lament - Tooltip: Summons a squid that viciously inks enemies + Tooltip: "[GFB]" + TooltipNormal: + ''' + Summons a squid that viciously inks enemies + 'In the Abyss, all kinds of resources are scarce. + Every species is solitary. There simply is not enough to share.' + ''' + TooltipGFB: "'Woomy!'" } CausticCroakerStaff: { @@ -402,11 +409,6 @@ GlacialEmbrace: { ''' } -GodspawnHelixStaff: { - DisplayName: Starspawn Helix Staff - Tooltip: Summons astral probes to protect you -} - GuidelightofOblivion: { DisplayName: Guidelight of Oblivion Tooltip: @@ -482,6 +484,21 @@ MidnightSunBeacon: { Tooltip: Summons a UFO to vaporize enemies } +MirrorofKalandra: { + DisplayName: Mirror of Kalandra + Tooltip: + ''' + Summons five ancient weapons to annihilate your enemies + There can only be one of each individual weapon + [c/BD7F59:Atziri's Disfavor brutally cleaves through enemies] + [c/E7A7FF:Starforge rips through foes and occasionally induces cosmic explosions] + [c/868B8F:Paradoxica teleports to enemies and blitzes through them at high speed] + [c/EBC3A5:Wind Ripper unleashes a single high-speed, powerful arrow at enemies] + [c/9B6856:Hope Shredder shoots arrows that split into three and pierce enemies twice] + 'Ultimate, Immeasurable, Indescribable' + ''' +} + OrthoceraShell: { DisplayName: Orthocera Shell Tooltip: Summons a flying orthocera sentry at the mouse position @@ -501,10 +518,8 @@ PlantationStaff: { DisplayName: Plantation Staff Tooltip: ''' - Summons a miniature Plantera to protect you - Fires seeds, spiky balls, and spore clouds from afar to poison targets - Enrages when you get under 75% health and begins ramming enemies - Occupies 3 minion slots and there can only be one Plantera at a time + Summons a minature Plantera to devastate enemies with floral fury + Occupies 3 minion slots and there can only be one Mini Plantera at a time ''' } @@ -627,20 +642,21 @@ StaffoftheMechworm: { Tooltip: Summons an aerial mechworm to fight for you } +StarspawnHelixStaff: { + DisplayName: Starspawn Helix Staff + Tooltip: Summons astral probes to protect you +} + +StellarTorusStaff: { + DisplayName: Stellar Torus Staff + Tooltip: Summons a Torus Orbital that fries foes with a telescoping light beam +} + StormjawStaff: { DisplayName: Stormjaw Staff Tooltip: Summons a baby stormlion to fight for you } -SunGodStaff: { - DisplayName: Vengeful Sun Staff - Tooltip: - ''' - Summons a solar god spirit to protect you - There can only be one spirit at a time - ''' -} - SunSpiritStaff: { DisplayName: Sun Spirit Staff Tooltip: @@ -701,6 +717,15 @@ UniverseSplitter: { ''' } +VengefulSunStaff: { + DisplayName: Vengeful Sun Staff + Tooltip: + ''' + Summons a vengeful solar spirit to protect you + There can only be one spirit at a time + ''' +} + Vigilance: { DisplayName: Vigilance Tooltip: Summons a soul seeker to fight for you @@ -774,24 +799,4 @@ YharonsKindleStaff: { Summons a fiery draconid to fight for you Requires 5 minion slots to use ''' -} - -MirrorofKalandra: { - DisplayName: Mirror of Kalandra - Tooltip: - ''' - Summons five ancient weapons to annihilate your enemies - There can only be one of each individual weapon - [c/BD7F59:Atziri's Disfavor brutally cleaves through enemies] - [c/E7A7FF:Starforge rips through foes and occasionally induces cosmic explosions] - [c/868B8F:Paradoxica teleports to enemies and blitzes through them at high speed] - [c/EBC3A5:Wind Ripper unleashes a single high-speed, powerful arrow at enemies] - [c/9B6856:Hope Shredder shoots arrows that split into three and pierce enemies twice] - 'Ultimate, Immeasurable, Indescribable' - ''' -} - -StellarTorusStaff: { - DisplayName: Stellar Torus Staff - Tooltip: Summons a Torus Orbital that fries foes with a telescoping light beam } \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Keybinds.hjson b/Localization/en-US/Mods.CalamityMod.Keybinds.hjson index 2800de597f..ceef827c39 100644 --- a/Localization/en-US/Mods.CalamityMod.Keybinds.hjson +++ b/Localization/en-US/Mods.CalamityMod.Keybinds.hjson @@ -5,8 +5,6 @@ AngelicAllianceBlessing.DisplayName: Angelic Alliance Blessing BoosterDash.DisplayName: Booster Dash SpectralVeilTeleport.DisplayName: Spectral Veil Teleport SandCloakEffect.DisplayName: Sand Cloak Effect -PurityUIToggle.DisplayName: Special Teleport UI Toggle -AstralTeleport.DisplayName: Astral Teleport ArmorSetBonus.DisplayName: Armor Set Bonus AdrenalineMode.DisplayName: Adrenaline Mode RageMode.DisplayName: Rage Mode diff --git a/Localization/en-US/Mods.CalamityMod.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Misc.hjson index 815e42a2a0..a79640a708 100644 --- a/Localization/en-US/Mods.CalamityMod.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Misc.hjson @@ -19,8 +19,9 @@ RecipeGroup: { } // Status -WikiStatus1: "[i:Book][c/EE4939:Note: The Fandom wiki is no longer supported by Calamity.] [i:Book]" -WikiStatus2: "[i:Book][c/EE4939:Check out the Official Calamity Mod Wiki at ][c/3989FF:calamitymod.wiki.gg][c/EE4939:!] [i:Book]" +WikiStatus1: "[i:Book] [c/EE4939:Note: The Fandom wiki is no longer supported by Calamity.] [i:Book]" +WikiStatus2: "[i:Book] [c/EE4939:Check out the Official Calamity Mod Wiki at ][c/3989FF:calamitymod.wiki.gg][c/EE4939:!] [i:Book]" +MusicModReminder: "[i:MusicBoxMartians] [c/71DFF5:Remember to also install the Calamity Music Mod to experience our soundtrack!] [i:MusicBoxMartians]" // Recipe Conditions Tier1ArsenalRecipeCondition: View an unencrypted schematic from the lab near the Sunken Sea Tier2ArsenalRecipeCondition: Decrypt a schematic from the lab in the large planetoid in the sky @@ -49,12 +50,12 @@ StylishHammerHit: Stylish! ThirdSageBlessingText: You have been blessed by the Third Sage! ThirdSageBlessingText2: The Third Sage has rescinded its blessing... GenericConsumedText: "[c/8A8A8A:You have already consumed this item]" -BloodOrangeText: You have already consumed a Blood Orange. Eating any more would not be good for you. -MiracleFruitText: You have already consumed a Miracle Fruit. Having another would make you sick. -ElderberryText: You have already consumed an Elderberry. It is probably not wise to eat more than one. -DragonfruitText: You have already consumed a Dragonfruit. Your stomach cannot take any more. -CometShardText: You have already used a Comet Shard. Using more would make you nauseous. -EtherealCoreText: You have already used an Ethereal Core. It's best to not use more than you are able to. -PhantomHeartText: You have already used a Phantom Heart. It's probably good that you can't use another. +BloodOrangeText: You have already consumed a Blood Orange. 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. +ElderberryText: You have already consumed an Elderberry. Your body would become dust if you ate more than one. +DragonfruitText: You have already consumed a Dragonfruit. Any more draconic power and you'd be rejected. +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. SulphurSwitchLeft: The Sulphurous Sea is now on the left side of the world. SulphurSwitchRight: The Sulphurous Sea is now on the right side of the world. \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index 402fe02879..c8f6464334 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -1,6 +1,8 @@ +BabyCannonballJellyfish.DisplayName: Baby Cannonball Jellyfish Bloatfish.DisplayName: Bloatfish BobbitWormHead.DisplayName: Bobbit Worm BoxJellyfish.DisplayName: Box Jellyfish +CannonballJellyfish.DisplayName: Cannonball Jellyfish ChaoticPuffer.DisplayName: Chaotic Puffer ColossalSquid.DisplayName: Colossal Squid TinySquid: Tiny Squid @@ -21,67 +23,19 @@ Viperfish.DisplayName: Viperfish AcidEel.DisplayName: Acid Eel BabyFlakCrab.DisplayName: Baby Flak Crab BloodwormNormal.DisplayName: Bloodworm - -CragmawMire: { - DisplayName: Cragmaw Mire - - BossChecklistIntegration: { - SpawnInfo: - ''' - Spawns during Acid Rain after the Aquatic Scourge has been defeated. - Start Acid Rain with a [i:CalamityMod/CausticTear] - ''' - DespawnMessage: "[c/F0E68C:The Cragmaw Mire buries itself within the sand.]" - } -} - +CragmawMire.DisplayName: Cragmaw Mire FlakCrab.DisplayName: Flak Crab GammaSlime.DisplayName: Gamma Slime IrradiatedSlime.DisplayName: Irradiated Slime - -Mauler: { - DisplayName: Mauler - - BossChecklistIntegration: { - SpawnInfo: - ''' - Spawns during Acid Rain after Polterghast has been defeated. - Start Acid Rain with a [i:CalamityMod/CausticTear] - ''' - DespawnMessage: "[c/F0E68C:The brutish shark looks elsewhere to turn its aggression.]" - } -} - -NuclearTerror: { - DisplayName: Nuclear Terror - - BossChecklistIntegration: { - SpawnInfo: - ''' - Spawns during Acid Rain after Polterghast has been defeated. - Start Acid Rain with a [i:CalamityMod/CausticTear] - ''' - DespawnMessage: "[c/F0E68C:The radioactive aberration fades away in a sickly light.]" - } -} - +Mauler.DisplayName: Mauler +NuclearTerror.DisplayName: Nuclear Terror NuclearToad.DisplayName: Nuclear Toad Orthocera.DisplayName: Orthocera Radiator.DisplayName: Radiator Skyfin.DisplayName: Skyfin SulphurousSkater.DisplayName: Sulphurous Skater Trilobite.DisplayName: Trilobite - -AquaticScourgeHead: { - DisplayName: Aquatic Scourge - - BossChecklistIntegration: { - SpawnInfo: Use a [i:CalamityMod/Seafood] in the Sulphuric Sea or wait for it to spawn in the Sulphuric Sea - DespawnMessage: "[c/F0E68C:The poisoned scourge swims back to the tranquil, open ocean.]" - EntryName: Aquatic Scourge - } -} - +AquaticScourgeHead.DisplayName: Aquatic Scourge Aries.DisplayName: Aries AstralachneaGround.DisplayName: Astralachnea AstralProbe.DisplayName: Astral Probe @@ -98,89 +52,22 @@ SightseerCollider.DisplayName: Sightseer Collider SightseerSpitter.DisplayName: Sightseer Spitter StellarCulex.DisplayName: Stellar Culex Twinkler.DisplayName: Twinkler - -AstrumAureus: { - DisplayName: Astrum Aureus - - BossChecklistIntegration: { - SpawnInfo: Use an [i:CalamityMod/AstralChunk] at Night in the Astral Biome - DespawnMessage: "[c/FFD700:Aureus has neutralized all threats. Resume prior reconnaissance.]" - } -} - +AstrumAureus.DisplayName: Astrum Aureus AureusSpawn.DisplayName: Aureus Spawn - -AstrumDeusHead: { - DisplayName: Astrum Deus - - BossChecklistIntegration: { - SpawnInfo: Use a [i:CalamityMod/TitanHeart] or [i:CalamityMod/Starcore] as offering at an [i:CalamityMod/AstralBeaconItem] - DespawnMessage: "[c/FFD700:The infected deity retreats to the heavens.]" - EntryName: Astrum Deus - } -} - +AstrumDeusHead.DisplayName: Astrum Deus Brimling.DisplayName: Brimling - -BrimstoneElemental: { - DisplayName: Brimstone Elemental - - BossChecklistIntegration: { - SpawnInfo: Use a [i:CalamityMod/CharredIdol] in the Brimstone Crag - DespawnMessage: "[c/DC143C:The elemental ever maintains her somber vigil over Azafure…]" - } -} - +BrimstoneElemental.DisplayName: Brimstone Elemental Bumblebirb: Bumblebirb - -Bumblefuck: { - DisplayName: Dragonfolly - - BossChecklistIntegration: { - EntryName: Dragonfolly - SpawnInfo: Use [i:CalamityMod/ExoticPheromones] in the Jungle Biome - DespawnMessage: "[c/FFD700:The folly returns to its secluded roost.]" - } -} - +Bumblefuck.DisplayName: Dragonfolly Bumblefuck2.DisplayName: Draconic Swarmer - -CalamitasClone: { - DisplayName: Calamitas Clone - - BossChecklistIntegration: { - EntryName: The Calamitas Clone - SpawnInfo: Use an [i:CalamityMod/EyeofDesolation] at Night - DespawnMessage: "[c/FFA500:The clone spits a bit of blood in disappointment and vanishes.]" - } -} - +CalamitasClone.DisplayName: Calamitas Clone Cataclysm.DisplayName: Cataclysmic Construct Catastrophe.DisplayName: Catastrophic Construct SoulSeeker.DisplayName: Soul Seeker - -CeaselessVoid: { - DisplayName: Ceaseless Void - - BossChecklistIntegration: { - SpawnInfo: Use a [i:CalamityMod/RuneofKos] in the Dungeon - DespawnMessage: "[c/4B0082:The ancient spatial rift slips away to places unknown.]" - EntryName: Ceaseless Void - } -} - +CeaselessVoid.DisplayName: Ceaseless Void DarkEnergy.DisplayName: Dark Energy CrabShroom.DisplayName: Crab Shroom - -Crabulon: { - DisplayName: Crabulon - - BossChecklistIntegration: { - SpawnInfo: Use a [i:CalamityMod/DecapoditaSprout] in the Mushroom Biome - DespawnMessage: "[c/6495ED:The monstrous mycelial crab shuffles away…]" - } -} - +Crabulon.DisplayName: Crabulon CalamityEye.DisplayName: Calamity Eye RenegadeWarlock.DisplayName: Renegade Warlock DespairStone.DisplayName: Despair Stone @@ -189,43 +76,14 @@ InfernalCongealment.DisplayName: Infernal Congealment Scryllar.DisplayName: Scryllar ScryllarRage.DisplayName: Scryllar SoulSlurper.DisplayName: Soul Slurper - -Cryogen: { - DisplayName: Cryogen - - BossChecklistIntegration: { - SpawnInfo: Use a [i:CalamityMod/CryoKey] in the Snow Biome - DespawnMessage: "[c/00FFFF:Cryogen disappears amidst the biting winds of the blizzard.]" - } -} - +Cryogen.DisplayName: Cryogen Pyrogen: Pyrogen CryogenShield.DisplayName: Cryogen's Shield PyrogenShield: Pyrogen's Shield DesertNuisanceHead.DisplayName: Desert Nuisance - -DesertScourgeHead: { - DisplayName: Desert Scourge - - BossChecklistIntegration: { - SpawnInfo: Use a [i:CalamityMod/DesertMedallion] in the Desert Biome - DespawnMessage: "[c/EEE8AA:The scourge of the desert delves back into the sand.]" - EntryName: Desert Scourge - } -} - +DesertScourgeHead.DisplayName: Desert Scourge CosmicGuardianHead.DisplayName: Cosmic Guardian - -DevourerofGodsHead: { - DisplayName: The Devourer of Gods - - BossChecklistIntegration: { - EntryName: Devourer of Gods - SpawnInfo: Use a [i:CalamityMod/CosmicWorm] - DespawnMessage: "[c/00FFFF:The Devourer of Gods haughtily returns to the depths of the Distortion.]" - } -} - +DevourerofGodsHead.DisplayName: The Devourer of Gods Androomba.DisplayName: Androomba Nanodroid.DisplayName: Nanodroid RepairUnitCritter.DisplayName: Repair Unit @@ -233,12 +91,6 @@ RepairUnitCritter.DisplayName: Repair Unit Apollo: { DisplayName: XS-03 Apollo HekateName: Corrosive Eye of XB-∞ Hekate - - BossChecklistIntegration: { - EntryName: Exo Mechs - SpawnInfo: By using a high-tech computer - DespawnMessage: "[c/7FFFD4:An imperfection after all… what a shame.]" - } } AresBody: { @@ -278,43 +130,16 @@ ThanatosHead: { HekateName: Spine of XB-∞ Hekate } -GreatSandShark: { - DisplayName: Great Sand Shark - - BossChecklistIntegration: { - SpawnInfo: Kill 10 sand sharks after defeating Plantera or use a [i:CalamityMod/SandstormsCore] in the Desert Biome - DespawnMessage: "[c/DAA520:The apex predator of the sands disappears between the dunes.]" - } -} - +GreatSandShark.DisplayName: Great Sand Shark DankCreeper.DisplayName: Dank Creeper DarkHeart.DisplayName: Dark Heart HiveBlob.DisplayName: Hive Blob - -HiveMind: { - DisplayName: The Hive Mind - - BossChecklistIntegration: { - SpawnInfo: Kill a Tumor in the Corruption or use a [i:CalamityMod/Teratoma] in the Corruption - DespawnMessage: "[c/9400D3:The Hive Mind flits away to brood elsewhere.]" - } -} - +HiveMind.DisplayName: The Hive Mind HiveTumor.DisplayName: Hive Tumor Anahita.DisplayName: Anahita AnahitasIceShield.DisplayName: Ice Shield AquaticAberration.DisplayName: Aquatic Aberration - -Leviathan: { - DisplayName: The Leviathan - - BossChecklistIntegration: { - EntryName: Leviathan - SpawnInfo: By killing an unknown entity in the Ocean Biome - DespawnMessage: "[c/7FFFD4:The aquatic outcasts return to their lonesome company.]" - } -} - +Leviathan.DisplayName: The Leviathan LeviathanStart.DisplayName: ??? AeroSlime.DisplayName: Aero Slime ArmoredDiggerHead.DisplayName: Armored Digger @@ -364,17 +189,7 @@ WulfrumDrone.DisplayName: Wulfrum Drone WulfrumGyrator.DisplayName: Wulfrum Gyrator WulfrumHovercraft.DisplayName: Wulfrum Hovercraft WulfrumRover.DisplayName: Wulfrum Rover - -OldDuke: { - DisplayName: The Old Duke - - BossChecklistIntegration: { - EntryName: Old Duke - SpawnInfo: Defeat the Acid Rain event post-Polterghast or fish using a [i:CalamityMod/BloodwormItem] in the Sulphurous Sea - DespawnMessage: "[c/F0E68C:The old duke retreats further into the acidic downpour.]" - } -} - +OldDuke.DisplayName: The Old Duke BoomerDuke: The Boomer Duke OldDukeToothBall.DisplayName: Tooth Ball SulphurousSharkron.DisplayName: Sulphurous Sharkron @@ -390,27 +205,8 @@ PerforatorHeadMedium.DisplayName: The Perforator PerforatorMedium: The Medium Perforator PerforatorHeadSmall.DisplayName: The Perforator PerforatorSmall: The Small Perforator - -PerforatorHive: { - DisplayName: The Perforator Hive - - BossChecklistIntegration: { - EntryName: The Perforators - SpawnInfo: Kill a Cyst in the Crimson or use a [i:CalamityMod/BloodyWormFood] in the Crimson - DespawnMessage: "[c/DC143C:The Perforators search for more hosts to gorge themselves on.]" - } -} - -PlaguebringerGoliath: { - DisplayName: The Plaguebringer Goliath - - BossChecklistIntegration: { - EntryName: Plaguebringer Goliath - SpawnInfo: Use an [i:CalamityMod/Abombination] in the Jungle Biome - DespawnMessage: "[c/00FF00:SPECIMENS EUTHANIZED. EXITING COMBAT PROTOCOL.]" - } -} - +PerforatorHive.DisplayName: The Perforator Hive +PlaguebringerGoliath.DisplayName: The Plaguebringer Goliath PlagueHomingMissile.DisplayName: Plague Homing Missile PlagueMine.DisplayName: Plague Mine Melter.DisplayName: Melter @@ -420,17 +216,7 @@ PlagueCharger.DisplayName: Plague Charger Plagueshell.DisplayName: Plagueshell Viruling.DisplayName: Viruling PhantomFuckYou.DisplayName: Phantom - -Polterghast: { - DisplayName: Polterghast - - BossChecklistIntegration: { - SpawnInfo: Kill 30 phantom spirits or use a [i:CalamityMod/NecroplasmicBeacon] in the Dungeon - DespawnMessage: "[c/B0E0E6:The volatile phantasm disperses in an echoing wail.]" - EntryName: Polterghast - } -} - +Polterghast.DisplayName: Polterghast Necroghast: Necroghast Necroplasm: Necroplasm Polterplasm: Polterplasm @@ -438,88 +224,28 @@ PolterghastHook.DisplayName: Polterghast Hook PolterPhantom.DisplayName: Polterghast PrimordialWyrmHead.DisplayName: Primordial Wyrm Jared: Jared - -ProfanedGuardianCommander: { - DisplayName: Guardian Commander - - BossChecklistIntegration: { - EntryName: Profaned Guardians - SpawnInfo: Use a [i:CalamityMod/ProfanedShard] in the Hallow or Underworld Biomes - DespawnMessage: "[c/FFA500:The Guardians are recalled to their Goddess' side.]" - } -} - +ProfanedGuardianCommander.DisplayName: Guardian Commander ProfanedGuardianDefender.DisplayName: Guardian Defender ProfanedGuardianHealer.DisplayName: Guardian Healer ProfanedRocks.DisplayName: Profaned Rocks - -Providence: { - DisplayName: Providence, the Profaned Goddess - - BossChecklistIntegration: { - EntryName: Providence - SpawnInfo: Use [i:CalamityMod/ProfanedCore] in the Hallow or Underworld Biomes - DespawnMessage: "[c/FFA500:The Profaned Goddess veils herself in purifying flame, leaving only ashes behind…]" - } -} - +Providence.DisplayName: Providence, the Profaned Goddess ProvSpawnDefense.DisplayName: Providence Defender ProvSpawnHealer.DisplayName: Providence Healer ProvSpawnOffense.DisplayName: Providence Offense FlamePillar.DisplayName: Flame Pillar - -RavagerBody: { - DisplayName: Ravager - - BossChecklistIntegration: { - SpawnInfo: Use a [i:CalamityMod/DeathWhistle] - DespawnMessage: "[c/B22222:The Ravager resumes its aimless, horrific rampage.]" - EntryName: Ravager - } -} - +RavagerBody.DisplayName: Ravager RockPillar.DisplayName: Rock Pillar CosmicLantern.DisplayName: Cosmic Lantern CosmicMine.DisplayName: Cosmic Mine - -Signus: { - DisplayName: Signus, Envoy of the Devourer - - BossChecklistIntegration: { - EntryName: Signus - SpawnInfo: Use a [i:CalamityMod/RuneofKos] in the Underworld - DespawnMessage: "[c/BA55D3:Signus inexplicably ceases to be where he once was.]" - } -} - +Signus.DisplayName: Signus, Envoy of the Devourer CorruptSlimeSpawn.DisplayName: Corrupt Slime Spawn CrimsonSlimeSpawn.DisplayName: Crimson Slime Spawn CrimulanPaladin.DisplayName: Crimulan Paladin EbonianPaladin.DisplayName: Ebonian Paladin - -SlimeGodCore: { - DisplayName: The Slime God - - BossChecklistIntegration: { - EntryName: Slime God - SpawnInfo: Use an [i:CalamityMod/OverloadedSludge] - DespawnMessage: "[c/BA5533:The grimy, gelatinous God hops away, its vengeance achieved.]" - } -} - +SlimeGodCore.DisplayName: The Slime God SplitCrimulanPaladin.DisplayName: Crimulan Paladin SplitEbonianPaladin.DisplayName: Ebonian Paladin - -StormWeaverHead: { - DisplayName: Storm Weaver - - BossChecklistIntegration: { - SpawnInfo: Use a [i:CalamityMod/RuneofKos] in Space - DespawnMessage: "[c/EE82EE:Storm Weaver hides itself within the fierce anvilhead clouds.]" - EntryName: Storm Weaver - } -} - +StormWeaverHead.DisplayName: Storm Weaver AnthozoanCrab.DisplayName: Anthozoan Crab AquaticUrchin.DisplayName: Aquatic Urchin BelchingCoral.DisplayName: Belching Coral @@ -533,16 +259,7 @@ BlindedAngler.DisplayName: Blinded Angler Clam.DisplayName: Clam EutrophicRay.DisplayName: Eutrophic Ray GhostBell.DisplayName: Ghost Bell - -GiantClam: { - DisplayName: Giant Clam - - BossChecklistIntegration: { - SpawnInfo: Can spawn naturally in the Sunken Sea - DespawnMessage: "[c/7FFFD4:The Giant Clam returns into hiding in its grotto.]" - } -} - +GiantClam.DisplayName: Giant Clam Clamitas: Clamitas SupremeClamitas: Supreme Clamitas PrismBack.DisplayName: Prism-Back @@ -552,30 +269,11 @@ SeaSerpent1.DisplayName: Sea Serpent BrimstoneHeart.DisplayName: Brimstone Heart SepulcherHead.DisplayName: Sepulcher SoulSeekerSupreme.DisplayName: Soul Seeker - -SupremeCalamitas: { - DisplayName: Supreme Witch, Calamitas - - BossChecklistIntegration: { - SpawnInfo: Use [i:CalamityMod/AshesofCalamity] or a [i:CalamityMod/CeremonialUrn] as offering at an [i:CalamityMod/AltarOfTheAccursedItem] - DespawnMessage: "[c/FFA500:Please don't waste my time.]" - } -} - +SupremeCalamitas.DisplayName: Supreme Witch, Calamitas SupremeCirrus: Supreme Alchemist, Cirrus SupremeCataclysm.DisplayName: Cataclysm SupremeCatastrophe.DisplayName: Catastrophe - -Yharon: { - DisplayName: Yharon, Dragon of Rebirth - - BossChecklistIntegration: { - EntryName: Yharon - SpawnInfo: Use a [i:CalamityMod/YharonEgg] - DespawnMessage: "[c/FFA500:Yharon soars out of sight, his task fulfilled.]" - } -} - +Yharon.DisplayName: Yharon, Dragon of Rebirth YharonPhase2: Yharon, Resplendent Phoenix // Town NPCs, Pets, etc AndroombaFriendly.DisplayName: Androomba Pal diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson index 84c08d1f13..51a60bf063 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson @@ -1,66 +1,66 @@ AbyssBall.DisplayName: Abyss Ball AcidGunStream.DisplayName: Acid Stream -AcidicReed.DisplayName: Reed +AcidicReed.DisplayName: Acidic Reed AcidicSaxBubble.DisplayName: Acid Bubble AcidicSaxMist.DisplayName: Acid Mist -AetherBeam.DisplayName: Beam +AetherBeam.DisplayName: Aether Beam AetherfluxCannonHoldout.DisplayName: Aetherflux Cannon -AnahitasArpeggioNote.DisplayName: Song -Ancient.DisplayName: Ancient -Ancient2.DisplayName: Ancient +AnahitasArpeggioNote.DisplayName: Anahita's Song +Ancient.DisplayName: Ancient Dust +Ancient2.DisplayName: Ancient Dust ApotheosisEnergy.DisplayName: Apotheosis Energy ApotheosisWorm.DisplayName: The Devourer of Gods -AquamarineBolt.DisplayName: Bolt +AquamarineBolt.DisplayName: Aqua Bolt ArcticBearPawProj.DisplayName: Arctic Bear Paw ArtAttackHoldout.DisplayName: Art Attack -ArtAttackStar.DisplayName: Star +ArtAttackStar.DisplayName: Artsy Star ArtAttackStrike.DisplayName: Art Attack Asteroid.DisplayName: Asteroid -AsteroidMolten.DisplayName: Asteroid -AstralachneaFang.DisplayName: Fang -AstralCrystal.DisplayName: Crystal +AsteroidMolten.DisplayName: Molten Asteroid +AstralachneaFang.DisplayName: Astral Fang +AstralCrystal.DisplayName: Astral Crystal AstralCrystalInvisibleExplosion.DisplayName: Astral Crystal Invisible Explosion -AstralStarMagic.DisplayName: Star +AstralStarMagic.DisplayName: Astral Star AtlantisSpear.DisplayName: Atlantis Spear AtlantisSpear2.DisplayName: Atlantis Spear AuraRain.DisplayName: Aura Rain AuroraAustralis.DisplayName: Aurora Australis BeamingBolt.DisplayName: Beaming Bolt BeamingBolt2.DisplayName: Beaming Bolt -BeamStar.DisplayName: Star -BeastScythe.DisplayName: Scythe +BeamStar.DisplayName: Stardust Star +BeastScythe.DisplayName: Beast Scythe BigBeamofDeath.DisplayName: Big Beam of Death BigBeamofDeath2.DisplayName: Big Beam of Death -BlackAnurianBubble.DisplayName: Bubble -BlackAnurianPlankton.DisplayName: Plankton +BlackAnurianBubble.DisplayName: Anurian Bubble +BlackAnurianPlankton.DisplayName: Anurian Plankton BlindingLight.DisplayName: Blinding Light BloodBeam.DisplayName: Blood Beam -BloodBlast.DisplayName: Blast +BloodBlast.DisplayName: Blood Blast BloodRay.DisplayName: Blood Ray BlueBubble.DisplayName: Bubble BlushieStaffProj.DisplayName: Staff of Blushie BrimroseBeam.DisplayName: Brimrose Beam -BrimstoneFireball.DisplayName: Fireball -BrimstoneHellfireballFriendly.DisplayName: Hellfire -BrimstoneHomer.DisplayName: Homer -BrimstoneTentacle.DisplayName: Tentacle -ClamorNoctusStar.DisplayName: Star -ClamorNoctusWyvern.DisplayName: Wyvern +BrimstoneFireball.DisplayName: Brimstone Fireball +BrimstoneHellfireballFriendly.DisplayName: Hellfireball +BrimstoneHomer.DisplayName: Brimstone Homer +BrimstoneTentacle.DisplayName: Brimstone Tentacle +ClamorNoctusStar.DisplayName: Clamor Star +ClamorNoctusWyvern.DisplayName: Clamor Wyvern ClimaxBeam.DisplayName: Voltaic Bolt ClimaxProj.DisplayName: Voltaic Orb CoralSpike.DisplayName: Coral Spike CoralSpoutHoldout.DisplayName: Coral Spout -CosmicTentacle.DisplayName: Tentacle -CryoBlast.DisplayName: Blast -DarkSparkBeam.DisplayName: Beam -DarkSparkPrism.DisplayName: Crystal +CosmicTentacle.DisplayName: Dark Tentacle +CryoBlast.DisplayName: Cryo Blast +DarkSparkBeam.DisplayName: Dark Spark Beam +DarkSparkPrism.DisplayName: Dark Crystal DeathhailBeam.DisplayName: Deathhail DivineRetributionSpear.DisplayName: Divine Retribution -DustProjectile.DisplayName: Dust -EelDrop.DisplayName: Acid -EidolicWailSoundwave.DisplayName: Wail -EldritchTentacle.DisplayName: Tentacle -ElementTentacle.DisplayName: Tentacle +DustProjectile.DisplayName: Death Valley Dust +EelDrop.DisplayName: Acid Eel Drop +EidolicWailSoundwave.DisplayName: Eidolic Wail +EldritchTentacle.DisplayName: Eldritch Tentacle +ElementTentacle.DisplayName: Elemental Tentacle EnormousConsumingVortex.DisplayName: Subsuming Vortex EternityBook.DisplayName: Eternity EternityCircle.DisplayName: Eternity @@ -69,30 +69,30 @@ EternityHex.DisplayName: Eternity EternityHoming.DisplayName: Eternity EventHorizonBlackhole.DisplayName: Blackhole EventHorizonStar.DisplayName: Event Horizon Star -EvergladeSprayProjectile.DisplayName: Spray +EvergladeSprayProjectile.DisplayName: Everglade Spray ExoVortex.DisplayName: Subsuming Vortex ExoVortex2.DisplayName: Subsuming Vortex -FabBolt.DisplayName: Bolt -FabRay.DisplayName: Ray +FabBolt.DisplayName: Fab Bolt +FabRay.DisplayName: Fab Ray FatesRevealFlame.DisplayName: Fate's Reveal FlamingPumpkin.DisplayName: Pumpkin FlareBoltProjectile.DisplayName: Flare Bolt -ForbiddenAxeBlade.DisplayName: Blade +ForbiddenAxeBlade.DisplayName: Ruin Blade ForbiddenSunburst.DisplayName: Sunburst -ForbiddenSunProjectile.DisplayName: Sun +ForbiddenSunProjectile.DisplayName: Forbidden Sun FrigidflashBoltProjectile.DisplayName: Frigidflash Bolt -FrostBoltProjectile.DisplayName: Ball -GammaLaser.DisplayName: Laser +FrostBoltProjectile.DisplayName: Frost Ball +GammaLaser.DisplayName: Gamma Laser GhastlyBlast.DisplayName: Ghast Blast GhastlyExplosion.DisplayName: Ghastly Explosion GhastlyExplosionShard.DisplayName: Ghastly Fragment GhastlySubBlast.DisplayName: Ghast Blast GhastlyVisageProj.DisplayName: Ghastly Visage -GleamingBolt.DisplayName: Bolt -GleamingBolt2.DisplayName: Bolt +GleamingBolt.DisplayName: Gleaming Bolt +GleamingBolt2.DisplayName: Gleaming Bolt GrandStaffoftheNebulaMage_Held.DisplayName: Grand Staff of the Nebula Mage GraniteEnergy.DisplayName: Granite Energy -GranitePulse.DisplayName: Pulse +GranitePulse.DisplayName: Granite Pulse GruesomeEminenceHoldout.DisplayName: Gruesome Eminence HadalUrnHoldout.DisplayName: Hadal Urn HadalUrnIsopod.DisplayName: Abyssal Isopod @@ -104,75 +104,75 @@ HeliumFlashBlast.DisplayName: Helium Flash HellfireExplosionFriendly.DisplayName: Explosion HellwingPillar.DisplayName: Pillar HeresyProj.DisplayName: Heresy -HolyFlame.DisplayName: Flame -HolyLaser.DisplayName: Laser +HolyFlame.DisplayName: Holy Flame +HolyLaser.DisplayName: Holy Laser IceBarrageMain.DisplayName: Ice Barrage IceBlock.DisplayName: Ice Barrage IceBlockIcicle.DisplayName: Ice Barrage -IceCluster.DisplayName: Ice +IceCluster.DisplayName: Ice Cluster Icicle.DisplayName: Icicle -IcicleStaffProj.DisplayName: Fury +IcicleStaffProj.DisplayName: Furious Icicle InfernadoFriendly.DisplayName: Infernado -InfernadoMarkFriendly.DisplayName: Mark -InfernalBlade.DisplayName: Blade -InfernalBlade2.DisplayName: Blade -IonBlast.DisplayName: Blast -KeelhaulBubble.DisplayName: Bubble -KeelhaulGeyserBottom.DisplayName: Geyser -KeelhaulGeyserTop.DisplayName: Geyser +InfernadoMarkFriendly.DisplayName: Infernado Mark +InfernalBlade.DisplayName: Infernal Blade +InfernalBlade2.DisplayName: Infernal Blade +IonBlast.DisplayName: Ion Blast +KeelhaulBubble.DisplayName: Keelhaul Bubble +KeelhaulGeyserBottom.DisplayName: Keelhaul Geyser +KeelhaulGeyserTop.DisplayName: Keelhaul Geyser LazharSolarBeam.DisplayName: Concentrated Solar Beam LightBall.DisplayName: Light Ball -LightBallExplosion.DisplayName: Explosion +LightBallExplosion.DisplayName: Light Explosion LightBead.DisplayName: Light Bead LightBeadSplit.DisplayName: Light Bead LightBlade.DisplayName: Light Blade LightningArc.DisplayName: Lightning Arc -LiquidBlade.DisplayName: Blade -LiquidBlade2.DisplayName: Blade -LuxorsGiftMagic.DisplayName: Gift +LiquidBlade.DisplayName: Liquidating Blade +LiquidBlade2.DisplayName: Liquidating Blade +LuxorsGiftMagic.DisplayName: Luxor's Magic MadAlchemistsCocktailAlt.DisplayName: Mad Alchemist's Prismatic Cocktail MadAlchemistsCocktailBlue.DisplayName: Mad Alchemist's Blue Cocktail MadAlchemistsCocktailGasCloud.DisplayName: Mad Alchemist's Gas MadAlchemistsCocktailGreen.DisplayName: Mad Alchemist's Green Cocktail MadAlchemistsCocktailPurple.DisplayName: Mad Alchemist's Purple Cocktail MadAlchemistsCocktailRed.DisplayName: Mad Alchemist's Red Cocktail -MadAlchemistsCocktailShrapnel.DisplayName: Shrapnel +MadAlchemistsCocktailShrapnel.DisplayName: Mad Alchemist's Shrapnel MagnaBlast.DisplayName: Blast -MagneticBeam.DisplayName: Beam +MagneticBeam.DisplayName: Magnetic Beam MagneticOrb.DisplayName: Magnetic Orb -ManaBolt.DisplayName: Bolt -ManaBoltSmall.DisplayName: Bolt -ManaBoltSmall2.DisplayName: Bolt +ManaBolt.DisplayName: Mana Bolt +ManaBoltSmall.DisplayName: Mana Bolt +ManaBoltSmall2.DisplayName: Mana Bolt ManaChargedCoral.DisplayName: Mana-charged Coral ManaMonster.DisplayName: Mana Monster MelterAmp.DisplayName: Melter Amp -MelterNote1.DisplayName: Song -MelterNote2.DisplayName: Song +MelterNote1.DisplayName: Melter Song +MelterNote2.DisplayName: Melter Song MeteorStar.DisplayName: Meteor Star MeteorStarExplosion.DisplayName: Explosion -MiasmaGas.DisplayName: Gas +MiasmaGas.DisplayName: Miasma Gas NanoPurgeHoldout.DisplayName: Nano Purge NanoPurgeLaser.DisplayName: Nano Beam NebulaCloud.DisplayName: Nebula Cloud NebulaCloudCore.DisplayName: Nebula Cloud Core -NebulaElementalBeam.DisplayName: Beam +NebulaElementalBeam.DisplayName: Nebula Beam NebulaNova.DisplayName: Nebula Nova -NettleRight.DisplayName: Thorn -NettleTip.DisplayName: Thorn -NightBolt.DisplayName: Bolt -NightOrb.DisplayName: Orb -NightsRayBeam.DisplayName: Ray +NettleRight.DisplayName: Nettle Thorn +NettleTip.DisplayName: Nettle Thorn +NightBolt.DisplayName: Night's Bolt +NightOrb.DisplayName: Night's Orb +NightsRayBeam.DisplayName: Night's Ray NuclearFuryProjectile.DisplayName: Nuclear Fury ParticleBeamofDoom.DisplayName: Doom PartySparkle.DisplayName: Pretty Sparkle -PhantasmalFuryProj.DisplayName: Fury +PhantasmalFuryProj.DisplayName: Phantasmal Fury Phantom.DisplayName: Phantom PhasedGodRay.DisplayName: Phased God Ray PlagueFang.DisplayName: Plague Fang -PlasmaBolt.DisplayName: Bolt -PlasmaRay.DisplayName: Ray -PlasmaRay2.DisplayName: Ray -PlasmaShot.DisplayName: Shot +PlasmaBolt.DisplayName: Plasma Bolt +PlasmaRay.DisplayName: Plasma Ray +PlasmaRay2.DisplayName: Plasma Ray +PlasmaShot.DisplayName: Plasma Shot PoseidonTyphoon.DisplayName: Poseidon Typhoon PrinceFlameLarge.DisplayName: Holy Fireball PrinceFlameSmall.DisplayName: Holy Fire @@ -180,59 +180,59 @@ RainbowComet.DisplayName: Comet RainbowPartyCannonProjectile.DisplayName: Party Cannon RainbowRocket.DisplayName: Rainbow Rocket RancorArm.DisplayName: Vengeful Arm -RancorFog.DisplayName: Fog +RancorFog.DisplayName: The Fog Is Coming RancorHoldout.DisplayName: Rancor RancorLargeCinder.DisplayName: Lava Cinder RancorLaserbeam.DisplayName: The Angy Beam RancorMagicCircle.DisplayName: Magic Circle -RancorSmallCinder.DisplayName: Cinder +RancorSmallCinder.DisplayName: Rancor Cinder RedirectingFire.DisplayName: Fire RedirectingGildedSoul.DisplayName: Gilded Soul RedirectingLostSoul.DisplayName: Soul RedirectingVengefulSoul.DisplayName: Soul -RougeSlashLarge.DisplayName: Slash -RougeSlashMedium.DisplayName: Slash -RougeSlashSmall.DisplayName: Slash -SanguineFlareProj.DisplayName: Flare -SeethingDischargeBrimstoneBarrage.DisplayName: Brimstone -SeethingDischargeBrimstoneHellblast.DisplayName: Hellblast +RougeSlashLarge.DisplayName: Rouge Slash +RougeSlashMedium.DisplayName: Rouge Slash +RougeSlashSmall.DisplayName: Rouge Slash +SanguineFlareProj.DisplayName: Sanguine Flare +SeethingDischargeBrimstoneBarrage.DisplayName: Seething Brimstone +SeethingDischargeBrimstoneHellblast.DisplayName: Seething Hellblast SerpentineBody.DisplayName: Serpentine SerpentineHead.DisplayName: Serpentine SerpentineTail.DisplayName: Serpentine -ShadecrystalProjectile.DisplayName: Crystal -ShadeNimbus.DisplayName: Nimbus -ShadeNimbusCloud.DisplayName: Nimbus -Shaderain.DisplayName: Rain -Shadowbolt.DisplayName: Bolt +ShadecrystalProjectile.DisplayName: Shadecrystal +ShadeNimbus.DisplayName: Shade Nimbus +ShadeNimbusCloud.DisplayName: Shade Nimbus +Shaderain.DisplayName: Shaderain +Shadowbolt.DisplayName: Shadowbolt ShiftingSandsProj.DisplayName: Shifting Sands SHPB.DisplayName: SHPB -SHPExplosion.DisplayName: Explosion -SHPL.DisplayName: Laser +SHPExplosion.DisplayName: SHPB Explosion +SHPL.DisplayName: SHPL SilvaBurst.DisplayName: Silva Burst -SlitheringEelProjectile.DisplayName: Eel +SlitheringEelProjectile.DisplayName: Slithering Eel SmallSpirit.DisplayName: Small Angry Spirit Snowball.DisplayName: Snowball Snowflake.DisplayName: Snowflake -SolarElementalBeam.DisplayName: Beam -SoulPiercerBeam.DisplayName: Piercer -SoulPiercerBolt.DisplayName: Piercer +SolarElementalBeam.DisplayName: Solar Beam +SoulPiercerBeam.DisplayName: Soul Piercer +SoulPiercerBolt.DisplayName: Soul Piercer SparkInfernal.DisplayName: Spark SparklingLaser.DisplayName: Sparkling Laser SpiritCongregation.DisplayName: Spirit Monster SpiritDust.DisplayName: Spirit Dust Starblast.DisplayName: Star -StardustElementalBeam.DisplayName: Beam +StardustElementalBeam.DisplayName: Stardust Beam StickyFeather.DisplayName: Feather -SupremeDustFlakProjectile.DisplayName: Dust -SupremeDustProjectile.DisplayName: Dust +SupremeDustFlakProjectile.DisplayName: Earthy Dust +SupremeDustProjectile.DisplayName: Earthy Dust TacticiansElectricBoom.DisplayName: Electric Explosion -TacticiansTrumpCardProj.DisplayName: Beam +TacticiansTrumpCardProj.DisplayName: Trump Beam TearsofHeavenProjectile.DisplayName: Tears of Heaven -TerraBeam.DisplayName: Beam -TerraShard.DisplayName: Shard -ThunderstormShot.DisplayName: Shot -ThunderstormShotSplit.DisplayName: Shot -TradewindsProjectile.DisplayName: Feather +TerraBeam.DisplayName: Terra Beam +TerraShard.DisplayName: Terra Shard +ThunderstormShot.DisplayName: Thunderous Shot +ThunderstormShotSplit.DisplayName: Thunderous Shot +TradewindsProjectile.DisplayName: Tradewinds Feather TridentIcicle.DisplayName: Trident Icicle UberBubble.DisplayName: Bubble UndinesRetributionSpear.DisplayName: Undine's Retribution @@ -243,26 +243,26 @@ VeeringWindFrostWave.DisplayName: Veering Wind Frost Wave Vehemence.DisplayName: Blast of Vehemence VehemenceHoldout.DisplayName: Vehemence VehemenceSkull.DisplayName: Vehement Skull -VenusianBolt.DisplayName: Bolt -VenusianExplosion.DisplayName: Explosion +VenusianBolt.DisplayName: Venusian Bolt +VenusianExplosion.DisplayName: Venusian Explosion VenusianFlame.DisplayName: Venusian Cinder VisceraBeam.DisplayName: Viscera -VitriolicViperFang.DisplayName: Fang -VitriolicViperSpit.DisplayName: Spit -VividBeam.DisplayName: Beam -VividBolt.DisplayName: Bolt -VividClarityBeam.DisplayName: Ray -VividExplosion.DisplayName: Explosion +VitriolicViperFang.DisplayName: Vitriolic Fang +VitriolicViperSpit.DisplayName: Vitriolic Spit +VividBeam.DisplayName: Vivid Beam +VividBolt.DisplayName: Vivid Bolt +VividClarityBeam.DisplayName: Vivid Ray +VividExplosion.DisplayName: Vivid Explosion VividLaser2.DisplayName: Vivid Bolt -VividOrb.DisplayName: Orb +VividOrb.DisplayName: Vivid Orb VoidVortexProj.DisplayName: Void Vortex VolatileStarcore.DisplayName: Volatile Starcore -VortexElementalBeam.DisplayName: Lightning -WaterLeechProj.DisplayName: Leech -WaterStream.DisplayName: Stream -WaterStream2.DisplayName: Stream +VortexElementalBeam.DisplayName: Vortex Lightning +WaterLeechProj.DisplayName: Water Leech +WaterStream.DisplayName: Water Stream +WaterStream2.DisplayName: Water Stream WaywasherProj.DisplayName: Waywasher Blast -WulfrumBolt.DisplayName: Bolt +WulfrumBolt.DisplayName: Wulfrum Bolt WulfrumManaDrain.DisplayName: Mana Drain WyvernFeatherGreen.DisplayName: Feather WyvernFeatherPink.DisplayName: Feather diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index 6cbdbe48db..2d486cc691 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -2,7 +2,7 @@ AegisBeam.DisplayName: Aegis Beam AegisBlast.DisplayName: Aegis Blast AegisBlast2.DisplayName: Aegis Blast AegisFlame.DisplayName: Aegis Flame -AftershockRock.DisplayName: Rock +AftershockRock.DisplayName: Afterrock AmidiasWhirlpool.DisplayName: Whirlpool AncientBeam.DisplayName: Ancient Beam AncientStar.DisplayName: Ancient Star @@ -28,46 +28,46 @@ AtaraxiaSide.DisplayName: Also Not Exoblade AtaraxiaSplit.DisplayName: Still Not Exoblade BalefulHarvesterProjectile.DisplayName: Pumpkin Skull BallOFuguProj.DisplayName: Ball O Fugu -BansheeHookBoom.DisplayName: Boom -BansheeHookScythe.DisplayName: Scythe +BansheeHookBoom.DisplayName: Banshee Boom +BansheeHookScythe.DisplayName: Banshee Scythe BiomeBladeHoldout.DisplayName: Mended Biome Blade BitingEmbrace.DisplayName: Biting Embrace BitingEmbraceMist.DisplayName: Glacial Mist BladecrestOathswordProj.DisplayName: Bladecrest Oathsword BlazingPhantomBlade.DisplayName: Blazing Phantom Blade -Blood.DisplayName: Blood +Blood.DisplayName: Carnage Blood Blood2.DisplayName: Blood BloodBall.DisplayName: Blood Ball BloodExplosion.DisplayName: Blood BloodScythe.DisplayName: Blood Scythe -BonebreakerFragment1.DisplayName: Shrapnel +BonebreakerFragment1.DisplayName: Bone Crunching Shrapnel BonebreakerProjectile.DisplayName: Bonebreaker Brimblast.DisplayName: Brimblast -BrimlanceHellfireExplosion.DisplayName: Explosion -BrimlanceStandingFire.DisplayName: Flame +BrimlanceHellfireExplosion.DisplayName: Brimlance Explosion +BrimlanceStandingFire.DisplayName: Brimlance Flame Brimlash2.DisplayName: Brimlash BrimlashProj.DisplayName: Brimlash BrimstoneBoom.DisplayName: Boom -BrimstoneLaserFriendly.DisplayName: Laser -BrimstoneSwordExplosion.DisplayName: Explosion +BrimstoneLaserFriendly.DisplayName: Brimstone Laser +BrimstoneSwordExplosion.DisplayName: Brimstone Sword Explosion BrimstoneSwordProj.DisplayName: Brimstone Sword BrinySpout.DisplayName: Briny Spout BrinyTyphoonBubble.DisplayName: Bubble BrokenBiomeBladeHoldout.DisplayName: Broken Biome Blade BurningMeteor.DisplayName: Meteor -CatastropheClaymoreSparkle.DisplayName: Aura +CatastropheClaymoreSparkle.DisplayName: Catastrophe Sparkle ChainedMeatHook.DisplayName: Enchanted Meat Hook ClamCrusherFlail.DisplayName: Clam Crusher -CometQuasherMeteor.DisplayName: Meteor -CosmicBolt.DisplayName: Bolt +CometQuasherMeteor.DisplayName: Comet Quasher Meteor +CosmicBolt.DisplayName: Cosmic Bolt CosmicDischargeFlail.DisplayName: Cosmic Discharge CosmicIceBurst.DisplayName: Cosmic Ice -CosmicOrb.DisplayName: Orb +CosmicOrb.DisplayName: Cosmic Orb CosmicShivBall.DisplayName: Cosmic Energy -CosmicShivBlade.DisplayName: Beam -CosmicSpiritBomb1.DisplayName: Bomb -CosmicSpiritBomb2.DisplayName: Bomb -CosmicSpiritBomb3.DisplayName: Bomb +CosmicShivBlade.DisplayName: Cosmic Beam +CosmicSpiritBomb1.DisplayName: Cosmic Bomb +CosmicSpiritBomb2.DisplayName: Cosmic Bomb +CosmicSpiritBomb3.DisplayName: Cosmic Bomb CrescentMoonFlail.DisplayName: Crescent Moon CrescentMoonProj.DisplayName: Crescent Moon CrystylCrusherRay.DisplayName: Crystyl Crusher Ray @@ -75,38 +75,38 @@ Cyclone.DisplayName: Cyclone DarkBall.DisplayName: Dark Ball DarkBeam.DisplayName: Dark Beam DarkIceZero.DisplayName: Dark Ice -DeathsAscensionProjectile.DisplayName: Scythe +DeathsAscensionProjectile.DisplayName: Ascended Scythe DeathsAscensionSwing.DisplayName: Death's Ascension DecaysRetort.DisplayName: Decay's Retort DecaysRetortDash.DisplayName: Evisceration Lunge DemonBlast.DisplayName: Devil Fork -DepthOrb.DisplayName: Beam -DepthOrb2.DisplayName: Beam +DepthOrb.DisplayName: Depth Trident +DepthOrb2.DisplayName: Neptune's Trident DevilsSunriseCyclone.DisplayName: Devil's Sunrise DevilsSunriseProj.DisplayName: Devil's Sunrise DivineHatchetBoomerang.DisplayName: Scorching Seeker DNA.DisplayName: DNA DNA2.DisplayName: DNA -DracoBeam.DisplayName: Beam -DracoBeam2.DisplayName: Beam +DracoBeam.DisplayName: Draconic Beam +DracoBeam2.DisplayName: Draconic Beam DraconicSpark.DisplayName: Draconic Spark DragonPowFlail.DisplayName: Dragon Pow -DragonRageFireball.DisplayName: Fire +DragonRageFireball.DisplayName: Dragon Rage Fireball DragonRageStaff.DisplayName: Dragon Rage Earth2.DisplayName: Earth Earth3.DisplayName: Earth Earth4.DisplayName: Earth EarthProj.DisplayName: Earth ElementalGlassStar.DisplayName: Glass Star -ElementBall.DisplayName: Ball +ElementBall.DisplayName: Elemental Ball ElementBallShiv.DisplayName: Shiv EmpyreanKnife.DisplayName: Empyrean Knife EntropicFlechette.DisplayName: Entropic Flechette EntropicFlechetteLarge.DisplayName: Entropic Flechette EntropicFlechetteSmall.DisplayName: Entropic Flechette EonBolt.DisplayName: Eon Bolt -EssenceFlame2.DisplayName: Flame -EssenceScythe.DisplayName: Scythe +EssenceFlame2.DisplayName: Essence Flame +EssenceScythe.DisplayName: Essence Scythe EutrophicScimitarProj.DisplayName: Scimitar Zap EutrophicSpark.DisplayName: Eutrophic Spark ExcelsusBlue.DisplayName: Excelsus @@ -126,25 +126,25 @@ FallenPaladinsHammerProj.DisplayName: Fallen Paladin's Hammer Feather.DisplayName: Feather Flarefrost.DisplayName: Flarefrost ForbiddenOathbladeProjectile.DisplayName: Oathblade -GaelExplosion.DisplayName: Explosion +GaelExplosion.DisplayName: Gael Explosion GaelSkull.DisplayName: No Longer Ark of the Cosmos' Superior Cousin GaelSkull2.DisplayName: No Longer Ark of the Cosmos' Superior Cousin -GalacticaComet.DisplayName: Comet +GalacticaComet.DisplayName: Galactus Comet GalaxiaBolt.DisplayName: Galaxia Bolt GalaxiaHoldout.DisplayName: Galactic Formation GalaxiaTropicRing.DisplayName: Star Ring -GalaxyBlast.DisplayName: Blast -GalaxyBlastType2.DisplayName: Blast -GalaxyBlastType3.DisplayName: Blast +GalaxyBlast.DisplayName: Galaxy Blast +GalaxyBlastType2.DisplayName: Galaxy Blast +GalaxyBlastType3.DisplayName: Galaxy Blast GalaxySmasherBlast.DisplayName: Galactic Blast GalaxySmasherEcho.DisplayName: Galaxy Smasher Echo GalaxySmasherHammer.DisplayName: Galaxy Smasher GalaxySmasherMini.DisplayName: Galaxy Smasher -GalaxyStar.DisplayName: Star +GalaxyStar.DisplayName: Galaxy Star GalileosMoon.DisplayName: Crescent Moon GalileosPlanet.DisplayName: Planet -GayBeam.DisplayName: Beam -GelWave.DisplayName: Wave +GayBeam.DisplayName: Iridescent Beam +GelWave.DisplayName: Gelitic Wave GemTechYellowShard.DisplayName: Trireme's Yellow Gem GestureForTheDrowned.DisplayName: Biome Blade GestureForTheDrownedOrb.DisplayName: Gesture for the Drowned @@ -152,56 +152,56 @@ GhastlyChain.DisplayName: Ghastly Chain GhastlySoulLarge.DisplayName: Ghastly Soul GhastlySoulMedium.DisplayName: Ghastly Soul GhastlySoulSmall.DisplayName: Ghastly Soul -GreenWater.DisplayName: Tooth +GreenWater.DisplayName: Greentide Tooth GrovetendersEntanglingVines.DisplayName: Entangling Growth GrovetendersTouch.DisplayName: Grovetender's Touch HeavensMight.DisplayName: Heaven's Might -HellionSpike.DisplayName: Spike -HolyColliderHolyFire.DisplayName: Fire -HyperBlade.DisplayName: Blade +HellionSpike.DisplayName: Hellion Spike +HolyColliderHolyFire.DisplayName: Holy Collider Fire +HyperBlade.DisplayName: Hyper Blade IceBombFriendly.DisplayName: Ice Bomb IllustriousKnife.DisplayName: Illustrious Knife -InsidiousHarpoon.DisplayName: Harpoon -JudgementProj.DisplayName: Judgement +InsidiousHarpoon.DisplayName: Insidious Harpoon +JudgementProj.DisplayName: JUDGEMENT LamentationsOfTheChained.DisplayName: Lamentations of the Chained -LaserFountain.DisplayName: Fountain -LifeScythe.DisplayName: Scythe +LaserFountain.DisplayName: Laser Fountain +LifeScythe.DisplayName: Lifehunt Scythe LightBeam.DisplayName: Light Beam LightningThing.DisplayName: Lightning -LuxorsGiftMelee.DisplayName: Gift +LuxorsGiftMelee.DisplayName: Luxor's Melee MarniteDeconstructorProj.DisplayName: Marnite Deconstructor MarniteObliteratorProj.DisplayName: Marnite Obliterator MercurialTides.DisplayName: Mercurial Tides MercurialTidesBlast.DisplayName: Mercurial Blast MercurialTidesMonolith.DisplayName: Mercurial Monolith MicrowaveAura.DisplayName: Microwave Radiation -MirrorBlast.DisplayName: Blast +MirrorBlast.DisplayName: Mirror Blade MonstrousKnife.DisplayName: Monstrous Knife MourningSkull.DisplayName: Mourning Skull MourningstarFlail.DisplayName: Mourningstar MurasamaSlash.DisplayName: Murasama -Nebudust.DisplayName: Dust +Nebudust.DisplayName: Nebulash Dust NebulashFlail.DisplayName: Nebulash -NebulaShot.DisplayName: Shot -NeptuneOrb.DisplayName: Beam +NebulaShot.DisplayName: Nebula Shot +NeptuneOrb.DisplayName: Neptune's Trident Oathblade.DisplayName: Oathblade -OathswordFlame.DisplayName: Flame +OathswordFlame.DisplayName: Oathsword Flame OldLordClaymoreProj.DisplayName: Old Lord Claymore OmnibladeSwing.DisplayName: Omniblade Orbacle.DisplayName: Auric Orb OrderbringerAura.DisplayName: Aura OrderbringerBeam.DisplayName: Orderbringer Beam OrderbringerRain.DisplayName: Rain -OrderbringerWhiteOrb.DisplayName: Orb +OrderbringerWhiteOrb.DisplayName: Orderbringer Orb PhoenixsPride.DisplayName: Phoenix's Pride -PhosphorescentGauntletPunches.DisplayName: Punch +PhosphorescentGauntletPunches.DisplayName: Gauntlet Punch PhotonRipperProjectile.DisplayName: Extraordinarily Cost-Inefficient Chainsaw -PlagueSeeker.DisplayName: Seeker +PlagueSeeker.DisplayName: Plague Seeker PolarisGaze.DisplayName: Polaris's Gaze PolarisGazeDash.DisplayName: Polaris Piercing Lunge PolarisGazeStar.DisplayName: Northern Star PrismaticBeam.DisplayName: Prismatic Beam -PrismaticWave.DisplayName: Wave +PrismaticWave.DisplayName: Prismatic Wave PrismRay.DisplayName: Prismatic Light PrismTooth.DisplayName: Photon Ripper PurityProjection.DisplayName: Purity Projection @@ -217,18 +217,18 @@ Razorwind.DisplayName: Razorwind RedtideWhirlpool.DisplayName: Whirlpool RemsRevengeProj.DisplayName: Rem's Revenge RendingNeedle.DisplayName: Rending Needle -Rox1.DisplayName: Rox1 +Rox1.DisplayName: Rock RoxShockwave.DisplayName: Rox Shockwave RoxSlam.DisplayName: Rox Slam RSSolarFlare.DisplayName: Flare -SandBlade.DisplayName: Blade +SandBlade.DisplayName: Sand Blade SandFire.DisplayName: Fire SanguineFury.DisplayName: Sanguine Fury SanguineFuryDash.DisplayName: Shredding Lunge SanguineFuryWheel.DisplayName: Sanguine Bladewheel ScourgeoftheCosmosMini.DisplayName: Miniature Cosmic Scourge ScourgeoftheCosmosProj.DisplayName: Cosmic Scourge -SeashineSwordProj.DisplayName: Seashine Sword Proj +SeashineSwordProj.DisplayName: Seashine Beam SHIV.DisplayName: Shiv AquaticDischargeProj.DisplayName: Aquatic Discharge CosmicShivProj.DisplayName: Cosmic Shiv @@ -237,68 +237,68 @@ GalileoGladiusProj.DisplayName: Galileo Gladius LucreciaProj.DisplayName: Lucrecia SubmarineShockerProj.DisplayName: Submarine Shocker SolarNeedle.DisplayName: Solar Needle -SolsticeBeam.DisplayName: Beam -SoulScythe.DisplayName: Scythe -SoulScytheExplosion.DisplayName: Explosion +SolsticeBeam.DisplayName: Solstice Beam +SoulScythe.DisplayName: Soul Scythe +SoulScytheExplosion.DisplayName: Soul Explosion Spark.DisplayName: Spark -SpatialSpear.DisplayName: Spear -SpatialSpear2.DisplayName: Spear -SpatialSpear3.DisplayName: Spear -SpatialSpear4.DisplayName: Spear -AmidiasTridentProj.DisplayName: Trident -AstralPikeProj.DisplayName: Pike +SpatialSpear.DisplayName: Elemental Spear +SpatialSpear2.DisplayName: Elemental Spear +SpatialSpear3.DisplayName: Elemental Spear +SpatialSpear4.DisplayName: Elemental Spear +AmidiasTridentProj.DisplayName: Amidias' Trident +AstralPikeProj.DisplayName: Astral Pike BansheeHookProj.DisplayName: Banshee Hook BrimlanceProj.DisplayName: Brimlance -DiseasedPikeSpear.DisplayName: Pike -EarthenPikeSpear.DisplayName: Pike -ElementalLanceProjectile.DisplayName: Lance -GildedProboscisProj.DisplayName: Proboscis -GoldplumeSpearProjectile.DisplayName: Spear -HellionFlowerSpearProjectile.DisplayName: Spear +DiseasedPikeSpear.DisplayName: Diseased Pike +EarthenPikeSpear.DisplayName: Earthen Pike +ElementalLanceProjectile.DisplayName: Elemental Lance +GildedProboscisProj.DisplayName: Gilded Proboscis +GoldplumeSpearProjectile.DisplayName: Goldplume Spear +HellionFlowerSpearProjectile.DisplayName: Hellion Flower Spear InsidiousImpalerProj.DisplayName: Insidious Impaler NadirSpear.DisplayName: Nadir RedtideSpearProjectile.DisplayName: Redtide Spear -SausageMakerSpear.DisplayName: Spear -StarnightLanceProjectile.DisplayName: Lance +SausageMakerSpear.DisplayName: Sausage Maker +StarnightLanceProjectile.DisplayName: Starnight Lance StreamGougeProj.DisplayName: Stream Gouge TenebreusTidesProjectile.DisplayName: Tenebreus Tides -TerraLanceProjectile.DisplayName: Lance -VulcaniteLanceProj.DisplayName: Lance +TerraLanceProjectile.DisplayName: Terra Lance +VulcaniteLanceProj.DisplayName: Vulcanite Lance YateveoBloomSpear.DisplayName: Yateveo Bloom SpineOfThanatosProjectile.DisplayName: Spine of Thanatos -StarnightBeam.DisplayName: Beam +StarnightBeam.DisplayName: Starnight Beam StellarContemptBlast.DisplayName: Stellar Blast StellarContemptEcho.DisplayName: Echoes of Contempt StellarContemptHammer.DisplayName: Stellar Contempt -StormBeam.DisplayName: Beam -StormMark.DisplayName: Mark -StormRulerProj.DisplayName: Ruler -StreamGougePortal.DisplayName: Portal +StormBeam.DisplayName: Storm Beam +StormMark.DisplayName: Storm Mark +StormRulerProj.DisplayName: Storm Ruler +StreamGougePortal.DisplayName: Stream Gouge Portal StygianShieldAttack.DisplayName: Bull Rush StygianShieldThrown.DisplayName: Shield of Chaos -SulphurousGrabberBubble.DisplayName: Bubble -SulphurousGrabberBubble2.DisplayName: Bubble -SunlightBlade.DisplayName: Blade +SulphurousGrabberBubble.DisplayName: Grabber Bubble +SulphurousGrabberBubble2.DisplayName: Grabber Bubble +SunlightBlade.DisplayName: Sunlight Blade SwordsmithsPride.DisplayName: Swordsmith's Pride SwordsmithsPrideBeam.DisplayName: Swordsmith's Projection SwordsplosionBlue.DisplayName: Blue Sword SwordsplosionGreen.DisplayName: Green Sword SwordsplosionPurple.DisplayName: Purple Sword SwordsplosionRed.DisplayName: Red Sword -TaintedBladeSlasher.DisplayName: Blade +TaintedBladeSlasher.DisplayName: Tainted Blade TenebreusTidesWaterProjectile.DisplayName: Water Spear TenebreusTidesWaterSpear.DisplayName: Tenebreus Tides Water Spear TenebreusTidesWaterSword.DisplayName: Tenebreus Tides Water Sword -TerraSpear.DisplayName: Spear +TerraSpear.DisplayName: Terra Spear TerratomereBeam.DisplayName: Terra Slash Beam TerratomereBigSlash.DisplayName: Terratomere Slash -TerratomereExplosion.DisplayName: Explosion +TerratomereExplosion.DisplayName: Terratomere Explosion TerratomereHoldoutProj.DisplayName: Terratomere TerratomereSlash.DisplayName: Terratomere Slash TerratomereSlashCreator.DisplayName: Anime Sword Effect TerrorBeam.DisplayName: Terror Beam TerrorBlast.DisplayName: Terror Blast -ThanatosBoom.DisplayName: Boom +ThanatosBoom.DisplayName: Thanos Boom ThornBase.DisplayName: Thorn ThornTip.DisplayName: Thorn TinyCrystal.DisplayName: Crystal @@ -313,7 +313,7 @@ TrueArkoftheAncientsParryHoldout.DisplayName: Ark of the Ancients TrueArkoftheAncientsSwungBlade.DisplayName: Ark of the Ancients TrueBiomeBladeHoldout.DisplayName: True Biome Blade TrueBitingEmbrace.DisplayName: Biting Embrace -TrueCausticEdgeProjectile.DisplayName: Edge +TrueCausticEdgeProjectile.DisplayName: Caustic Edge TrueDecaysRetort.DisplayName: Decay's Retort TrueGrovetendersTouch.DisplayName: Grovetender's Touch TruePurityProjection.DisplayName: Purity Projection @@ -322,8 +322,8 @@ TumbleweedRolling.DisplayName: Tumbleweed TyphonsGreedBubble.DisplayName: Typhon's Greed TyphonsGreedStaff.DisplayName: Typhon's Greed UltimusCleaverDust.DisplayName: Ultimus Flame -UrchinBall.DisplayName: UrchinBall -UrchinBallSpike.DisplayName: Spike +UrchinBall.DisplayName: Urchin Ball +UrchinBallSpike.DisplayName: Urchin Ball Spike UrchinMaceProjectile.DisplayName: Urchin Mace UrchinSpikeFugu.DisplayName: Urchin Spike ViolenceSlashProjectile.DisplayName: Violence @@ -334,12 +334,12 @@ VoidEssence.DisplayName: Void Essence VoidTentacle.DisplayName: Void Tentacle VolcanicFireball.DisplayName: Volcanic Fireball VolcanicFireballLarge.DisplayName: Volcanic Fireball -Waterfall.DisplayName: Beam -WhiteBoltAura.DisplayName: Aura -WhiteOrb.DisplayName: Orb -Whiterain.DisplayName: Rain -WulfrumScrew.DisplayName: Screw -WulfrumScrewdriverProj.DisplayName: Screwdriver +Waterfall.DisplayName: Waterfall Beam +WhiteBoltAura.DisplayName: White Aura +WhiteOrb.DisplayName: White Orb +Whiterain.DisplayName: White Rain +WulfrumScrew.DisplayName: Wulfrum Screw +WulfrumScrewdriverProj.DisplayName: Wulfrum Screwdriver YateveoBloomProj.DisplayName: Yateveo Bloom YinYoDark.DisplayName: Dark Shard YinYoLight.DisplayName: Light Shard diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index d81a3a58cb..1b316cb95e 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -8,30 +8,31 @@ AquaBlast.DisplayName: Aqua Blast AquaBlastToxic.DisplayName: Aqua Blast Toxic Aquashard.DisplayName: Aquashard AquashardSplit.DisplayName: Aquashard +ArcherfishRing.DisplayName: Archerfish Ring ArcherfishShot.DisplayName: Water Round ArcticArrowProj.DisplayName: Arctic Arrow AstralCannonProjectile.DisplayName: Astral Crystal AstralRound.DisplayName: Astral Round AstralSandgun.DisplayName: Astral Sandgun AstrealArrow.DisplayName: Astreal Arrow -AstrealFlame.DisplayName: Flame -AuralisBullet.DisplayName: Bullet -AuroraFire.DisplayName: Aurora +AstrealFlame.DisplayName: Astreal Flame +AuralisBullet.DisplayName: Auralis Bullet +AuroraFire.DisplayName: Aurora Blaze BallistaGreatArrow.DisplayName: Ballista Great Arrow BeeRPG.DisplayName: Bee RPG BigCoral.DisplayName: Big Coral BigNuke.DisplayName: Big Nuke BlissfulBombardierDustProjectile.DisplayName: Holy Flare Dust -BloodBoilerFire.DisplayName: Blood +BloodBoilerFire.DisplayName: Blood Fire BloodClotFriendly.DisplayName: Blood Clot BloodfireArrowProj.DisplayName: Bloodfire Arrow BloodfireBulletProj.DisplayName: Bloodfire Bullet BloodflareSoul.DisplayName: Blood Soul -Bolt.DisplayName: Bolt +Bolt.DisplayName: Storm Bolt BoltArrow.DisplayName: Bolt Arrow BouncingShotgunPellet.DisplayName: Shotgun Pellet -BrimstoneBolt.DisplayName: Bolt -BrimstoneFireFriendly.DisplayName: Fire +BrimstoneBolt.DisplayName: Brimstone Bolt +BrimstoneFireFriendly.DisplayName: Brimstone Fire BubonicRoundProj.DisplayName: Bubonic Round ButcherGun.DisplayName: Butcher CardClub.DisplayName: Club @@ -44,8 +45,8 @@ ChargedBlast2.DisplayName: Blast ChickenCannonHeld.DisplayName: Chicken Cannon ChickenExplosion.DisplayName: Kentucky Fried Explosion ChickenRocket.DisplayName: Chicken Rocket -ClamorRifleProj.DisplayName: Energy Bolt -ClamorRifleProjSplit.DisplayName: Energy Bolt +ClamorRifleProj.DisplayName: Clamor Bolt +ClamorRifleProjSplit.DisplayName: Clamor Bolt ClaretCannonProj.DisplayName: Claret Cannon ClockworkBowHoldout.DisplayName: ClockworkBow CondemnationArrow.DisplayName: Condemning Arrow @@ -56,10 +57,10 @@ ContagionBall.DisplayName: Contagion Ball ContagionBow.DisplayName: Contagion CorinthPrimeAirburst.DisplayName: Airburst CorinthPrimeAirburstGrenade.DisplayName: Corinth Prime Airburst Shot -CorossiveFlames.DisplayName: Flames -CorrodedShell.DisplayName: Shell -CosmicFire.DisplayName: Fire -DaemonsFlameArrow.DisplayName: Arrow +CorossiveFlames.DisplayName: Plagued Flames +CorrodedShell.DisplayName: Corroded Shell +CosmicFire.DisplayName: Dead Sun's Fire +DaemonsFlameArrow.DisplayName: Daemon's Arrow DaemonsFlameBow.DisplayName: Daemon's Flame DragonsBreathRound.DisplayName: Dragon's Breath Round DrataliornusBow.DisplayName: Drataliornus @@ -69,10 +70,11 @@ DrizzlefishFire.DisplayName: Drizzlefish Flames DrizzlefishFireball.DisplayName: Drizzlefish Fireball DrizzlefishFireSplit.DisplayName: Drizzlefish Flames DWArrow.DisplayName: Death's Arrow -ElysianArrowProj.DisplayName: Arrow +ElementalFire.DisplayName: Elemental Fire +ElysianArrowProj.DisplayName: Elysian Arrow EmesisGore.DisplayName: Rotten Gore EnhancedNanoRoundProj.DisplayName: Enhanced Nano Round -EssenceFire.DisplayName: Fire +EssenceFire.DisplayName: God Slayer Fire ExoCrystalArrow.DisplayName: Exo Crystal ExoFire.DisplayName: Exo Flames ExoFlare.DisplayName: Exo Flare @@ -84,8 +86,8 @@ FallenStarProj.DisplayName: Fallen Star FeatherLarge.DisplayName: Feather FishronRPG.DisplayName: RPG FlakKrakenGun.DisplayName: Flak Kraken -FlakKrakenProj.DisplayName: Kraken -FlareBat.DisplayName: Bat +FlakKrakenProj.DisplayName: Kraken Reticle +FlareBat.DisplayName: Flare Bat Flash.DisplayName: Flash FlashRoundProj.DisplayName: Flash Round FlurrystormCannonShooting.DisplayName: Flurrystorm Cannon @@ -94,17 +96,17 @@ FlurrystormIceShard.DisplayName: Ice Shard FossilShard.DisplayName: Shard FreedomStarBeam.DisplayName: Freedom Star Beam FreedomStarHoldout.DisplayName: Freedom Star -FungiOrb.DisplayName: Orb -FungiOrb2.DisplayName: Orb +FungiOrb.DisplayName: Fungi Orb +FungiOrb2.DisplayName: Fungi Orb GemTechGreenFlechette.DisplayName: Gem Tech Flechette GodSlayerSlugProj.DisplayName: God Slayer Slug -GoliathRocket.DisplayName: Rocket +GoliathRocket.DisplayName: Goliath Rocket HalleysComet.DisplayName: Halley's Comet HandheldTankShell.DisplayName: Tank Shell HeavenlyGaleProj.DisplayName: Heavenly Gale HighExplosivePeanutShell.DisplayName: High Explosive Peanut Shell -HiveBomb.DisplayName: Bomb -HiveMissile.DisplayName: Bomb +HiveBomb.DisplayName: Hive Bomb +HiveMissile.DisplayName: Hive Missile HolyFireBulletProj.DisplayName: Holy Fire Bullet HydraHead.DisplayName: Hydra Head HydraHeadLaunch.DisplayName: Hydra Head @@ -116,11 +118,13 @@ IcyBulletProj.DisplayName: Icy Bullet IlluminatedBullet.DisplayName: Illuminated Bullet ImpactRound.DisplayName: Impact Round KarasawaShot.DisplayName: Karasawa Shot -LeafArrow.DisplayName: Arrow +LeafArrow.DisplayName: Leaf Arrow LunarBolt.DisplayName: Bolt LunarBolt2.DisplayName: Bolt -LuxorsGiftRanged.DisplayName: Gift +LuxorsGiftRanged.DisplayName: Luxor's Ranged MaelstromHoldout.DisplayName: The Maelstrom +MagnaCannonHoldout.DisplayName: Magna Cannon +MagnaShot.DisplayName: Magna Bolt MagnaStrike.DisplayName: Strike MagnomalyAura.DisplayName: Magnomaly Aura MagnomalyBeam.DisplayName: Beam @@ -128,15 +132,15 @@ MagnomalyExplosion.DisplayName: Explosion MagnomalyRocket.DisplayName: Nuke MarksmanShot.DisplayName: Marksman Shot MechanicalBarracuda.DisplayName: Barracuda -MeowFire.DisplayName: Fire -MeowFire2.DisplayName: Fire +MeowFire.DisplayName: Purr Fire +MeowFire2.DisplayName: Purr Fire MiniatureFolly.DisplayName: Miniature Folly MiniRocket.DisplayName: Rocket MiniSharkron.DisplayName: Mini Sharkron -MistArrow.DisplayName: Arrow +MistArrow.DisplayName: Mist Arrow MortarRoundProj.DisplayName: Mortar -Nanomachine.DisplayName: Bullet -NapalmArrowProj.DisplayName: Arrow +Nanomachine.DisplayName: Nanomachine +NapalmArrowProj.DisplayName: Napalm Arrow NeedlerProj.DisplayName: Needle NorfleetCannon.DisplayName: Norfleet NorfleetComet.DisplayName: Comet @@ -144,19 +148,21 @@ NorfleetExplosion.DisplayName: Explosion Nuke.DisplayName: Nuke NullShot.DisplayName: Null NullShot2.DisplayName: Null -OnyxSharkBomb.DisplayName: Shark -OpalStrike.DisplayName: Strike +OnyxSharkBomb.DisplayName: Onyx Shark +OpalChargedStrike.DisplayName: Charged Plasma Bolt +OpalStrike.DisplayName: Heated Bolt +OpalStrikerHoldout.DisplayName: Opal Striker PhangasmBow.DisplayName: Phangasm PiercingBullet.DisplayName: Piercing Blow -PlagueArrow.DisplayName: Arrow +PlagueArrow.DisplayName: Plague Arrow PlagueExplosionFriendly.DisplayName: Explosion PlagueTaintedProjectile.DisplayName: Plague Tainted Projectile PlagueTaintedDrone.DisplayName: Plague Tainted Drone -PlanarRipperBolt.DisplayName: Bolt -PlanarRipperExplosion.DisplayName: Explosion -PlanetaryAnnihilationProj.DisplayName: Ball -PlasmaBlast.DisplayName: Blast -PlasmaExplosion.DisplayName: Explosion +PlanarRipperBolt.DisplayName: Planar Bolt +PlanarRipperExplosion.DisplayName: Planar Explosion +PlanetaryAnnihilationProj.DisplayName: Planetary Ball +PlasmaBlast.DisplayName: Plasma Blast +PlasmaExplosion.DisplayName: Plasma Explosion PolarStar.DisplayName: Polar Star PrecisionBolt.DisplayName: Precision Bolt PressurizedBubbleStream.DisplayName: Pressurized Bubble Stream @@ -166,8 +172,8 @@ PrismEnergyBullet.DisplayName: Prism Rocket PrismExplosionLarge.DisplayName: Explosion PrismExplosionSmall.DisplayName: Explosion PrismMine.DisplayName: Mine -PristineFire.DisplayName: Fire -PristineSecondary.DisplayName: Fire +PristineFire.DisplayName: Pristine Fire +PristineSecondary.DisplayName: Pristine Lingering Fire PumplerGrenade.DisplayName: Squash Shell PumplerHoldout.DisplayName: Pumpler RainbowBlast.DisplayName: Blast @@ -176,13 +182,14 @@ RainbowTrail.DisplayName: Rainbow RealmRavagerBullet.DisplayName: Explosive Bullet RicoshotCoin.DisplayName: Ricoshot Coin RocketFire.DisplayName: Fire -RubberMortarRoundProj.DisplayName: Round +RubberMortarRoundProj.DisplayName: Rubber Mortar SandstormBullet.DisplayName: Sandstorm SandyWaifuShark.DisplayName: Shark ScorchedEarthBlast.DisplayName: Earth Scorcher ScorchedEarthClusterBomb.DisplayName: Cluster Bomb ScorchedEarthRocket.DisplayName: Rocket -SeaDragonRocket.DisplayName: RPG +SeaDragonMuzzleBlast.DisplayName: Seadragon Muzzle Blast +SeaDragonRocket.DisplayName: Seadragon RPG SeasSearingBubble.DisplayName: Searing Bubble SeasSearingSecondary.DisplayName: Hydroshower SeasSearingSpout.DisplayName: Spout @@ -195,7 +202,7 @@ SevensStrikerGrape.DisplayName: Grapes SevensStrikerHoldout.DisplayName: Sevens Striker SevensStrikerOrange.DisplayName: Orange SevensStrikerPlatinumCoin.DisplayName: Platinum Coin -ShadeFire.DisplayName: Fire +ShadeFire.DisplayName: Shady Fire Shell.DisplayName: Shell Shockblast.DisplayName: Blast ShockblastRound.DisplayName: Round @@ -203,13 +210,13 @@ Shroom.DisplayName: Shroom Sickness.DisplayName: Sickness SicknessRound.DisplayName: Round SicknessRound2.DisplayName: Round -SlagRound.DisplayName: Round -SlimeBolt.DisplayName: Bolt +SlagRound.DisplayName: Slag Round +SlimeBolt.DisplayName: Slime Bolt SmallCoral.DisplayName: Small Coral SparkSpreaderFire.DisplayName: Sparked Flames -SporeBomb.DisplayName: Bomb -SputterComet.DisplayName: Comet -SputterCometBig.DisplayName: Comet +SporeBomb.DisplayName: Spore Bomb +SputterComet.DisplayName: Sputter Comet +SputterCometBig.DisplayName: Sputter Comet SpykerProj.DisplayName: Spyker StarfleetMK2Gun.DisplayName: Starmada StarmageddonBinaryStarCenter.DisplayName: Starmageddon Binary Star Center @@ -221,35 +228,35 @@ SulphuricBlast.DisplayName: Sulphuric Blast SuperballBulletProj.DisplayName: Superball Bullet SurgeDriverHoldout.DisplayName: Surge Driver TelluricGlareArrow.DisplayName: Radiant Arrow -TerraArrowMain.DisplayName: Arrow -TerraArrowSplit.DisplayName: Arrow +TerraArrowMain.DisplayName: Terra Arrow +TerraArrowSplit.DisplayName: Terra Arrow TerraBulletMain.DisplayName: Terra Bullet -TerraBulletSplit.DisplayName: Bullet -TerraFireGreen.DisplayName: Fire -TerraFireGreen2.DisplayName: Fire -TheMaelstromExplosion.DisplayName: Explosion +TerraBulletSplit.DisplayName: Terra Bullet +TerraFireGreen.DisplayName: Terra Fire +TheMaelstromExplosion.DisplayName: Reaper Explosion TheMaelstromShark.DisplayName: Reaper Shark ThePackMinissile.DisplayName: Pack Minissile ThePackMissile.DisplayName: Pack Missile TitaniumRailgunScope.DisplayName: Titanium Scope TitaniumRailgunShot.DisplayName: Titanium Decimator -TorrentialArrow.DisplayName: Arrow -ToxicannonDrop.DisplayName: Acid -ToxicannonShot.DisplayName: Cannon Shot +TorrentialArrow.DisplayName: Torrential Arrow +ToxicannonDrop.DisplayName: Toxic Acid +ToxicannonShot.DisplayName: Toxic Shot ToxicArrow.DisplayName: Toxic Arrow -TyphoonArrow.DisplayName: Arrow -TyphoonBubble.DisplayName: Bubble +TyphoonArrow.DisplayName: Typhoon Arrow +TyphoonBubble.DisplayName: Typhoon UltimaBolt.DisplayName: Ultima Bolt UltimaBowProjectile.DisplayName: Ultima UltimaRay.DisplayName: Ultima Ray UltimaSpark.DisplayName: Ultima Spark -UniversalGenesisStar.DisplayName: Star +UniversalGenesisStar.DisplayName: Genesis Star UniversalGenesisStarcaller.DisplayName: Starcaller Shot -VanquisherArrowMain.DisplayName: Arrow +VanquisherArrowMain.DisplayName: Vanquisher Arrow VeriumBulletProj.DisplayName: Verium Bullet -Voidragon.DisplayName: Blast +Voidragon.DisplayName: Voidragon Blast VoidragonTentacle.DisplayName: Voidragon Tentacle WaterSpout.DisplayName: Spout WulfrumScrapBullet.DisplayName: High Speed Scrap -ArcherfishRing.DisplayName: Archerfish Ring -SeaDragonMuzzleBlast.DisplayName: Seadragon Muzzle Blast \ No newline at end of file +ArcNovaDiffuserHoldout.DisplayName: Arc Nova Diffuser Holdout +NovaShot.DisplayName: Nova Bolt +NovaChargeShot.DisplayName: Charged Nova Blast \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson index bd1b0ec7a5..591a7b9367 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson @@ -1,6 +1,6 @@ AbyssalMirrorProjectile.DisplayName: Lumenyl Fluid -AcidBarrelDrop.DisplayName: Acid -AcidShrapnel.DisplayName: Shrapnel +AcidBarrelDrop.DisplayName: Barrel Acid Drop +AcidShrapnel.DisplayName: Acidic Shrapnel AdamantiteThrowingAxeProjectile.DisplayName: Adamantite Throwing Axe AlphaSeeker.DisplayName: Alpha Virus Seeker AlphaVirusProjectile.DisplayName: Alpha Virus @@ -13,23 +13,23 @@ AshenStalagmiteProj.DisplayName: Ashen Stalagmite AuroradicalSplitter.DisplayName: Auroradical Star AuroradicalStar.DisplayName: Auroradical Star BallisticPoisonBombProj.DisplayName: Poison Bomb -BallisticPoisonBombSpike.DisplayName: Spike -BarrelShrapnel.DisplayName: Shrapnel +BallisticPoisonBombSpike.DisplayName: Poison Spike +BarrelShrapnel.DisplayName: Barrel Shrapnel BettyExplosion.DisplayName: Betty Explosion BileExplosion.DisplayName: Bile -BlastBarrelProjectile.DisplayName: Barrel +BlastBarrelProjectile.DisplayName: Blast Barrel BlazingStarProj.DisplayName: Blazing Star BloodsoakedCrashax.DisplayName: Bloodsoaked Crasher BlueFlamePillar.DisplayName: Flame Pillar -BlunderBoosterLightning.DisplayName: Bolt -BouncingEyeballProjectile.DisplayName: Eyeball -BouncingEyeballProjectileStealthStrike.DisplayName: Eyeball +BlunderBoosterLightning.DisplayName: Blunder Bolt +BouncingEyeballProjectile.DisplayName: Bouncy Eyeball +BouncingEyeballProjectileStealthStrike.DisplayName: Bouncy Eyeball BouncyBol.DisplayName: Bouncy Ball BrackishFlaskProj.DisplayName: Brackish Flask -BrackishSpear.DisplayName: Atlantis Spear -BrackishSpear2.DisplayName: Atlantis Spear -BrackishWater.DisplayName: Water -BrackishWaterBlast.DisplayName: Water +BrackishSpear.DisplayName: Not Atlantis Spear +BrackishSpear2.DisplayName: Not Atlantis Spear +BrackishWater.DisplayName: Brackish Water +BrackishWaterBlast.DisplayName: Brackish Water Brick.DisplayName: Brick BrickFragment.DisplayName: Brick Fragment Brimblade2.DisplayName: Brimblade @@ -42,10 +42,10 @@ CelestialReaperProjectile.DisplayName: Celestial Reaper CelestusMiniScythe.DisplayName: Celestus CelestusProj.DisplayName: Celestus CinquedeaProj.DisplayName: Cinquedea -CircletMark.DisplayName: Mark +CircletMark.DisplayName: Tornado Mark CircletTornado.DisplayName: Tornado CobaltEnergy.DisplayName: Cobalt Energy -CobaltKunaiProjectile.DisplayName: Kunai +CobaltKunaiProjectile.DisplayName: Cobalt Kunai ConsecratedWaterProjectile.DisplayName: Consecrated Water ContaminatedBileFlask.DisplayName: Contaminated Bile CorpusAvertorClone.DisplayName: Corpus Avertor @@ -54,7 +54,7 @@ CorpusAvertorStealth.DisplayName: Corpus Avertor Corrocloud1.DisplayName: Corrocloud Corrocloud2.DisplayName: Corrocloud Corrocloud3.DisplayName: Corrocloud -CosmicKunaiProj.DisplayName: Kunai +CosmicKunaiProj.DisplayName: Cosmic Kunai CosmicScythe.DisplayName: Cosmic Scythe CraniumSMASH.DisplayName: Cranium SMASH CraniumSmasherExplosive.DisplayName: Explosive Cranium Smasher @@ -65,6 +65,7 @@ Crystalline2.DisplayName: Crystalline CrystallineProj.DisplayName: Crystalline CrystalPiercerProjectile.DisplayName: Crystal Piercer CrystalPiercerShard.DisplayName: Crystal Shard +CursedDaggerBlastHitbox.DisplayName: Cursed Vortex CursedDaggerProj.DisplayName: Cursed Dagger DeepSeaDumbbell1.DisplayName: Deep Sea Dumbbell DeepSeaDumbbell2.DisplayName: Deep Sea Dumbbell @@ -72,27 +73,27 @@ DeepSeaDumbbell3.DisplayName: Deep Sea Dumbbell DeepSeaDumbbellWeight.DisplayName: Deep Sea Dumbbell DeepWounderProjectile.DisplayName: Deep Wounder Projectile DeepWounderWater.DisplayName: Water Droplet -DeificThunderboltProj.DisplayName: Deific Thunderbolt -DesecratedBubble.DisplayName: Bubble +TwistingThunderProj.DisplayName: Deific Thunderbolt +DesecratedBubble.DisplayName: Desecrated Bubble DesecratedWaterProj.DisplayName: Desecrated Water DestructionBolt.DisplayName: Destruction Bolt DestructionStar.DisplayName: Star of Destruction DragonShit.DisplayName: Fire -DukesDecapitatorBubble.DisplayName: Bubble -DukesDecapitatorProj.DisplayName: Decapitator +DukesDecapitatorBubble.DisplayName: Duke Bubble +DukesDecapitatorProj.DisplayName: Duke's Decapitator DuststormCloud.DisplayName: Dust Cloud DuststormCloudHitbox.DisplayName: Duststorm Cloud DuststormInABottleProj.DisplayName: Duststorm Bottle DragonScalesInfernado.DisplayName: Infernado -DynamicPursuerElectricity.DisplayName: Electricity -DynamicPursuerLaser.DisplayName: Laser +DynamicPursuerElectricity.DisplayName: Dynamic Electricity +DynamicPursuerLaser.DisplayName: Dynamic Laser DynamicPursuerProjectile.DisplayName: Dynamic Pursuer EclipseMirrorBurst.DisplayName: Eclipse Mirror Flash EclipsesFallMain.DisplayName: Eclipse's Fall EclipsesSmol.DisplayName: Eclipse's Small EclipsesStealth.DisplayName: Eclipse's Fall EclipseStealthBoom.DisplayName: Eclipse Blast -EGloveSpark.DisplayName: Spark +EGloveSpark.DisplayName: Electrician's Spark ElementalDiskProj.DisplayName: Elemental Disk ElementalDiskSplit.DisplayName: Elemental Disk EnchantedAxe2.DisplayName: Enchanted Axe @@ -102,15 +103,15 @@ EquanimityDarkShard.DisplayName: Dark Shard EquanimityLightShard.DisplayName: Light Shard EquanimityProj.DisplayName: Equanimity EradicatorProjectile.DisplayName: Eradicator -ExecutionersBladeProj.DisplayName: Blade -ExecutionersBladeStealthProj.DisplayName: Blade +ExecutionersBladeProj.DisplayName: Executioner's Blade +ExecutionersBladeStealthProj.DisplayName: Executioner's Blade ExorcismProj.DisplayName: Exorcism ExorcismShockwave.DisplayName: Exorcism Shockwave ExorcismStar.DisplayName: Exorcism Star ExplosiveSun.DisplayName: Explosive Sun FantasyTalismanProj.DisplayName: Talisman FantasyTalismanStealth.DisplayName: Talisman -FeatherKnifeProjectile.DisplayName: Knife +FeatherKnifeProjectile.DisplayName: Feather Knife FinalDawnFireball.DisplayName: The Final Dawn FinalDawnFireSlash.DisplayName: The Final Dawn FinalDawnFlame.DisplayName: The Final Dawn @@ -121,21 +122,21 @@ FinalDawnThrow.DisplayName: The Final Dawn FinalDawnThrow2.DisplayName: The Final Dawn FishboneBoomerangProjectile.DisplayName: Fishbone Boomerang Fork.DisplayName: Fork -FossilShardThrown.DisplayName: Shard +FossilShardThrown.DisplayName: Fossil Shard FrostShardFriendly.DisplayName: Frost Shard FrostyFlareProj.DisplayName: Frosty Flare FrostyFlareStealth.DisplayName: Frosty Flare -GacruxianHome.DisplayName: Mollusk -GacruxianProj.DisplayName: Mollusk -GelDartProjectile.DisplayName: Dart +GacruxianHome.DisplayName: Gacruxian Mollusk +GacruxianProj.DisplayName: Gacruxian Mollusk +GelDartProjectile.DisplayName: Gel Dart GhoulishGougerBoomerang.DisplayName: Ghoulish Gouger GildedDaggerProj.DisplayName: Gilded Dagger GlaiveProj.DisplayName: Glaive GleamingDaggerProj.DisplayName: Gleaming Dagger -GodsParanoiaDart.DisplayName: Kunai +GodsParanoiaDart.DisplayName: God's Paranoia Dart GodsParanoiaProj.DisplayName: God's Paranoia GraveGrimreaverProjectile.DisplayName: Grave Grimreaver -GreenDonkeyKongReference.DisplayName: Barrel +GreenDonkeyKongReference.DisplayName: Acidic Rain Barrel GrimreaverBat.DisplayName: Grim Bat GrimreaverSkull.DisplayName: Grim Skull HeavenfallenEnergy.DisplayName: Heavenfallen Energy @@ -146,8 +147,8 @@ HoneycombFragment.DisplayName: Honeycomb Fragment HypothermiaChunk.DisplayName: Ice Chunk HypothermiaShard.DisplayName: Ice Shard IcebreakerHammer.DisplayName: Icebreaker -IceStarProjectile.DisplayName: Star -IchorSpearProj.DisplayName: Spear +IceStarProjectile.DisplayName: Ice Star +IchorSpearProj.DisplayName: Ichor Spear InfernalKrisCinder.DisplayName: Infernal Cinder InfernalKrisExplosion.DisplayName: Infernal Explosion InfernalKrisProjectile.DisplayName: Infernal Kris @@ -163,52 +164,51 @@ KelvinCatalystBoomerang.DisplayName: Kelvin Catalyst Knife.DisplayName: Knife KylieBoomerang.DisplayName: Kylie LeadTomahawkProj.DisplayName: Lead Tomahawk -LeonidCometBig.DisplayName: Comet -LeonidCometSmall.DisplayName: Comet +LeonidCometBig.DisplayName: Leonid Comet +LeonidCometSmall.DisplayName: Leonid Comet LeonidProgenitorBombshell.DisplayName: Leonid Bombshell LeonidStar.DisplayName: Leonid Star LeviathanTooth.DisplayName: Leviathan Tooth LionfishProj.DisplayName: Lionfish LostSoulFriendly.DisplayName: Lost Soul LuminousShard.DisplayName: Stardust Shard -LuminousStrikerProj.DisplayName: Luminous Striker -LunarKunaiProj.DisplayName: Kunai -LuxorsGiftRogue.DisplayName: Gift +RealityRuptureLance.DisplayName: Lance of Reality +LunarKunaiProj.DisplayName: Lunar Kunai +LuxorsGiftRogue.DisplayName: Luxor's Rogue MalachiteBolt.DisplayName: Malachite MalachiteProj.DisplayName: Malachite MalachiteStealth.DisplayName: Malachite -MangroveChakramFlower.DisplayName: Flower +MangroveChakramFlower.DisplayName: Mangrove Flower MangroveChakramProjectile.DisplayName: Mangrove Chakram MetalChunk.DisplayName: Metal Chunk MetalShard.DisplayName: Metal Shard -MeteorFistProj.DisplayName: Fist +MeteorFistProj.DisplayName: Meteor Fist Gud For A Lot Of Shtuff +MeteorFistStealth.DisplayName: Meteor Fist Gud For A Lot Of Shtuff MoltenAmputatorProj.DisplayName: Molten Amputator MoltenBlobThrown.DisplayName: Molten Blob MonkeyDart.DisplayName: Monkey Dart MoonSigil.DisplayName: Moon Sigil -MycorootProj.DisplayName: Root -MythrilKnifeProjectile.DisplayName: Knife +MycorootProj.DisplayName: Mycoroot +MythrilKnifeProjectile.DisplayName: Mythril Knife NanoblackMain.DisplayName: Nanoblack Reaper NanoblackSplit.DisplayName: Nanoblack Blade NanoblackStealthSplit.DisplayName: Nanoblack Afterimage NastyChollaBol.DisplayName: Nasty Cholla -NastyChollaNeedle.DisplayName: Needle -NiceCock.DisplayName: Flame +NastyChollaNeedle.DisplayName: Cactus Needle +NiceCock.DisplayName: Kitchen Fire NightsGazeProjectile.DisplayName: Night's Gaze NightsGazeSpark.DisplayName: Night's Gaze Spark NightsGazeStar.DisplayName: Night's Gaze Star NychthemeronOrb.DisplayName: Nychthemeron Orb NychthemeronProjectile.DisplayName: Nychthemeron -OrichalcumSpikedGemstoneProjectile.DisplayName: Gemstone -PalladiumJavelinProjectile.DisplayName: Javelin -PanSpark.DisplayName: Spark +OrichalcumSpikedGemstoneProjectile.DisplayName: Orichalcum Gemstone +PalladiumJavelinProjectile.DisplayName: Palladium Javelin +PanSpark.DisplayName: Pan Spark PartisanExplosion.DisplayName: Profaned Explosion PenumbraBomb.DisplayName: Penumbra Bomb PenumbraSoul.DisplayName: Penumbra Soul -PhantasmalRuinGhost.DisplayName: Phantasmal Afterimage PhantasmalRuinProj.DisplayName: Phantasmal Ruin PhantasmalSoul.DisplayName: Phantasmal Soul -PhantomLanceProj.DisplayName: Phantom Lance PlaguedFuelPackCloud.DisplayName: Plagued Cloud PlaguenadeBee.DisplayName: Plague Bee PlaguenadeProj.DisplayName: Plaguenade @@ -217,30 +217,30 @@ Prismalline2.DisplayName: Prismalline Prismalline3.DisplayName: Prismalline PrismallineProj.DisplayName: Prismalline PrismRocket.DisplayName: Prism Rocket -PrismShurikenBlade.DisplayName: Blade +PrismShurikenBlade.DisplayName: Refraction Blade ProfanedPartisanProj.DisplayName: Profaned Partisan ProfanedPartisanSpear.DisplayName: Profaned Spear -RadiantExplosion.DisplayName: Explosion +RadiantExplosion.DisplayName: Radiant Explosion RadiantStar2.DisplayName: Radiant Star RadiantStarKnife.DisplayName: Radiant Star ReaperProjectile.DisplayName: The Old Reaper RefractionRotorProjectile.DisplayName: Prism Shuriken RegulusEnergy.DisplayName: Regulus Energy RegulusRiotProj.DisplayName: Regulus Riot -RotBallProjectile.DisplayName: Ball +RotBallProjectile.DisplayName: Rot Ball SacrificeProjectile.DisplayName: Sacrificial Dagger SandDollarProj.DisplayName: Sand Dollar SandDollarStealth.DisplayName: Sand Dollar SandslasherProj.DisplayName: Sandslasher -ScarletBlast.DisplayName: Blast +ScarletBlast.DisplayName: Scarlet Blast ScarletDevilBullet.DisplayName: Gungnir Bullet ScarletDevilProjectile.DisplayName: Spear the Gungnir -ScourgeoftheDesertProj.DisplayName: Scourge +ScourgeoftheDesertProj.DisplayName: Scourge of the Desert ScourgeoftheSeasProjectile.DisplayName: Moist Scourge ScourgeVenomCloud.DisplayName: Venom Cloud SeafoamBombProj.DisplayName: Seafoam Bomb SeafoamBubble.DisplayName: Seafoam Bubble -SealedSingularityBlackhole.DisplayName: Blackhole +SealedSingularityBlackhole.DisplayName: Sealed Blackhole SealedSingularityGore.DisplayName: Sealed Singularity Fragment SealedSingularityProj.DisplayName: Sealed Singularity SearedPanProjectile.DisplayName: Pan @@ -253,11 +253,11 @@ ShatteredExplosion.DisplayName: Shattered Sun Blast ShatteredSunKnife.DisplayName: Shattered Sun ShatteredSunScorchedBlade.DisplayName: Scorched Blade ShinobiBladeProjectile.DisplayName: Shinobi Blade -ShockGrenadeBolt.DisplayName: Bolt +ShockGrenadeBolt.DisplayName: Shock Grenade Bolt ShockGrenadeExplosion.DisplayName: Shock Grenade Explosion ShockGrenadeProjectile.DisplayName: Shock Grenade ShockTeslaAura.DisplayName: Electrifying Aura -ShroomerangSpore.DisplayName: Spore +ShroomerangSpore.DisplayName: Infested Spore SkyBomberGas.DisplayName: Irradiated Cloud SkyfinNuke.DisplayName: Skyfin Nuke SkyStabberProj.DisplayName: SkyStabberProj @@ -266,8 +266,8 @@ SludgeSplotchProj1.DisplayName: Sludge Splotch SludgeSplotchProj2.DisplayName: Sludge Splotch SnapClamProj.DisplayName: Snap Clam SnapClamStealth.DisplayName: Snap Clam -SpearofDestinyProjectile.DisplayName: Spear -SpearofPaleolithProj.DisplayName: Spear +SpearofDestinyProjectile.DisplayName: Destiny Spear +SpearofPaleolithProj.DisplayName: Paleolith Spear SpentFuelContainerProjectile.DisplayName: Spent Fuel Container SphereBladed.DisplayName: Bladed Sphere SphereBlue.DisplayName: Blue Thruster Sphere @@ -278,9 +278,9 @@ StealthNimbusCloud.DisplayName: Nimbus StealthRain.DisplayName: Rain StellarKnifeProj.DisplayName: Stellar Knife StickyBol.DisplayName: Sticky Bol -StormfrontLightning.DisplayName: Lightning +StormfrontLightning.DisplayName: Stormfront Lightning StormfrontRazorProjectile.DisplayName: Stormfront Razor -Stormfrontspark.DisplayName: Spark +Stormfrontspark.DisplayName: Stormfront Spark SubductionFlameburst.DisplayName: Flame Pillar SubductionSlicerProj.DisplayName: Subduction Slicer SulphuricNukesplosion.DisplayName: Nuke @@ -291,8 +291,8 @@ SupernovaSpike.DisplayName: Spike TalonLargeProj.DisplayName: Huge Terror Talon TalonSmallProj.DisplayName: Terror Talon TarragonThrowingDartProjectile.DisplayName: Tarragon Throwing Dart -TarraThornRight.DisplayName: Thorn -TarraThornTip.DisplayName: Thorn +TarraThornRight.DisplayName: Tarragon Thorn +TarraThornTip.DisplayName: Tarragon Thorn TerraDiskProjectile.DisplayName: Terra Disk TerraDiskProjectile2.DisplayName: Terra Disk TheAtomSplitterDuplicate.DisplayName: Atom Splitter @@ -303,17 +303,17 @@ TheSyringeS1.DisplayName: Shrapnel TimeBoltKnife.DisplayName: Time Bolt TitaniumClone.DisplayName: Shuriken TitaniumShurikenProjectile.DisplayName: Shuriken -ToothBallProjectile.DisplayName: Ball -TotalityFire.DisplayName: Fire +ToothBallProjectile.DisplayName: Tooth Ball +TotalityFire.DisplayName: Totality Fire TotalityFlask.DisplayName: Totality Flask TotalityTar.DisplayName: Totality Tar TotalMeltdown.DisplayName: Explosion -ToxicantTwisterDust.DisplayName: Dust +ToxicantTwisterDust.DisplayName: Toxicant Dust ToxicantTwisterTwoPointZero.DisplayName: Toxicant Twister TurbulanceProjectile.DisplayName: Turbulance TurbulanceWindSlash.DisplayName: Wind Slash UmbraphileBoom.DisplayName: Umbra Blast -UrchinStingerProj.DisplayName: Stinger +UrchinStingerProj.DisplayName: Urchin Stinger ValariBoomerang.DisplayName: Frostcrush Valari Valaricicle.DisplayName: Valaricicle Valaricicle2.DisplayName: Valaricicle @@ -323,5 +323,11 @@ WebBallBol.DisplayName: Web Ball WrathwingCinder.DisplayName: Wrathwing Eruption WrathwingFireball.DisplayName: Wrathwing Fireball WrathwingSpear.DisplayName: Wrathwing -WulfrumKnifeProj.DisplayName: Knife -WaveSkipperProjectile.DisplayName: Scourge \ No newline at end of file +WulfrumKnifeProj.DisplayName: Wulfrum Knife +WaveSkipperProjectile.DisplayName: Wave Skipper +LanceofDestiny.DisplayName: Holy Lance +SpearofDestinyStealth.DisplayName: Empowered Holy Lance +SpearofDestinyStealthExplosion.DisplayName: Strong Burst +RealityRuptureMini.DisplayName: Reality Shard +RealityRuptureStealth.DisplayName: Ruptured Reality +PhantasmalSoulBlue.DisplayName: Blue Spirit \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson index a6c03fd30b..78f3a99ff3 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson @@ -1,10 +1,10 @@ AndromedaDeathRay.DisplayName: Beam AndromedaRegislash.DisplayName: Regislash AndromedaUI_Background.DisplayName: UI -AngelBolt.DisplayName: Bolt +AngelBolt.DisplayName: Angelic Bolt AngelicAllianceArchangel.DisplayName: Archangel -AngelOrb.DisplayName: Orb -AngelRay.DisplayName: Ray +AngelOrb.DisplayName: Angelic Orb +AngelRay.DisplayName: Angelic Ray ApexShark.DisplayName: Ancient Mineral Shark ApparatusExplosion.DisplayName: Explosion AquasScepterCloud.DisplayName: Storm Cloud @@ -32,10 +32,10 @@ BlackDragonHead.DisplayName: Black Celestial Dragon BlackDragonTail.DisplayName: Black Celestial Dragon BlackHawkBullet.DisplayName: Black Hawk Bullet BlackHawkSummon.DisplayName: Black Hawk -BloodBreath.DisplayName: Fire +BloodBreath.DisplayName: Blood Dragon Fire BloodClotMinion.DisplayName: Blood Clot BloodRain.DisplayName: Blood Rain -BloodSpit.DisplayName: Spit +BloodSpit.DisplayName: Blood Spit BoneMatter.DisplayName: Bone Matter BoneMatter2.DisplayName: Bone Matter BrimseekerAuraBall.DisplayName: Seeker @@ -43,12 +43,12 @@ BrimstoneDartMinion.DisplayName: Brimfire BrimstoneDartSummon.DisplayName: Brimstone Dart BrimstoneElementalMinion.DisplayName: Brimstone Elemental BrimstoneExplosionMinion.DisplayName: Explosion -BrimstoneFireballMinion.DisplayName: Brimfire -BrimstoneFireSummon.DisplayName: Fire -BrimstoneLaserSummon.DisplayName: Laser +BrimstoneFireballMinion.DisplayName: Brimstone Fireball +BrimstoneFireSummon.DisplayName: Brimstone Fire +BrimstoneLaserSummon.DisplayName: Brimstone Laser BrittleStarMinion.DisplayName: Brittle Star -CalamariInk.DisplayName: Ink -CalamariMinion.DisplayName: Calamari +CalamarisLamentProjectile.DisplayName: Calamari Ink +CalamarisLamentMinion.DisplayName: Calamari Calamitamini.DisplayName: Calamitamini Cataclymini.DisplayName: Cataclymini CataclysmSummon.DisplayName: Cataclysm @@ -60,12 +60,12 @@ Cinder.DisplayName: Cinder CinderBlossom.DisplayName: Cinder Blossom CloudElementalMinion.DisplayName: Cloudy Waifu CnidarianJellyfishOnTheString.DisplayName: Cnidarian -CnidarianSpark.DisplayName: Spark +CnidarianSpark.DisplayName: Cnidarian Spark GlacialEmbracePointyThing.DisplayName: Ice Castle Shard CorroslimeMinion.DisplayName: Corroslime CorruptionSlimeGodMinion.DisplayName: Slime God -CosmicBlast.DisplayName: Blast -CosmicBlastBig.DisplayName: Blast +CosmicBlast.DisplayName: Cosmic Blast +CosmicBlastBig.DisplayName: Cosmic Blast CosmicEnergySpiral.DisplayName: Cosmic Energy CosmicViperConcussionMissile.DisplayName: Concussion Missile CosmicViperHomingRocket.DisplayName: Homing Rocket @@ -80,34 +80,34 @@ DaedalusCrystal.DisplayName: Daedalus Crystal DaedalusCrystalShot.DisplayName: Crystal Shot DaedalusGolem.DisplayName: Daedalus Golem DaedalusLightning.DisplayName: Daedalus Lightning -DaedalusPellet.DisplayName: Pellet +DaedalusPellet.DisplayName: Daedalus Pellet DankCreeperMinion.DisplayName: Dank Creeper DazzlingStabber.DisplayName: Dazzling Stabber -DeathstareBeam.DisplayName: Beam -DeathstareEyeball.DisplayName: Eyeball +DeathstareBeam.DisplayName: Deathstare Beam +DeathstareEyeball.DisplayName: Deathstare DormantBrimseekerAura.DisplayName: Dormant Brimseeker Aura Projecter DormantBrimseekerBab.DisplayName: Dormant Brimseeker DormantBrimseekerSummoner.DisplayName: Dormant Brimseeker -Dreadmine.DisplayName: Mine +Dreadmine.DisplayName: Dreadmine DreadmineTurret.DisplayName: Dreadmine Turret -ElementalAxeMinion.DisplayName: Axe -EndoBeam.DisplayName: Ray +ElementalAxeMinion.DisplayName: Elemental Axe +EndoBeam.DisplayName: Endo Beam EndoCooperBody.DisplayName: Ascened Cooper EndoCooperLimbs.DisplayName: Ascened Cooper EndoFire.DisplayName: Endo Fire EndoHydraBody.DisplayName: Hydra Body EndoHydraHead.DisplayName: Hydra Head EndoIceShard.DisplayName: Endo Ice Shard -EndoRay.DisplayName: Ray +EndoRay.DisplayName: Endo Ray EnergyOrb.DisplayName: Energy Orb EXPLODINGFROG.DisplayName: A not frog of the explosive variety -EyeOfNightCell.DisplayName: Cell +EyeOfNightCell.DisplayName: Night Cell EyeOfNightSummon.DisplayName: Eye of Night FieryDraconid.DisplayName: Fiery Draconid -FlameBlast.DisplayName: Blast -FlameBurst.DisplayName: Burst +FlameBlast.DisplayName: Flame Blast +FlameBurst.DisplayName: Flame Burst FleshBallMinion.DisplayName: Flesh Ball -FleshBlood.DisplayName: Blood +FleshBlood.DisplayName: Flesh Blood FlowersOfMortalityPetal.DisplayName: Elemental Petal FlyingOrthocera.DisplayName: Flying Orthocera FlyingOrthoceraStream.DisplayName: Acid Stream @@ -117,9 +117,9 @@ FrogGore2.DisplayName: Gore from a not frog of the explosive variety FrogGore3.DisplayName: Gore from a not frog of the explosive variety FrogGore4.DisplayName: Gore from a not frog of the explosive variety FrogGore5.DisplayName: Gore from a not frog of the explosive variety -FrostBeam.DisplayName: Beam +FrostBeam.DisplayName: Frost Beam FrostBlossom.DisplayName: Frost Blossom -FrostMistFriendly.DisplayName: Mist +FrostMistFriendly.DisplayName: Frost Mist GammaCanister.DisplayName: Gamma Canister GammaHead.DisplayName: Gamma Head GastricBelcher.DisplayName: Gastric Belcher @@ -128,8 +128,8 @@ GastricBelcherVomit.DisplayName: Gastric Vomit GhostFire.DisplayName: Ghastly Particle GhostlyMine.DisplayName: Mine GiantIbanRobotOfDoom.DisplayName: Andromeda -HallowedStarSummon.DisplayName: Star -HauntedDishes.DisplayName: HauntedDishes +HallowedStarSummon.DisplayName: Hallowed Star +HauntedDishes.DisplayName: Haunted Dishes HermitCrabMinion.DisplayName: Hermit Crab HerringAI.DisplayName: Herring School HerringMinion.DisplayName: Herring @@ -146,32 +146,33 @@ IceSentry.DisplayName: Ice Sentry IceSentryFrostBolt.DisplayName: Ball IceSentryShard.DisplayName: Frost Shard IgneousBlade.DisplayName: Igneous Blade -IgneousBladeStrike.DisplayName: Blade +IgneousBladeStrike.DisplayName: Igneous Blade IrradiatedAura.DisplayName: Irradiated Aura -LanternFlame.DisplayName: Flame +LanternFlame.DisplayName: Lantern Flame LanternSoul.DisplayName: Lantern LostSoulGiant.DisplayName: Soul LostSoulGold.DisplayName: Gold Soul LostSoulLarge.DisplayName: Soul LostSoulSmall.DisplayName: Soul -LuxorsGiftSummon.DisplayName: Gift +LuxorsGiftSummon.DisplayName: Luxor's Summon MechwormBody.DisplayName: Mechworm MechwormHead.DisplayName: Mechworm -MechwormLaser.DisplayName: Laser +MechwormLaser.DisplayName: Mechworm Laser MechwormTail.DisplayName: Mechworm MechwormTeleportRift.DisplayName: Rift MidnightSunBeaconProj.DisplayName: Midnight Sun Beacon -MidnightSunBeam.DisplayName: Beam +MidnightSunBeam.DisplayName: Midnight Beam MidnightSunShot.DisplayName: Midnight Shot MidnightSunUFO.DisplayName: Midnight Sun UFO MiniGuardianAttack.DisplayName: Offensive Guardian MiniGuardianDefense.DisplayName: Defensive Guardian MiniGuardianHealer.DisplayName: Healer Guardian +MiniGuardianRock.DisplayName: Rocky Road MiniGuardianSpear.DisplayName: Bab Spear MiniSandShark.DisplayName: Mini Sand Shark -MK2FlaskSummon.DisplayName: Flask -MK2RocketHoming.DisplayName: Rocket -MK2RocketNormal.DisplayName: Rocket +MK2FlaskSummon.DisplayName: Fuel Cell Flask +MK2RocketHoming.DisplayName: Plague Rocket +MK2RocketNormal.DisplayName: Plague Rocket MoonFist.DisplayName: Cosmic Fist MoonFistTeleportVisual.DisplayName: Light MortalityBeam.DisplayName: Beam @@ -187,12 +188,11 @@ PlagueBeeSmall.DisplayName: Plague Bee PlaguebringerMK2.DisplayName: Plaguebringer MK2 PlaguebringerSummon.DisplayName: Lil' Plaguebringer PlaguePrincess.DisplayName: Virili -PlantSeed.DisplayName: Seed -PlantSeedGreen.DisplayName: Seed -PlantSporeCloud.DisplayName: Spore Cloud -PlantSummon.DisplayName: Plantera -PlantTentacle.DisplayName: Tentacle -PlantThornBall.DisplayName: Thorn Ball +PlantationStaffSummon.DisplayName: Mini Plantera +PlantationStaffThornball.DisplayName: Mini Plantera's Thornball +PlantationStaffSeed.DisplayName: Mini Plantera's Seed +PlantationStaffSporeCloud.DisplayName: Mini Plantera's Spores +PlantationStaffTentacle.DisplayName: Mini Plantera's Tentacle PlateProjectile.DisplayName: Plate PolypLauncherProjectile.DisplayName: Polyp Chunk PolypLauncherSentry.DisplayName: Polyp Launcher @@ -205,7 +205,7 @@ ProfanedCrystalRangedHuges.DisplayName: Holy Bab Boomer ProfanedCrystalRangedSmalls.DisplayName: Holy Bab Boomer Orb ProfanedCrystalRogueShard.DisplayName: Holy Bab Crystal Shard ProfanedEnergy.DisplayName: Profaned Energy -PuffCloud.DisplayName: Cloud +PuffCloud.DisplayName: Puff Cloud PuffWarrior.DisplayName: Puff Warrior PurpleButterfly.DisplayName: Purple Butterfly RustyBeaconPulse.DisplayName: Irradiated Pulse @@ -215,7 +215,7 @@ SageSpirit.DisplayName: Sage Spirit SakuraBullet.DisplayName: Sakura Bullet SandBolt.DisplayName: Bolt SandElementalHealer.DisplayName: Sand Healer -SandElementalMinion.DisplayName: Waifu +SandElementalMinion.DisplayName: Sand Elemental SandMark.DisplayName: Mark SandnadoMinion.DisplayName: Sandnado SandTornado.DisplayName: Tornado @@ -227,11 +227,11 @@ SepulcherMinion.DisplayName: Sepulcher Shellfish.DisplayName: Shellfish SilvaCrystal.DisplayName: Silva Crystal SilvaCrystalExplosion.DisplayName: Explosion -SiriusBeam.DisplayName: Beam -SiriusExplosion.DisplayName: Explosion +SiriusBeam.DisplayName: Sirius Beam +SiriusExplosion.DisplayName: Sirius Explosion SiriusMinion.DisplayName: Sirius -SkeletalDragonChild.DisplayName: Child -SkeletalDragonMother.DisplayName: Mother +SkeletalDragonChild.DisplayName: Skeletal Child +SkeletalDragonMother.DisplayName: Skeletal Mother SlimePuppet.DisplayName: Slime Puppet CannonLaserbeam.DisplayName: Exothermal Deathray ExoskeletonGaussNukeCannon.DisplayName: Gauss Nuke @@ -251,12 +251,12 @@ MinionPlasmaBlast.DisplayName: Volatile Plasma Blast MinionPlasmaGas.DisplayName: Superheated Plasma Cloud MinionTeslaOrb.DisplayName: Tesla Sphere SmallSkeletonMinion.DisplayName: Small Skeleton -SolarBeam.DisplayName: Beam -SolarGod.DisplayName: Solar God +SolarBeam.DisplayName: Solar Beam +SolarGod.DisplayName: Vengeful Solar Spirit SolarPixie.DisplayName: Solar Pixie Spikecrag.DisplayName: Spikecrag SpikecragSpike.DisplayName: Spikecrag Spike -SquirrelSquireAcorn.DisplayName: Acorn +SquirrelSquireAcorn.DisplayName: Squirrel Acorn SquirrelSquireMinion.DisplayName: Squirrel Squire StormjawBaby.DisplayName: Stormjaw Baby SummonAstralExplosion.DisplayName: Explosion @@ -267,14 +267,14 @@ TundraFlameBlossom.DisplayName: Tundra Flame Blossoms TundraFlameBlossomsOrb.DisplayName: Tundra Flame Blossoms Orb MagicArrow.DisplayName: Vermillion Arrow MagicAxe.DisplayName: Jade Axe -MagicBird.DisplayName: Bird -MagicBullet.DisplayName: Bullet -MagicBulletBig.DisplayName: Bullet -MagicBunny.DisplayName: Bunny +MagicBird.DisplayName: Magic Bird +MagicBullet.DisplayName: Magic Bullet +MagicBulletBig.DisplayName: Magic Bullet +MagicBunny.DisplayName: Magic Bunny MagicHammer.DisplayName: Marmalade Hammer MagicHat.DisplayName: Magic Hat MagicRifle.DisplayName: Lavender Rifle -MagicTree.DisplayName: Tree +MagicTree.DisplayName: Magic Tree MagicUmbrella.DisplayName: Cyan Umbrella UniverseSplitterField.DisplayName: Field UniverseSplitterHugeBeam.DisplayName: Universe Splitter Ray @@ -291,14 +291,14 @@ VoidConcentrationOrb.DisplayName: Void Orb VolcanicFireballSummon.DisplayName: Volcanic Fireball WaterElementalMinion.DisplayName: Anahita WaterElementalSong.DisplayName: Siren Song -WaterSpearFriendly.DisplayName: Spear +WaterSpearFriendly.DisplayName: Water Spear WhiteDragonBody.DisplayName: White Celestial Dragon WhiteDragonHead.DisplayName: White Celestial Dragon WhiteDragonTail.DisplayName: White Celestial Dragon WitherBlossom.DisplayName: Wither Blossom WitherBolt.DisplayName: Wither Bolt WulfrumDroid.DisplayName: Wulfrum Droid -WulfrumEnergyBurst.DisplayName: Bolt +WulfrumEnergyBurst.DisplayName: Wulfrum Bolt WulfrumFusionBolt.DisplayName: Fusion Bolt YharonMinionFireball.DisplayName: Dragon Fireball YoungDuke.DisplayName: Young Old Duke diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index 99350685ec..d90dd63c47 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -100,7 +100,8 @@ Cooldowns: { PlagueBlackout: Plague Blackout Cooldown PotionSickness: Healing Cooldown PrismaticLaser: Prismatic Laser Barrage Cooldown - ProfanedSoulArtifact: Profaned Soul Artifact Burnout + ProfanedSoulShieldDurability: Profaned Soul Shield Durability + ProfanedSoulShieldRecharge: Profaned Soul Shield Recharge RelicOfResilience: Relic of Resilience Cooldown RogueBooster: Rogue Booster Cooldown SandCloak: Sand Cloak Cooldown diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index 8ccc70ac38..7a83fe8711 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -1,5 +1,6 @@ // Buff Descriptions BuffDescription: { + Banner: You have increased damage and defense against the following: BeetleMight: Melee damage and speed increase by {0}% and {1}% respectively ChaosState: Rod of Discord teleports are disabled LeafCrystal: Emits powerful life pulses at nearby enemies @@ -21,32 +22,32 @@ ArmsDealerChat: { MentionQuadBarrel: That old man left a cranky old gun on his deathbed. You catching my drift? HasQuadBarrel: Hah! Look at that rusty old shotty. It looks straight out of the 70's! DoGDefeated: Is it me or are your weapons getting bigger and bigger? - Eclipse: That's the biggest moth I've ever seen for sure. You'd need one big gun to take one of those down. + Eclipse: I thought moths went for light, what is one doing here?! You gonna need more than a boomstick if you want to kill that! } ClothierChat: { - PolterghastDefeated: Whatever that thing was, I'm glad it's gone now + PolterghastDefeated: The voices have ceased... I don't want to know what you did there, but thank you. MoonLordDefeated1: Who you gonna call? MoonLordDefeated2: Those screams... I'm not sure why, but I feel like a nameless fear has awoken in my heart. - MoonLordDefeated3: I can faintly hear ghostly shrieks from the dungeon... and not ones I'm familiar with at all. Just what is going on in there? + MoonLordDefeated3: The voices I always kept hearing while in the Dungeon are back... There must be something behind them, I know when it's just my head. MoonLordPresent: Houston, we've had a problem. } CyborgChat: { MoonLordDefeated1: Always shoot for the moon! It has clearly worked before. - MoonLordDefeated2: Draedon? He's... a little 'high octane' if you know what I mean. - MentionPlague: Those oversized bugs terrorizing the jungle... Surely you of all people could shut them down! + MoonLordDefeated2: Draedon? The guy who made these upgrades on me said he wanted to best him, but I never cared about that, I just wanted to shoot lasers from my eyes. + 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. } DemolitionistChat.DoGDefeated: God Slayer Dynamite? Boy do I like the sound of that! DryadChat: { - DarksunEclipse: There's a dark solar energy emanating from the moths that appear during this time. Ah, as you progress further the moths get more powerful... + DarksunEclipse: There's a dark solar energy emanating from the moths that appear during this time. What's up with moths getting stronger as you do too? Hardmode: That starborne illness sits upon this land like a blister. Do even more vile forces of corruption exist in worlds beyond? DrunkPrincessShroom: "{0} put me up to this." Mushroom: I'm not here for any reason! Just picking up mushrooms for uh, later use. - SulphurSea: My ancestor was lost here long ago. I must pay my respects to her. + SulphurSea: My Goddess is resting deep below this sea. If you may excuse me, I wish to pay my respects to her alone. } DyeTraderChat: { @@ -60,11 +61,11 @@ GoblinTinkererChat: { } GuideChat: { - ProvidenceDefeated1: Seems like extinguishing that butterfly caused its life to seep into the hallowed areas, try taking a peek there and see what you can find! - ProvidenceDefeated2: I've heard there is a portal of antimatter absorbing everything it can see in the dungeon, try using the Rune of Kos there! - MoonLordDefeated: The dungeon seems even more restless than usual, watch out for the powerful abominations stirring up in there. + ProvidenceDefeated1: Killing a Goddess would obviously make her essence seep into the land, you can probably use the remnants of her power to make even more powerful gear! + ProvidenceDefeated2: I've heard the Dragon Cult has something locked in the Dungeon they use to power their hexes, apparently messing with it can lead you to another world... + MoonLordDefeated: I've seen members of the Dragon Cult outside of the Dungeon far more often than before... I think you should check what could be causing their displacement. Hardmode1: Could you be so kind as to, ah... check hell for me...? I left someone I kind of care about down there. - Hardmode2: I have this sudden shiver up my spine, like a meteor just fell and thousands of innocent creatures turned into monsters from the stars. + Hardmode2: That earthquake wasn't natural, something must have caused it... Beware when exploring, whatever caused it must be a powerful entity, perhaps even otherworldly. } MechanicChat: { @@ -75,7 +76,7 @@ MechanicChat: { } MerchantChat: { - MoonLordDefeated: Each night seems only more foreboding than the last. I feel unthinkable terrors are watching your every move. + MoonLordDefeated: Every night seems more tense than the last. I feel unspeakable horrors are watching over us. Eclipse: Are you daft?! Turn off those lamps! AcidRain: If this acid rain keeps up, there'll be a shortage of Dirt Blocks soon enough! Bandit: I happen to have several Angel Statues at the moment, a truely rare commodity. Want one? @@ -121,7 +122,7 @@ SkeletonMerchantChat.Normal: What'dya buyin'? SteampunkerChat: { HasPortalGun: Just what is that contraption? It makes my Teleporters look like child's play! MoonLordDefeated: Yep! I'm also considering being a space pirate now. - Astral: Some of my machines are starting to go haywire thanks to this Astral Infection. I probably shouldn't have built them here + Astral: Some of my machines are starting to go haywire thanks to this Astral Infection. I probably shouldn't have built them here. Hallow: I'm sorry I really don't have any Unicorn proof tech here, you're on your own. } @@ -141,7 +142,7 @@ TavernkeepChat: { TaxCollectorChat: { DoGDefeated: Devourer of what, you said? Devourer of Funds, if its payroll is anything to go by! - PreBrimmy: Perhaps with all that time you've got you could check those old ruins? Certainly something of value in it for you! + PreBrimmy: So those punks on Azafure think they can live for free on my lands? Tell you what, do my job there and I might give you a bonus. HasSlickCane: Goodness! That cane has swagger! Has500Plat: Where and how are you getting all of this money? Has100Plat: BAH! Doesn't seem like I'll ever be able to quarrel with the debts of the town again! @@ -156,11 +157,11 @@ TruffleChat: { WitchDoctorChat: { BloodMoon: This is as good a time as any to pick up the best ingredients for potions. - PrePlantera: I have unique items if you show me that you have bested the guardian of this jungle. - Jungle: My home here has an extensive history and a mysterious past. You'll find out quickly just how extensive it is... + PrePlantera: I remember hearing some rumours about some villagers that were creating a monster to defend their village, maybe their magic can be of use to you? + Jungle: I wonder how my relatives are doing, last time I checked on them they were too busy praising the... Sun, I think. } WizardChat: { Hardmode: Space just got way too close for comfort. - MentionRoD: I wanted to sell you a special rod I found in the Hallow, but it appears I have misplaced it. Maybe a trip back there would refresh my memory. + MentionRoD: I saw some teleporting pink apparitions in the Hallow. If you let me live nearby, I should be able to channel their magic into a special staff for you. } \ No newline at end of file diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index 19302dcd1e..b4ffadf86d 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -405,6 +405,18 @@ namespace CalamityMod case "layer_1": case "abysslayer1": case "abyss layer 1": + case "sulfur depths": + case "sulfurdepths": + case "sulphur depths": + case "sulphurdepths": + case "sulfurous depths": + case "sulfurousdepths": + case "sulphurous depths": + case "sulphurousdepths": + case "sulfuric depths": + case "sulfuricdepths": + case "sulphuric depths": + case "sulphuricdepths": return mp.ZoneAbyssLayer1; case "abyss2": @@ -415,6 +427,10 @@ namespace CalamityMod case "layer_2": case "abysslayer2": case "abyss layer 2": + case "murky water": + case "murkywater": + case "murky waters": + case "murkywaters": return mp.ZoneAbyssLayer2; case "abyss3": @@ -425,6 +441,9 @@ namespace CalamityMod case "layer_3": case "abysslayer3": case "abyss layer 3": + case "thermalvents": + case "thermal vents": + case "vents": return mp.ZoneAbyssLayer3; case "abyss4": @@ -435,6 +454,9 @@ namespace CalamityMod case "layer_4": case "abysslayer4": case "abyss layer 4": + case "void": + case "the void": + case "thevoid": return mp.ZoneAbyssLayer4; } } diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index d366c6ca50..b629b91164 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -1,36 +1,24 @@ -using CalamityMod.Buffs.Summon; +using System; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Buffs.Summon; using CalamityMod.Events; using CalamityMod.Items; -using CalamityMod.Items.Accessories; -using CalamityMod.Items.Accessories.Wings; using CalamityMod.Items.Armor.Vanity; -using CalamityMod.Items.Dyes; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; -using CalamityMod.Items.Mounts; using CalamityMod.Items.PermanentBoosters; using CalamityMod.Items.Pets; -using CalamityMod.Items.Placeables; -using CalamityMod.Items.Placeables.Furniture; using CalamityMod.Items.Placeables.Furniture.BossRelics; -using CalamityMod.Items.Placeables.Furniture.CraftingStations; using CalamityMod.Items.Placeables.Furniture.DevPaintings; using CalamityMod.Items.Placeables.Furniture.Trophies; -using CalamityMod.Items.Placeables.FurnitureCosmilite; -using CalamityMod.Items.Potions; -using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.SummonItems; using CalamityMod.Items.SummonItems.Invasion; -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 CalamityMod.Items.Weapons.Typeless; using CalamityMod.NPCs.AcidRain; -using CalamityMod.NPCs.PrimordialWyrm; using CalamityMod.NPCs.AquaticScourge; using CalamityMod.NPCs.Astral; using CalamityMod.NPCs.AstrumAureus; @@ -62,7 +50,6 @@ using CalamityMod.NPCs.Ravager; using CalamityMod.NPCs.Signus; using CalamityMod.NPCs.SlimeGod; using CalamityMod.NPCs.StormWeaver; -using CalamityMod.NPCs.SulphurousSea; using CalamityMod.NPCs.SunkenSea; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.TownNPCs; @@ -71,14 +58,11 @@ using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Summon.Umbrella; using Microsoft.Xna.Framework; -using System; -using System.Collections.Generic; -using System.Linq; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; -using Microsoft.Xna.Framework.Graphics; - using static CalamityMod.Downed; using static Terraria.ModLoader.ModContent; @@ -86,18 +70,19 @@ namespace CalamityMod { internal class Downed { - public static readonly Func NotDownedCalClone = () => !DownedBossSystem.downedCalamitasClone; public static readonly Func DownedDesertScourge = () => DownedBossSystem.downedDesertScourge; public static readonly Func DownedGiantClam = () => DownedBossSystem.downedCLAM; public static readonly Func DownedCrabulon = () => DownedBossSystem.downedCrabulon; public static readonly Func DownedHiveMind = () => DownedBossSystem.downedHiveMind; - public static readonly Func DownedPerfs = () => DownedBossSystem.downedPerforator; + public static readonly Func DownedPerforators = () => DownedBossSystem.downedPerforator; public static readonly Func DownedSlimeGod = () => DownedBossSystem.downedSlimeGod; public static readonly Func DownedCryogen = () => DownedBossSystem.downedCryogen; public static readonly Func DownedBrimstoneElemental = () => DownedBossSystem.downedBrimstoneElemental; public static readonly Func DownedAquaticScourge = () => DownedBossSystem.downedAquaticScourge; public static readonly Func DownedCragmawMire = () => DownedBossSystem.downedCragmawMire; public static readonly Func DownedCalClone = () => DownedBossSystem.downedCalamitasClone; + // This function is not used anywhere in Calamity, but to be safe, don't remove it. Other mods may depend on it existing. + public static readonly Func NotDownedCalClone = () => !DownedBossSystem.downedCalamitasClone; public static readonly Func DownedGSS = () => DownedBossSystem.downedGSS; public static readonly Func DownedLeviathan = () => DownedBossSystem.downedLeviathan; public static readonly Func DownedAureus = () => DownedBossSystem.downedAstrumAureus; @@ -105,7 +90,7 @@ namespace CalamityMod public static readonly Func DownedRavager = () => DownedBossSystem.downedRavager; public static readonly Func DownedDeus = () => DownedBossSystem.downedAstrumDeus; public static readonly Func DownedGuardians = () => DownedBossSystem.downedGuardians; - public static readonly Func DownedBirb = () => DownedBossSystem.downedDragonfolly; + public static readonly Func DownedDragonfolly = () => DownedBossSystem.downedDragonfolly; public static readonly Func DownedProvidence = () => DownedBossSystem.downedProvidence; public static readonly Func DownedCeaselessVoid = () => DownedBossSystem.downedCeaselessVoid; public static readonly Func DownedStormWeaver = () => DownedBossSystem.downedStormWeaver; @@ -113,15 +98,16 @@ namespace CalamityMod public static readonly Func DownedPolterghast = () => DownedBossSystem.downedPolterghast; public static readonly Func DownedMauler = () => DownedBossSystem.downedMauler; public static readonly Func DownedNuclearTerror = () => DownedBossSystem.downedNuclearTerror; - public static readonly Func DownedBoomerDuke = () => DownedBossSystem.downedBoomerDuke; + public static readonly Func DownedOldDuke = () => DownedBossSystem.downedBoomerDuke; public static readonly Func DownedDoG = () => DownedBossSystem.downedDoG; public static readonly Func DownedYharon = () => DownedBossSystem.downedYharon; public static readonly Func DownedExoMechs = () => DownedBossSystem.downedExoMechs; - public static readonly Func DownedSCal = () => DownedBossSystem.downedCalamitas; + public static readonly Func DownedCalamitas = () => DownedBossSystem.downedCalamitas; public static readonly Func DownedPrimordialWyrm = () => DownedBossSystem.downedPrimordialWyrm; public static readonly Func DownedAcidRainInitial = () => DownedBossSystem.downedEoCAcidRain; public static readonly Func DownedAcidRainHardmode = () => DownedBossSystem.downedAquaticScourgeAcidRain; + // T3 Acid Rain is considered beaten when you beat Old Duke public static readonly Func DownedBossRush = () => DownedBossSystem.downedBossRush; } @@ -129,18 +115,19 @@ namespace CalamityMod { public const string CalamityWikiURLOld = "calamitymod.wiki.gg"; public const string CalamityWikiURL = "https://calamitymod.wiki.gg/wiki/{}"; + private const string loreItemPage = "Lore#Lore_Items"; /// /// Vanilla main bosses:
- /// 1.0 = King Slime
- /// 2.0 = Eye of Cthulhu
- /// 3.0 = Eater of Worlds / Brain of Cthulhu
- /// 4.0 = Queen Bee
- /// 5.0 = Skeletron
- /// 6.0 = Deerclops
- /// 7.0 = Wall of Flesh
- /// 8.0 = Queen Slime
- /// 9.0 = The Twins
+ /// 1.0 = King Slime
+ /// 2.0 = Eye of Cthulhu
+ /// 3.0 = Eater of Worlds / Brain of Cthulhu
+ /// 4.0 = Queen Bee
+ /// 5.0 = Skeletron
+ /// 6.0 = Deerclops
+ /// 7.0 = Wall of Flesh
+ /// 8.0 = Queen Slime
+ /// 9.0 = The Twins
/// 10.0 = The Destroyer
/// 11.0 = Skeletron Prime
/// 12.0 = Plantera
@@ -151,7 +138,7 @@ namespace CalamityMod /// 17.0 = Lunatic Cultist
/// 18.0 = Moon Lord ///
- private static readonly Dictionary ModProgression = new Dictionary + private static readonly Dictionary BossChecklistProgressionValues = new Dictionary { { "DesertScourge", 1.6f }, { "GiantClam", 1.61f }, @@ -202,6 +189,8 @@ namespace CalamityMod SummonersAssociationSupport(); } + #region WikiThis + // This is a separate function because it only runs clientside public static void WikiThisSupport() { // Wikithis is a clientside mod @@ -217,91 +206,87 @@ namespace CalamityMod wiki.Call("AddModURL", calamity, oldVersion ? CalamityWikiURLOld : CalamityWikiURL); wiki.Call(0, calamity, oldVersion ? CalamityWikiURLOld : CalamityWikiURL); - wiki.Call("AddWikiTexture", calamity, ModContent.Request("CalamityMod/ModSupport/WikiThisIcon")); - wiki.Call(3, calamity, ModContent.Request("CalamityMod/ModSupport/WikiThisIcon")); + wiki.Call("AddWikiTexture", calamity, Request("CalamityMod/ModSupport/WikiThisIcon")); + wiki.Call(3, calamity, Request("CalamityMod/ModSupport/WikiThisIcon")); // Clear up name conflicts - void ItemRedirect(int item, string pageName) - { - wiki.Call(1, item, pageName); - } - void EnemyRedirect(int item, string pageName) - { - wiki.Call(2, item, pageName); - } + void ItemRedirect(int item, string pageName) => wiki.Call(1, item, pageName); + void EnemyRedirect(int item, string pageName) => wiki.Call(2, item, pageName); // Items - ItemRedirect(ModContent.ItemType(), "Blood Orange (calamity)"); - ItemRedirect(ModContent.ItemType(), "Elderberry (calamity)"); - ItemRedirect(ModContent.ItemType(), "Pineapple (calamity)"); - ItemRedirect(ModContent.ItemType(), "Trash Can (pet)"); - ItemRedirect(ModContent.ItemType(), "Butcher (weapon)"); - ItemRedirect(ModContent.ItemType(), "Sandstorm (weapon)"); - ItemRedirect(ModContent.ItemType(), "Thunderstorm (weapon)"); + ItemRedirect(ItemType(), "Blood Orange (calamity)"); + ItemRedirect(ItemType(), "Elderberry (calamity)"); + ItemRedirect(ItemType(), "Pineapple (calamity)"); + ItemRedirect(ItemType(), "Trash Can (pet)"); + ItemRedirect(ItemType(), "Butcher (weapon)"); + ItemRedirect(ItemType(), "Sandstorm (weapon)"); + ItemRedirect(ItemType(), "Thunderstorm (weapon)"); // Lore items - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); - ItemRedirect(ModContent.ItemType(), "Lore#Lore_Items"); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); + ItemRedirect(ItemType(), loreItemPage); // Enemies - EnemyRedirect(ModContent.NPCType(), "Hive (enemy)"); - EnemyRedirect(ModContent.NPCType(), "Crown Jewel (enemy)"); - EnemyRedirect(ModContent.NPCType(), "Tooth Ball (Old Duke)"); - EnemyRedirect(ModContent.NPCType(), "Enchantment"); - EnemyRedirect(ModContent.NPCType(), "%3F%3F%3F"); + EnemyRedirect(NPCType(), "Hive (enemy)"); + EnemyRedirect(NPCType(), "Crown Jewel (enemy)"); + EnemyRedirect(NPCType(), "Tooth Ball (Old Duke)"); + EnemyRedirect(NPCType(), "Enchantment"); + EnemyRedirect(NPCType(), "%3F%3F%3F"); } + #endregion + #region Subworld Library // Wrapper function to detect if a subworld is in use for Subworld Library. internal static bool InAnySubworld() { @@ -319,19 +304,26 @@ namespace CalamityMod } return false; } + #endregion + #region Boss Checklist // Wrapper function to add bosses to Boss Checklist. - private static void AddBoss(Mod bossChecklist, Mod hostMod, string name, float difficulty, object npcTypes, Func downed, Dictionary extraInfo) + private static void AddBoss(Mod bossChecklist, Mod hostMod, string name, float difficulty, Func downed, object npcTypes, Dictionary extraInfo) => bossChecklist.Call("LogBoss", hostMod, name, difficulty, downed, npcTypes, extraInfo); // Wrapper function to add minibosses to Boss Checklist. - private static void AddMiniBoss(Mod bossChecklist, Mod hostMod, string name, float difficulty, int npcType, Func downed, Dictionary extraInfo) + private static void AddMiniBoss(Mod bossChecklist, Mod hostMod, string name, float difficulty, Func downed, int npcType, Dictionary extraInfo) => bossChecklist.Call("LogMiniBoss", hostMod, name, difficulty, downed, npcType, extraInfo); // Wrapper function to add events to Boss Checklist. - private static void AddInvasion(Mod bossChecklist, Mod hostMod, string name, float difficulty, List npcTypes, Func downed, Dictionary extraInfo) + private static void AddEvent(Mod bossChecklist, Mod hostMod, string name, float difficulty, Func downed, List npcTypes, Dictionary extraInfo) => bossChecklist.Call("LogEvent", hostMod, name, difficulty, downed, npcTypes, extraInfo); + // Shorthands to grab localization keys for Boss Checklist entries. + private static LocalizedText GetDisplayName(string entryName) => CalamityUtils.GetText($"BossChecklistIntegration.{entryName}.EntryName"); + private static LocalizedText GetSpawnInfo(string entryName) => CalamityUtils.GetText($"BossChecklistIntegration.{entryName}.SpawnInfo"); + private static LocalizedText GetDespawnMessage(string entryName) => CalamityUtils.GetText($"BossChecklistIntegration.{entryName}.DespawnMessage"); + private static void BossChecklistSupport() { CalamityMod calamity = GetInstance(); @@ -343,27 +335,31 @@ namespace CalamityMod AddCalamityBosses(bossChecklist, calamity); // Adds every single Calamity invasion to the Boss Checklist's Invasion Log. - AddCalamityInvasions(bossChecklist, calamity); + AddCalamityEvents(bossChecklist, calamity); // Registers Calamity's special loot (ie. Lore items) and alternate spawn items to Boss Checklist's Boss Log. RegisterCalamityExtraInfo(bossChecklist, calamity); } + #region Boss Checklist: Bosses and Minibosses private static void AddCalamityBosses(Mod bossChecklist, Mod calamity) { // Desert Scourge { string entryName = "DesertScourge"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); List segments = new List() { NPCType(), NPCType(), NPCType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; Action portrait = (SpriteBatch sb, Rectangle rect, Color color) => { - Texture2D texture = ModContent.Request("CalamityMod/NPCs/DesertScourge/DesertScourge_BossChecklist").Value; + Texture2D texture = Request("CalamityMod/NPCs/DesertScourge/DesertScourge_BossChecklist").Value; Vector2 centered = new Vector2(rect.Center.X - (texture.Width / 2), rect.Center.Y - (texture.Height / 2)); sb.Draw(texture, centered, color); }; - AddBoss(bossChecklist, calamity, entryName, order, segments, DownedDesertScourge, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedDesertScourge, segments, new Dictionary() { + ["displayName"] = GetDisplayName(entryName), + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection, ["customPortrait"] = portrait @@ -373,11 +369,13 @@ namespace CalamityMod // Giant Clam { string entryName = "GiantClam"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); List collection = new List() { ItemType(), ItemType() }; - AddMiniBoss(bossChecklist, calamity, entryName, order, type, DownedGiantClam, new Dictionary() + AddMiniBoss(bossChecklist, calamity, entryName, order, DownedGiantClam, type, new Dictionary() { + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["collectibles"] = collection }); } @@ -385,11 +383,13 @@ namespace CalamityMod // Crabulon { string entryName = "Crabulon"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - AddBoss(bossChecklist, calamity, entryName, order, type, DownedCrabulon, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedCrabulon, type, new Dictionary() { + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection }); @@ -398,11 +398,13 @@ namespace CalamityMod // Hive Mind { string entryName = "HiveMind"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - AddBoss(bossChecklist, calamity, entryName, order, type, DownedHiveMind, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedHiveMind, type, new Dictionary() { + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection, ["overrideHeadTextures"] = "CalamityMod/NPCs/HiveMind/HiveMindP2_Head_Boss" @@ -412,24 +414,31 @@ namespace CalamityMod // Perforators { string entryName = "Perforators"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - AddBoss(bossChecklist, calamity, entryName, order, type, DownedPerfs, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedPerforators, type, new Dictionary() { + ["displayName"] = GetDisplayName(entryName), + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), - ["collectibles"] = collection + ["collectibles"] = collection, + ["displayName"] = GetDisplayName(entryName), }); } // Slime God { string entryName = "SlimeGod"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); List bosses = new List() { NPCType(), NPCType(), NPCType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - AddBoss(bossChecklist, calamity, entryName, order, bosses, DownedSlimeGod, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedSlimeGod, bosses, new Dictionary() { + ["displayName"] = GetDisplayName(entryName), + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection }); @@ -438,11 +447,13 @@ namespace CalamityMod // Cryogen { string entryName = "Cryogen"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - AddBoss(bossChecklist, calamity, entryName, order, type, DownedCryogen, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedCryogen, type, new Dictionary() { + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection, ["overrideHeadTextures"] = "CalamityMod/NPCs/Cryogen/Cryogen_Phase1_Head_Boss" @@ -452,16 +463,19 @@ namespace CalamityMod // Aquatic Scourge { string entryName = "AquaticScourge"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); List segments = new List() { NPCType(), NPCType(), NPCType(), NPCType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; Action portrait = (SpriteBatch sb, Rectangle rect, Color color) => { - Texture2D texture = ModContent.Request("CalamityMod/NPCs/AquaticScourge/AquaticScourge_BossChecklist").Value; + Texture2D texture = Request("CalamityMod/NPCs/AquaticScourge/AquaticScourge_BossChecklist").Value; Vector2 centered = new Vector2(rect.Center.X - (texture.Width / 2), rect.Center.Y - (texture.Height / 2)); sb.Draw(texture, centered, color); }; - AddBoss(bossChecklist, calamity, entryName, order, segments, DownedAquaticScourge, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedAquaticScourge, segments, new Dictionary() { + ["displayName"] = GetDisplayName(entryName), + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection, ["customPortrait"] = portrait @@ -471,11 +485,13 @@ namespace CalamityMod // Cragmaw Mire { string entryName = "CragmawMire"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); List collection = new List() { ItemType(), ItemType() }; - AddMiniBoss(bossChecklist, calamity, entryName, order, type, DownedCragmawMire, new Dictionary() + AddMiniBoss(bossChecklist, calamity, entryName, order, DownedCragmawMire, type, new Dictionary() { + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection, ["availability"] = DownedAcidRainInitial @@ -485,11 +501,13 @@ namespace CalamityMod // Brimstone Elemental { string entryName = "BrimstoneElemental"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - AddBoss(bossChecklist, calamity, entryName, order, type, DownedBrimstoneElemental, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedBrimstoneElemental, type, new Dictionary() { + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection }); @@ -498,11 +516,13 @@ namespace CalamityMod // Calamitas Clone { string entryName = "CalamitasClone"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - AddBoss(bossChecklist, calamity, entryName, order, type, DownedCalClone, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedCalClone, type, new Dictionary() { + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection }); @@ -511,11 +531,13 @@ namespace CalamityMod // Great Sand Shark { string entryName = "GreatSandShark"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); List collection = new List() { ItemType(), ItemType(), ItemID.MusicBoxSandstorm }; - AddMiniBoss(bossChecklist, calamity, entryName, order, type, DownedGSS, new Dictionary() + AddMiniBoss(bossChecklist, calamity, entryName, order, DownedGSS, type, new Dictionary() { + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection }); @@ -524,16 +546,19 @@ namespace CalamityMod // Anahita and Leviathan { string entryName = "Leviathan"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); List bosses = new List() { NPCType(), NPCType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; Action portrait = (SpriteBatch sb, Rectangle rect, Color color) => { - Texture2D texture = ModContent.Request("CalamityMod/NPCs/Leviathan/AnahitaLevi_BossChecklist").Value; + Texture2D texture = Request("CalamityMod/NPCs/Leviathan/AnahitaLevi_BossChecklist").Value; Vector2 centered = new Vector2(rect.Center.X - (texture.Width / 2), rect.Center.Y - (texture.Height / 2)); sb.Draw(texture, centered, color); }; - AddBoss(bossChecklist, calamity, entryName, order, bosses, DownedLeviathan, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedLeviathan, bosses, new Dictionary() { + ["displayName"] = GetDisplayName(entryName), + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["collectibles"] = collection, ["customPortrait"] = portrait }); @@ -542,11 +567,13 @@ namespace CalamityMod // Astrum Aureus { string entryName = "AstrumAureus"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - AddBoss(bossChecklist, calamity, entryName, order, type, DownedAureus, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedAureus, type, new Dictionary() { + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection }); @@ -555,16 +582,18 @@ namespace CalamityMod // Plaguebringer Goliath { string entryName = "PlaguebringerGoliath"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; Action portrait = (SpriteBatch sb, Rectangle rect, Color color) => { - Texture2D texture = ModContent.Request("CalamityMod/NPCs/PlaguebringerGoliath/PlaguebringerGoliath_BossChecklist").Value; + Texture2D texture = Request("CalamityMod/NPCs/PlaguebringerGoliath/PlaguebringerGoliath_BossChecklist").Value; Vector2 centered = new Vector2(rect.Center.X - (texture.Width / 2), rect.Center.Y - (texture.Height / 2)); sb.Draw(texture, centered, color); }; - AddBoss(bossChecklist, calamity, entryName, order, type, DownedPBG, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedPBG, type, new Dictionary() { + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection, ["customPortrait"] = portrait @@ -574,16 +603,19 @@ namespace CalamityMod // Ravager { string entryName = "Ravager"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); List segments = new List() { NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; Action portrait = (SpriteBatch sb, Rectangle rect, Color color) => { - Texture2D texture = ModContent.Request("CalamityMod/NPCs/Ravager/Ravager_BossChecklist").Value; + Texture2D texture = Request("CalamityMod/NPCs/Ravager/Ravager_BossChecklist").Value; Vector2 centered = new Vector2(rect.Center.X - (texture.Width / 2), rect.Center.Y - (texture.Height / 2)); sb.Draw(texture, centered, color); }; - AddBoss(bossChecklist, calamity, entryName, order, segments, DownedRavager, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedRavager, segments, new Dictionary() { + ["displayName"] = GetDisplayName(entryName), + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection, ["customPortrait"] = portrait @@ -593,18 +625,21 @@ namespace CalamityMod // Astrum Deus { string entryName = "AstrumDeus"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); List segments = new List() { NPCType(), NPCType(), NPCType() }; List summons = new List() { ItemType(), ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; Action portrait = (SpriteBatch sb, Rectangle rect, Color color) => { - Texture2D texture = ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeus_BossChecklist").Value; + Texture2D texture = Request("CalamityMod/NPCs/AstrumDeus/AstrumDeus_BossChecklist").Value; Vector2 centered = new Vector2(rect.Center.X - (texture.Width / 2), rect.Center.Y - (texture.Height / 2)); sb.Draw(texture, centered, color); }; - AddBoss(bossChecklist, calamity, entryName, order, segments, DownedDeus, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedDeus, segments, new Dictionary() { + ["displayName"] = GetDisplayName(entryName), + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = summons, ["collectibles"] = collection, ["customPortrait"] = portrait @@ -614,17 +649,20 @@ namespace CalamityMod // Profaned Guardians { string entryName = "ProfanedGuardians"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; Action portrait = (SpriteBatch sb, Rectangle rect, Color color) => { - Texture2D texture = ModContent.Request("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardians_BossChecklist").Value; + Texture2D texture = Request("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardians_BossChecklist").Value; float scale = 0.7f; Vector2 centered = new Vector2(rect.Center.X - texture.Width * scale / 2, rect.Center.Y - texture.Height * scale / 2); sb.Draw(texture, centered, null, color, 0f, Vector2.Zero, scale, SpriteEffects.None, 0f); }; - AddBoss(bossChecklist, calamity, entryName, order, type, DownedGuardians, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedGuardians, type, new Dictionary() { + ["displayName"] = GetDisplayName(entryName), + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection, ["customPortrait"] = portrait, @@ -635,11 +673,13 @@ namespace CalamityMod // Dragonfolly { string entryName = "Dragonfolly"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - AddBoss(bossChecklist, calamity, entryName, order, type, DownedBirb, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedDragonfolly, type, new Dictionary() { + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection }); @@ -648,16 +688,18 @@ namespace CalamityMod // Providence { string entryName = "Providence"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; Action portrait = (SpriteBatch sb, Rectangle rect, Color color) => { - Texture2D texture = ModContent.Request("CalamityMod/NPCs/Providence/Providence_BossChecklist").Value; + Texture2D texture = Request("CalamityMod/NPCs/Providence/Providence_BossChecklist").Value; Vector2 centered = new Vector2(rect.Center.X - (texture.Width / 2), rect.Center.Y - (texture.Height / 2)); sb.Draw(texture, centered, color); }; - AddBoss(bossChecklist, calamity, entryName, order, type, DownedProvidence, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedProvidence, type, new Dictionary() { + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection, ["customPortrait"] = portrait @@ -667,11 +709,14 @@ namespace CalamityMod // Ceaseless Void { string entryName = "CeaselessVoid"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); List bosses = new List() { NPCType(), NPCType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - AddBoss(bossChecklist, calamity, entryName, order, bosses, DownedCeaselessVoid, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedCeaselessVoid, bosses, new Dictionary() { + ["displayName"] = GetDisplayName(entryName), + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection }); @@ -680,16 +725,19 @@ namespace CalamityMod // Storm Weaver { string entryName = "StormWeaver"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); List segments = new List() { NPCType(), NPCType(), NPCType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; Action portrait = (SpriteBatch sb, Rectangle rect, Color color) => { - Texture2D texture = ModContent.Request("CalamityMod/NPCs/StormWeaver/StormWeaver_BossChecklist").Value; + Texture2D texture = Request("CalamityMod/NPCs/StormWeaver/StormWeaver_BossChecklist").Value; Vector2 centered = new Vector2(rect.Center.X - (texture.Width / 2), rect.Center.Y - (texture.Height / 2)); sb.Draw(texture, centered, color); }; - AddBoss(bossChecklist, calamity, entryName, order, segments, DownedStormWeaver, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedStormWeaver, segments, new Dictionary() { + ["displayName"] = GetDisplayName(entryName), + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection, ["customPortrait"] = portrait, @@ -700,11 +748,14 @@ namespace CalamityMod // Signus { string entryName = "Signus"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - AddBoss(bossChecklist, calamity, entryName, order, type, DownedSignus, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedSignus, type, new Dictionary() { + ["displayName"] = GetDisplayName(entryName), + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection }); @@ -713,11 +764,14 @@ namespace CalamityMod // Polterghast { string entryName = "Polterghast"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); List bosses = new List() { NPCType(), NPCType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - AddBoss(bossChecklist, calamity, entryName, order, bosses, DownedPolterghast, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedPolterghast, bosses, new Dictionary() { + ["displayName"] = GetDisplayName(entryName), + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection }); @@ -726,11 +780,13 @@ namespace CalamityMod // Mauler { string entryName = "Mauler"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); List collection = new List() { ItemType(), ItemType() }; - AddMiniBoss(bossChecklist, calamity, entryName, order, type, DownedMauler, new Dictionary() + AddMiniBoss(bossChecklist, calamity, entryName, order, DownedMauler, type, new Dictionary() { + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection, ["availability"] = DownedAcidRainHardmode @@ -740,11 +796,13 @@ namespace CalamityMod // Nuclear Terror { string entryName = "NuclearTerror"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); List collection = new List() { ItemType(), ItemType() }; - AddMiniBoss(bossChecklist, calamity, entryName, order, type, DownedNuclearTerror, new Dictionary() + AddMiniBoss(bossChecklist, calamity, entryName, order, DownedNuclearTerror, type, new Dictionary() { + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection, ["availability"] = DownedAcidRainHardmode @@ -754,11 +812,14 @@ namespace CalamityMod // Old Duke { string entryName = "OldDuke"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - AddBoss(bossChecklist, calamity, entryName, order, type, DownedBoomerDuke, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedOldDuke, type, new Dictionary() { + ["displayName"] = GetDisplayName(entryName), + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection }); @@ -767,16 +828,19 @@ namespace CalamityMod // Devourer of Gods { string entryName = "DevourerofGods"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; Action portrait = (SpriteBatch sb, Rectangle rect, Color color) => { - Texture2D texture = ModContent.Request("CalamityMod/NPCs/DevourerofGods/DevourerofGods_BossChecklist").Value; + Texture2D texture = Request("CalamityMod/NPCs/DevourerofGods/DevourerofGods_BossChecklist").Value; Vector2 centered = new Vector2(rect.Center.X - (texture.Width / 2), rect.Center.Y - (texture.Height / 2)); sb.Draw(texture, centered, color); }; - AddBoss(bossChecklist, calamity, entryName, order, type, DownedDoG, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedDoG, type, new Dictionary() { + ["displayName"] = GetDisplayName(entryName), + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection, ["customPortrait"] = portrait, @@ -787,23 +851,23 @@ namespace CalamityMod // Yharon { string entryName = "Yharon"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - AddBoss(bossChecklist, calamity, entryName, order, type, DownedYharon, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedYharon, type, new Dictionary() { + ["displayName"] = GetDisplayName(entryName), + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), ["collectibles"] = collection }); } // Exo Mechs - // Collection requires edits - // Instructions require edits - // Despawn requires edits { string entryName = "ExoMechs"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); List bosses = new List() { NPCType(), NPCType(), NPCType(), NPCType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; Action portrait = (SpriteBatch sb, Rectangle rect, Color color) => { @@ -813,8 +877,11 @@ namespace CalamityMod sb.Draw(texture, centered, null, color, 0f, Vector2.Zero, scale, SpriteEffects.None, 0f); }; - AddBoss(bossChecklist, calamity, entryName, order, bosses, DownedExoMechs, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedExoMechs, bosses, new Dictionary() { + ["displayName"] = GetDisplayName(entryName), + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["collectibles"] = collection, ["customPortrait"] = portrait }); @@ -823,33 +890,38 @@ namespace CalamityMod // Calamitas { string entryName = "Calamitas"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); List summons = new List() { ItemType(), ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - AddBoss(bossChecklist, calamity, entryName, order, type, DownedSCal, new Dictionary() + AddBoss(bossChecklist, calamity, entryName, order, DownedCalamitas, type, new Dictionary() { + ["displayName"] = GetDisplayName(entryName), + ["spawnInfo"] = GetSpawnInfo(entryName), + ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = summons, ["collectibles"] = collection, ["overrideHeadTextures"] = "CalamityMod/NPCs/SupremeCalamitas/HoodedHeadIcon" }); } } + #endregion - private static void AddCalamityInvasions(Mod bossChecklist, Mod calamity) + #region Boss Checklist: Events and Invasions + private static void AddCalamityEvents(Mod bossChecklist, Mod calamity) { // Initial Acid Rain { string entryName = "AcidRainT1"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); List enemies = AcidRainEvent.PossibleEnemiesPreHM.Select(enemy => enemy.Key).ToList(); Action portrait = (SpriteBatch sb, Rectangle rect, Color color) => { - Texture2D texture = ModContent.Request("CalamityMod/Events/AcidRainT1_BossChecklist").Value; + Texture2D texture = Request("CalamityMod/Events/AcidRainT1_BossChecklist").Value; float scale = 1f; Vector2 centered = new Vector2(rect.Center.X - texture.Width * scale / 2, rect.Center.Y - texture.Height * scale / 2); sb.Draw(texture, centered, null, color, 0f, Vector2.Zero, scale, SpriteEffects.None, 0f); }; - AddInvasion(bossChecklist, calamity, entryName, order, enemies, DownedAcidRainInitial, new Dictionary() + AddEvent(bossChecklist, calamity, entryName, order, DownedAcidRainInitial, enemies, new Dictionary() { ["spawnItems"] = ItemType(), ["collectibles"] = ItemType(), @@ -860,18 +932,18 @@ namespace CalamityMod // Post-Aquatic Scourge Acid Rain { string entryName = "AcidRainT2"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); List enemies = AcidRainEvent.PossibleEnemiesAS.Select(enemy => enemy.Key).ToList(); - enemies.Add(ModContent.NPCType()); + enemies.Add(NPCType()); enemies.AddRange(AcidRainEvent.PossibleMinibossesAS.Select(miniboss => miniboss.Key)); List collection = new List() { ItemType(), ItemType(), ItemType()}; Action portrait = (SpriteBatch sb, Rectangle rect, Color color) => { - Texture2D texture = ModContent.Request("CalamityMod/Events/AcidRainT2_BossChecklist").Value; + Texture2D texture = Request("CalamityMod/Events/AcidRainT2_BossChecklist").Value; float scale = 0.9f; Vector2 centered = new Vector2(rect.Center.X - texture.Width * scale / 2, rect.Center.Y - texture.Height * scale / 2); sb.Draw(texture, centered, null, color, 0f, Vector2.Zero, scale, SpriteEffects.None, 0f); }; - AddInvasion(bossChecklist, calamity, entryName, order, enemies, DownedAcidRainHardmode, new Dictionary() + AddEvent(bossChecklist, calamity, entryName, order, DownedAcidRainHardmode, enemies, new Dictionary() { ["spawnItems"] = ItemType(), ["collectibles"] = collection, @@ -883,17 +955,17 @@ namespace CalamityMod // Post-Polterghast Acid Rain { string entryName = "AcidRainT3"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); List enemies = AcidRainEvent.PossibleEnemiesPolter.Select(enemy => enemy.Key).ToList(); enemies.AddRange(AcidRainEvent.PossibleMinibossesPolter.Select(miniboss => miniboss.Key)); List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType()}; Action portrait = (SpriteBatch sb, Rectangle rect, Color color) => { - Texture2D texture = ModContent.Request("CalamityMod/Events/AcidRainT3_BossChecklist").Value; + Texture2D texture = Request("CalamityMod/Events/AcidRainT3_BossChecklist").Value; float scale = 0.9f; Vector2 centered = new Vector2(rect.Center.X - texture.Width * scale / 2, rect.Center.Y - texture.Height * scale / 2); sb.Draw(texture, centered, null, color, 0f, Vector2.Zero, scale, SpriteEffects.None, 0f); }; - AddInvasion(bossChecklist, calamity, entryName, order, enemies, DownedBoomerDuke, new Dictionary() + AddEvent(bossChecklist, calamity, entryName, order, DownedOldDuke, enemies, new Dictionary() { ["spawnItems"] = ItemType(), ["collectibles"] = collection, @@ -905,15 +977,15 @@ namespace CalamityMod // Boss Rush { string entryName = "BossRush"; - ModProgression.TryGetValue(entryName, out float order); + BossChecklistProgressionValues.TryGetValue(entryName, out float order); List enemies = new List() { NPCID.None }; // This is for loot purposes, which no bosses give during the event Action portrait = (SpriteBatch sb, Rectangle rect, Color color) => { - Texture2D texture = ModContent.Request("CalamityMod/Skies/XerocEye").Value; + Texture2D texture = Request("CalamityMod/Skies/XerocEye").Value; float scale = 0.5f; Vector2 centered = new Vector2(rect.Center.X - texture.Width * scale / 2, rect.Center.Y - texture.Height * scale / 2); sb.Draw(texture, centered, null, color, 0f, Vector2.Zero, scale, SpriteEffects.None, 0f); }; - AddInvasion(bossChecklist, calamity, entryName, order, enemies, DownedBossRush, new Dictionary() + AddEvent(bossChecklist, calamity, entryName, order, DownedBossRush, enemies, new Dictionary() { ["spawnItems"] = ItemType(), ["collectibles"] = ItemType(), @@ -922,9 +994,12 @@ namespace CalamityMod }); } } + #endregion + #region Boss Checklist: Vanilla Edits private static void RegisterCalamityExtraInfo(Mod bossChecklist, Mod calamity) { + // Calamity spawn items which spawn vanilla bosses. bossChecklist.Call("SubmitEntrySpawnItems", calamity, new Dictionary() { { "Terraria Plantera", ItemType() }, @@ -932,6 +1007,8 @@ namespace CalamityMod { "Terraria CultistBoss", ItemType() } }); + // Collectibles which drop from vanilla bosses. + // These are lore items, Hermit's Box, and the thank you painting. bossChecklist.Call("SubmitEntryCollectibles", calamity, new Dictionary() { { "Terraria KingSlime", new List() { ItemType(), ItemType() } }, @@ -953,7 +1030,10 @@ namespace CalamityMod { "Terraria MoonLord", new List() { ItemType(), ItemType() } } }); } + #endregion + #endregion + #region Fargo's Mutant Mod private static void FargosSupport() { Mod fargos = GetInstance().fargos; @@ -962,15 +1042,17 @@ namespace CalamityMod void AddToMutantShop(string bossName, string summonItemName, Func downed, int price) { - ModProgression.TryGetValue(bossName, out float order); + BossChecklistProgressionValues.TryGetValue(bossName, out float order); fargos.Call("AddSummon", order, "CalamityMod", summonItemName, downed, price); } fargos.Call("AbominationnClearEvents", "CalamityMod", AcidRainEvent.AcidRainEventIsOngoing, true); - AddToMutantShop("OldDuke", "BloodwormItem", DownedBoomerDuke, Item.buyPrice(platinum: 2)); + AddToMutantShop("OldDuke", "BloodwormItem", DownedOldDuke, Item.buyPrice(platinum: 2)); } + #endregion + #region Dialogue Tweaks private static void DialogueTweakSupport() { Mod dialogueMod = GetInstance().dialogueTweak; @@ -979,7 +1061,9 @@ namespace CalamityMod dialogueMod.Call("ReplaceShopButtonIcon", NPCType(), "Head"); } } + #endregion + #region Summoner's Association private static void SummonersAssociationSupport() { Mod sAssociation = GetInstance().summonersAssociation; @@ -1002,7 +1086,6 @@ namespace CalamityMod RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); - RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); @@ -1020,17 +1103,17 @@ namespace CalamityMod RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); - RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); - RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); - RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); @@ -1041,7 +1124,7 @@ namespace CalamityMod RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); - RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); @@ -1099,5 +1182,6 @@ namespace CalamityMod } }); } + #endregion } } diff --git a/NPCs/Abyss/BabyCannonballJellyfish.cs b/NPCs/Abyss/BabyCannonballJellyfish.cs new file mode 100644 index 0000000000..e63b7ff216 --- /dev/null +++ b/NPCs/Abyss/BabyCannonballJellyfish.cs @@ -0,0 +1,182 @@ +using CalamityMod.BiomeManagers; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System.IO; +using System.Linq; +using CalamityMod.Items.Critters; +using CalamityMod.Items.Placeables.Banners; +using Terraria; +using Terraria.GameContent; +using Terraria.GameContent.Bestiary; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ModLoader.Utilities; +using Terraria.Audio; +using Terraria.DataStructures; + +namespace CalamityMod.NPCs.Abyss +{ + public class BabyCannonballJellyfish : ModNPC + { + public bool hasBeenHit = false; + + public override void SetStaticDefaults() + { + Main.npcFrameCount[NPC.type] = 7; + //Main.npcCatchable[NPC.type] = true; + NPCID.Sets.CountsAsCritter[NPC.type] = true; + } + + public override void SetDefaults() + { + NPC.npcSlots = 0.1f; + NPC.noGravity = true; + NPC.chaseable = false; + NPC.aiStyle = -1; + AIType = -1; + NPC.damage = 30; + NPC.width = 28; + NPC.height = 36; + NPC.defense = 0; + NPC.lifeMax = 5; + NPC.knockBackResist = 1f; + NPC.alpha = 100; + NPC.HitSound = SoundID.NPCHit25; + NPC.DeathSound = SoundID.NPCDeath28; + Banner = NPC.type; + BannerItem = ModContent.ItemType(); + NPC.catchItem = (short)ModContent.ItemType(); + NPC.Calamity().VulnerableToHeat = false; + NPC.Calamity().VulnerableToSickness = false; + NPC.Calamity().VulnerableToElectricity = true; + NPC.Calamity().VulnerableToWater = false; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + } + + public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) + { + bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] + { + new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.BabyCannonballJellyfish") + }); + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(NPC.chaseable); + writer.Write(hasBeenHit); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + NPC.chaseable = reader.ReadBoolean(); + hasBeenHit = reader.ReadBoolean(); + } + + public override void AI() + { + if (NPC.localAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient) + { + NPC.localAI[0] = 1f; + NPC.velocity.Y = -3f; + NPC.netUpdate = true; + } + Lighting.AddLight(NPC.Center, (67 - NPC.alpha) * 1f / 255f, (218 - NPC.alpha) * 1f / 255f, (166 - NPC.alpha) * 1f / 255f); + if (NPC.wet) + { + NPC.noGravity = true; + if (NPC.velocity.Y < 0f) + { + NPC.velocity.Y += 0.1f; + } + if (NPC.velocity.Y > 0f) + { + NPC.velocity.Y = 0f; + } + } + else + { + NPC.noGravity = false; + } + } + + public override bool? CanBeHitByProjectile(Projectile projectile) + { + if (projectile.minion && !projectile.Calamity().overridesMinionDamagePrevention) + { + return hasBeenHit; + } + return null; + } + + public override void FindFrame(int frameHeight) + { + NPC.frameCounter += 0.15f; + NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + int frame = (int)NPC.frameCounter; + NPC.frame.Y = frame * frameHeight; + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.Player.Calamity().ZoneAbyssLayer1 && spawnInfo.Water) + { + return SpawnCondition.CaveJellyfish.Chance; + } + return 0f; + } + + public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (NPC.spriteDirection == 1) + { + spriteEffects = SpriteEffects.FlipHorizontally; + } + Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); + Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 vector = center - screenPos; + vector -= new Vector2((float)ModContent.Request("CalamityMod/NPCs/Abyss/BabyCannonballJellyfishGlow").Value.Width, (float)(ModContent.Request("CalamityMod/NPCs/Abyss/BabyCannonballJellyfishGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; + vector += vector11 * 1f + new Vector2(0f, 4f + NPC.gfxOffY); + Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(new Color(67, 218, 166)); + Main.spriteBatch.Draw(ModContent.Request("CalamityMod/NPCs/Abyss/BabyCannonballJellyfishGlow").Value, vector, + new Microsoft.Xna.Framework.Rectangle?(NPC.frame), color, NPC.rotation, vector11, 1f, spriteEffects, 0f); + } + + public override bool CheckDead() + { + Explode(); + return false; //custom death handling + } + + private void Explode() + { + NPC.position = NPC.Center; + NPC.width = (int)(NPC.width * 3f); + NPC.height = (int)(NPC.height * 3f); + NPC.position -= NPC.Size * 0.5f; //hitbox expansion + adjustments + SoundEngine.PlaySound(SoundID.Item14, NPC.Center); //bomb sound + foreach (Player player in Main.player.Where(player => player.active && !player.dead && NPC.Hitbox.Intersects(player.Hitbox))) + player.Hurt(PlayerDeathReason.ByNPC(NPC.whoAmI), NPC.damage, NPC.direction); + for (int k = 0; k < 8; k++) + { + int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.MoonBoulder, 0f, -1f, 0, default, 1f); + if (Main.dust.IndexInRange(dust)) + Main.dust[dust].noGravity = true; + } + NPC.active = false; + NPC.NPCLoot(); + NPC.netUpdate = true; + } + + public override bool CanHitPlayer(Player target, ref int cooldownSlot) => NPC.life <= 0; + + public override void HitEffect(NPC.HitInfo hit) + { + for (int k = 0; k < 2; k++) + { + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.MoonBoulder, hit.HitDirection, -1f, 0, default, 1f); + } + } + } +} diff --git a/NPCs/Abyss/BabyCannonballJellyfish.png b/NPCs/Abyss/BabyCannonballJellyfish.png new file mode 100644 index 0000000000..dc393d1f84 Binary files /dev/null and b/NPCs/Abyss/BabyCannonballJellyfish.png differ diff --git a/NPCs/Abyss/BabyCannonballJellyfishGlow.png b/NPCs/Abyss/BabyCannonballJellyfishGlow.png new file mode 100644 index 0000000000..dc393d1f84 Binary files /dev/null and b/NPCs/Abyss/BabyCannonballJellyfishGlow.png differ diff --git a/NPCs/Abyss/CannonballJellyfish.cs b/NPCs/Abyss/CannonballJellyfish.cs new file mode 100644 index 0000000000..1cefcf6e86 --- /dev/null +++ b/NPCs/Abyss/CannonballJellyfish.cs @@ -0,0 +1,315 @@ +using System; +using CalamityMod.BiomeManagers; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System.IO; +using System.Linq; +using CalamityMod.Items.Placeables.Banners; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.GameContent.Bestiary; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ModLoader.Utilities; + +namespace CalamityMod.NPCs.Abyss +{ + public class CannonballJellyfish : ModNPC + { + public bool hasBeenHit = false; + public bool dying = false; + public bool shouldTarget = false; + public int boomTimer = -1; + public int currentFrame = 0; + + public const int dyingDuration = 75; + + public override void SetStaticDefaults() + { + Main.npcFrameCount[NPC.type] = 8; + } + + public override void SetDefaults() + { + NPC.noGravity = true; + NPC.aiStyle = -1; + AIType = -1; + NPC.damage = 50; //the damage is amplified on explosion, contact can be lower + NPC.width = 54; + NPC.height = 76; + NPC.defense = 0; + NPC.lifeMax = 400; + NPC.knockBackResist = 0f; + NPC.alpha = 100; + NPC.value = Item.buyPrice(0, 0, 1, 5); + NPC.HitSound = SoundID.NPCHit25; + NPC.DeathSound = SoundID.NPCDeath28; + Banner = NPC.type; + BannerItem = ModContent.ItemType(); + NPC.Calamity().VulnerableToHeat = false; + NPC.Calamity().VulnerableToSickness = false; + NPC.Calamity().VulnerableToElectricity = true; + NPC.Calamity().VulnerableToWater = false; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + } + + public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) + { + bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] + { + new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.CannonballJellyfish") + }); + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(hasBeenHit); + writer.Write(shouldTarget); + writer.Write(boomTimer); + writer.Write(currentFrame); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + hasBeenHit = reader.ReadBoolean(); + shouldTarget = reader.ReadBoolean(); + boomTimer = reader.ReadInt32(); + currentFrame = reader.ReadInt32(); + } + + public override bool CanHitPlayer(Player target, ref int cooldownSlot) => !dying && base.CanHitPlayer(target, ref cooldownSlot); + + private void DyingAI() + { + if (boomTimer == 0) + { + if (!shouldTarget) + { + NPC.alpha = 50; + shouldTarget = true; + boomTimer = dyingDuration; + NPC.noTileCollide = true; + NPC.netUpdate = true; + } + else + { + Explode(); + return; + } + + } + + if (boomTimer == 60 && !shouldTarget) //happens only once + { + NPC.velocity.Y = 0.75f; //sink slowly + } + + + if (shouldTarget) + { + // Get a target + if (NPC.target < 0 || !NPC.target.WithinBounds(Main.maxPlayers) || Main.player[NPC.target].dead || !Main.player[NPC.target].active) + NPC.TargetClosest(); + + if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) + NPC.TargetClosest(); + + Player player = Main.player[NPC.target]; + + if (boomTimer >= (dyingDuration - 20)) //home for the first 20 frames, not beyond that + { + float num543 = player.position.X + (float)(player.width / 2); + float num544 = player.position.Y + (float)(player.height / 2); + float num550 = 30f; + Vector2 vector43 = new Vector2(NPC.position.X + (float)NPC.width * 0.5f, NPC.position.Y + (float)NPC.height * 0.5f); + float num551 = num543 - vector43.X; + float num552 = num544 - vector43.Y; + float num553 = (float)Math.Sqrt((double)(num551 * num551 + num552 * num552)); + if (num553 < 100f) + { + num550 = 10f; //5 + } + num553 = num550 / num553; + num551 *= num553; + num552 *= num553; + NPC.velocity.X = (NPC.velocity.X * 5f + num551) / 6f; + NPC.velocity.Y = (NPC.velocity.Y * 5f + num552) / 6f; + + NPC.velocity *= 0.9f; //slow it down a bit to be fair + + NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + 1.57f; + + } + + + //apparently NPC.wet can return true even when out of water :skull: + if (!Collision.DrownCollision(NPC.position, NPC.width, NPC.height) || Collision.SolidCollision(NPC.Center, NPC.width, NPC.height) || NPC.Hitbox.Intersects(player.Hitbox)) //explode when in contact with a tile or target + Explode(); + } + else + { + Lighting.AddLight(NPC.Center, (175 - NPC.alpha) * 0.2f, 0, 0); + } + + boomTimer--; + } + + public override void AI() + { + NPC.chaseable = !dying && hasBeenHit; + // Do the death animation once killed. + if (dying) + { + DyingAI(); + return; + } + // Trigger the death animation + if (NPC.life <= 1) + { + dying = true; + boomTimer = boomTimer == -1 ? 60 : boomTimer; + NPC.life = 1; + NPC.dontTakeDamage = true; + NPC.netUpdate = true; + return; + } + Lighting.AddLight(NPC.Center, (67 - NPC.alpha) * 1f / 220f, (218 - NPC.alpha) * 1f / 220f, (166 - NPC.alpha) * 1f / 220f); + if (NPC.justHit) + { + hasBeenHit = true; + NPC.chaseable = true; + NPC.netUpdate = true; + } + if (NPC.localAI[0] == 0f) + { + NPC.localAI[0] = 1f; + NPC.velocity.Y = -6f; + NPC.netUpdate = true; + } + if (NPC.wet) + { + NPC.noGravity = true; + if (NPC.localAI[2] > 0f) + { + NPC.localAI[2] -= 1f; + } + if (NPC.localAI[2] <= 0f) + { + if (NPC.velocity.Y == 0f) + { + NPC.localAI[1] += 1f; + } + else + { + NPC.localAI[1] = 0f; + } + } + NPC.velocity.Y += 0.1f; + if (currentFrame == 5 && NPC.frameCounter == 0.0) + NPC.velocity.Y = -2.748f; // manually picked value :desolate: + } + else + { + NPC.noGravity = false; + NPC.velocity.Y = 2f; + NPC.localAI[2] = 75f; + NPC.netUpdate = true; + } + } + + public override void FindFrame(int frameHeight) //8 frames, 78 height + { + NPC.frameCounter += 1.0; + if (NPC.frameCounter >= 7) + { + currentFrame = currentFrame == 7 ? 0 : currentFrame + 1; + NPC.netUpdate = true; //update current frame variable + NPC.frameCounter = 0; + } + + NPC.frame.Y = currentFrame * frameHeight; + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.Player.Calamity().ZoneAbyssLayer1 && spawnInfo.Water) + { + return SpawnCondition.CaveJellyfish.Chance * 1.1f; + } + return 0f; + } + + public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (NPC.spriteDirection == 1) + { + spriteEffects = SpriteEffects.FlipHorizontally; + } + Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); + var texture = TextureAssets.Npc[NPC.type]; + Vector2 vector11 = new Vector2((float)(texture.Value.Width / 2), (float)(texture.Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 vector = center - screenPos; + var glowTexture = ModContent.Request("CalamityMod/NPCs/Abyss/CannonballJellyfishGlow"); + vector -= new Vector2((float)glowTexture.Value.Width, (float)(glowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; + vector += vector11 * 1f + new Vector2(0f, 4f + NPC.gfxOffY); + Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(new Color(67, 218, 166)); + Main.spriteBatch.Draw(ModContent.Request("CalamityMod/NPCs/Abyss/CannonballJellyfishGlow").Value, vector, + new Microsoft.Xna.Framework.Rectangle?(NPC.frame), color, NPC.rotation, vector11, 1f, spriteEffects, 0f); + } + + private void Explode() + { + NPC.position = NPC.Center; + NPC.height *= 3; + NPC.width = NPC.height; + NPC.position -= NPC.Size * 0.5f; //hitbox expansion + adjustments + SoundEngine.PlaySound(SoundID.Item14, NPC.Center); //bomb sound + foreach (Player player in Main.player.Where(player => player.active && !player.dead && NPC.Hitbox.Intersects(player.Hitbox))) + player.Hurt(PlayerDeathReason.ByNPC(NPC.whoAmI), NPC.damage * 3, NPC.direction); //Due to how slow the jelly is, this might catch you unaware, but then you'll never get hit by it again + for (int k = 0; k < 25; k++) + { + int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.MoonBoulder, 0f, -1f, 0, default, 2f); + if (Main.dust.IndexInRange(dust)) + Main.dust[dust].noGravity = true; + } + NPC.active = false; + NPC.NPCLoot(); + NPC.netUpdate = true; + } + + public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers) => target.AddBuff(BuffID.Poisoned, 60 * (this.shouldTarget ? 10 : 5)); //10 sec for explosion, 5 sec for non explosion + + public override bool CheckDead() + { + NPC.life = 1; + NPC.alpha = boomTimer == -1 ? 125 : NPC.alpha; + boomTimer = boomTimer == -1 ? 60 : boomTimer; + dying = true; + NPC.active = true; + NPC.dontTakeDamage = true; + NPC.netUpdate = true; + return false; + } + + public override bool? CanBeHitByItem(Player player, Item item) => dying ? false : base.CanBeHitByItem(player, item); + + public override bool? CanBeHitByProjectile(Projectile projectile) => dying ? false : base.CanBeHitByProjectile(projectile); + + public override void HitEffect(NPC.HitInfo hit) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.MoonBoulder, hit.HitDirection, -1f, 0, default, 1f); + } + } + + public override void ModifyNPCLoot(NPCLoot npcLoot) + { + npcLoot.Add(ItemID.Bomb, 1, 1, 1); + npcLoot.Add(ItemID.JellyfishNecklace, 100); + } + } +} diff --git a/NPCs/Abyss/CannonballJellyfish.png b/NPCs/Abyss/CannonballJellyfish.png new file mode 100644 index 0000000000..4c0fd135b7 Binary files /dev/null and b/NPCs/Abyss/CannonballJellyfish.png differ diff --git a/NPCs/Abyss/CannonballJellyfishGlow.png b/NPCs/Abyss/CannonballJellyfishGlow.png new file mode 100644 index 0000000000..4c0fd135b7 Binary files /dev/null and b/NPCs/Abyss/CannonballJellyfishGlow.png differ diff --git a/NPCs/AstrumDeus/AstrumDeusBody.cs b/NPCs/AstrumDeus/AstrumDeusBody.cs index 6aaf48eff8..4f9cae887b 100644 --- a/NPCs/AstrumDeus/AstrumDeusBody.cs +++ b/NPCs/AstrumDeus/AstrumDeusBody.cs @@ -16,6 +16,7 @@ namespace CalamityMod.NPCs.AstrumDeus public class AstrumDeusBody : ModNPC { public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.AstrumDeusHead.DisplayName"); + public override void SetStaticDefaults() { this.HideFromBestiary(); @@ -98,74 +99,34 @@ namespace CalamityMod.NPCs.AstrumDeus bool deathModeEnragePhase = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] == 3f; bool doubleWormPhase = NPC.Calamity().newAI[0] != 0f && !deathModeEnragePhase; - Texture2D texture2D15 = altBodyTextures ? ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyAltSpectral").Value : TextureAssets.Npc[NPC.type].Value; - Texture2D texture2D16 = ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow2").Value; - Vector2 vector11 = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); - Color color36 = Color.White; - float amount9 = 0.5f; - int num153 = deathModeEnragePhase ? 10 : 5; + Texture2D texture = altBodyTextures ? ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyAltSpectral").Value : TextureAssets.Npc[NPC.type].Value; + Texture2D texture2 = ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow2").Value; + Vector2 vector = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); - if (CalamityConfig.Instance.Afterimages) - { - for (int num155 = 1; num155 < num153; num155 += 2) - { - Color color38 = drawColor; - color38 = Color.Lerp(color38, color36, amount9); - color38 = NPC.GetAlpha(color38); - color38 *= (num153 - num155) / 15f; - Vector2 vector41 = NPC.oldPos[num155] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f; - vector41 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, vector41, NPC.frame, color38, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); - } - } + Vector2 vector2 = NPC.Center - screenPos; + vector2 -= new Vector2(texture.Width, texture.Height) * NPC.scale / 2f; + vector2 += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY); + spriteBatch.Draw(texture, vector2, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, spriteEffects, 0f); - Vector2 vector43 = NPC.Center - screenPos; - vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f; - vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); - - texture2D15 = altBodyTextures ? ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyAltGlow").Value : ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow").Value; + texture = altBodyTextures ? ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyAltGlow").Value : ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow").Value; Color phaseColor = drawCyan ? Color.Cyan : Color.Orange; if (doubleWormPhase) { - texture2D15 = drawCyan ? texture2D15 : (altBodyTextures ? ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyAltGlow2").Value : ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow3").Value); - texture2D16 = drawCyan ? ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow4").Value : texture2D16; - } - Color color37 = Color.Lerp(Color.White, doubleWormPhase ? phaseColor : Color.Cyan, 0.5f) * (deathModeEnragePhase ? 1f : NPC.Opacity); - Color color42 = Color.Lerp(Color.White, doubleWormPhase ? phaseColor : Color.Orange, 0.5f) * (deathModeEnragePhase ? 1f : NPC.Opacity); - - if (CalamityConfig.Instance.Afterimages) - { - for (int num163 = 1; num163 < num153; num163++) - { - Color color41 = color37; - color41 = Color.Lerp(color41, color36, amount9); - color41 *= (num153 - num163) / 15f; - Vector2 vector44 = NPC.oldPos[num163] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - vector44 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f; - vector44 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, vector44, NPC.frame, color41, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); - - if (!altBodyTextures) - { - Color color43 = color42; - color43 = Color.Lerp(color43, color36, amount9); - color43 *= (num153 - num163) / 15f; - spriteBatch.Draw(texture2D16, vector44, NPC.frame, color43, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); - } - } + texture = drawCyan ? texture : (altBodyTextures ? ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyAltGlow2").Value : ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow3").Value); + texture2 = drawCyan ? ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow4").Value : texture2; } + Color color = Color.Lerp(Color.White, doubleWormPhase ? phaseColor : Color.Cyan, 0.5f) * (deathModeEnragePhase ? 1f : NPC.Opacity); + Color color2 = Color.Lerp(Color.White, doubleWormPhase ? phaseColor : Color.Orange, 0.5f) * (deathModeEnragePhase ? 1f : NPC.Opacity); int timesToDraw = deathModeEnragePhase ? 3 : drawCyan ? 1 : 2; for (int i = 0; i < timesToDraw; i++) - spriteBatch.Draw(texture2D15, vector43, NPC.frame, color37, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, vector2, NPC.frame, color, NPC.rotation, vector, NPC.scale, spriteEffects, 0f); if (!altBodyTextures) { timesToDraw = deathModeEnragePhase ? 3 : drawCyan ? 2 : 1; for (int i = 0; i < timesToDraw; i++) - spriteBatch.Draw(texture2D16, vector43, NPC.frame, color42, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture2, vector2, NPC.frame, color2, NPC.rotation, vector, NPC.scale, spriteEffects, 0f); } return false; diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index ae8a1cc622..9dc5d655da 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -97,7 +97,8 @@ namespace CalamityMod.NPCs.AstrumDeus if (Main.zenithWorld) { if (CalamityWorld.death) // killing 10 worms with half of the og's health is ridiculous - NPC.lifeMax /= 3; + NPC.lifeMax /= 3; + NPC.value /= 5; } } @@ -148,69 +149,32 @@ namespace CalamityMod.NPCs.AstrumDeus bool deathModeEnragePhase = NPC.Calamity().newAI[0] == 3f; bool doubleWormPhase = NPC.Calamity().newAI[0] != 0f && !deathModeEnragePhase; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Texture2D texture2D16 = ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow2").Value; - Vector2 vector11 = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); - Color color36 = Color.White; - float amount9 = 0.5f; - int num153 = deathModeEnragePhase ? 10 : 5; + Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture2 = ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow2").Value; + Vector2 vector = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); - if (CalamityConfig.Instance.Afterimages) - { - for (int num155 = 1; num155 < num153; num155 += 2) - { - Color color38 = drawColor; - color38 = Color.Lerp(color38, color36, amount9); - color38 = NPC.GetAlpha(color38); - color38 *= (num153 - num155) / 15f; - Vector2 vector41 = NPC.oldPos[num155] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f; - vector41 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, vector41, NPC.frame, color38, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); - } - } + Vector2 vector2 = NPC.Center - screenPos; + vector2 -= new Vector2(texture.Width, texture.Height) * NPC.scale / 2f; + vector2 += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY); + spriteBatch.Draw(texture, vector2, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, spriteEffects, 0f); - Vector2 vector43 = NPC.Center - screenPos; - vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f; - vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); - - texture2D15 = ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow").Value; + texture = ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow").Value; Color phaseColor = drawCyan ? Color.Cyan : Color.Orange; if (doubleWormPhase) { - texture2D15 = drawCyan ? texture2D15 : ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow3").Value; - texture2D16 = drawCyan ? ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow4").Value : texture2D16; - } - Color color37 = Color.Lerp(Color.White, doubleWormPhase ? phaseColor : Color.Cyan, 0.5f) * (deathModeEnragePhase ? 1f : NPC.Opacity); - Color color42 = Color.Lerp(Color.White, doubleWormPhase ? phaseColor : Color.Orange, 0.5f) * (deathModeEnragePhase ? 1f : NPC.Opacity); - - if (CalamityConfig.Instance.Afterimages) - { - for (int num163 = 1; num163 < num153; num163++) - { - Color color41 = color37; - color41 = Color.Lerp(color41, color36, amount9); - color41 *= (num153 - num163) / 15f; - Vector2 vector44 = NPC.oldPos[num163] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - vector44 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f; - vector44 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, vector44, NPC.frame, color41, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); - - Color color43 = color42; - color43 = Color.Lerp(color43, color36, amount9); - color43 *= (num153 - num163) / 15f; - spriteBatch.Draw(texture2D16, vector44, NPC.frame, color43, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); - } + texture = drawCyan ? texture : ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow3").Value; + texture2 = drawCyan ? ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow4").Value : texture2; } + Color color = Color.Lerp(Color.White, doubleWormPhase ? phaseColor : Color.Cyan, 0.5f) * (deathModeEnragePhase ? 1f : NPC.Opacity); + Color color2 = Color.Lerp(Color.White, doubleWormPhase ? phaseColor : Color.Orange, 0.5f) * (deathModeEnragePhase ? 1f : NPC.Opacity); int timesToDraw = deathModeEnragePhase ? 3 : drawCyan ? 1 : 2; for (int i = 0; i < timesToDraw; i++) - spriteBatch.Draw(texture2D15, vector43, NPC.frame, color37, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, vector2, NPC.frame, color, NPC.rotation, vector, NPC.scale, spriteEffects, 0f); timesToDraw = deathModeEnragePhase ? 3 : drawCyan ? 2 : 1; for (int i = 0; i < timesToDraw; i++) - spriteBatch.Draw(texture2D16, vector43, NPC.frame, color42, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture2, vector2, NPC.frame, color2, NPC.rotation, vector, NPC.scale, spriteEffects, 0f); return false; } @@ -316,7 +280,7 @@ namespace CalamityMod.NPCs.AstrumDeus ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType(), }; normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, weapons)); diff --git a/NPCs/AstrumDeus/AstrumDeusTail.cs b/NPCs/AstrumDeus/AstrumDeusTail.cs index 42863a9aa5..fa38b5fc2f 100644 --- a/NPCs/AstrumDeus/AstrumDeusTail.cs +++ b/NPCs/AstrumDeus/AstrumDeusTail.cs @@ -16,6 +16,7 @@ namespace CalamityMod.NPCs.AstrumDeus public class AstrumDeusTail : ModNPC { public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.AstrumDeusHead.DisplayName"); + public override void SetStaticDefaults() { this.HideFromBestiary(); @@ -97,57 +98,24 @@ namespace CalamityMod.NPCs.AstrumDeus bool deathModeEnragePhase = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] == 3f; bool doubleWormPhase = NPC.Calamity().newAI[0] != 0f && !deathModeEnragePhase; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 vector11 = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); - Color color36 = Color.White; - float amount9 = 0.5f; - int num153 = deathModeEnragePhase ? 10 : 5; + Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Vector2 vector = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); - if (CalamityConfig.Instance.Afterimages) - { - for (int num155 = 1; num155 < num153; num155 += 2) - { - Color color38 = drawColor; - color38 = Color.Lerp(color38, color36, amount9); - color38 = NPC.GetAlpha(color38); - color38 *= (num153 - num155) / 15f; - Vector2 vector41 = NPC.oldPos[num155] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f; - vector41 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, vector41, NPC.frame, color38, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); - } - } + Vector2 vector2 = NPC.Center - screenPos; + vector2 -= new Vector2(texture.Width, texture.Height) * NPC.scale / 2f; + vector2 += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY); + spriteBatch.Draw(texture, vector2, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, spriteEffects, 0f); - Vector2 vector43 = NPC.Center - screenPos; - vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f; - vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); - - texture2D15 = ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusTailGlow").Value; + texture = ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusTailGlow").Value; Color phaseColor = drawCyan ? Color.Cyan : Color.Orange; if (doubleWormPhase) - { - texture2D15 = drawCyan ? ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusTailGlow2").Value : texture2D15; - } - Color color37 = Color.Lerp(Color.White, doubleWormPhase ? phaseColor : Color.Orange, 0.5f) * (deathModeEnragePhase ? 1f : NPC.Opacity); + texture = drawCyan ? ModContent.Request("CalamityMod/NPCs/AstrumDeus/AstrumDeusTailGlow2").Value : texture; - if (CalamityConfig.Instance.Afterimages) - { - for (int num163 = 1; num163 < num153; num163++) - { - Color color41 = color37; - color41 = Color.Lerp(color41, color36, amount9); - color41 *= (num153 - num163) / 15f; - Vector2 vector44 = NPC.oldPos[num163] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - vector44 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f; - vector44 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, vector44, NPC.frame, color41, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); - } - } + Color color = Color.Lerp(Color.White, doubleWormPhase ? phaseColor : Color.Orange, 0.5f) * (deathModeEnragePhase ? 1f : NPC.Opacity); int timesToDraw = deathModeEnragePhase ? 3 : drawCyan ? 2 : 1; for (int i = 0; i < timesToDraw; i++) - spriteBatch.Draw(texture2D15, vector43, NPC.frame, color37, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, vector2, NPC.frame, color, NPC.rotation, vector, NPC.scale, spriteEffects, 0f); return false; } diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 1781f01de3..b8c41e9cf5 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -3581,10 +3581,8 @@ namespace CalamityMod.NPCs calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = calamityGlobalNPC.newAI[1] < resistanceTime; // Flight timer - float aiSwitchTimer = doubleWormPhase ? 1200f : 1800f; - if (Main.getGoodWorld) - aiSwitchTimer *= 0.5f; - + float aiSwitchTimer = doubleWormPhase ? (Main.getGoodWorld ? 600f : 1200f) : (Main.getGoodWorld ? 900f : 1800f); + calamityGlobalNPC.newAI[3] += 1f; if (calamityGlobalNPC.newAI[3] >= aiSwitchTimer) calamityGlobalNPC.newAI[3] = 0f; @@ -3594,8 +3592,8 @@ namespace CalamityMod.NPCs // Length of worms int phase1Length = death ? 80 : revenge ? 70 : expertMode ? 60 : 50; - int phase2Length = phase1Length / 2; - int gfbLength = phase1Length / 10; + int phase2Length = death ? 40 : revenge ? 35 : expertMode ? 30 : 25; + int gfbLength = death ? 8 : revenge ? 7 : expertMode ? 6 : 5; int maxLength = Main.zenithWorld && doubleWormPhase ? gfbLength : doubleWormPhase ? phase2Length : phase1Length; // Become gradually more pissed as more worms are killed @@ -3701,6 +3699,7 @@ namespace CalamityMod.NPCs Main.npc[headOneID].Calamity().newAI[0] = 1f; Main.npc[headOneID].velocity = Vector2.Normalize(player.Center - Main.npc[headOneID].Center) * 16f; Main.npc[headOneID].timeLeft *= 20; + Main.npc[headOneID].netSpam = 0; Main.npc[headOneID].netUpdate = true; // On server, immediately send the correct extra AI of this head to clients. @@ -3723,6 +3722,7 @@ namespace CalamityMod.NPCs Main.npc[headTwoID].Calamity().newAI[3] = Main.getGoodWorld ? 300f : 600f; Main.npc[headTwoID].velocity = Vector2.Normalize(player.Center - Main.npc[headTwoID].Center) * 16f; Main.npc[headTwoID].timeLeft *= 20; + Main.npc[headTwoID].netSpam = 0; Main.npc[headTwoID].netUpdate = true; // On server, immediately send the correct extra AI of this head to clients. @@ -3793,7 +3793,7 @@ namespace CalamityMod.NPCs if (npc.ai[2] > 0f) npc.realLife = (int)npc.ai[2]; - // Dust and alpha effects + // Alpha effects if ((head || Main.npc[(int)npc.ai[1]].alpha < 128) && !npc.dontTakeDamage) { // Alpha changes @@ -3825,7 +3825,12 @@ namespace CalamityMod.NPCs npc.HitEffect(0, 10.0); npc.checkDead(); npc.active = false; + npc.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (npc.netSpam >= 10) + npc.netSpam = 9; } } @@ -3907,8 +3912,8 @@ namespace CalamityMod.NPCs if (Main.tile[k, l] != null && ((Main.tile[k, l].HasUnactuatedTile && (Main.tileSolid[Main.tile[k, l].TileType] || (Main.tileSolidTop[Main.tile[k, l].TileType] && Main.tile[k, l].TileFrameY == 0))) || Main.tile[k, l].LiquidAmount > 64)) { Vector2 vector2; - vector2.X = k * 16; - vector2.Y = l * 16; + vector2.X = k * 16f; + vector2.Y = l * 16f; if (npc.position.X + npc.width > vector2.X && npc.position.X < vector2.X + 16f && npc.position.Y + npc.height > vector2.Y && npc.position.Y < vector2.Y + 16f) { flag2 = true; @@ -3924,31 +3929,28 @@ namespace CalamityMod.NPCs { npc.localAI[1] = 1f; - if (head) - { - Rectangle rectangle = new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height); - int num16 = 200; - int heightReduction = death ? 130 : (int)(130f * (1f - lifeRatio)); - int height = 400 - heightReduction; - bool flag3 = true; + Rectangle rectangle = new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height); + int num16 = 200; + int heightReduction = death ? 130 : (int)(130f * (1f - lifeRatio)); + int height = 400 - heightReduction; + bool flag3 = true; - if (npc.position.Y > player.position.Y) + if (npc.position.Y > player.position.Y) + { + for (int m = 0; m < Main.maxPlayers; m++) { - for (int m = 0; m < Main.maxPlayers; m++) + if (Main.player[m].active) { - if (Main.player[m].active) + Rectangle rectangle2 = new Rectangle((int)Main.player[m].position.X - num16, (int)Main.player[m].position.Y - num16, num16 * 2, height); + if (rectangle.Intersects(rectangle2)) { - Rectangle rectangle2 = new Rectangle((int)Main.player[m].position.X - num16, (int)Main.player[m].position.Y - num16, num16 * 2, height); - if (rectangle.Intersects(rectangle2)) - { - flag3 = false; - break; - } + flag3 = false; + break; } } - if (flag3) - flag2 = true; } + if (flag3) + flag2 = true; } } else @@ -3977,7 +3979,12 @@ namespace CalamityMod.NPCs if (Main.npc[num957].type == headType || Main.npc[num957].type == bodyType || Main.npc[num957].type == tailType) { Main.npc[num957].active = false; + Main.npc[num957].netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (Main.npc[num957].netSpam >= 10) + Main.npc[num957].netSpam = 9; } } } @@ -4018,7 +4025,7 @@ namespace CalamityMod.NPCs turnSpeed *= 1.15f; } - Vector2 vector3 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + Vector2 vector3 = npc.Center; float num20 = player.position.X + (player.width / 2); float num21 = player.position.Y + (player.height / 2); num20 = (int)(num20 / 16f) * 16; @@ -4171,21 +4178,39 @@ namespace CalamityMod.NPCs if (flag2) { if (npc.localAI[0] != 1f) + { npc.netUpdate = true; + // Prevent netUpdate from being blocked by the spam counter. + if (npc.netSpam >= 10) + npc.netSpam = 9; + } + npc.localAI[0] = 1f; } else { if (npc.localAI[0] != 0f) + { npc.netUpdate = true; + // Prevent netUpdate from being blocked by the spam counter. + if (npc.netSpam >= 10) + npc.netSpam = 9; + } + npc.localAI[0] = 0f; } if (((npc.velocity.X > 0f && npc.oldVelocity.X < 0f) || (npc.velocity.X < 0f && npc.oldVelocity.X > 0f) || (npc.velocity.Y > 0f && npc.oldVelocity.Y < 0f) || (npc.velocity.Y < 0f && npc.oldVelocity.Y > 0f)) && !npc.justHit) + { npc.netUpdate = true; + // Prevent netUpdate from being blocked by the spam counter. + if (npc.netSpam >= 10) + npc.netSpam = 9; + } + npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) + MathHelper.PiOver2; } @@ -4195,9 +4220,10 @@ namespace CalamityMod.NPCs // Shoot lasers if (npc.type == ModContent.NPCType()) { - int shootTime = (doubleWormPhase && expertMode) ? 2 : 1; npc.localAI[0] += 1f; - float shootProjectile = 400 / shootTime; + + int shootTime = (doubleWormPhase && expertMode) ? 2 : 1; + float shootProjectile = (doubleWormPhase && expertMode) ? 200 : 400; float timer = npc.ai[0] + 15f; float divisor = timer + shootProjectile; bool shootGodRays = phase2 || deathModeEnragePhase_BodyAndTail; @@ -4235,7 +4261,7 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient) { float num941 = (death ? 16f : revenge ? 14f : 13f) + enrageScale * 4f; - Vector2 vector104 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + (npc.height / 2)); + Vector2 vector104 = npc.Center; float num942 = player.position.X + player.width * 0.5f - vector104.X; float num943 = player.position.Y + player.height * 0.5f - vector104.Y; float num944 = (float)Math.Sqrt(num942 * num942 + num943 * num943); @@ -4257,7 +4283,7 @@ namespace CalamityMod.NPCs for (int i = -1; i <= 1; i += 2) { Vector2 laserStartPos = vector104 + i * perp + Main.rand.NextVector2CircularEdge(6f, 6f); - Projectile godRay = Projectile.NewProjectileDirect(npc.GetSource_FromAI(), laserStartPos, laserVelocity * 1.1f, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); + Projectile godRay = Projectile.NewProjectileDirect(npc.GetSource_FromAI(), laserStartPos, laserVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); // Tell this Phased God Ray exactly which way it should be waving. godRay.localAI[1] = i * 0.5f; @@ -4290,7 +4316,7 @@ namespace CalamityMod.NPCs } // Follow the head - Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + Vector2 vector18 = npc.Center; float num191 = player.position.X + (player.width / 2); float num192 = player.position.Y + (player.height / 2); num191 = (int)(num191 / 16f) * 16; @@ -4304,7 +4330,7 @@ namespace CalamityMod.NPCs { try { - vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + vector18 = npc.Center; num191 = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - vector18.X; num192 = Main.npc[(int)npc.ai[1]].position.Y + (Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y; } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 1c395f9ad6..9222b8cdc4 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -4567,7 +4567,7 @@ namespace CalamityMod.NPCs // Hitbox criteria were changed to allow long one dimensional projectiles so that Condemnation would work. bool hitBullseye = false; bool acceptableVelocity = projectile.velocity != Vector2.Zero; - bool acceptableHitbox = (projectile.width < 36) || (projectile.height < 36); + bool acceptableHitbox = (projectile.width <= 36) || (projectile.height <= 36); if (bullseye != null && acceptableVelocity && acceptableHitbox) { // Bullseyes are visually different on bosses and thus have larger hitboxes. @@ -5778,7 +5778,7 @@ namespace CalamityMod.NPCs // Visual debuff if (RancorBurnTime > 0) - buffTextureList.Add(Request("CalamityMod/Buffs/RancorBurn").Value); + buffTextureList.Add(Request("CalamityMod/Buffs/DamageOverTime/RancorBurn").Value); // Vanilla damage over time debuffs if (electrified > 0) @@ -6191,7 +6191,7 @@ namespace CalamityMod.NPCs segmentDrawColor = Color.Black; } } - + // Draw segments spriteBatch.Draw(npcTexture, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, segmentDrawColor, npc.rotation, halfSize, npc.scale, spriteEffects, 0f); @@ -6203,6 +6203,12 @@ namespace CalamityMod.NPCs if (npc.realLife >= 0) destroyerLifeRatio = Main.npc[npc.realLife].life / (float)Main.npc[npc.realLife].lifeMax; + float shootProjectile = (CalamityWorld.death || BossRushEvent.BossRushActive) ? 180 : 300; + float timer = npc.ai[0] * 30f; + float shootProjectileGateValue = timer + shootProjectile; + float glowDuration = 120f; + float startGlowingGateValue = shootProjectileGateValue - glowDuration; + if ((newAI[3] >= 900f && destroyerLifeRatio < 0.5f) || (newAI[1] < 600f && newAI[1] > 60f)) { Color drawColor2 = new Color(50, 50, 255, 0) * (1f - npc.alpha / 255f); @@ -6211,12 +6217,38 @@ namespace CalamityMod.NPCs spriteBatch.Draw(TextureAssets.Dest[npc.type - NPCID.TheDestroyer].Value, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, drawColor2, npc.rotation, halfSize, npc.scale, spriteEffects, 0f); } + + // Glow telegraph for lasers + /*if (newAI[0] > startGlowingGateValue) + { + Texture2D bloomTexture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + Color bloom = drawColor2; + bloom = Main.hslToRgb((Main.rgbToHsl(bloom).X + 0.02f) % 1, Main.rgbToHsl(bloom).Y, Main.rgbToHsl(bloom).Z); + float scalingFactor = (newAI[0] - startGlowingGateValue) / glowDuration; + float opacity = (float)Math.Sin(MathHelper.PiOver2 + scalingFactor * MathHelper.PiOver2); + float properBloomSize = (float)npc.height / (float)bloomTexture.Height; + float scale = scalingFactor; + spriteBatch.Draw(bloomTexture, npc.Center - Main.screenPosition, null, bloom * opacity * 0.5f, 0, bloomTexture.Size() / 2f, scale * 1f * properBloomSize, SpriteEffects.None, 0); + }*/ } else { Color drawColor2 = new Color(255, 255, 255, 0) * (1f - npc.alpha / 255f); spriteBatch.Draw(TextureAssets.Dest[npc.type - NPCID.TheDestroyer].Value, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, drawColor2, npc.rotation, halfSize, npc.scale, spriteEffects, 0f); + + // Glow telegraph for lasers + /*if (newAI[0] > startGlowingGateValue) + { + Texture2D bloomTexture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + Color bloom = drawColor2; + bloom = Main.hslToRgb((Main.rgbToHsl(bloom).X + 0.02f) % 1, Main.rgbToHsl(bloom).Y, Main.rgbToHsl(bloom).Z); + float scalingFactor = (newAI[0] - startGlowingGateValue) / glowDuration; + float opacity = (float)Math.Sin(MathHelper.PiOver2 + scalingFactor * MathHelper.PiOver2); + float properBloomSize = (float)npc.height / (float)bloomTexture.Height; + float scale = scalingFactor; + spriteBatch.Draw(bloomTexture, npc.Center - Main.screenPosition, null, bloom * opacity * 0.5f, 0, bloomTexture.Size() / 2f, scale * 1f * properBloomSize, SpriteEffects.None, 0); + }*/ } } } diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index d211fd12a3..3529d17409 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -352,15 +352,6 @@ namespace CalamityMod.NPCs npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 2, 1)); break; - // Derpling, Cochineal Beetle, Cyan Beetle, Lac Beetle - // Beetle Juice @ 33.33% Normal, 50% Expert+ - case NPCID.Derpling: - case NPCID.CochinealBeetle: - case NPCID.CyanBeetle: - case NPCID.LacBeetle: - npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 3, 2)); - break; - // Moth // Butterfly Dust @ 100% INSTEAD OF 50% case NPCID.Moth: @@ -1629,13 +1620,9 @@ namespace CalamityMod.NPCs #region Enemy Lists // All Moss Hornets - // Stinger @ 50% Normal, 100% Expert+ // Needler @ 4% Normal, 6.67% Expert+ if (CalamityLists.mossHornetList.Contains(npc.type)) - { - npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Stinger, 2, 1)); npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 25, 15)); - } // All Skeletons // Ancient Bone Dust @ 20% Normal, 33.33% Expert+ @@ -1713,9 +1700,9 @@ namespace CalamityMod.NPCs // Block anything except the Rock from dropping DropHelper.BlockEverything(ModContent.ItemType()); } - return true; - } - #endregion + return true; + } + #endregion #region On Kill Main Hook public override void OnKill(NPC npc) @@ -1781,8 +1768,11 @@ namespace CalamityMod.NPCs // First kill: Notify of Abyss chests being unlocked. if (!NPC.downedBoss3) { - World.Abyss.AbleToUnlockChests = true; - World.Abyss.UnlockAllAbyssChests(); + if (Main.netMode != NetmodeID.MultiplayerClient) //Only the server should do this to prevent already unlocked chests from attempting to be unlocked + { + World.Abyss.AbleToUnlockChests = true; + World.Abyss.UnlockAllAbyssChests(); + } string keysk = "Mods.CalamityMod.Status.Progression.SkeletronAbyssChestNotification"; CalamityUtils.DisplayLocalizedText(keysk, new Color(76, 181, 76)); diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 6c9ff6a9ec..fdb8d83703 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -24,7 +24,6 @@ using Terraria.GameContent; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using CalamityMod.Items.Placeables.Walls; using static Terraria.ModLoader.ModContent; namespace CalamityMod.NPCs @@ -128,6 +127,7 @@ namespace CalamityMod.NPCs "Outlaw", // <@!918311619480657922> (TheChosenOutlaw#8746) "Alfred Rend", // <@!606301806481375255> (Deadsqurp300#0907) "Leeman", // <@!281999243168841728> (Tweee#5831) + "Mihai", // <@!373941893467209730> (cmihaii.) }; private static readonly string[] MechanicNames = { @@ -324,18 +324,22 @@ namespace CalamityMod.NPCs // Annoyingly, because npc.GivenName is a property, it can't be passed as a ref parameter. private string ChooseName(ref bool alreadySet, string currentName, int numVanillaNames, string[] patreonNames, string[] globalNames) { - if (alreadySet || patreonNames is null || patreonNames.Length == 0) + if (alreadySet) { alreadySet = true; return currentName; } alreadySet = true; - int index = Main.rand.Next(numVanillaNames + patreonNames.Length + globalNames.Length); - + // PatreonNames can be null, so can global names, it short circuits in the next step if so + int combinedLength = (patreonNames?.Length ?? 0) + (globalNames?.Length ?? 0); + int index = Main.rand.Next(numVanillaNames + combinedLength); + // If the roll isn't low enough, then a "vanilla name" was picked, meaning we change nothing. - if (index >= patreonNames.Length + globalNames.Length) + if (index >= combinedLength) return currentName; + + // Change the name to be a randomly selected Patreon name if the roll is low enough. if (index >= globalNames.Length) return patreonNames[index - globalNames.Length]; @@ -378,22 +382,22 @@ namespace CalamityMod.NPCs switch (npc.townNpcVariationIndex) { case 0: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownDogLabradorVanillaNames, TownDogLabradorNames, TownDogNames); + npc.GivenName = ChooseName(ref CalamityWorld.dogName, npc.GivenName, TownDogLabradorVanillaNames, TownDogLabradorNames, TownDogNames); break; case 1: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownDogPitBullVanillaNames, TownDogPitBullNames, TownDogNames); + npc.GivenName = ChooseName(ref CalamityWorld.dogName, npc.GivenName, TownDogPitBullVanillaNames, TownDogPitBullNames, TownDogNames); break; case 2: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownDogBeagleVanillaNames, TownDogBeagleNames, TownDogNames); + npc.GivenName = ChooseName(ref CalamityWorld.dogName, npc.GivenName, TownDogBeagleVanillaNames, TownDogBeagleNames, TownDogNames); break; case 3: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownDogCorgiVanillaNames, TownDogCorgiNames, TownDogNames); + npc.GivenName = ChooseName(ref CalamityWorld.dogName, npc.GivenName, TownDogCorgiVanillaNames, TownDogCorgiNames, TownDogNames); break; case 4: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownDogDalmatianVanillaNames, TownDogDalmatianNames, TownDogNames); + npc.GivenName = ChooseName(ref CalamityWorld.dogName, npc.GivenName, TownDogDalmatianVanillaNames, TownDogDalmatianNames, TownDogNames); break; case 5: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownDogHuskyVanillaNames, TownDogHuskyNames, TownDogNames); + npc.GivenName = ChooseName(ref CalamityWorld.dogName, npc.GivenName, TownDogHuskyVanillaNames, TownDogHuskyNames, TownDogNames); break; default: break; @@ -403,22 +407,22 @@ namespace CalamityMod.NPCs switch (npc.townNpcVariationIndex) { case 0: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownBunnyWhiteVanillaNames, TownBunnyWhiteNames, TownBunnyNames); + npc.GivenName = ChooseName(ref CalamityWorld.bunnyName, npc.GivenName, TownBunnyWhiteVanillaNames, TownBunnyWhiteNames, TownBunnyNames); break; case 1: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownBunnyAngoraVanillaNames, TownBunnyAngoraNames, TownBunnyNames); + npc.GivenName = ChooseName(ref CalamityWorld.bunnyName, npc.GivenName, TownBunnyAngoraVanillaNames, TownBunnyAngoraNames, TownBunnyNames); break; case 2: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownBunnyDutchVanillaNames, TownBunnyDutchNames, TownBunnyNames); + npc.GivenName = ChooseName(ref CalamityWorld.bunnyName, npc.GivenName, TownBunnyDutchVanillaNames, TownBunnyDutchNames, TownBunnyNames); break; case 3: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownBunnyFlemishVanillaNames, TownBunnyFlemishNames, TownBunnyNames); + npc.GivenName = ChooseName(ref CalamityWorld.bunnyName, npc.GivenName, TownBunnyFlemishVanillaNames, TownBunnyFlemishNames, TownBunnyNames); break; case 4: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownBunnyLopVanillaNames, TownBunnyLopNames, TownBunnyNames); + npc.GivenName = ChooseName(ref CalamityWorld.bunnyName, npc.GivenName, TownBunnyLopVanillaNames, TownBunnyLopNames, TownBunnyNames); break; case 5: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownBunnySilverVanillaNames, TownBunnySilverNames, TownBunnyNames); + npc.GivenName = ChooseName(ref CalamityWorld.bunnyName, npc.GivenName, TownBunnySilverVanillaNames, TownBunnySilverNames, TownBunnyNames); break; default: break; @@ -530,7 +534,7 @@ namespace CalamityMod.NPCs break; // This function doesn't work with Town Pets currently - /*case NPCID.TownCat: + case NPCID.TownCat: AddNewNames(nameList, TownCatNames); switch (npc.townNpcVariationIndex) { @@ -607,7 +611,7 @@ namespace CalamityMod.NPCs default: break; } - break;*/ + break; default: break; @@ -1012,7 +1016,7 @@ namespace CalamityMod.NPCs case NPCID.DyeTrader: if (Main.rand.NextBool(5) && permadong != -1) - chat = CalamityUtils.GetText("Vanilla.PainterChat.Archmage").Format(Main.npc[permadong].GivenName); + chat = CalamityUtils.GetText("Vanilla.DyeTraderChat.Archmage").Format(Main.npc[permadong].GivenName); else if (Main.rand.NextBool(5)) chat = CalamityUtils.GetTextValue("Vanilla.DyeTraderChat.Normal"); break; @@ -1131,11 +1135,11 @@ namespace CalamityMod.NPCs chat = CalamityUtils.GetText("Vanilla.StylistChat.Hardmode").Format(worldEvil); if (Main.rand.NextBool(15) && fapsol != -1) chat = CalamityUtils.GetText("Vanilla.StylistChat.DrunkPrincess" + (ChildSafety.Disabled ? Main.rand.Next(1, 2 + 1) : 1)).Format(Main.npc[fapsol].GivenName); - if ((Main.rand.NextBool(npc.GivenName == "Amber" ? 10 : 15)) && Main.LocalPlayer.Calamity().pArtifact) + if ((Main.rand.NextBool(npc.GivenName == "Amber" ? 10 : 15)) && Main.LocalPlayer.Calamity().pSoulArtifact) { if (Main.LocalPlayer.Calamity().profanedCrystalBuffs) chat = CalamityUtils.GetTextValue("Vanilla.StylistChat.ProfanedSoulCrystal" + Main.rand.Next(1, 2 + 1)); - else if (Main.LocalPlayer.Calamity().donutBabs) + else if (Main.LocalPlayer.Calamity().pSoulGuardians) chat = CalamityUtils.GetTextValue("Vanilla.StylistChat.ProfanedDonuts"); } break; diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index 6d1e60f8a8..6385e1a98a 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -256,11 +256,11 @@ namespace CalamityMod.NPCs.DesertScourge if (expertMode) { - if (NPC.Calamity().newAI[2] < 300f) + if (NPC.Calamity().newAI[2] < 180f) NPC.Calamity().newAI[2] += 1f; if (NPC.SafeDirectionTo(player.Center).AngleBetween((NPC.rotation - MathHelper.PiOver2).ToRotationVector2()) < MathHelper.ToRadians(18f) && - NPC.Calamity().newAI[2] >= 300f && Vector2.Distance(NPC.Center, player.Center) > 320f && + NPC.Calamity().newAI[2] >= 180f && Vector2.Distance(NPC.Center, player.Center) > 320f && Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height)) { if (NPC.Calamity().newAI[2] % 30f == 0f) @@ -295,7 +295,7 @@ namespace CalamityMod.NPCs.DesertScourge } NPC.Calamity().newAI[2] += 1f; - if (NPC.Calamity().newAI[2] > 360f) + if (NPC.Calamity().newAI[2] > 240f) NPC.Calamity().newAI[2] = 0f; } } @@ -439,7 +439,7 @@ namespace CalamityMod.NPCs.DesertScourge int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); Vector2 projectileVelocity = Vector2.Normalize(NPC.Center + NPC.velocity * 10f - NPC.Center) * velocity; - int numProj = bossRush ? 24 : death ? 20 : revenge ? 18 : expertMode ? 16 : 12; + int numProj = bossRush ? 30 : death ? 24 : revenge ? 20 : expertMode ? 16 : 12; if (Main.getGoodWorld) numProj *= 2; diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index c87f2028d6..b1bf07c43b 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -158,7 +158,12 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.height = (int)(70 * NPC.scale); NPC.frame = new Rectangle(0, 0, 114, 88); NPC.position -= NPC.Size * 0.5f; + NPC.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; } } @@ -304,6 +309,10 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.Opacity = 0f; NPC.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; } } } @@ -431,8 +440,13 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.life = 1; NPC.dontTakeDamage = true; NPC.active = true; + NPC.netUpdate = true; + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; + if (NPC.realLife >= 0) { NPC Head = Main.npc[NPC.realLife]; @@ -441,7 +455,12 @@ namespace CalamityMod.NPCs.DevourerofGods Head.ModNPC().Dying = true; Head.dontTakeDamage = true; + Head.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (Head.netSpam >= 10) + Head.netSpam = 9; } return false; } diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 68b78f813b..b87f8d9d23 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -461,6 +461,10 @@ namespace CalamityMod.NPCs.DevourerofGods Main.npc[a].active = false; Main.npc[a].netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (Main.npc[a].netSpam >= 10) + Main.npc[a].netSpam = 9; } } } @@ -538,7 +542,12 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.height = (int)(186 * NPC.scale); NPC.position -= NPC.Size * 0.5f; NPC.frame = new Rectangle(0, 0, 134, 196); + NPC.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; } // Dialogue the moment the second phase starts @@ -577,7 +586,12 @@ namespace CalamityMod.NPCs.DevourerofGods if (Main.netMode != NetmodeID.MultiplayerClient && newOpacity > 0f && NPC.Opacity > newOpacity) { NPC.Opacity = newOpacity; + NPC.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; } if (NPC.Opacity < 0.2f) @@ -594,7 +608,12 @@ namespace CalamityMod.NPCs.DevourerofGods PortalIndex = Projectile.NewProjectile(NPC.GetSource_FromAI(), portalSpawnPosition, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); hasCreatedPhase1Portal = true; + NPC.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; } AttemptingToEnterPortal = true; @@ -628,7 +647,13 @@ namespace CalamityMod.NPCs.DevourerofGods { Dying = true; NPC.dontTakeDamage = true; + NPC.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; + return; } @@ -1225,7 +1250,12 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.ai[3] = 1f; calamityGlobalNPC.newAI[2] = 0f; NPC.TargetClosest(); + NPC.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; } } @@ -1467,28 +1497,51 @@ namespace CalamityMod.NPCs.DevourerofGods if (flies) { if (NPC.localAI[0] != 1f) + { NPC.netUpdate = true; + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; + } + NPC.localAI[0] = 1f; } else { if (NPC.localAI[0] != 0f) + { NPC.netUpdate = true; + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; + } + NPC.localAI[0] = 0f; } if (((NPC.velocity.X > 0f && NPC.oldVelocity.X < 0f) || (NPC.velocity.X < 0f && NPC.oldVelocity.X > 0f) || (NPC.velocity.Y > 0f && NPC.oldVelocity.Y < 0f) || (NPC.velocity.Y < 0f && NPC.oldVelocity.Y > 0f)) && !NPC.justHit) + { NPC.netUpdate = true; + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; + } + if (calamityGlobalNPC.newAI[2] > phaseLimit) { calamityGlobalNPC.velocityPriorToPhaseSwap = NPC.velocity.Length(); NPC.ai[3] = 0f; calamityGlobalNPC.newAI[2] = 0f; NPC.TargetClosest(); + NPC.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; } } } @@ -1973,7 +2026,12 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.ai[3] = 1f; calamityGlobalNPC.newAI[2] = 0f; NPC.TargetClosest(); + NPC.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; } } @@ -2203,21 +2261,39 @@ namespace CalamityMod.NPCs.DevourerofGods if (flies) { if (NPC.localAI[0] != 1f) + { NPC.netUpdate = true; + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; + } + NPC.localAI[0] = 1f; } else { if (NPC.localAI[0] != 0f) + { NPC.netUpdate = true; + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; + } + NPC.localAI[0] = 0f; } if (((NPC.velocity.X > 0f && NPC.oldVelocity.X < 0f) || (NPC.velocity.X < 0f && NPC.oldVelocity.X > 0f) || (NPC.velocity.Y > 0f && NPC.oldVelocity.Y < 0f) || (NPC.velocity.Y < 0f && NPC.oldVelocity.Y > 0f)) && !NPC.justHit) + { NPC.netUpdate = true; + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; + } + if (calamityGlobalNPC.newAI[2] > phaseLimit) { calamityGlobalNPC.velocityPriorToPhaseSwap = NPC.velocity.Length(); @@ -2309,8 +2385,13 @@ namespace CalamityMod.NPCs.DevourerofGods // Prediction is Death Mode only for now because it's weird without the line telegraph that Shayy spoke about Vector2 predictionVector = death ? player.velocity * 40f : Vector2.Zero; NPC.velocity = Vector2.Normalize(player.Center + predictionVector - NPC.Center) * chargeVelocity; + NPC.netUpdate = true; + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; + for (int i = 0; i < Main.maxNPCs; i++) { if (Main.npc[i].active && (Main.npc[i].type == ModContent.NPCType() || Main.npc[i].type == ModContent.NPCType())) @@ -2321,6 +2402,10 @@ namespace CalamityMod.NPCs.DevourerofGods ((DevourerofGodsTail)Main.npc[i].ModNPC).setInvulTime(720); Main.npc[i].netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (Main.npc[i].netSpam >= 10) + Main.npc[i].netSpam = 9; } } @@ -2367,7 +2452,13 @@ namespace CalamityMod.NPCs.DevourerofGods Main.npc[i].life = 0; Main.npc[i].HitEffect(); Main.npc[i].active = false; + Main.npc[i].netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (Main.npc[i].netSpam >= 10) + Main.npc[i].netSpam = 9; + destroyedSegments++; break; } @@ -2422,7 +2513,12 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.HitEffect(); NPC.NPCLoot(); NPC.active = false; + NPC.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; } DeathAnimationTimer++; } @@ -2682,7 +2778,13 @@ namespace CalamityMod.NPCs.DevourerofGods Dying = true; NPC.dontTakeDamage = true; NPC.active = true; + NPC.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; + return false; } diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index 35cd1a4a02..a878a80666 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -157,7 +157,12 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.height = (int)(140 * NPC.scale); NPC.frame = new Rectangle(0, 0, 86, 148); NPC.position -= NPC.Size * 0.5f; + NPC.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; } } @@ -250,6 +255,10 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.Opacity = 0f; NPC.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; } } } @@ -429,8 +438,13 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.life = 1; NPC.dontTakeDamage = true; NPC.active = true; + NPC.netUpdate = true; + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; + if (NPC.realLife >= 0) { NPC Head = Main.npc[NPC.realLife]; @@ -439,7 +453,12 @@ namespace CalamityMod.NPCs.DevourerofGods Head.ModNPC().Dying = true; Head.dontTakeDamage = true; + Head.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (Head.netSpam >= 10) + Head.netSpam = 9; } return false; } diff --git a/NPCs/HiveMind/HiveBlob.cs b/NPCs/HiveMind/HiveBlob.cs index c3a4a089cf..7eae50d146 100644 --- a/NPCs/HiveMind/HiveBlob.cs +++ b/NPCs/HiveMind/HiveBlob.cs @@ -2,8 +2,10 @@ using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.GameContent; using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; @@ -176,6 +178,28 @@ namespace CalamityMod.NPCs.HiveMind } } + public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (NPC.spriteDirection == 1) + spriteEffects = SpriteEffects.FlipHorizontally; + + Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Vector2 vector = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); + + Vector2 vector2 = NPC.Center - screenPos; + vector2 -= new Vector2(texture.Width, texture.Height) * NPC.scale / 2f; + vector2 += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY); + Color color = NPC.GetAlpha(drawColor); + + if (NPC.localAI[1] > 240f) + color = Color.Lerp(color, Color.Green, MathHelper.Clamp((NPC.localAI[1] - 240f) / 120f, 0f, 1f)); + + spriteBatch.Draw(texture, vector2, NPC.frame, color, NPC.rotation, vector, NPC.scale, spriteEffects, 0f); + + return false; + } + public override void OnKill() { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); @@ -183,23 +207,17 @@ namespace CalamityMod.NPCs.HiveMind Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } - public override bool CheckActive() - { - return false; - } + public override bool CheckActive() => false; public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 5; k++) - { Dust.NewDust(NPC.position, NPC.width, NPC.height, 14, hit.HitDirection, -1f, 0, default, 1f); - } + if (NPC.life <= 0) { for (int k = 0; k < 10; k++) - { Dust.NewDust(NPC.position, NPC.width, NPC.height, 14, hit.HitDirection, -1f, 0, default, 1f); - } } } } diff --git a/NPCs/HiveMind/HiveBlob2.cs b/NPCs/HiveMind/HiveBlob2.cs index 58a38cd455..62bcc4dc41 100644 --- a/NPCs/HiveMind/HiveBlob2.cs +++ b/NPCs/HiveMind/HiveBlob2.cs @@ -2,8 +2,10 @@ using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -13,6 +15,7 @@ namespace CalamityMod.NPCs.HiveMind public class HiveBlob2 : ModNPC { public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.HiveBlob.DisplayName"); + public override void SetStaticDefaults() { this.HideFromBestiary(); @@ -177,6 +180,28 @@ namespace CalamityMod.NPCs.HiveMind } } + public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (NPC.spriteDirection == 1) + spriteEffects = SpriteEffects.FlipHorizontally; + + Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Vector2 vector = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); + + Vector2 vector2 = NPC.Center - screenPos; + vector2 -= new Vector2(texture.Width, texture.Height) * NPC.scale / 2f; + vector2 += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY); + Color color = NPC.GetAlpha(drawColor); + + if (NPC.localAI[1] > 240f) + color = Color.Lerp(color, Color.Green, MathHelper.Clamp((NPC.localAI[1] - 240f) / 120f, 0f, 1f)); + + spriteBatch.Draw(texture, vector2, NPC.frame, color, NPC.rotation, vector, NPC.scale, spriteEffects, 0f); + + return false; + } + public override void OnKill() { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); @@ -184,26 +209,21 @@ namespace CalamityMod.NPCs.HiveMind Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } - public override bool CheckActive() - { - return false; - } + public override bool CheckActive() => false; public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 5; k++) - { Dust.NewDust(NPC.position, NPC.width, NPC.height, 14, hit.HitDirection, -1f, 0, default, 1f); - } + if (NPC.life <= 0) { for (int k = 0; k < 10; k++) - { Dust.NewDust(NPC.position, NPC.width, NPC.height, 14, hit.HitDirection, -1f, 0, default, 1f); - } + if (Main.netMode != NetmodeID.MultiplayerClient && Main.zenithWorld) { - //Spawn even more blobs on death + // Spawn even more blobs on death for (int i = 1; i < 3; i++) { Vector2 spawnAt = NPC.Center + new Vector2(0f, NPC.height / 2f); diff --git a/NPCs/NormalNPCs/Stormlion.cs b/NPCs/NormalNPCs/Stormlion.cs index 6e89077e0a..fb02481c3c 100644 --- a/NPCs/NormalNPCs/Stormlion.cs +++ b/NPCs/NormalNPCs/Stormlion.cs @@ -94,7 +94,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Electrified, 120, true); + target.AddBuff(BuffID.Electrified, 30, true); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 33c7751f91..3ffbb331b2 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -549,7 +549,7 @@ namespace CalamityMod.NPCs.Perforator ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), + ModContent.ItemType(), new WeightedItemStack(ModContent.ItemType(), 1f, 30, 50), })); diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index fef158d1da..c294689a67 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -14,6 +14,7 @@ using System.IO; using Terraria; using Terraria.GameContent; using Terraria.GameContent.Bestiary; +using Terraria.Graphics.Effects; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items.Placeables.Furniture.BossRelics; @@ -22,6 +23,7 @@ using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Events; using Terraria.Audio; using CalamityMod.Items.Materials; +using Filters = Terraria.Graphics.Effects.Filters; namespace CalamityMod.NPCs.ProfanedGuardians { @@ -1137,10 +1139,42 @@ namespace CalamityMod.NPCs.ProfanedGuardians color *= 0.6f; color2 *= 0.6f; float scaleMult = 1.2f + scaleDuringShieldDespawn; + + // The scale used for the noise overlay polygons also grows and shrinks + // This is intentionally out of sync with the shield, and intentionally desynced per player + // Don't put this anywhere less than 0.25f or higher than 1f. The higher it is, the denser / more zoomed out the noise overlay is. + float noiseScale = MathHelper.Lerp(0.4f, 0.8f, (float)Math.Sin(Main.GlobalTimeWrappedHourly * 0.3f) * 0.5f + 0.5f); + + // Define shader parameters + Effect shieldEffect = Filters.Scene["CalamityMod:RoverDriveShield"].GetShader().Shader; + shieldEffect.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly * 0.058f); // Scrolling speed of polygonal overlay + shieldEffect.Parameters["blowUpPower"].SetValue(2.8f); + shieldEffect.Parameters["blowUpSize"].SetValue(0.4f); + shieldEffect.Parameters["noiseScale"].SetValue(noiseScale); + + shieldEffect.Parameters["shieldOpacity"].SetValue(opacityScaleDuringShieldDespawn); + shieldEffect.Parameters["shieldEdgeBlendStrenght"].SetValue(4f); + + Color edgeColor = CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly * 0.2f, color, color2); + + // Define shader parameters for shield color + shieldEffect.Parameters["shieldColor"].SetValue(color.ToVector3()); + shieldEffect.Parameters["shieldEdgeColor"].SetValue(edgeColor.ToVector3()); + spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color, NPC.rotation, origin, shieldScale2 * scaleMult, SpriteEffects.None, 0f); spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color2, NPC.rotation, origin, shieldScale2 * scaleMult * 0.95f, SpriteEffects.None, 0f); spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color, NPC.rotation, origin, shieldScale * scaleMult, SpriteEffects.None, 0f); spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color2, NPC.rotation, origin, shieldScale * scaleMult * 0.95f, SpriteEffects.None, 0f); + + // The shield for the border MUST be drawn before the main shield, it becomes incredibly visually obnoxious otherwise. + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, shieldEffect, Main.GameViewMatrix.TransformationMatrix); + + // Fetch shield heat overlay texture (this is the neutrons fed to the shader) + Texture2D heatTex = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/Neurons2").Value; + Vector2 pos = NPC.Center + NPC.gfxOffY * Vector2.UnitY - Main.screenPosition; + Main.spriteBatch.Draw(heatTex, shieldDrawPos, null, Color.White, 0, heatTex.Size() / 2f, shieldScale * scaleMult * 0.5f, 0, 0); } return false; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs index c07eea57f4..2205053b9c 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs @@ -8,12 +8,15 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; +using CalamityMod.Items.Accessories; +using ReLogic.Content; using Terraria; using Terraria.GameContent; using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using Filters = Terraria.Graphics.Effects.Filters; namespace CalamityMod.NPCs.ProfanedGuardians { @@ -79,7 +82,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheHallow, BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld, - new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.ProfanedGuardianDefender") + new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.ProfanedGuardianDefender") }); } @@ -280,9 +283,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians float goLowDurationPhase1 = totalGoLowDurationPhase1 * 0.5f; float roundedGoLowPhase1Check = (float)Math.Round(goLowDurationPhase1 * 0.5); bool commanderGoingLowOrHighInPhase1 = (Main.npc[CalamityGlobalNPC.doughnutBoss].localAI[3] > (moveToOtherSideInPhase1GateValue - goLowDurationPhase1) && - Main.npc[CalamityGlobalNPC.doughnutBoss].localAI[3] <= (moveToOtherSideInPhase1GateValue + roundedGoLowPhase1Check)) || - Main.npc[CalamityGlobalNPC.doughnutBoss].localAI[3] > (timeBeforeMoveToOtherSideInPhase1Reset - goLowDurationPhase1) || - Main.npc[CalamityGlobalNPC.doughnutBoss].localAI[3] <= (-roundedGoLowPhase1Check); + Main.npc[CalamityGlobalNPC.doughnutBoss].localAI[3] <= (moveToOtherSideInPhase1GateValue + roundedGoLowPhase1Check)) || + Main.npc[CalamityGlobalNPC.doughnutBoss].localAI[3] > (timeBeforeMoveToOtherSideInPhase1Reset - goLowDurationPhase1) || + Main.npc[CalamityGlobalNPC.doughnutBoss].localAI[3] <= (-roundedGoLowPhase1Check); float moveToOtherSideInPhase2GateValue = commanderGuardPhase2Duration - 120f; float timeBeforeMoveToOtherSideInPhase2Reset = moveToOtherSideInPhase2GateValue * 2f; @@ -290,9 +293,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians float goLowDurationPhase2 = totalGoLowDurationPhase2 * 0.5f; float roundedGoLowPhase2Check = (float)Math.Round(goLowDurationPhase2 * 0.5); bool commanderGoingLowOrHighInPhase2 = (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().newAI[1] > (moveToOtherSideInPhase2GateValue - goLowDurationPhase2) && - Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().newAI[1] <= (moveToOtherSideInPhase2GateValue + roundedGoLowPhase2Check)) || - Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().newAI[1] > (timeBeforeMoveToOtherSideInPhase2Reset - goLowDurationPhase2) || - Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().newAI[1] <= (-roundedGoLowPhase2Check); + Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().newAI[1] <= (moveToOtherSideInPhase2GateValue + roundedGoLowPhase2Check)) || + Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().newAI[1] > (timeBeforeMoveToOtherSideInPhase2Reset - goLowDurationPhase2) || + Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().newAI[1] <= (-roundedGoLowPhase2Check); // Tell rocks to fade out and shrink if (commanderGoingLowOrHighInPhase1 || commanderGoingLowOrHighInPhase2) @@ -853,10 +856,41 @@ namespace CalamityMod.NPCs.ProfanedGuardians color *= 0.6f; color2 *= 0.6f; float scaleMult = 1.2f + scaleDuringShieldDespawn; + + // The scale used for the noise overlay polygons also grows and shrinks + // This is intentionally out of sync with the shield, and intentionally desynced per player + // Don't put this anywhere less than 0.25f or higher than 1f. The higher it is, the denser / more zoomed out the noise overlay is. + float noiseScale = MathHelper.Lerp(0.4f, 0.8f, (float)Math.Sin(Main.GlobalTimeWrappedHourly * 0.3f) * 0.5f + 0.5f); + + // Define shader parameters + Effect shieldEffect = Filters.Scene["CalamityMod:RoverDriveShield"].GetShader().Shader; + shieldEffect.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly * 0.058f); // Scrolling speed of polygonal overlay + shieldEffect.Parameters["blowUpPower"].SetValue(2.8f); + shieldEffect.Parameters["blowUpSize"].SetValue(0.4f); + shieldEffect.Parameters["noiseScale"].SetValue(noiseScale); + + shieldEffect.Parameters["shieldOpacity"].SetValue(opacityScaleDuringShieldDespawn); + shieldEffect.Parameters["shieldEdgeBlendStrenght"].SetValue(4f); + + Color edgeColor = CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly * 0.2f, color, color2); + + // Define shader parameters for shield color + shieldEffect.Parameters["shieldColor"].SetValue(color.ToVector3()); + shieldEffect.Parameters["shieldEdgeColor"].SetValue(edgeColor.ToVector3()); + spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color, NPC.rotation, origin, shieldScale2 * scaleMult, SpriteEffects.None, 0f); spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color2, NPC.rotation, origin, shieldScale2 * scaleMult * 0.95f, SpriteEffects.None, 0f); spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color, NPC.rotation, origin, shieldScale * scaleMult, SpriteEffects.None, 0f); spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color2, NPC.rotation, origin, shieldScale * scaleMult * 0.95f, SpriteEffects.None, 0f); + + // The shield for the border MUST be drawn before the main shield, it becomes incredibly visually obnoxious otherwise. + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, shieldEffect, Main.GameViewMatrix.TransformationMatrix); + // Fetch shield heat overlay texture (this is the neutrons fed to the shader) + Texture2D heatTex = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/Neurons2").Value; + Vector2 pos = NPC.Center + NPC.gfxOffY * Vector2.UnitY - Main.screenPosition; + Main.spriteBatch.Draw(heatTex, shieldDrawPos, null, Color.White, 0, heatTex.Size() / 2f, shieldScale * scaleMult * 0.5f, 0, 0); } return false; diff --git a/NPCs/Providence/ProvSpawnDefense.cs b/NPCs/Providence/ProvSpawnDefense.cs index 5b9214a8e5..7b2755d913 100644 --- a/NPCs/Providence/ProvSpawnDefense.cs +++ b/NPCs/Providence/ProvSpawnDefense.cs @@ -101,7 +101,7 @@ namespace CalamityMod.NPCs.Providence double deg = NPC.ai[1]; double rad = deg * (Math.PI / 180); - double dist = 400; + double dist = 450; NPC.position.X = parent.Center.X - (int)(Math.Cos(rad) * dist) - NPC.width / 2; NPC.position.Y = parent.Center.Y - (int)(Math.Sin(rad) * dist) - NPC.height / 2; NPC.ai[1] += 1f; diff --git a/NPCs/Providence/ProvSpawnHealer.cs b/NPCs/Providence/ProvSpawnHealer.cs index 041ac9665e..c32dff5cf3 100644 --- a/NPCs/Providence/ProvSpawnHealer.cs +++ b/NPCs/Providence/ProvSpawnHealer.cs @@ -100,7 +100,7 @@ namespace CalamityMod.NPCs.Providence double deg = NPC.ai[1]; double rad = deg * (Math.PI / 180); - double dist = 400; + double dist = 450; NPC.position.X = parent.Center.X - (int)(Math.Cos(rad) * dist) - NPC.width / 2; NPC.position.Y = parent.Center.Y - (int)(Math.Sin(rad) * dist) - NPC.height / 2; NPC.ai[1] += 1f; diff --git a/NPCs/Providence/ProvSpawnOffense.cs b/NPCs/Providence/ProvSpawnOffense.cs index 57d78d04b4..e80c1bb8c7 100644 --- a/NPCs/Providence/ProvSpawnOffense.cs +++ b/NPCs/Providence/ProvSpawnOffense.cs @@ -101,7 +101,7 @@ namespace CalamityMod.NPCs.Providence double deg = NPC.ai[1]; double rad = deg * (Math.PI / 180); - double dist = 400; + double dist = 450; NPC.position.X = parent.Center.X - (int)(Math.Cos(rad) * dist) - NPC.width / 2; NPC.position.Y = parent.Center.Y - (int)(Math.Sin(rad) * dist) - NPC.height / 2; NPC.ai[1] += 1f; diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index f29e600281..7fbbf20fbb 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -37,9 +37,11 @@ using Terraria.DataStructures; using Terraria.GameContent; using Terraria.GameContent.Bestiary; using Terraria.GameContent.ItemDropRules; +using Terraria.Graphics.Effects; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; +using Filters = Terraria.Graphics.Effects.Filters; namespace CalamityMod.NPCs.Providence { @@ -304,6 +306,10 @@ namespace CalamityMod.NPCs.Providence calamityGlobalNPC.newAI[2] = 0f; calamityGlobalNPC.newAI[3] = 0f; NPC.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; } // Increase all projectile damage at night, but reduce to 0 for Zenith @@ -536,6 +542,11 @@ namespace CalamityMod.NPCs.Providence Dying = true; NPC.dontTakeDamage = true; NPC.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; + return; } @@ -620,6 +631,11 @@ namespace CalamityMod.NPCs.Providence { NPC.life += healAmt; NPC.HealEffect(healAmt, true); + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; + NPC.netUpdate = true; } } @@ -936,7 +952,13 @@ namespace CalamityMod.NPCs.Providence NPC.ai[3] = 0f; calamityGlobalNPC.newAI[1] = 0f; calamityGlobalNPC.newAI[2] = 0f; + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; + NPC.netUpdate = true; + break; case (int)Phase.HolyBlast: @@ -1171,7 +1193,12 @@ namespace CalamityMod.NPCs.Providence // Radial offset NPC.ai[2] += 10f; } + NPC.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; } else { @@ -1674,6 +1701,10 @@ namespace CalamityMod.NPCs.Providence } NPC.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; } } } @@ -1754,15 +1785,26 @@ namespace CalamityMod.NPCs.Providence // Do periodic syncs. if (Main.netMode == NetmodeID.Server && DeathAnimationTimer % 45f == 44f) + { NPC.netUpdate = true; + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; + } + // Die and create drops after the star is gone. if (DeathAnimationTimer >= 345f) { NPC.active = false; NPC.HitEffect(); NPC.NPCLoot(); + NPC.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; } } @@ -1842,7 +1884,13 @@ namespace CalamityMod.NPCs.Providence Dying = true; NPC.active = true; NPC.dontTakeDamage = true; + NPC.netUpdate = true; + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; + return false; } @@ -2235,7 +2283,7 @@ namespace CalamityMod.NPCs.Providence float invertedSmallerOscillationRatio = 1f - (1f - smallerRemappedOscillation) * (1f - smallerRemappedOscillation); float smallerOscillationScale = 1f - (1f - invertedSmallerOscillationRatio) * (1f - invertedSmallerOscillationRatio); float shieldScale2 = (minScale + maxPulseScale * smallerOscillationScale) * invertedOscillationUsedForScale; - Texture2D shieldTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleOpenCircle").Value; + Texture2D shieldTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleOpenCircleButBigger").Value; Rectangle shieldFrame = shieldTexture.Frame(); Vector2 origin = shieldFrame.Size() * 0.5f; Vector2 shieldDrawPos = NPC.Center - screenPos; @@ -2252,11 +2300,40 @@ namespace CalamityMod.NPCs.Providence color2.A = 0; color *= 0.6f; color2 *= 0.6f; - float scaleMult = 2.2f + scaleDuringShieldDespawn; - spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color, NPC.rotation, origin, shieldScale2 * scaleMult, SpriteEffects.None, 0f); - spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color2, NPC.rotation, origin, shieldScale2 * scaleMult * 0.95f, SpriteEffects.None, 0f); - spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color, NPC.rotation, origin, shieldScale * scaleMult, SpriteEffects.None, 0f); - spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color2, NPC.rotation, origin, shieldScale * scaleMult * 0.95f, SpriteEffects.None, 0f); + float scaleMult = 2.75f + scaleDuringShieldDespawn; + spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color2, NPC.rotation, origin, shieldScale2 * scaleMult * 0.45f, SpriteEffects.None, 0f); + spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color2, NPC.rotation, origin, shieldScale2 * scaleMult * 0.5f, SpriteEffects.None, 0f); + + // The shield for the border MUST be drawn before the main shield, it becomes incredibly visually obnoxious otherwise. + + // The scale used for the noise overlay polygons also grows and shrinks + // This is intentionally out of sync with the shield, and intentionally desynced per player + // Don't put this anywhere less than 0.25f or higher than 1f. The higher it is, the denser / more zoomed out the noise overlay is. + float noiseScale = MathHelper.Lerp(0.4f, 0.8f, (float)Math.Sin(Main.GlobalTimeWrappedHourly * 0.3f) * 0.5f + 0.5f); + + // Define shader parameters + Effect shieldEffect = Filters.Scene["CalamityMod:RoverDriveShield"].GetShader().Shader; + shieldEffect.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly * 0.058f); // Scrolling speed of polygonal overlay + shieldEffect.Parameters["blowUpPower"].SetValue(2.8f); + shieldEffect.Parameters["blowUpSize"].SetValue(0.4f); + shieldEffect.Parameters["noiseScale"].SetValue(noiseScale); + + shieldEffect.Parameters["shieldOpacity"].SetValue(opacityScaleDuringShieldDespawn); + shieldEffect.Parameters["shieldEdgeBlendStrenght"].SetValue(4f); + + Color edgeColor = CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly * 0.2f, color, color2); + + // Define shader parameters for shield color + shieldEffect.Parameters["shieldColor"].SetValue(color.ToVector3()); + shieldEffect.Parameters["shieldEdgeColor"].SetValue(edgeColor.ToVector3()); + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, shieldEffect, Main.GameViewMatrix.TransformationMatrix); + + // Fetch shield heat overlay texture (this is the neutrons fed to the shader) + Texture2D heatTex = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/Neurons2").Value; + Vector2 pos = NPC.Center + NPC.gfxOffY * Vector2.UnitY - Main.screenPosition; + Main.spriteBatch.Draw(heatTex, shieldDrawPos, null, Color.White, 0, heatTex.Size() / 2f, shieldScale * scaleMult * 0.5f, 0, 0); } return false; @@ -2360,6 +2437,8 @@ namespace CalamityMod.NPCs.Providence ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), @@ -2373,7 +2452,7 @@ namespace CalamityMod.NPCs.Providence !projectile.CountsAsClass() && !projectile.CountsAsClass() && !projectile.CountsAsClass()); bool allowedDamage = allowedClass && hit.Damage <= 75; //Flat 75 regardless of difficulty. //Absorber on-hit effects likely won't proc this but Deific Amulet and Astral Bulwark stars will proc this. - bool allowedBabs = Main.player[projectile.owner].Calamity().pArtifact && !Main.player[projectile.owner].Calamity().profanedCrystalBuffs; + bool allowedBabs = Main.player[projectile.owner].Calamity().pSoulArtifact && !Main.player[projectile.owner].Calamity().profanedCrystalBuffs; if ((exceptionList.TrueForAll(x => projectile.type != x) && !allowedDamage) || !allowedBabs) { diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index 97e8db59e7..5faf00cefb 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -16,6 +16,7 @@ namespace CalamityMod.NPCs.StormWeaver public class StormWeaverBody : ModNPC { public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.StormWeaverHead.DisplayName"); + public override void SetStaticDefaults() { this.HideFromBestiary(); @@ -156,8 +157,6 @@ namespace CalamityMod.NPCs.StormWeaver } } - Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); - // Check if other segments are still alive, if not, die bool shouldDespawn = true; for (int i = 0; i < Main.maxNPCs; i++) @@ -263,38 +262,14 @@ namespace CalamityMod.NPCs.StormWeaver if (!phase3) chargePhaseGateValue *= 0.5f; - Texture2D texture2D15 = phase2 ? ModContent.Request("CalamityMod/NPCs/StormWeaver/StormWeaverBodyNaked").Value : TextureAssets.Npc[NPC.type].Value; - Vector2 vector11 = new Vector2(texture2D15.Width / 2, texture2D15.Height / 2); - Color color36 = Color.White; - float amount9 = 0.5f; - int num153 = 5; + Texture2D texture = phase2 ? ModContent.Request("CalamityMod/NPCs/StormWeaver/StormWeaverBodyNaked").Value : TextureAssets.Npc[NPC.type].Value; + Vector2 vector = new Vector2(texture.Width / 2, texture.Height / 2); float chargeTelegraphTime = 120f; float chargeTelegraphGateValue = chargePhaseGateValue - chargeTelegraphTime; - if (CalamityConfig.Instance.Afterimages) - { - for (int num155 = 1; num155 < num153; num155 += 2) - { - Color color38 = drawColor; - - if (Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] > chargeTelegraphGateValue) - color38 = Color.Lerp(color38, Color.Cyan, MathHelper.Clamp((Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] - chargeTelegraphGateValue) / chargeTelegraphTime, 0f, 1f)); - else if (Main.npc[(int)NPC.ai[2]].localAI[3] > 0f) - color38 = Color.Lerp(color38, Color.Cyan, MathHelper.Clamp(Main.npc[(int)NPC.ai[2]].localAI[3] / 60f, 0f, 1f)); - - color38 = Color.Lerp(color38, color36, amount9); - color38 = NPC.GetAlpha(color38); - color38 *= (num153 - num155) / 15f; - Vector2 vector41 = NPC.oldPos[num155] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f; - vector41 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, vector41, NPC.frame, color38, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); - } - } - - Vector2 vector43 = NPC.Center - screenPos; - vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f; - vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); + Vector2 vector2 = NPC.Center - screenPos; + vector2 -= new Vector2(texture.Width, texture.Height) * NPC.scale / 2f; + vector2 += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY); Color color = NPC.GetAlpha(drawColor); if (Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] > chargeTelegraphGateValue) @@ -302,7 +277,7 @@ namespace CalamityMod.NPCs.StormWeaver else if (Main.npc[(int)NPC.ai[2]].localAI[3] > 0f) color = Color.Lerp(color, Color.Cyan, MathHelper.Clamp(Main.npc[(int)NPC.ai[2]].localAI[3] / 60f, 0f, 1f)); - spriteBatch.Draw(texture2D15, vector43, NPC.frame, color, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, vector2, NPC.frame, color, NPC.rotation, vector, NPC.scale, spriteEffects, 0f); return false; } @@ -323,7 +298,7 @@ namespace CalamityMod.NPCs.StormWeaver if (!phase3) chargePhaseGateValue *= 0.5f; - int buffDuration = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] >= chargePhaseGateValue ? 240 : 120; + int buffDuration = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] >= chargePhaseGateValue ? 120 : 60; if (hurtInfo.Damage > 0) target.AddBuff(BuffID.Electrified, buffDuration, true); } diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 308329c153..467e5fde64 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -208,8 +208,6 @@ namespace CalamityMod.NPCs.StormWeaver } } - Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); - if (NPC.ai[2] > 0f) NPC.realLife = (int)NPC.ai[2]; @@ -828,38 +826,14 @@ namespace CalamityMod.NPCs.StormWeaver if (!phase3) chargePhaseGateValue *= 0.5f; - Texture2D texture2D15 = phase2 ? ModContent.Request("CalamityMod/NPCs/StormWeaver/StormWeaverHeadNaked").Value : TextureAssets.Npc[NPC.type].Value; - Vector2 vector11 = new Vector2(texture2D15.Width / 2, texture2D15.Height / 2); - Color color36 = Color.White; - float amount9 = 0.5f; - int num153 = 5; + Texture2D texture = phase2 ? ModContent.Request("CalamityMod/NPCs/StormWeaver/StormWeaverHeadNaked").Value : TextureAssets.Npc[NPC.type].Value; + Vector2 vector = new Vector2(texture.Width / 2, texture.Height / 2); float chargeTelegraphTime = 120f; float chargeTelegraphGateValue = chargePhaseGateValue - chargeTelegraphTime; - if (CalamityConfig.Instance.Afterimages) - { - for (int num155 = 1; num155 < num153; num155 += 2) - { - Color color38 = drawColor; - - if (calamityGlobalNPC.newAI[0] > chargeTelegraphGateValue) - color38 = Color.Lerp(color38, Color.Cyan, MathHelper.Clamp((calamityGlobalNPC.newAI[0] - chargeTelegraphGateValue) / chargeTelegraphTime, 0f, 1f)); - else if (NPC.localAI[3] > 0f) - color38 = Color.Lerp(color38, Color.Cyan, MathHelper.Clamp(NPC.localAI[3] / 60f, 0f, 1f)); - - color38 = Color.Lerp(color38, color36, amount9); - color38 = NPC.GetAlpha(color38); - color38 *= (num153 - num155) / 15f; - Vector2 vector41 = NPC.oldPos[num155] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f; - vector41 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, vector41, NPC.frame, color38, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); - } - } - - Vector2 vector43 = NPC.Center - screenPos; - vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f; - vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); + Vector2 vector2 = NPC.Center - screenPos; + vector2 -= new Vector2(texture.Width, texture.Height) * NPC.scale / 2f; + vector2 += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY); Color color = NPC.GetAlpha(drawColor); if (calamityGlobalNPC.newAI[0] > chargeTelegraphGateValue) @@ -867,7 +841,7 @@ namespace CalamityMod.NPCs.StormWeaver else if (NPC.localAI[3] > 0f) color = Color.Lerp(color, Color.Cyan, MathHelper.Clamp(NPC.localAI[3] / 60f, 0f, 1f)); - spriteBatch.Draw(texture2D15, vector43, NPC.frame, color, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, vector2, NPC.frame, color, NPC.rotation, vector, NPC.scale, spriteEffects, 0f); return false; } @@ -888,7 +862,7 @@ namespace CalamityMod.NPCs.StormWeaver if (!phase3) chargePhaseGateValue *= 0.5f; - int buffDuration = NPC.Calamity().newAI[0] >= chargePhaseGateValue ? 480 : 240; + int buffDuration = NPC.Calamity().newAI[0] >= chargePhaseGateValue ? 240 : 120; if (hurtInfo.Damage > 0) target.AddBuff(BuffID.Electrified, buffDuration, true); } diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index 53de28283d..ff664b375a 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -15,7 +15,9 @@ namespace CalamityMod.NPCs.StormWeaver public class StormWeaverTail : ModNPC { private int invinceTime = 180; + public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.StormWeaverHead.DisplayName"); + public override void SetStaticDefaults() { this.HideFromBestiary(); @@ -147,8 +149,6 @@ namespace CalamityMod.NPCs.StormWeaver } } - Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); - // Check if other segments are still alive, if not, die bool shouldDespawn = true; for (int i = 0; i < Main.maxNPCs; i++) @@ -254,38 +254,14 @@ namespace CalamityMod.NPCs.StormWeaver if (!phase3) chargePhaseGateValue *= 0.5f; - Texture2D texture2D15 = phase2 ? ModContent.Request("CalamityMod/NPCs/StormWeaver/StormWeaverTailNaked").Value : TextureAssets.Npc[NPC.type].Value; - Vector2 vector11 = new Vector2(texture2D15.Width / 2, texture2D15.Height / 2); - Color color36 = Color.White; - float amount9 = 0.5f; - int num153 = 5; + Texture2D texture = phase2 ? ModContent.Request("CalamityMod/NPCs/StormWeaver/StormWeaverTailNaked").Value : TextureAssets.Npc[NPC.type].Value; + Vector2 vector = new Vector2(texture.Width / 2, texture.Height / 2); float chargeTelegraphTime = 120f; float chargeTelegraphGateValue = chargePhaseGateValue - chargeTelegraphTime; - if (CalamityConfig.Instance.Afterimages) - { - for (int num155 = 1; num155 < num153; num155 += 2) - { - Color color38 = drawColor; - - if (Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] > chargeTelegraphGateValue) - color38 = Color.Lerp(color38, Color.Cyan, MathHelper.Clamp((Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] - chargeTelegraphGateValue) / chargeTelegraphTime, 0f, 1f)); - else if (Main.npc[(int)NPC.ai[2]].localAI[3] > 0f) - color38 = Color.Lerp(color38, Color.Cyan, MathHelper.Clamp(Main.npc[(int)NPC.ai[2]].localAI[3] / 60f, 0f, 1f)); - - color38 = Color.Lerp(color38, color36, amount9); - color38 = NPC.GetAlpha(color38); - color38 *= (num153 - num155) / 15f; - Vector2 vector41 = NPC.oldPos[num155] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f; - vector41 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, vector41, NPC.frame, color38, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); - } - } - - Vector2 vector43 = NPC.Center - screenPos; - vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f; - vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); + Vector2 vector2 = NPC.Center - screenPos; + vector2 -= new Vector2(texture.Width, texture.Height) * NPC.scale / 2f; + vector2 += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY); Color color = NPC.GetAlpha(drawColor); if (Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] > chargeTelegraphGateValue) @@ -293,14 +269,14 @@ namespace CalamityMod.NPCs.StormWeaver else if (Main.npc[(int)NPC.ai[2]].localAI[3] > 0f) color = Color.Lerp(color, Color.Cyan, MathHelper.Clamp(Main.npc[(int)NPC.ai[2]].localAI[3] / 60f, 0f, 1f)); - spriteBatch.Draw(texture2D15, vector43, NPC.frame, color, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, vector2, NPC.frame, color, NPC.rotation, vector, NPC.scale, spriteEffects, 0f); if (!phase2) { - texture2D15 = ModContent.Request("CalamityMod/NPCs/StormWeaver/StormWeaverTailGlow").Value; + texture = ModContent.Request("CalamityMod/NPCs/StormWeaver/StormWeaverTailGlow").Value; Color rainbowBecauseWhyTheFuckNot = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); Color color37 = Color.Lerp(Color.White, rainbowBecauseWhyTheFuckNot, 0.5f); - spriteBatch.Draw(texture2D15, vector43, NPC.frame, color37, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, vector2, NPC.frame, color37, NPC.rotation, vector, NPC.scale, spriteEffects, 0f); } return false; @@ -322,7 +298,7 @@ namespace CalamityMod.NPCs.StormWeaver if (!phase3) chargePhaseGateValue *= 0.5f; - int buffDuration = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] >= chargePhaseGateValue ? 120 : 60; + int buffDuration = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] >= chargePhaseGateValue ? 60 : 30; if (hurtInfo.Damage > 0) target.AddBuff(BuffID.Electrified, buffDuration, true); } diff --git a/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs b/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs index eaa67832f5..6e49fad655 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs @@ -268,7 +268,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } bool scrap = false; - if (probeLaunched && Main.rand.NextBool()) + if (probeLaunched) { scrap = true; projectileType = ProjectileID.SaucerScrap; diff --git a/NPCs/VanillaNPCOverrides/Bosses/EaterOfWorldsAI.cs b/NPCs/VanillaNPCOverrides/Bosses/EaterOfWorldsAI.cs index 57197a5fd7..cbfa4e9624 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/EaterOfWorldsAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/EaterOfWorldsAI.cs @@ -80,7 +80,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Main.rand.NextBool(Main.getGoodWorld ? 450 : 900) && phase2) { npc.TargetClosest(); - if (Collision.CanHitLine(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) + if (Collision.CanHitLine(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1) && Vector2.Distance(npc.Center, Main.player[npc.target].Center) > 320f) NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (npc.width / 2) + npc.velocity.X), (int)(npc.position.Y + (npc.height / 2) + npc.velocity.Y), NPCID.VileSpitEaterOfWorlds, 0, 0f, 1f, 0f, 0f, 255); } } @@ -98,9 +98,11 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (calamityGlobalNPC.newAI[0] >= timer && phase3) { - calamityGlobalNPC.newAI[0] = 0f; - if (Collision.CanHitLine(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) + if (Collision.CanHitLine(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1) && + npc.SafeDirectionTo(Main.player[npc.target].Center).AngleBetween((npc.rotation - MathHelper.PiOver2).ToRotationVector2()) < MathHelper.ToRadians(18f) && + Vector2.Distance(npc.Center, Main.player[npc.target].Center) > 320f) { + calamityGlobalNPC.newAI[0] = 0f; Vector2 vector34 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); float num349 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - vector34.X; float num350 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - vector34.Y; @@ -115,7 +117,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses vector34.Y -= num350; int type = ProjectileID.CursedFlameHostile; - Projectile.NewProjectile(npc.GetSource_FromAI(), vector34.X, vector34.Y, num349, num350, type, npc.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector34.X, vector34.Y, num349, num350, type, npc.GetProjectileDamage(type), 0f, Main.myPlayer); } } } diff --git a/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs b/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs index ffdadfcb36..2f17fbc3cc 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs @@ -208,8 +208,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses float playerLocation = npc.Center.X - Main.player[npc.target].Center.X; npc.direction = playerLocation < 0 ? 1 : -1; npc.spriteDirection = npc.direction; - - SoundEngine.PlaySound(SoundID.Roar, npc.position); + + SoundEngine.PlaySound(SoundID.Zombie125, npc.Center); return false; } diff --git a/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs b/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs index 1d8caef8c7..271967206e 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs @@ -281,10 +281,10 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses float num158 = bossRush ? 10f : phase2 ? (60f - (death ? 30f * (1f - lifeRatio) : 0f)) : 75f; if (Main.getGoodWorld) num158 *= 0.8f; + num158 = (float)Math.Ceiling(num158); - if (Main.netMode != NetmodeID.MultiplayerClient && calamityGlobalNPC.newAI[1] >= num158) + if (Main.netMode != NetmodeID.MultiplayerClient && calamityGlobalNPC.newAI[1] % num158 == 0f && calamityGlobalNPC.newAI[1] > 45f) { - calamityGlobalNPC.newAI[1] = 0f; Vector2 vector18 = npc.Center; float num159 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - vector18.X; float num160 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - vector18.Y; @@ -292,8 +292,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Collision.CanHit(vector18, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { float num162 = phase2 ? (5f + (death ? 3f * (1f - lifeRatio) : 0f)) : 4f; - float num163 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector18.X + Main.rand.Next(-20, 21); - float num164 = Main.player[npc.target].position.Y + Main.player[npc.target].height * 0.5f - vector18.Y + Main.rand.Next(-20, 21); + float num163 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector18.X; + float num164 = Main.player[npc.target].position.Y + Main.player[npc.target].height * 0.5f - vector18.Y; float num165 = (float)Math.Sqrt(num163 * num163 + num164 * num164); num165 = num162 / num165; num163 *= num165; diff --git a/Particles/Crack.png b/Particles/Crack.png new file mode 100644 index 0000000000..ef945142ec Binary files /dev/null and b/Particles/Crack.png differ diff --git a/Particles/CrackParticle.cs b/Particles/CrackParticle.cs new file mode 100644 index 0000000000..0ebfc60c20 --- /dev/null +++ b/Particles/CrackParticle.cs @@ -0,0 +1,55 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using static CalamityMod.CalamityUtils; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Particles +{ + public class CrackParticle : Particle + { + public override string Texture => "CalamityMod/Particles/Crack"; + public override bool UseAdditiveBlend => true; + public override bool SetLifetime => true; + public override bool UseCustomDraw => true; + + private float OriginalScale; + private float FinalScale; + private Vector2 Squish; + private Color BaseColor; + public int Stop = 0; + + public CrackParticle(Vector2 position, Vector2 velocity, Color color, Vector2 squish, float rotation, float originalScale, float finalScale, int lifeTime) + { + Position = position; + Velocity = velocity; + BaseColor = color; + OriginalScale = originalScale; + FinalScale = finalScale; + Scale = originalScale; + Lifetime = lifeTime; + Squish = squish; + Rotation = rotation; + } + + public override void Update() + { + if (Velocity != Vector2.Zero) + Rotation = Velocity.ToRotation() + MathHelper.PiOver2; + ++Stop; + float pulseProgress = PiecewiseAnimation(LifetimeCompletion, new CurveSegment[] { new CurveSegment(EasingType.PolyOut, 0f, 0f, 1f, 4) }); + Scale = MathHelper.Lerp(OriginalScale, FinalScale, pulseProgress); + if (Stop > 1) + Velocity *= 0; + Color = BaseColor; + } + + public override void CustomDraw(SpriteBatch spriteBatch) + { + Texture2D tex = ModContent.Request(Texture).Value; + spriteBatch.Draw(tex, Position - Main.screenPosition, null, Color, Rotation, tex.Size() / 2f, Scale * Squish, SpriteEffects.None, 0); + } + + } +} diff --git a/Projectiles/BaseProjectiles/BaseMinionProjectile.cs b/Projectiles/BaseProjectiles/BaseMinionProjectile.cs new file mode 100644 index 0000000000..18752d5124 --- /dev/null +++ b/Projectiles/BaseProjectiles/BaseMinionProjectile.cs @@ -0,0 +1,175 @@ +using CalamityMod.CalPlayer; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.BaseProjectiles +{ + /// + /// An abstract class that contains the necessary code for a minion to work.
+ /// Contains useful properties for minions, such as IFrames, Enemy Distance Detection, and sets the Owner and Target. + /// Also has a hook, with basic animation code that can be overriden. + ///
+ public abstract class BaseMinionProjectile : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Summon"; + + #region Properties + + /// + /// Input here the correspondent of the minion. + /// + public abstract int AssociatedProjectileTypeID { get; } + + /// + /// Input here the correspondent of the minion. + /// + public abstract int AssociatedBuffTypeID { get; } + + /// + /// Input the reference of the minion bool from with .
+ /// Example for Elemental Axe: + /// public override ref bool AssociatedMinionBool => ref ModdedOwner.eAxe; + ///
+ public abstract ref bool AssociatedMinionBool { get; } + + /// + /// The amount of minion slots this summon consumes.
+ /// Defaults to 1f. + ///
+ public virtual float MinionSlots => 1f; + + /// + /// The distance in which the minion can detect an enemy, in pixels.
+ /// is set to this value.
+ /// Defaults to 1200f (75 tiles). + ///
+ public virtual float EnemyDistanceDetection => 1200f; + + /// + /// The amount of local I-Frames this minion has.
+ /// Multiplied by so changing won't affect this.
+ /// Defaults to 10. + ///
+ public int IFrames { get => Projectile.localNPCHitCooldown / Projectile.MaxUpdates; set => Projectile.localNPCHitCooldown = value * Projectile.MaxUpdates; } + + /// + /// If , makes the minion only be able to detect and attack enemies through tiles only when there are any bosses alive.
+ /// Defaults to . + ///
+ public virtual bool PreHardmodeMinionTileVision => false; + + /// + /// If , makes the minion not target certain NPCs (Like Abyss' or Sunken Sea's enemies) until they're hit.
+ /// Defaults to . + ///
+ public virtual bool PreventTargettingUntilTargetHit => true; + + /// + /// The frames that it takes to go to the next frame of animation.
+ /// Defaults to 5. + ///
+ public int FramesUntilNextAnimationFrame { get; set; } = 5; + + /// + /// Set here .
+ /// Defaults to 2. + ///
+ public int TrailingMode { get; set; } = 2; + + /// + /// Set here .
+ /// Defaults to 5.
+ ///
+ public int TrailCacheLength { get; set; } = 5; + + public Player Owner => Main.player[Projectile.owner]; + public CalamityPlayer ModdedOwner => Owner.Calamity(); + public NPC Target { get; set; } + + #endregion + + public override void SetStaticDefaults() + { + ProjectileID.Sets.MinionTargettingFeature[Type] = true; + ProjectileID.Sets.TrailingMode[Type] = TrailingMode; + ProjectileID.Sets.TrailCacheLength[Type] = TrailCacheLength; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = (int)EnemyDistanceDetection; + } + + public override void SetDefaults() + { + Projectile.DamageType = DamageClass.Summon; + Projectile.minionSlots = MinionSlots; + Projectile.penetrate = -1; + + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.minion = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.netImportant = true; + } + + public override bool PreAI() + { + Projectile.Calamity().overridesMinionDamagePrevention = !PreventTargettingUntilTargetHit; + return true; + } + + public override void AI() + { + CheckMinionExistence(); + DoAnimation(); + ChooseTarget(); + MinionAI(); + } + + #region AI Methods + + /// + /// Where all of the actual AI of the minion will be placed. + /// + public abstract void MinionAI(); + + /// + /// The universal way all minions check if they can still exist. + /// + public virtual void CheckMinionExistence() + { + Owner.AddBuff(AssociatedBuffTypeID, 2); + if (Type != AssociatedProjectileTypeID) + return; + + if (Owner.dead) + AssociatedMinionBool = false; + if (AssociatedMinionBool) + Projectile.timeLeft = 2; + } + + /// + /// Basic animation code that the majority of minions use.
+ /// It will only run if the minion is set to have more than 1 frame of animation.
+ /// If something more complex is needed, override it. Or leave it blank if not needed at all. + ///
+ public virtual void DoAnimation() + { + if (Main.projFrames[Type] <= 1) + return; + + Projectile.frameCounter++; + if (Projectile.frameCounter >= FramesUntilNextAnimationFrame * Projectile.MaxUpdates) + { + Projectile.frameCounter = 0; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; + } + } + + /// + /// Where the null property is set to a valid target, a non-null value. + /// + public virtual void ChooseTarget() => Target = Owner.Center.MinionHoming(EnemyDistanceDetection, Owner, !PreHardmodeMinionTileVision || CalamityPlayer.areThereAnyDamnBosses); + + #endregion + } +} diff --git a/Projectiles/Boss/AstralGodRay.cs b/Projectiles/Boss/AstralGodRay.cs index e31cfcac64..dd6138070c 100644 --- a/Projectiles/Boss/AstralGodRay.cs +++ b/Projectiles/Boss/AstralGodRay.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Projectiles.Boss // They are extremely carefully chosen and barely work as is! private const float WaveTheta = 0.09f; private const int WaveTwistFrames = 9; + private ref float WaveFrameState => ref Projectile.localAI[1]; public override string Texture => "CalamityMod/Projectiles/LaserProj"; @@ -81,12 +82,6 @@ namespace CalamityMod.Projectiles.Boss Projectile.velocity = Projectile.velocity.RotatedBy(waveSign * WaveTheta); Projectile.rotation = Projectile.velocity.ToRotation(); - // Emit light. - if (WaveFrameState < 0f) - Lighting.AddLight(Projectile.Center, 0.87f, 0.65f, 0.1725f); - else - Lighting.AddLight(Projectile.Center, 0.1725f, 0.87f, 0.65f); - // Laser length shenanigans. If the laser is still growing, increase localAI 0 to indicate it is getting longer. Projectile.localAI[0] += 10f; // LaserLengthChangeRate; diff --git a/Projectiles/Boss/AstralShot2.cs b/Projectiles/Boss/AstralShot2.cs index 743c43ef8f..b82fd9362d 100644 --- a/Projectiles/Boss/AstralShot2.cs +++ b/Projectiles/Boss/AstralShot2.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Projectiles.Boss public class AstralShot2 : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Boss"; + public override void SetStaticDefaults() { Main.projFrames[Projectile.type] = 4; diff --git a/Projectiles/Boss/CirrusBlaster.cs b/Projectiles/Boss/CirrusBlaster.cs index ccb1697fb2..cefe1a51b7 100644 --- a/Projectiles/Boss/CirrusBlaster.cs +++ b/Projectiles/Boss/CirrusBlaster.cs @@ -44,7 +44,8 @@ namespace CalamityMod.Projectiles.Boss else if (Projectile.ai[0] >= 55f) { Projectile.ai[0] = 90f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, storedVelocity, ModContent.ProjectileType(), Projectile.damage, 0f, Projectile.owner, Projectile.ai[1], Projectile.whoAmI); + if (Projectile.owner == Main.myPlayer) + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, storedVelocity, ModContent.ProjectileType(), Projectile.damage, 0f, Projectile.owner, Projectile.ai[1], Projectile.whoAmI); SoundEngine.PlaySound(SANSFire, Projectile.Center); // Funny Gaster Blaster sounds #2 } diff --git a/Projectiles/Boss/RavagerBlaster.cs b/Projectiles/Boss/RavagerBlaster.cs index 7a9e0551f9..5bff5ee0a7 100644 --- a/Projectiles/Boss/RavagerBlaster.cs +++ b/Projectiles/Boss/RavagerBlaster.cs @@ -43,7 +43,8 @@ namespace CalamityMod.Projectiles.Boss else if (Projectile.ai[0] >= 55f) { Projectile.ai[0] = 90f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, storedVelocity, ModContent.ProjectileType(), Projectile.damage, 0f, Projectile.owner, Projectile.ai[1], Projectile.whoAmI); + if (Projectile.owner == Main.myPlayer) + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, storedVelocity, ModContent.ProjectileType(), Projectile.damage, 0f, Projectile.owner, Projectile.ai[1], Projectile.whoAmI); SoundEngine.PlaySound(SANSFire, Projectile.Center); //Funny Gaster Blaster sounds #2 } diff --git a/Projectiles/Boss/YharonFireball2.cs b/Projectiles/Boss/YharonFireball2.cs index bd31835b65..712a067b9f 100644 --- a/Projectiles/Boss/YharonFireball2.cs +++ b/Projectiles/Boss/YharonFireball2.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Projectiles.Boss public class YharonFireball2 : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Boss"; + public override string Texture => "CalamityMod/Projectiles/Boss/YharonFireball"; public static readonly SoundStyle FireballSound = new("CalamityMod/Sounds/Custom/Yharon/YharonFireball", 3); @@ -28,6 +29,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.width = 34; Projectile.height = 34; Projectile.hostile = true; + Projectile.Opacity = 0.25f; Projectile.alpha = 255; Projectile.penetrate = -1; Projectile.timeLeft = 3600; @@ -55,6 +57,26 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.frame >= Main.projFrames[Projectile.type]) Projectile.frame = 0; + if (Projectile.velocity.Y >= -16f) + { + if (Projectile.Opacity < 1f) + { + Projectile.Opacity = 1f; + SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); + int dustAmount = 36; + for (int i = 0; i < dustAmount; i++) + { + Vector2 dustSpawnPosition = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.5f; + dustSpawnPosition = dustSpawnPosition.RotatedBy((double)((float)(i - (dustAmount / 2 - 1)) * MathHelper.TwoPi / (float)dustAmount), default) + Projectile.Center; + Vector2 dustVelocity = dustSpawnPosition - Projectile.Center; + int dust = Dust.NewDust(dustSpawnPosition + dustVelocity, 0, 0, 55, dustVelocity.X, dustVelocity.Y); + Main.dust[dust].noGravity = true; + Main.dust[dust].noLight = true; + Main.dust[dust].velocity = dustVelocity; + } + } + } + if (Projectile.velocity.Y < -1f) { // 129 frames to get from -50 to -1 diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index c4e325877c..eabbb9cf29 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -2126,6 +2126,9 @@ namespace CalamityMod.Projectiles { if (projectile.type != ProjectileType()) projectile.extraUpdates += 1; + if (projectile.type == ProjectileID.MechanicalPiranha) + projectile.localNPCHitCooldown *= 2; + projectile.timeLeft *= 2; } if (modPlayer.camper && !player.StandingStill()) diff --git a/Projectiles/CalamityGlobalProjectileTweaks.cs b/Projectiles/CalamityGlobalProjectileTweaks.cs index 183f2cdb7c..95bbcb7c41 100644 --- a/Projectiles/CalamityGlobalProjectileTweaks.cs +++ b/Projectiles/CalamityGlobalProjectileTweaks.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using CalamityMod.World; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,6 +20,8 @@ namespace CalamityMod.Projectiles IProjectileTweak[] trueMeleeNoSpeed = Do(TrueMeleeNoSpeed); IProjectileTweak[] pointBlank = Do(PointBlank); IProjectileTweak[] standardBulletTweaks = Do(PointBlank, ExtraUpdatesDelta(+2)); + IProjectileTweak[] standardChainsawTweaks = Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+15), LocalIFrames(5)); + IProjectileTweak[] standardDrillTweaks = Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+25), LocalIFrames(5)); IProjectileTweak[] counterweightTweaks = Do(MaxUpdatesExact(2), IDStaticIFrames(10)); // Shorthand for changing all the stats of a yoyo at once. This handles extra update related math for you. @@ -112,6 +113,8 @@ namespace CalamityMod.Projectiles #endregion #region CATEGORY 2: Weapon/Enemy Balancing + { ProjectileID.AdamantiteChainsaw, standardChainsawTweaks }, + { ProjectileID.AdamantiteDrill, standardDrillTweaks }, { ProjectileID.Anchor, Do(ExtraUpdatesExact(1)) }, { ProjectileID.Bee, Do(PiercingExact(2)) }, { ProjectileID.BlackCounterweight, counterweightTweaks }, @@ -119,7 +122,11 @@ namespace CalamityMod.Projectiles { ProjectileID.BlueMoon, Do(ExtraUpdatesExact(1)) }, { ProjectileID.Bullet, standardBulletTweaks }, { ProjectileID.BulletHighVelocity, Do(PointBlank, LocalIFrames(-1)) }, - { ProjectileID.ButchersChainsaw, Do(TrueMeleeNoSpeed, ScaleExact(1.5f)) }, + { ProjectileID.ButchersChainsaw, Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+15), LocalIFrames(5), ScaleExact(1.5f)) }, + { ProjectileID.ChlorophyteChainsaw, standardChainsawTweaks }, + { ProjectileID.ChlorophyteDrill, standardDrillTweaks }, + { ProjectileID.CobaltChainsaw, standardChainsawTweaks }, + { ProjectileID.CobaltDrill, standardDrillTweaks }, { ProjectileID.CrystalBullet, standardBulletTweaks }, { ProjectileID.CrystalVileShardHead, Do(LocalIFrames(10)) }, { ProjectileID.CrystalVileShardShaft, Do(LocalIFrames(10)) }, @@ -139,44 +146,55 @@ namespace CalamityMod.Projectiles { ProjectileID.GiantBee, Do(PiercingExact(2)) }, { ProjectileID.GoldenBullet, standardBulletTweaks }, { ProjectileID.GreenCounterweight, counterweightTweaks }, + { ProjectileID.Hamdrax, standardDrillTweaks }, // Drax (never internally renamed since 1.1) { ProjectileID.IceBoomerang, Do(ExtraUpdatesExact(1)) }, { ProjectileID.IchorBullet, standardBulletTweaks }, { ProjectileID.InfluxWaver, Do(ExtraUpdatesExact(1)) }, + { ProjectileID.LaserDrill, Do(ArmorPenetrationDelta(+25), LocalIFrames(5)) }, { ProjectileID.LightDisc, Do(MaxUpdatesExact(3)) }, { ProjectileID.LostSoulHostile, Do(TileCollide) }, // Ragged Caster { ProjectileID.MeteorShot, standardBulletTweaks }, + { ProjectileID.Meowmere, Do(PiercingExact(3), LocalIFrames(-1)) }, { ProjectileID.MonkStaffT1, Do(TrueMeleeNoSpeed, ScaleExact(3f)) }, // Sleepy Octopod { ProjectileID.MonkStaffT2, Do(TrueMelee, IDStaticIFrames(18)) }, // Ghastly Glaive { ProjectileID.MonkStaffT3, Do(ScaleRatio(2f)) }, // Sky Dragon's Fury { ProjectileID.MoonlordBullet, standardBulletTweaks }, // Luminite Bullet + { ProjectileID.MythrilChainsaw, standardChainsawTweaks }, + { ProjectileID.MythrilDrill, standardDrillTweaks }, { ProjectileID.NanoBullet, standardBulletTweaks }, + { ProjectileID.NebulaDrill, standardDrillTweaks }, { ProjectileID.NebulaLaser, Do(ExtraUpdatesDelta(+1)) }, + { ProjectileID.OrichalcumChainsaw, standardChainsawTweaks }, + { ProjectileID.OrichalcumDrill, standardDrillTweaks }, + { ProjectileID.PalladiumChainsaw, standardChainsawTweaks }, + { ProjectileID.PalladiumDrill, standardDrillTweaks }, { ProjectileID.PartyBullet, standardBulletTweaks }, { ProjectileID.PoisonFang, Do(LocalIFrames(10)) }, { ProjectileID.PurpleCounterweight, counterweightTweaks }, { ProjectileID.QueenSlimeGelAttack, Do(NoPiercing) }, { ProjectileID.QueenSlimeMinionPinkBall, Do(NoPiercing) }, { ProjectileID.RedCounterweight, counterweightTweaks }, + { ProjectileID.SawtoothShark, Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+15), LocalIFrames(6)) }, { ProjectileID.ShadowBeamHostile, Do(TimeLeftExact(60)) }, { ProjectileID.Shroomerang, Do(ExtraUpdatesExact(1)) }, + { ProjectileID.SolarFlareDrill, standardDrillTweaks }, + { ProjectileID.StardustDrill, standardDrillTweaks }, { ProjectileID.StarWrath, Do(NoPiercing) }, { ProjectileID.Sunfury, Do(ExtraUpdatesExact(1)) }, + { ProjectileID.SwordBeam, Do(ExtraUpdatesExact(1)) }, // Beam Sword projectile + { ProjectileID.TitaniumChainsaw, standardChainsawTweaks }, + { ProjectileID.TitaniumDrill, standardDrillTweaks }, { ProjectileID.Trimarang, Do(ExtraUpdatesExact(1)) }, { ProjectileID.VenomBullet, standardBulletTweaks }, { ProjectileID.VenomFang, Do(LocalIFrames(10)) }, + { ProjectileID.VortexDrill, standardDrillTweaks }, { ProjectileID.YellowCounterweight, counterweightTweaks }, #endregion #region CATEGORY 3: True Melee support - { ProjectileID.AdamantiteChainsaw, trueMeleeNoSpeed }, - { ProjectileID.AdamantiteDrill, trueMeleeNoSpeed }, { ProjectileID.AdamantiteGlaive, trueMelee }, { ProjectileID.Arkhalis, trueMeleeNoSpeed }, - { ProjectileID.ChlorophyteChainsaw, trueMeleeNoSpeed }, - { ProjectileID.ChlorophyteDrill, trueMeleeNoSpeed }, { ProjectileID.ChlorophyteJackhammer, trueMeleeNoSpeed }, - { ProjectileID.CobaltChainsaw, trueMeleeNoSpeed }, - { ProjectileID.CobaltDrill, trueMeleeNoSpeed }, { ProjectileID.CobaltNaginata, trueMelee }, { ProjectileID.CopperShortswordStab, trueMelee }, { ProjectileID.DarkLance, trueMelee }, @@ -184,45 +202,31 @@ namespace CalamityMod.Projectiles { ProjectileID.GoldShortswordStab, trueMelee }, { ProjectileID.Gungnir, trueMelee }, { ProjectileID.HallowJoustingLance, trueMelee }, - { ProjectileID.Hamdrax, trueMeleeNoSpeed }, // Drax (never internally renamed since 1.1) { ProjectileID.IronShortswordStab, trueMelee }, { ProjectileID.JoustingLance, trueMelee }, { ProjectileID.LeadShortswordStab, trueMelee }, { ProjectileID.MushroomSpear, trueMelee }, - { ProjectileID.MythrilChainsaw, trueMeleeNoSpeed }, - { ProjectileID.MythrilDrill, trueMeleeNoSpeed }, { ProjectileID.MythrilHalberd, trueMelee }, { ProjectileID.NebulaChainsaw, trueMeleeNoSpeed }, - { ProjectileID.NebulaDrill, trueMeleeNoSpeed }, { ProjectileID.ObsidianSwordfish, trueMelee }, - { ProjectileID.OrichalcumChainsaw, trueMeleeNoSpeed }, - { ProjectileID.OrichalcumDrill, trueMeleeNoSpeed }, { ProjectileID.OrichalcumHalberd, trueMelee }, - { ProjectileID.PalladiumChainsaw, trueMeleeNoSpeed }, - { ProjectileID.PalladiumDrill, trueMeleeNoSpeed }, { ProjectileID.PalladiumPike, trueMelee }, { ProjectileID.PiercingStarlight, trueMelee }, { ProjectileID.PlatinumShortswordStab, trueMelee }, { ProjectileID.RulerStab, trueMelee }, - { ProjectileID.SawtoothShark, trueMeleeNoSpeed }, { ProjectileID.ShadowJoustingLance, trueMelee }, { ProjectileID.SilverShortswordStab, trueMelee }, { ProjectileID.SolarFlareChainsaw, trueMeleeNoSpeed }, - { ProjectileID.SolarFlareDrill, trueMeleeNoSpeed }, { ProjectileID.Spear, trueMelee }, { ProjectileID.StardustChainsaw, trueMeleeNoSpeed }, - { ProjectileID.StardustDrill, trueMeleeNoSpeed }, { ProjectileID.Swordfish, trueMelee }, { ProjectileID.Terragrim, trueMeleeNoSpeed }, { ProjectileID.TheRottedFork, trueMelee }, { ProjectileID.TinShortswordStab, trueMelee }, - { ProjectileID.TitaniumChainsaw, trueMeleeNoSpeed }, - { ProjectileID.TitaniumDrill, trueMeleeNoSpeed }, { ProjectileID.TitaniumTrident, trueMelee }, { ProjectileID.Trident, trueMelee }, { ProjectileID.TungstenShortswordStab, trueMelee }, { ProjectileID.VortexChainsaw, trueMeleeNoSpeed }, - { ProjectileID.VortexDrill, trueMeleeNoSpeed }, #endregion #region CATEGORY 4: Point Blank support @@ -345,6 +349,28 @@ namespace CalamityMod.Projectiles void ApplyTweak(Projectile proj); } + #region Built-In Armor Penetration + internal class ArmorPenetrationDeltaRule : IProjectileTweak + { + internal readonly int delta = 0; + + public ArmorPenetrationDeltaRule(int d) => delta = d; + public bool AppliesTo(Projectile proj) => true; + public void ApplyTweak(Projectile proj) => proj.ArmorPenetration += delta; + } + internal static IProjectileTweak ArmorPenetrationDelta(int d) => new ArmorPenetrationDeltaRule(d); + + internal class ArmorPenetrationExactRule : IProjectileTweak + { + internal readonly int armorPen = 0; + + public ArmorPenetrationExactRule(int a) => armorPen = a; + public bool AppliesTo(Projectile proj) => true; + public void ApplyTweak(Projectile proj) => proj.ArmorPenetration = armorPen; + } + internal static IProjectileTweak ArmorPenetrationExact(int a) => new ArmorPenetrationExactRule(a); + #endregion + #region Defense Damage internal class DefenseDamageRule : IProjectileTweak { diff --git a/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs b/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs index 2675611ef2..ebc322e266 100644 --- a/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs +++ b/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile.DamageType = DamageClass.Summon; Projectile.localNPCHitCooldown = 10; Projectile.width = Projectile.height = 16; - Projectile.timeLeft = 120; + Projectile.timeLeft = 300; Projectile.penetrate = -1; Projectile.friendly = true; @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal if (TimerToRedirect >= SnakeEyes.TimeToRedirect && !HasRedirected) { - if (TargetShot is not null) + if (TargetShot is not null && TargetShot.active) TargetEnemy(TargetShot); else if (Target is not null) TargetEnemy(Target); @@ -83,14 +83,10 @@ namespace CalamityMod.Projectiles.DraedonsArsenal if (HasRedirected) { - if (TargetShot is not null) + if (TargetShot is not null && TargetShot.active) FollowEnemy(TargetShot); else if (Target is not null) FollowEnemy(Target); - else - Projectile.Kill(); - - Projectile.timeLeft = 2; } for (int i = 0; i < 2; i++) diff --git a/Projectiles/Healing/AbsorberAura.cs b/Projectiles/Healing/AbsorberAura.cs index 03c29a479c..37e717607d 100644 --- a/Projectiles/Healing/AbsorberAura.cs +++ b/Projectiles/Healing/AbsorberAura.cs @@ -12,7 +12,7 @@ using Terraria.ID; using Terraria.ModLoader; using System.Collections.Generic; -namespace CalamityMod.Projectiles.Typless +namespace CalamityMod.Projectiles.Healing { public class AbsorberAura : ModProjectile, ILocalizedModType { @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Typless float targetDist = Vector2.Distance(player.Center, Projectile.Center); //Remove the players debuffs and defense damage, but only once per aura - if (targetDist < 232f) + if (targetDist < 310f) { player.AddBuff(ModContent.BuffType(), 600); if (cleanseList[playerIndex] == false) diff --git a/Projectiles/Healing/BlueJellyAura.cs b/Projectiles/Healing/BlueJellyAura.cs index 81418a9fad..8245496e2f 100644 --- a/Projectiles/Healing/BlueJellyAura.cs +++ b/Projectiles/Healing/BlueJellyAura.cs @@ -12,7 +12,7 @@ using Terraria.ID; using Terraria.ModLoader; using System.Collections.Generic; -namespace CalamityMod.Projectiles.Typless +namespace CalamityMod.Projectiles.Healing { public class BlueJellyAura : ModProjectile, ILocalizedModType { @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Typless float targetDist = Vector2.Distance(player.Center, Projectile.Center); //Remove the players debuffs and defense damage, but only once per aura - if (targetDist < 155f && cleanseList[playerIndex] == false) + if (targetDist < 165f && cleanseList[playerIndex] == false) { cleanseList[playerIndex] = true; CleansingEffect = 1; diff --git a/Projectiles/Healing/GreenJellyAura.cs b/Projectiles/Healing/GreenJellyAura.cs index 7002c05254..7a4f2e8d89 100644 --- a/Projectiles/Healing/GreenJellyAura.cs +++ b/Projectiles/Healing/GreenJellyAura.cs @@ -12,7 +12,7 @@ using Terraria.ID; using Terraria.ModLoader; using System.Collections.Generic; -namespace CalamityMod.Projectiles.Typless +namespace CalamityMod.Projectiles.Healing { public class GreenJellyAura : ModProjectile, ILocalizedModType { @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Typless float targetDist = Vector2.Distance(player.Center, Projectile.Center); //Remove the players debuffs and defense damage, but only once per aura - if (targetDist < 232f) + if (targetDist < 245f) { player.AddBuff(ModContent.BuffType(), 480); if (cleanseList[playerIndex] == false) diff --git a/Projectiles/Healing/PinkJellyAura.cs b/Projectiles/Healing/PinkJellyAura.cs index f906cb933a..461df9446b 100644 --- a/Projectiles/Healing/PinkJellyAura.cs +++ b/Projectiles/Healing/PinkJellyAura.cs @@ -10,7 +10,7 @@ using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Typless +namespace CalamityMod.Projectiles.Healing { public class PinkJellyAura : ModProjectile, ILocalizedModType { @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Typless { Player player = Main.player[playerIndex]; float targetDist = Vector2.Distance(player.Center, Projectile.Center); - if (targetDist < 155f) + if (targetDist < 165f) { player.AddBuff(ModContent.BuffType(), 300); } diff --git a/Projectiles/Magic/MagnaBlast.cs b/Projectiles/Magic/MagnaBlast.cs deleted file mode 100644 index f88859f7bc..0000000000 --- a/Projectiles/Magic/MagnaBlast.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Microsoft.Xna.Framework; -using System; -using Terraria; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Magic -{ - public class MagnaBlast : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Magic"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 16; - Projectile.height = 32; - Projectile.friendly = true; - Projectile.DamageType = DamageClass.Magic; - Projectile.penetrate = 1; - Projectile.timeLeft = 600; - } - - public override void AI() - { - if (Projectile.scale <= 1.6f) - { - Projectile.scale *= 1.01f; - Projectile.width = (int)(16f * Projectile.scale); - Projectile.height = (int)(32f * Projectile.scale); - } - Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X) + 1.57f; - Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.1f / 255f, (255 - Projectile.alpha) * 0.1f / 255f, (255 - Projectile.alpha) * 1f / 255f); - Projectile.localAI[0] += 1f; - if (Projectile.localAI[0] > 4f) - { - for (int num468 = 0; num468 < 3; num468++) - { - int num469 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 59, 0f, 0f, 100, default, Projectile.scale); - Main.dust[num469].noGravity = true; - Main.dust[num469].velocity *= 0f; - } - } - } - - public override void Kill(int timeLeft) - { - for (int k = 0; k < 10; k++) - { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 59, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); - } - } - } -} diff --git a/Projectiles/Magic/PhantasmalFuryProj.cs b/Projectiles/Magic/PhantasmalFuryProj.cs index 265c3f54c5..eb51d5d945 100644 --- a/Projectiles/Magic/PhantasmalFuryProj.cs +++ b/Projectiles/Magic/PhantasmalFuryProj.cs @@ -43,6 +43,10 @@ namespace CalamityMod.Projectiles.Magic if (Projectile.owner == Main.myPlayer) Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); } + if (Projectile.timeLeft < 100) + { + CalamityUtils.HomeInOnNPC(Projectile, true, 300f, 10f, 20f); + } Lighting.AddLight(Projectile.Center, 0.25f, 0.25f, 0.25f); diff --git a/Projectiles/Magic/ShiftingSandsProj.cs b/Projectiles/Magic/ShiftingSandsProj.cs index 3dbce5a91b..cb2b5cc174 100644 --- a/Projectiles/Magic/ShiftingSandsProj.cs +++ b/Projectiles/Magic/ShiftingSandsProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Magic/SoulPiercerBeam.cs b/Projectiles/Magic/SoulPiercerBeam.cs index f41b8f7b3a..27bc43185f 100644 --- a/Projectiles/Magic/SoulPiercerBeam.cs +++ b/Projectiles/Magic/SoulPiercerBeam.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.ignoreWater = true; Projectile.penetrate = -1; Projectile.extraUpdates = 100; - Projectile.timeLeft = 240; + Projectile.timeLeft = 360; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; } diff --git a/Projectiles/Magic/SupremeDustProjectile.cs b/Projectiles/Magic/SupremeDustProjectile.cs index 70680c262d..855c462864 100644 --- a/Projectiles/Magic/SupremeDustProjectile.cs +++ b/Projectiles/Magic/SupremeDustProjectile.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.ignoreWater = true; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; - Projectile.penetrate = 4; + Projectile.penetrate = 3; Projectile.MaxUpdates = 4; Projectile.timeLeft = 50 * Projectile.MaxUpdates; // 50 effective, 200 total Projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Melee/CosmicShivBall.cs b/Projectiles/Melee/CosmicShivBall.cs index ebd0317d35..be8cae2632 100644 --- a/Projectiles/Melee/CosmicShivBall.cs +++ b/Projectiles/Melee/CosmicShivBall.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Melee public bool initialized = false; public float startingVelocityY = 0f; public float randomAngleDelta = 0f; - public const float explosionDamageMultiplier = 1.8f; + public const float explosionDamageMultiplier = 1.5f; public override void SetDefaults() { Projectile.width = 12; @@ -47,7 +47,6 @@ namespace CalamityMod.Projectiles.Melee Main.dust[dustID].noGravity = true; Main.dust[dustID].velocity *= 0f; } - Projectile.velocity.Y *= 0.965f; } if (Projectile.localAI[0] % 30 == 0) // every 0.5 seconds { @@ -60,21 +59,16 @@ namespace CalamityMod.Projectiles.Melee Vector2 idealVelocity = Projectile.SafeDirectionTo(target.Center, Vector2.UnitX) * homingSpeed; Projectile.velocity = (Projectile.velocity * (inertia - 1f) + idealVelocity) / inertia; } - else - { - Projectile.ai[0]++; - Projectile.velocity.Y = startingVelocityY + (float)(Math.Cos(Projectile.ai[0] / 12D + randomAngleDelta) * 7D); - } } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { // for spawning the side beams - for (int i = 0; i < 3; i++) + for (int i = 0; i < 2; i++) { int directionSign = Main.rand.NextBool(2).ToDirectionInt(); Vector2 spawnPos = new Vector2(target.Center.X + directionSign * 650, Projectile.Center.Y + Main.rand.Next(-500, 501)); Vector2 velocity = Vector2.Normalize(target.Center - spawnPos) * 30f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos.X, spawnPos.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * 0.1f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos.X, spawnPos.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), (int)(Projectile.damage * 0.8f), Projectile.knockBack * 0.1f, Projectile.owner); } int starMax = Main.rand.Next(6, 11); // 6 to 10 stars for (int i = -starMax / 2; i < starMax / 2; i++) @@ -82,7 +76,7 @@ namespace CalamityMod.Projectiles.Melee int ySpawnAdditive = Main.rand.Next(-40, 41); Vector2 toSpawn = target.Center - new Vector2(0f, 800f + ySpawnAdditive).RotatedBy(MathHelper.ToRadians(i * 11f / starMax)); Vector2 toTarget = Vector2.Normalize(target.Center - toSpawn) * 35f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), toSpawn, toTarget, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack * 0.5f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), toSpawn, toTarget, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * 0.5f, Projectile.owner); } target.AddBuff(ModContent.BuffType(), 60); } diff --git a/Projectiles/Melee/CosmicShivBlade.cs b/Projectiles/Melee/CosmicShivBlade.cs index f9fcbc6139..7ea7599c5b 100644 --- a/Projectiles/Melee/CosmicShivBlade.cs +++ b/Projectiles/Melee/CosmicShivBlade.cs @@ -22,6 +22,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = penetrateMax; Projectile.tileCollide = false; Projectile.timeLeft = 290; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 5; } public override void AI() { @@ -58,16 +60,8 @@ namespace CalamityMod.Projectiles.Melee } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (Projectile.penetrate == penetrateMax) - { - Projectile.damage /= 15; - } - else - { - Projectile.scale += (maxScale - 1) / (float)penetrateMax; - } + Projectile.scale += (maxScale - 1) / (float)penetrateMax; Projectile.ai[1] = 5 + Main.rand.Next(-2, 3); - target.immune[Projectile.owner] = 0; //so that all blades can hit the enemy target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Melee/Exobeam.cs b/Projectiles/Melee/Exobeam.cs index 75cae7c52a..92d74dc7aa 100644 --- a/Projectiles/Melee/Exobeam.cs +++ b/Projectiles/Melee/Exobeam.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = 1; Projectile.extraUpdates = 1; Projectile.alpha = 255; - Projectile.timeLeft = 600; + Projectile.timeLeft = 360; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = Projectile.MaxUpdates * 12; } diff --git a/Projectiles/Melee/GaelSkull.cs b/Projectiles/Melee/GaelSkull.cs index 0c892b0dfe..d3c1282a0b 100644 --- a/Projectiles/Melee/GaelSkull.cs +++ b/Projectiles/Melee/GaelSkull.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; Projectile.ignoreWater = true; - Projectile.penetrate = 2; + Projectile.penetrate = 1; Projectile.timeLeft = 600; Projectile.light = 1f; Projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Melee/GalaxyStar.cs b/Projectiles/Melee/GalaxyStar.cs index 7b6c229d55..6fffa74c23 100644 --- a/Projectiles/Melee/GalaxyStar.cs +++ b/Projectiles/Melee/GalaxyStar.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = 1; Projectile.tileCollide = false; Projectile.timeLeft = 160; + Projectile.extraUpdates = 2; } public override void AI() { diff --git a/Projectiles/Melee/GalileosMoon.cs b/Projectiles/Melee/GalileosMoon.cs index 9d2601d578..5f3d6c1c25 100644 --- a/Projectiles/Melee/GalileosMoon.cs +++ b/Projectiles/Melee/GalileosMoon.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; Projectile.tileCollide = false; - Projectile.penetrate = 12; + Projectile.penetrate = -1; Projectile.extraUpdates = 1; Projectile.timeLeft = 135 * Projectile.MaxUpdates; Projectile.ignoreWater = true; diff --git a/Projectiles/Melee/ScourgeoftheCosmosMini.cs b/Projectiles/Melee/ScourgeoftheCosmosMini.cs index 4282ffed8c..6836a73f50 100644 --- a/Projectiles/Melee/ScourgeoftheCosmosMini.cs +++ b/Projectiles/Melee/ScourgeoftheCosmosMini.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.DamageType = DamageClass.MeleeNoSpeed; Projectile.alpha = 255; Projectile.penetrate = 1; - Projectile.timeLeft = 300; - Projectile.extraUpdates = 3; + Projectile.timeLeft = 375; + Projectile.extraUpdates = 4; } public override bool? CanHitNPC(NPC target) => Projectile.timeLeft < 270 && target.CanBeChasedBy(Projectile); @@ -53,12 +53,12 @@ namespace CalamityMod.Projectiles.Melee for (int num369 = 0; num369 < 1; num369++) { int dustType = Main.rand.NextBool(3) ? 56 : 242; - float num370 = Projectile.velocity.X / 3f * num369; - float num371 = Projectile.velocity.Y / 3f * num369; + float dustX = Projectile.velocity.X / 3f * num369; + float dustY = Projectile.velocity.Y / 3f * num369; int num372 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 0, default, 1f); Dust dust = Main.dust[num372]; - dust.position.X = Projectile.Center.X - num370; - dust.position.Y = Projectile.Center.Y - num371; + dust.position.X = Projectile.Center.X - dustX; + dust.position.Y = Projectile.Center.Y - dustY; dust.velocity *= 0f; dust.scale = 0.5f; } @@ -68,41 +68,40 @@ namespace CalamityMod.Projectiles.Melee float num373 = Projectile.position.X; float num374 = Projectile.position.Y; float num375 = 100000f; - bool flag10 = false; + bool isHoming = false; Projectile.ai[0] += 1f; if (Projectile.ai[0] > 30f) { Projectile.ai[0] = 30f; - for (int num376 = 0; num376 < Main.maxNPCs; num376++) + for (int enemy = 0; enemy < Main.maxNPCs; enemy++) { - if (Main.npc[num376].CanBeChasedBy(Projectile, false)) + if (Main.npc[enemy].CanBeChasedBy(Projectile, false)) { - float num377 = Main.npc[num376].position.X + Main.npc[num376].width / 2; - float num378 = Main.npc[num376].position.Y + Main.npc[num376].height / 2; - float num379 = Math.Abs(Projectile.position.X + Projectile.width / 2 - num377) + Math.Abs(Projectile.position.Y + Projectile.height / 2 - num378); - if (num379 < 800f && num379 < num375 && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, Main.npc[num376].position, Main.npc[num376].width, Main.npc[num376].height)) + float enemyX = Main.npc[enemy].position.X + Main.npc[enemy].width / 2; + float enemyY = Main.npc[enemy].position.Y + Main.npc[enemy].height / 2; + float enemyDistance = Math.Abs(Projectile.position.X + Projectile.width / 2 - enemyX) + Math.Abs(Projectile.position.Y + Projectile.height / 2 - enemyY); + if (enemyDistance < 800f && enemyDistance < num375 && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, Main.npc[enemy].position, Main.npc[enemy].width, Main.npc[enemy].height)) { - num375 = num379; - num373 = num377; - num374 = num378; - flag10 = true; + num375 = enemyDistance; + num373 = enemyX; + num374 = enemyY; + isHoming = true; } } } } - if (!flag10) + if (!isHoming) { num373 = Projectile.position.X + Projectile.width / 2 + Projectile.velocity.X * 100f; num374 = Projectile.position.Y + Projectile.height / 2 + Projectile.velocity.Y * 100f; } - float num380 = 10f; float num381 = 0.16f; Vector2 vector30 = new Vector2(Projectile.position.X + Projectile.width * 0.5f, Projectile.position.Y + Projectile.height * 0.5f); float num382 = num373 - vector30.X; float num383 = num374 - vector30.Y; float num384 = (float)Math.Sqrt(num382 * num382 + num383 * num383); - num384 = num380 / num384; + num384 = 10f / num384; num382 *= num384; num383 *= num384; if (Projectile.velocity.X < num382) diff --git a/Projectiles/Melee/ScourgeoftheCosmosProj.cs b/Projectiles/Melee/ScourgeoftheCosmosProj.cs index 06d3711db8..bbfdd8bb5d 100644 --- a/Projectiles/Melee/ScourgeoftheCosmosProj.cs +++ b/Projectiles/Melee/ScourgeoftheCosmosProj.cs @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Melee float num629 = Main.rand.Next(-35, 36) * 0.02f; num628 *= 10f; num629 *= 10f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.position.X, Projectile.position.Y, num628, num629, ModContent.ProjectileType(), (int)(Projectile.damage * 0.7), Projectile.knockBack * 0.35f, Main.myPlayer); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.position.X, Projectile.position.Y, num628, num629, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75), Projectile.knockBack * 0.35f, Main.myPlayer); num3 = num627; } } diff --git a/Projectiles/Melee/Shortswords/CosmicShivProj.cs b/Projectiles/Melee/Shortswords/CosmicShivProj.cs index 239fa21fb0..5a56e3b252 100644 --- a/Projectiles/Melee/Shortswords/CosmicShivProj.cs +++ b/Projectiles/Melee/Shortswords/CosmicShivProj.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Melee.Shortswords public override Action EffectBeforePullback => (proj) => { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 14f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5), Projectile.knockBack, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 14f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f); }; public override void SetVisualOffsets() diff --git a/Projectiles/Melee/Shortswords/GalileoGladiusProj.cs b/Projectiles/Melee/Shortswords/GalileoGladiusProj.cs index 4c4cec01ca..f855f9c6a8 100644 --- a/Projectiles/Melee/Shortswords/GalileoGladiusProj.cs +++ b/Projectiles/Melee/Shortswords/GalileoGladiusProj.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Melee.Shortswords public override Action EffectBeforePullback => (proj) => { - int moonDamage = (int)(Projectile.damage * 0.3333f); + int moonDamage = (int)(Projectile.damage * 0.6f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 10f, ModContent.ProjectileType(), moonDamage, Projectile.knockBack, Projectile.owner, 0f, 0f); }; diff --git a/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs b/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs new file mode 100644 index 0000000000..c8b4c7794c --- /dev/null +++ b/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs @@ -0,0 +1,288 @@ +using System; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using ReLogic.Utilities; +using Terraria; +using Terraria.Audio; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class ArcNovaDiffuserHoldout : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + private Player Owner => Main.player[Projectile.owner]; + public SlotId NovaChargeStartSlot; + public SlotId NovaChargeLoopSlot; + + public float CurrentChargingFrames = 0f; + + private ref float ShotsLoaded => ref Projectile.ai[1]; //arrowsloaded + + private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; + private float storedVelocity = 12f; + public const float velocityMultiplier = 1.2f; + public int Time = 0; + public int SoundSpamFix = 0; + public bool FirstLoop = true; + public bool ChargeLV1 = false; + public bool ChargeLV2 = false; + public float Aftershot = ArcNovaDiffuser.AftershotCooldownFrames; + public int SoundVariable = 5; + public bool NovaRing = false; + public bool ThrowItBack = false; + public float Recoil = 0; + public bool PostFireEnergy = true; + + public override string Texture => "CalamityMod/Items/Weapons/Ranged/ArcNovaDiffuser"; + + public override void SetDefaults() + { + Projectile.width = 72; + Projectile.height = 38; + Projectile.friendly = true; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.DamageType = DamageClass.Ranged; + Projectile.ignoreWater = true; + } + + public override void AI() + { + Player player = Main.player[Projectile.owner]; + if (player.dead) // destroy the holdout if the player dies + { + Projectile.Kill(); + return; + } + + Vector2 armPosition = Owner.RotatedRelativePoint(Owner.MountedCenter, true); + Vector2 tipPosition = armPosition + Projectile.velocity * Projectile.width * 0.95f; + + // Fire if the owner stops channeling or otherwise cannot use the weapon. + if (!OwnerCanShoot) + { + + if (Aftershot == ArcNovaDiffuser.AftershotCooldownFrames) + { + if (SoundEngine.TryGetActiveSound(NovaChargeStartSlot, out var NovaCharge2)) + NovaCharge2.Stop(); + if (SoundEngine.TryGetActiveSound(NovaChargeLoopSlot, out var NovaChargeLoop2)) + NovaChargeLoop2.Stop(); + + if (ChargeLV2) // Big Shot Mode + { + SoundEngine.PlaySound(ArcNovaDiffuser.BigShot, Projectile.position); + CurrentChargingFrames = 0; + ShotsLoaded = 0; + Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * storedVelocity; + int charge2Damage = Projectile.damage * 20; + float charge2KB = Projectile.knockBack * 3f; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, shootVelocity, ModContent.ProjectileType(), charge2Damage, charge2KB, Projectile.owner); + Main.player[Projectile.owner].Calamity().GeneralScreenShakePower = 5; + for (int i = 0; i <= 20; i++) + { + Dust dust = Dust.NewDustPerfect(tipPosition, 107, shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.2f, 1.2f), 0, default, Main.rand.NextFloat(1.5f, 2.3f)); + dust.noGravity = true; + } + ThrowItBack = true; + Recoil = 10; + Aftershot -= 0.5f; + } + else //Rapid Fire Mode + { + if (SoundSpamFix >= (ChargeLV1 ? 7 : 8)) //Shoot faster if fully charged + SoundSpamFix = 0; + + if (SoundSpamFix == (ChargeLV1 ? 6 : 7))//Recoil should be 1 frame lower than above frames + ThrowItBack = false; + + if (ShotsLoaded <= 0f) + { + --Aftershot; + } + Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * storedVelocity; + if (SoundSpamFix == 0) + { + for (int i = 0; i <= 3; i++) + { + Dust dust = Dust.NewDustPerfect(tipPosition, 107, shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.9f, 1.2f), 0, default, Main.rand.NextFloat(1.3f, 1.7f)); + dust.noGravity = true; + } + ThrowItBack = true; + Recoil = 16; + Vector2 fireVec = shootVelocity.RotatedByRandom(MathHelper.ToRadians(2f)); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, fireVec, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + SoundEngine.PlaySound(ArcNovaDiffuser.SmallShot, Projectile.position); + --ShotsLoaded; + } + Recoil += 1; + SoundSpamFix++; + + CurrentChargingFrames = 0; + } + } + else + { + if (ChargeLV2) + { + if (Recoil >= 30) + { + ThrowItBack = false; + } + Recoil += 2; + Aftershot -= 0.5f; + } + else + --Aftershot; + } + + if (ShotsLoaded == 0 && PostFireEnergy) + { + for (int i = 0; i < 6; i++) + { + SparkParticle spark2 = new SparkParticle((tipPosition - Projectile.velocity * 3) + Main.rand.NextVector2Circular(10, 10), -Projectile.velocity * Main.rand.NextFloat(9.1f, 17.8f), false, Main.rand.Next(9, 12), Main.rand.NextFloat(0.2f, 0.3f), Main.rand.NextBool(4) ? Color.Chartreuse : Color.Lime); + GeneralParticleHandler.SpawnParticle(spark2); + } + PostFireEnergy = false; + } + + if (Aftershot <= 0) + Projectile.Kill(); + } + else + { + if (CurrentChargingFrames == 0) + { + CurrentChargingFrames++; + } + + if (CurrentChargingFrames % 13 == 0 && !ChargeLV1) //every 13 frames get another shot + ShotsLoaded++; + + if (CurrentChargingFrames >= 10) + { + for (int i = 0; i < (ChargeLV2 ? 4 : ChargeLV1 ? 3 : 2); i++) + { + SparkParticle spark2 = new SparkParticle((tipPosition -Projectile.velocity * 4) + Main.rand.NextVector2Circular(12, 12), -Projectile.velocity * Main.rand.NextFloat(16.1f, 30.8f), false, Main.rand.Next(2, 7), Main.rand.NextFloat(CurrentChargingFrames / 350, CurrentChargingFrames / 270), Main.rand.NextBool(4) ? Color.Chartreuse : Color.Lime); + GeneralParticleHandler.SpawnParticle(spark2); + } + Particle orb = new GenericBloom(tipPosition, Projectile.velocity, Color.Lime, CurrentChargingFrames / 270, 2); + GeneralParticleHandler.SpawnParticle(orb); + Particle orb2 = new GenericBloom(tipPosition, Projectile.velocity, Color.White, CurrentChargingFrames / 400, 2); + GeneralParticleHandler.SpawnParticle(orb2); + } + if (CurrentChargingFrames == 10) + { + NovaChargeStartSlot = SoundEngine.PlaySound(ArcNovaDiffuser.ChargeStart, Projectile.position); + } + // Start Charging. + if (CurrentChargingFrames < ArcNovaDiffuser.Charge2Frames + 2) //308 is when you reach LV2 charge + { + if (ChargeLV1) + CurrentChargingFrames += 2; + else + CurrentChargingFrames++; + } + + if (CurrentChargingFrames >= ArcNovaDiffuser.Charge1Frames) //146 frames is durration of charge sound + { + Time++; + if (CurrentChargingFrames == ArcNovaDiffuser.Charge1Frames) + { + SoundEngine.PlaySound(ArcNovaDiffuser.ChargeLV1, Projectile.position); + ShotsLoaded = 15; + ChargeLV1 = true; + } + if (FirstLoop) + { + NovaChargeLoopSlot = SoundEngine.PlaySound(ArcNovaDiffuser.ChargeLoop, Projectile.position); + FirstLoop = false; + } + if (Time % ArcNovaDiffuser.ChargeLoopSoundFrames == 0) //Loop sound is 151 frames long + { + NovaChargeLoopSlot = SoundEngine.PlaySound(ArcNovaDiffuser.ChargeLoop, Projectile.position); + } + } + + if (CurrentChargingFrames >= ArcNovaDiffuser.Charge2Frames) //Stuff for reaching charge LV2 + { + if (CurrentChargingFrames == ArcNovaDiffuser.Charge2Frames) + { + SoundEngine.PlaySound(ArcNovaDiffuser.ChargeLV2, Projectile.position); + ChargeLV2 = true; + } + } + + if (CurrentChargingFrames == ArcNovaDiffuser.Charge1Frames) + { + for (int i = 0; i < 36; i++) + { + Dust chargefull = Dust.NewDustPerfect(tipPosition, 107); + chargefull.velocity = (MathHelper.TwoPi * i / 36f).ToRotationVector2() * 8f + Owner.velocity; + chargefull.scale = Main.rand.NextFloat(1f, 1.3f); + chargefull.noGravity = true; + } + } + if (CurrentChargingFrames == ArcNovaDiffuser.Charge2Frames) + { + for (int i = 0; i < 45; i++) + { + Dust chargefull = Dust.NewDustPerfect(tipPosition, 107); + chargefull.velocity = (MathHelper.TwoPi * i / 36f).ToRotationVector2() * 12f + Owner.velocity; + chargefull.scale = Main.rand.NextFloat(1.2f, 1.4f); + chargefull.noGravity = true; + } + } + } + if (SoundEngine.TryGetActiveSound(NovaChargeLoopSlot, out var NovaChargeLoop) && NovaChargeLoop.IsPlaying) + NovaChargeLoop.Position = Projectile.Center; + if (SoundEngine.TryGetActiveSound(NovaChargeStartSlot, out var NovaCharge) && NovaCharge.IsPlaying) + NovaCharge.Position = Projectile.Center; + UpdateProjectileHeldVariables(armPosition); + ManipulatePlayerVariables(); + } + + private void UpdateProjectileHeldVariables(Vector2 armPosition) + { + if (Main.myPlayer == Projectile.owner) + { + float interpolant = Utils.GetLerpValue(5f, 25f, Projectile.Distance(Main.MouseWorld), true); + Vector2 oldVelocity = Projectile.velocity; + Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.SafeDirectionTo(Main.MouseWorld), interpolant); + } + Player player = Main.player[Projectile.owner]; + Projectile.Center = (player.RotatedRelativePoint(player.MountedCenter, true) + Projectile.velocity * (ThrowItBack ? Recoil : 30)) + new Vector2 (0, 7); + Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + Projectile.spriteDirection = Projectile.direction; + Projectile.timeLeft = 2; + player.ChangeDir(Projectile.direction); + player.heldProj = Projectile.whoAmI; + player.itemTime = 2; + player.itemAnimation = 2; + player.itemRotation = (float)Math.Atan2(Projectile.velocity.Y * Projectile.direction, Projectile.velocity.X * Projectile.direction); + Projectile.position += Main.rand.NextVector2Circular(CurrentChargingFrames / 70f, CurrentChargingFrames / 70f); //rumble features + + } + + private void ManipulatePlayerVariables() + { + Owner.ChangeDir(Projectile.direction); + Owner.heldProj = Projectile.whoAmI; + Owner.itemTime = 2; + Owner.itemAnimation = 2; + Owner.itemRotation = (Projectile.velocity * Projectile.direction).ToRotation(); + } + public override void Kill(int timeLeft) + { + if (SoundEngine.TryGetActiveSound(NovaChargeStartSlot, out var NovaCharge)) + NovaCharge.Stop(); + if (SoundEngine.TryGetActiveSound(NovaChargeLoopSlot, out var NovaChargeLoop)) + NovaChargeLoop.Stop(); + CurrentChargingFrames = 0; + } + + public override bool? CanDamage() => false; + } +} diff --git a/Projectiles/Ranged/BloodfireArrowProj.cs b/Projectiles/Ranged/BloodfireArrowProj.cs index f860ee2b96..fea561969f 100644 --- a/Projectiles/Ranged/BloodfireArrowProj.cs +++ b/Projectiles/Ranged/BloodfireArrowProj.cs @@ -59,9 +59,6 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[num9].velocity = Vector2.Normalize(Projectile.Center - Projectile.velocity * 3f - Main.dust[num9].position) * 1.25f; } } - - if (Projectile.ai[1] == 80f) //means it's from Arterial Assault's wooden arrow conversion - CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Ranged/TerraFireGreen2.cs b/Projectiles/Ranged/ElementalFire.cs similarity index 97% rename from Projectiles/Ranged/TerraFireGreen2.cs rename to Projectiles/Ranged/ElementalFire.cs index 0989276c84..734170923d 100644 --- a/Projectiles/Ranged/TerraFireGreen2.cs +++ b/Projectiles/Ranged/ElementalFire.cs @@ -5,7 +5,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class TerraFireGreen2 : ModProjectile, ILocalizedModType + public class ElementalFire : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; diff --git a/Projectiles/Ranged/FlareBat.cs b/Projectiles/Ranged/FlareBat.cs index 85ca86d3fa..1b2cf87985 100644 --- a/Projectiles/Ranged/FlareBat.cs +++ b/Projectiles/Ranged/FlareBat.cs @@ -70,13 +70,13 @@ namespace CalamityMod.Projectiles.Ranged // Makes the bat home onto enemies after piercing once if (Projectile.penetrate == 1 && Projectile.localAI[0] <= 0f) - CalamityUtils.HomeInOnNPC(Projectile, false, 500f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, false, 550f, 12f, 20f); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.OnFire3, 480); - Projectile.localAI[0] = 10f; + Projectile.localAI[0] = 8f; Projectile.damage /= 2; } diff --git a/Projectiles/Ranged/HalleysComet.cs b/Projectiles/Ranged/HalleysComet.cs index e99c03a1c6..bdb9e589ee 100644 --- a/Projectiles/Ranged/HalleysComet.cs +++ b/Projectiles/Ranged/HalleysComet.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.Ranged; - Projectile.penetrate = 10; + Projectile.penetrate = 4; Projectile.extraUpdates = 10; Projectile.timeLeft = 600; } diff --git a/Projectiles/Ranged/MagnaCannonHoldout.cs b/Projectiles/Ranged/MagnaCannonHoldout.cs new file mode 100644 index 0000000000..2a1cf51e61 --- /dev/null +++ b/Projectiles/Ranged/MagnaCannonHoldout.cs @@ -0,0 +1,225 @@ +using System; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using ReLogic.Utilities; +using Terraria; +using Terraria.Audio; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class MagnaCannonHoldout : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + private Player Owner => Main.player[Projectile.owner]; + public SlotId MagnaChargeSlot; + public SlotId MagnaChargeLoopSlot; + public SlotId MagnaChargeFirstLoopSlot; + + private float CurrentChargingFrames = 0f; + public int Fullchargesoundframes = 42; + + private ref float ShotsLoaded => ref Projectile.ai[1]; //arrowsloaded + + private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; + private float storedVelocity = 12f; + public const float velocityMultiplier = 1.2f; + public bool Extradamage; + public int Time = 0; + public int SoundSpamFix = 0; + public bool FirstLoop = true; + public bool FullCharge = false; + public int Aftershot = MagnaCannon.AftershotCooldownFrames; + + public override string Texture => "CalamityMod/Items/Weapons/Ranged/MagnaCannon"; + + public override void SetDefaults() + { + Projectile.width = 58; + Projectile.height = 30; + Projectile.friendly = true; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.DamageType = DamageClass.Ranged; + Projectile.ignoreWater = true; + } + + public override void AI() + { + Player player = Main.player[Projectile.owner]; + if (player.dead) // destroy the holdout if the player dies + { + Projectile.Kill(); + return; + } + + if (CurrentChargingFrames >= 88) + Extradamage = true; + else + Extradamage = false; + + Vector2 armPosition = Owner.RotatedRelativePoint(Owner.MountedCenter, true); + Vector2 tipPosition = armPosition + Projectile.velocity * Projectile.width * 0.9f; + + // Fire if the owner stops channeling or otherwise cannot use the weapon. + if (!OwnerCanShoot) + { + if (Aftershot == MagnaCannon.AftershotCooldownFrames) + { + if (SoundEngine.TryGetActiveSound(MagnaChargeSlot, out var MagnaCharge2)) + MagnaCharge2.Stop(); + if (SoundEngine.TryGetActiveSound(MagnaChargeLoopSlot, out var MagnaChargeLoop2)) + MagnaChargeLoop2.Stop(); + if (SoundEngine.TryGetActiveSound(MagnaChargeLoopSlot, out var MagnaChargeFirstLoop2)) + MagnaChargeFirstLoop2.Stop(); + + if (SoundSpamFix >= (FullCharge ? 4 : 5)) //Shoot faster if fully charged + SoundSpamFix = 0; + + if (ShotsLoaded <= 0f) + { + --Aftershot; + } + Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * storedVelocity; + if (SoundSpamFix == 0) + { + for (int i = 0; i <= 3; i++) + { + Dust dust = Dust.NewDustPerfect(tipPosition, 187, shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.9f, 1.2f), 0, default, Main.rand.NextFloat(1.5f, 2.3f)); + dust.noGravity = true; + } + SoundEngine.PlaySound(MagnaCannon.Fire, Projectile.position); + --ShotsLoaded; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, shootVelocity.RotatedByRandom(MathHelper.ToRadians(9f)), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * (Extradamage ? 3 : 1), Projectile.owner); + } + + SoundSpamFix++; + + CurrentChargingFrames = 0; + } + else + --Aftershot; + + if (Aftershot == 0) + Projectile.Kill(); + } + else + { + if (CurrentChargingFrames == 0) + CurrentChargingFrames++; + + if (CurrentChargingFrames % 9 == 0) //every 9 frames get another shot + ShotsLoaded++; + + if (CurrentChargingFrames >= 10) + { + if (CurrentChargingFrames < MagnaCannon.FullChargeFrames) + { + Particle streak = new ManaDrainStreak(player, Main.rand.NextFloat(0.06f + (CurrentChargingFrames / 180), 0.08f + (CurrentChargingFrames / 180)), Main.rand.NextVector2CircularEdge(2f, 2f) * Main.rand.NextFloat(0.3f * CurrentChargingFrames, 0.3f * CurrentChargingFrames), 0f, Color.White, Color.Aqua, 7, tipPosition); + GeneralParticleHandler.SpawnParticle(streak); + } + Particle orb = new GenericBloom(tipPosition, Projectile.velocity, Color.DarkBlue, CurrentChargingFrames / 135, 2); + GeneralParticleHandler.SpawnParticle(orb); + Particle orb2 = new GenericBloom(tipPosition, Projectile.velocity, Color.Aqua, CurrentChargingFrames / 200, 2); + GeneralParticleHandler.SpawnParticle(orb2); + } + if (CurrentChargingFrames == 10) + { + MagnaChargeSlot = SoundEngine.PlaySound(MagnaCannon.ChargeStart, Projectile.position); + } + // Start Charging. + if (CurrentChargingFrames < MagnaCannon.FullChargeFrames + 2) + { + ++CurrentChargingFrames; + } + + if (CurrentChargingFrames >= MagnaCannon.FullChargeFrames) //128 frames is durration of charge sound + { + Fullchargesoundframes--; + Time++; + if (CurrentChargingFrames == MagnaCannon.FullChargeFrames) + { + SoundEngine.PlaySound(MagnaCannon.ChargeFull, Projectile.position); + ShotsLoaded = 20; + FullCharge = true; + } + if (Fullchargesoundframes <= 0) + { + if (FirstLoop) + { + MagnaChargeFirstLoopSlot = MagnaChargeLoopSlot = SoundEngine.PlaySound(MagnaCannon.ChargeLoop, Projectile.position); + FirstLoop = false; + } + if (Time % MagnaCannon.ChargeLoopSoundFrames == 0) + { + MagnaChargeLoopSlot = SoundEngine.PlaySound(MagnaCannon.ChargeLoop, Projectile.position); + } + } + } + + if (CurrentChargingFrames == MagnaCannon.FullChargeFrames) + { + for (int i = 0; i < 36; i++) + { + Dust chargefull = Dust.NewDustPerfect(tipPosition, 160); + chargefull.velocity = (MathHelper.TwoPi * i / 36f).ToRotationVector2() * 18f + Owner.velocity; + chargefull.scale = Main.rand.NextFloat(1f, 1.5f); + chargefull.noGravity = true; + } + } + } + if (SoundEngine.TryGetActiveSound(MagnaChargeLoopSlot, out var MagnaChargeLoop) && MagnaChargeLoop.IsPlaying) + MagnaChargeLoop.Position = Projectile.Center; + if (SoundEngine.TryGetActiveSound(MagnaChargeFirstLoopSlot, out var MagnaChargeFirstLoop) && MagnaChargeFirstLoop.IsPlaying) + MagnaChargeFirstLoop.Position = Projectile.Center; + if (SoundEngine.TryGetActiveSound(MagnaChargeSlot, out var MagnaCharge) && MagnaCharge.IsPlaying) + MagnaCharge.Position = Projectile.Center; + UpdateProjectileHeldVariables(armPosition); + ManipulatePlayerVariables(); + } + + private void UpdateProjectileHeldVariables(Vector2 armPosition) + { + if (Main.myPlayer == Projectile.owner) + { + float interpolant = Utils.GetLerpValue(5f, 25f, Projectile.Distance(Main.MouseWorld), true); + Vector2 oldVelocity = Projectile.velocity; + Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.SafeDirectionTo(Main.MouseWorld), interpolant); + } + Player player = Main.player[Projectile.owner]; + Projectile.Center = player.RotatedRelativePoint(player.MountedCenter, true) + Projectile.velocity * 20; + Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + Projectile.spriteDirection = Projectile.direction; + Projectile.timeLeft = 2; + player.ChangeDir(Projectile.direction); + player.heldProj = Projectile.whoAmI; + player.itemTime = 2; + player.itemAnimation = 2; + player.itemRotation = (float)Math.Atan2(Projectile.velocity.Y * Projectile.direction, Projectile.velocity.X * Projectile.direction); + Projectile.position += Main.rand.NextVector2Circular(CurrentChargingFrames / 43f, CurrentChargingFrames / 43f); //rumble features + + } + + private void ManipulatePlayerVariables() + { + Owner.ChangeDir(Projectile.direction); + Owner.heldProj = Projectile.whoAmI; + Owner.itemTime = 2; + Owner.itemAnimation = 2; + Owner.itemRotation = (Projectile.velocity * Projectile.direction).ToRotation(); + } + public override void Kill(int timeLeft) + { + if (SoundEngine.TryGetActiveSound(MagnaChargeSlot, out var MagnaCharge)) + MagnaCharge.Stop(); + if (SoundEngine.TryGetActiveSound(MagnaChargeLoopSlot, out var MagnaChargeLoop)) + MagnaChargeLoop.Stop(); + if (SoundEngine.TryGetActiveSound(MagnaChargeLoopSlot, out var MagnaChargeFirstLoop)) + MagnaChargeFirstLoop.Stop(); + CurrentChargingFrames = 0; + } + + public override bool? CanDamage() => false; + } +} diff --git a/Projectiles/Ranged/MagnaShot.cs b/Projectiles/Ranged/MagnaShot.cs new file mode 100644 index 0000000000..5b667b8fda --- /dev/null +++ b/Projectiles/Ranged/MagnaShot.cs @@ -0,0 +1,56 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Ranged +{ + public class MagnaShot : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; + ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + } + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 5; + Projectile.friendly = true; + Projectile.alpha = 25; + Projectile.penetrate = 1; + Projectile.timeLeft = 300; + Projectile.DamageType = DamageClass.Ranged; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; + Projectile.extraUpdates = 2; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 50; + } + + public override void AI() + { + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + Dust dust = Dust.NewDustPerfect(Projectile.Center, 187); + dust.noGravity = true; + dust.scale = 0.5f; + } + + public override bool PreDraw(ref Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + return false; + } + public override void Kill(int timeLeft) + { + for (int i = 0; i <= 3; i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.position, 187, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(30f)) / 2, 0, default, Main.rand.NextFloat(1.1f, 1.3f)); + dust.noGravity = false; + SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact with { Volume = 0.8f, PitchVariance = 0.3f }, Projectile.Center); + } + } + public override bool? CanDamage() => base.CanDamage(); + } +} diff --git a/Projectiles/Ranged/MagnaShot.png b/Projectiles/Ranged/MagnaShot.png new file mode 100644 index 0000000000..855e439e45 Binary files /dev/null and b/Projectiles/Ranged/MagnaShot.png differ diff --git a/Projectiles/Ranged/MagnomalyRocket.cs b/Projectiles/Ranged/MagnomalyRocket.cs index 7f4eebbbec..46fb65e4a2 100644 --- a/Projectiles/Ranged/MagnomalyRocket.cs +++ b/Projectiles/Ranged/MagnomalyRocket.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[exo].noGravity = true; Main.dust[exo].noLight = true; } - CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 300f, 12f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Ranged/MeowFire.cs b/Projectiles/Ranged/MeowFire.cs index 4f04ca70be..a46a6b59f6 100644 --- a/Projectiles/Ranged/MeowFire.cs +++ b/Projectiles/Ranged/MeowFire.cs @@ -20,31 +20,32 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = -1; Projectile.extraUpdates = 3; - Projectile.timeLeft = 90; + Projectile.timeLeft = 95; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() { if (Projectile.ai[0] > 7f) { - float num296 = 1f; + float dustScale = 1f; if (Projectile.ai[0] == 8f) { - num296 = 0.25f; + dustScale = 0.25f; } else if (Projectile.ai[0] == 9f) { - num296 = 0.5f; + dustScale = 0.5f; } else if (Projectile.ai[0] == 10f) { - num296 = 0.75f; + dustScale = 0.75f; } Projectile.ai[0] += 1f; - int num297 = 56; - for (int num298 = 0; num298 < 2; num298++) + for (int i = 0; i < 2; i++) { - int num299 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, num297, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 1f); + int num299 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 56, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 1f); Dust dust = Main.dust[num299]; if (Main.rand.NextBool(3)) { @@ -59,7 +60,7 @@ namespace CalamityMod.Projectiles.Ranged } dust.velocity.X *= 1.2f; dust.velocity.Y *= 1.2f; - dust.scale *= num296; + dust.scale *= dustScale; dust.velocity += Projectile.velocity; if (!dust.noGravity) { @@ -76,7 +77,6 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.immune[Projectile.owner] = 8; SoundEngine.PlaySound(SoundID.Item57, Projectile.position); Projectile.position.X = Projectile.position.X + (float)(Projectile.width / 2); Projectile.position.Y = Projectile.position.Y + (float)(Projectile.height / 2); @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.height = 10; Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2); - for (int num621 = 0; num621 < 10; num621++) + for (int j = 0; j < 10; j++) { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 56, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - for (int num623 = 0; num623 < 20; num623++) + for (int k = 0; k < 20; k++) { int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 56, 0f, 0f, 100, default, 1.5f); Main.dust[num624].noGravity = true; diff --git a/Projectiles/Ranged/MeowFire2.cs b/Projectiles/Ranged/MeowFire2.cs index e2f172eb3a..13aba71e0b 100644 --- a/Projectiles/Ranged/MeowFire2.cs +++ b/Projectiles/Ranged/MeowFire2.cs @@ -20,31 +20,32 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = -1; Projectile.extraUpdates = 3; - Projectile.timeLeft = 90; + Projectile.timeLeft = 95; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() { if (Projectile.ai[0] > 7f) { - float num296 = 1f; + float dustScale = 1f; if (Projectile.ai[0] == 8f) { - num296 = 0.25f; + dustScale = 0.25f; } else if (Projectile.ai[0] == 9f) { - num296 = 0.5f; + dustScale = 0.5f; } else if (Projectile.ai[0] == 10f) { - num296 = 0.75f; + dustScale = 0.75f; } Projectile.ai[0] += 1f; - int num297 = 73; - for (int num298 = 0; num298 < 2; num298++) + for (int i = 0; i < 2; i++) { - int num299 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, num297, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 1f); + int num299 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 73, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 1f); Dust dust = Main.dust[num299]; if (Main.rand.NextBool(3)) { @@ -59,7 +60,7 @@ namespace CalamityMod.Projectiles.Ranged } dust.velocity.X *= 1.2f; dust.velocity.Y *= 1.2f; - dust.scale *= num296; + dust.scale *= dustScale; dust.velocity += Projectile.velocity; if (!dust.noGravity) { @@ -76,7 +77,6 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.immune[Projectile.owner] = 8; SoundEngine.PlaySound(SoundID.Item58, Projectile.position); Projectile.position.X = Projectile.position.X + (float)(Projectile.width / 2); Projectile.position.Y = Projectile.position.Y + (float)(Projectile.height / 2); @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.height = 10; Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2); - for (int num621 = 0; num621 < 10; num621++) + for (int j = 0; j < 10; j++) { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 73, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - for (int num623 = 0; num623 < 20; num623++) + for (int k = 0; k < 20; k++) { int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 73, 0f, 0f, 100, default, 1.5f); Main.dust[num624].noGravity = true; diff --git a/Projectiles/Ranged/NovaChargeShot.cs b/Projectiles/Ranged/NovaChargeShot.cs new file mode 100644 index 0000000000..ebfc7e3cf3 --- /dev/null +++ b/Projectiles/Ranged/NovaChargeShot.cs @@ -0,0 +1,101 @@ +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Ranged +{ + public class NovaChargeShot : ModProjectile, ILocalizedModType + { + public static readonly SoundStyle ChargeImpact = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeImpact") { Volume = 0.3f }; + public int Time = 0; + public new string LocalizationCategory => "Projectiles.Ranged"; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; + ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + } + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 36; + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.alpha = 20; + Projectile.penetrate = 1; + Projectile.timeLeft = 1200; + Projectile.DamageType = DamageClass.Ranged; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; + Projectile.extraUpdates = 24; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + + public override void AI() + { + Time++; + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(-3, 3), 107); + dust.noGravity = true; + dust.scale = 1.2f; + if (Main.rand.NextBool(2)) + { + Vector2 trailPos = Projectile.Center + Main.rand.NextVector2Circular(10, 10); + float trailScale = Main.rand.NextFloat(0.8f, 1.2f); + Color trailColor = Main.rand.NextBool(3) ? Color.Chartreuse : Color.Lime; + Particle Trail = new SparkParticle(trailPos, Projectile.velocity * 0.2f, false, 60, trailScale, trailColor); + GeneralParticleHandler.SpawnParticle(Trail); + } + + } + public override bool PreDraw(ref Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + return false; + } + public override Color? GetAlpha(Color lightColor) + { + return new Color(50, 255, 50, Projectile.alpha); + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(BuffID.CursedInferno, 900); + } + public override void Kill(int timeLeft) + { + for (int i = 0; i <= 19; i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, 107, new Vector2(0, -18).RotatedByRandom(MathHelper.ToRadians(35f)) * Main.rand.NextFloat(0.1f, 1.9f)); + dust.noGravity = false; + dust.scale = Main.rand.NextFloat(0.8f, 1.5f); + Dust dust2 = Dust.NewDustPerfect(Projectile.Center, 107, new Vector2(0, -7).RotatedByRandom(MathHelper.ToRadians(35f)) * Main.rand.NextFloat(0.1f, 1.9f)); + dust2.noGravity = false; + dust2.scale = Main.rand.NextFloat(0.8f, 1.5f); + } + SoundEngine.PlaySound(ChargeImpact, Projectile.position); + Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Lime, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 0.6f, 20); + GeneralParticleHandler.SpawnParticle(pulse); + Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Chartreuse, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 0.5f, 16); + GeneralParticleHandler.SpawnParticle(pulse2); + + for (int i = 0; i < 25; ++i) + { + int bloodLifetime = Main.rand.Next(22, 36); + float bloodScale = Main.rand.NextFloat(0.6f, 0.8f); + Color bloodColor = Color.Lerp(Color.Lime, Color.Chartreuse, 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() * 5 * randomSpeedMultiplier; + bloodVelocity.Y -= 5f; + BloodParticle blood = new BloodParticle(Projectile.Center, bloodVelocity, bloodLifetime, bloodScale, bloodColor); + GeneralParticleHandler.SpawnParticle(blood); + } + } + public override bool? CanDamage() => base.CanDamage(); + } +} diff --git a/Projectiles/Ranged/NovaChargeShot.png b/Projectiles/Ranged/NovaChargeShot.png new file mode 100644 index 0000000000..a88840b773 Binary files /dev/null and b/Projectiles/Ranged/NovaChargeShot.png differ diff --git a/Projectiles/Ranged/NovaShot.cs b/Projectiles/Ranged/NovaShot.cs new file mode 100644 index 0000000000..583f0b6c9d --- /dev/null +++ b/Projectiles/Ranged/NovaShot.cs @@ -0,0 +1,86 @@ +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Ranged +{ + public class NovaShot : ModProjectile, ILocalizedModType + { + public bool FirstFrameNoDraw = true; + public new string LocalizationCategory => "Projectiles.Ranged"; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; + ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + } + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 20; + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.alpha = 20; + Projectile.penetrate = -1; + Projectile.timeLeft = 300; + Projectile.DamageType = DamageClass.Ranged; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; + Projectile.extraUpdates = 3; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + + public override void AI() + { + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + //Dust dust = Dust.NewDustPerfect(Projectile.Center, 107); // + Main.rand.NextVector2Circular(-3, 3) + //dust.noGravity = true; + //dust.scale = 0.5f; + if (Main.rand.NextBool(4)) + { + Vector2 SparkVelocity1 = Projectile.velocity.RotatedBy(-3, default) * 0.1f - Projectile.velocity / 2f; + Vector2 SparkPosition1 = Projectile.velocity.RotatedBy(-0.8, default); + SparkParticle spark = new SparkParticle(Projectile.Center + SparkPosition1, SparkVelocity1, false, Main.rand.Next(4, 5), Main.rand.NextFloat(0.4f, 0.6f), Color.Lime); + GeneralParticleHandler.SpawnParticle(spark); + + } + if (Main.rand.NextBool(4)) + { + Vector2 SparkVelocity2 = Projectile.velocity.RotatedBy(3, default) * 0.1f - Projectile.velocity / 2f; + Vector2 SparkPosition2 = Projectile.velocity.RotatedBy(0.8, default); + SparkParticle spark2 = new SparkParticle(Projectile.Center + SparkPosition2, SparkVelocity2, false, Main.rand.Next(4, 5), Main.rand.NextFloat(0.4f, 0.6f), Main.rand.NextBool(4) ? Color.Chartreuse : Color.Lime); + GeneralParticleHandler.SpawnParticle(spark2); + } + } + public override bool PreDraw(ref Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + return false; + } + public override Color? GetAlpha(Color lightColor) + { + return new Color(50, 255, 50, Projectile.alpha); + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(BuffID.CursedInferno, 90); + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + Projectile.damage = (int)(Projectile.damage * 0.88f); + if (Projectile.damage < 1) + Projectile.damage = 1; + } + public override void Kill(int timeLeft) + { + for (int i = 0; i <= 4; i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.position, 107, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.1f, 0.8f), 0, default, Main.rand.NextFloat(1.2f, 1.6f)); + dust.noGravity = false; + } + } + public override bool? CanDamage() => base.CanDamage(); + } +} diff --git a/Projectiles/Ranged/NovaShot.png b/Projectiles/Ranged/NovaShot.png new file mode 100644 index 0000000000..4bcbe3130b Binary files /dev/null and b/Projectiles/Ranged/NovaShot.png differ diff --git a/Projectiles/Ranged/OpalChargedStrike.cs b/Projectiles/Ranged/OpalChargedStrike.cs new file mode 100644 index 0000000000..f0c738d228 --- /dev/null +++ b/Projectiles/Ranged/OpalChargedStrike.cs @@ -0,0 +1,72 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Ranged +{ + public class OpalChargedStrike : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; + ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + } + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 30; + Projectile.friendly = true; + Projectile.alpha = 55; + Projectile.penetrate = 2; + Projectile.timeLeft = 300; + Projectile.DamageType = DamageClass.Ranged; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; + Projectile.extraUpdates = 3; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 50; + } + + public override void AI() + { + if (Main.rand.NextBool(2)) + { + Vector2 position = Projectile.Center + Vector2.Normalize(Projectile.velocity); + Dust dust = Main.dust[Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 162, 0f, 0f, 0, default, Main.rand.NextFloat(1.2f, 1.5f))]; + dust.position = position; + dust.velocity = Projectile.velocity.RotatedBy(0.2, default) * 0.1f + Projectile.velocity / 8f; + dust.position += Projectile.velocity.RotatedBy(0.2, default); + dust.fadeIn = 0.5f; + dust.noGravity = true; + dust = Main.dust[Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 162, 0f, 0f, 0, default, Main.rand.NextFloat(1.2f, 1.5f))]; + dust.position = position; + dust.velocity = Projectile.velocity.RotatedBy(-0.2, default) * 0.1f + Projectile.velocity / 8f; + dust.position += Projectile.velocity.RotatedBy(-0.2, default); + dust.fadeIn = 0.5f; + dust.noGravity = true; + } + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + } + + public override bool PreDraw(ref Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + return false; + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(BuffID.OnFire, 300); + } + public override void Kill(int timeLeft) + { + for (int i = 0; i <= 8; i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.position, 162, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(30f)) / 2, 0, default, Main.rand.NextFloat(1.6f, 2.3f)); + dust.noGravity = false; + } + } + public override bool? CanDamage() => base.CanDamage(); + } +} diff --git a/Projectiles/Ranged/OpalChargedStrike.png b/Projectiles/Ranged/OpalChargedStrike.png new file mode 100644 index 0000000000..9ca374f859 Binary files /dev/null and b/Projectiles/Ranged/OpalChargedStrike.png differ diff --git a/Projectiles/Ranged/OpalStrike.cs b/Projectiles/Ranged/OpalStrike.cs index 2879df71f1..8b028ac38a 100644 --- a/Projectiles/Ranged/OpalStrike.cs +++ b/Projectiles/Ranged/OpalStrike.cs @@ -1,15 +1,18 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { public class OpalStrike : ModProjectile, ILocalizedModType { + public bool FirstFrameNoDraw = true; public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; ProjectileID.Sets.TrailingMode[Projectile.type] = 0; } @@ -17,22 +20,20 @@ namespace CalamityMod.Projectiles.Ranged { Projectile.width = Projectile.height = 20; Projectile.friendly = true; - Projectile.scale = 0.5f; - Projectile.alpha = 200; - Projectile.penetrate = 1; + Projectile.alpha = 55; + Projectile.penetrate = 2; Projectile.timeLeft = 300; Projectile.DamageType = DamageClass.Ranged; Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; + Projectile.extraUpdates = 2; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 50; } public override void AI() { - if (Projectile.scale <= 1.5f) - Projectile.scale *= 1.01f; - Projectile.alpha -= 2; - if (Projectile.alpha == 0) - Projectile.alpha = 200; Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + Dust.NewDustPerfect(Projectile.Center, 162); } public override bool PreDraw(ref Color lightColor) @@ -40,5 +41,18 @@ namespace CalamityMod.Projectiles.Ranged CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); return false; } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(BuffID.OnFire, 60); + } + public override void Kill(int timeLeft) + { + for (int i = 0; i <= 8; i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.position, 162, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(30f)) / 2, 0, default, Main.rand.NextFloat(1.6f, 2.3f)); + dust.noGravity = false; + } + } + public override bool? CanDamage() => base.CanDamage(); } } diff --git a/Projectiles/Ranged/OpalStrikerHoldout.cs b/Projectiles/Ranged/OpalStrikerHoldout.cs new file mode 100644 index 0000000000..44e25c81ff --- /dev/null +++ b/Projectiles/Ranged/OpalStrikerHoldout.cs @@ -0,0 +1,188 @@ +using System; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using ReLogic.Utilities; +using Terraria; +using Terraria.Audio; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class OpalStrikerHoldout : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + private Player Owner => Main.player[Projectile.owner]; + public SlotId OpalChargeSlot; + public SlotId OpalChargeLoopSlot; + public SlotId OpalChargeShotSlot; + + private float CurrentChargingFrames = 0f; + + private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; + private float storedVelocity = 12f; + public const float velocityMultiplier = 1.2f; + public bool Extradamage = false; + public int Time = 0; + public int Aftershot = OpalStriker.AftershotCooldownFrames; + + public override string Texture => "CalamityMod/Items/Weapons/Ranged/OpalStriker"; + + public override void SetDefaults() + { + Projectile.width = 46; + Projectile.height = 30; + Projectile.friendly = true; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.DamageType = DamageClass.Ranged; + Projectile.ignoreWater = true; + } + + public override void AI() + { + Player player = Main.player[Projectile.owner]; + if (player.dead) // destroy the holdout if the player dies + { + Projectile.Kill(); + return; + } + + if (CurrentChargingFrames >= OpalStriker.FullChargeFrames) + Extradamage = true; + else + Extradamage = false; + + Vector2 armPosition = Owner.RotatedRelativePoint(Owner.MountedCenter, true); + Vector2 tipPosition = armPosition + Projectile.velocity * Projectile.width * 0.85f; + + // Fire if the owner stops channeling or otherwise cannot use the weapon. + if (!OwnerCanShoot) + { + if (Aftershot == OpalStriker.AftershotCooldownFrames) + { + if (SoundEngine.TryGetActiveSound(OpalChargeSlot, out var OpalCharge2)) + OpalCharge2.Stop(); + if (SoundEngine.TryGetActiveSound(OpalChargeLoopSlot, out var OpalChargeLoop2)) + OpalChargeLoop2.Stop(); + + int newdamage = Projectile.damage * (Extradamage ? 6 : 1); + OpalChargeShotSlot = SoundEngine.PlaySound(Extradamage ? OpalStriker.ChargedFire : OpalStriker.Fire, Projectile.position); + CurrentChargingFrames = 0; + Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * storedVelocity; + if (Extradamage) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, shootVelocity, ModContent.ProjectileType(), newdamage, Projectile.knockBack * 3, Projectile.owner); + for (int i = 0; i <= 10; i++) + { + Dust dust = Dust.NewDustPerfect(tipPosition, 162, shootVelocity.RotatedByRandom(MathHelper.ToRadians(20f)) * Main.rand.NextFloat(0.8f, 1.4f), 0, default, Main.rand.NextFloat(1.5f, 2.3f)); + dust.noGravity = true; + } + } + else + Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, shootVelocity, ModContent.ProjectileType(), newdamage, Projectile.knockBack, Projectile.owner); + + Aftershot--; + } + else + Aftershot--; + + if (Aftershot == 0) + Projectile.Kill(); + } + else + { + if (CurrentChargingFrames >= 10) + { + if (CurrentChargingFrames < OpalStriker.FullChargeFrames) + { + Particle streak = new ManaDrainStreak(player, Main.rand.NextFloat(0.06f + (CurrentChargingFrames / 180), 0.08f + (CurrentChargingFrames / 180)), Main.rand.NextVector2CircularEdge(2f, 2f) * Main.rand.NextFloat(0.3f * CurrentChargingFrames, 0.3f * CurrentChargingFrames), 0f, Color.Gold, Color.Orange, 7, tipPosition); + GeneralParticleHandler.SpawnParticle(streak); + } + Particle orb = new GenericBloom(tipPosition, Projectile.velocity, Color.OrangeRed, CurrentChargingFrames / 135, 2); + GeneralParticleHandler.SpawnParticle(orb); + Particle orb2 = new GenericBloom(tipPosition, Projectile.velocity, Color.Coral, CurrentChargingFrames / 200, 2); + GeneralParticleHandler.SpawnParticle(orb2); + } + if (CurrentChargingFrames == 10) + { + OpalChargeSlot = SoundEngine.PlaySound(OpalStriker.Charge, Projectile.position); + } + // Start Charging. + if (CurrentChargingFrames < OpalStriker.FullChargeFrames + 2) + ++CurrentChargingFrames; + + if (CurrentChargingFrames >= OpalStriker.FullChargeFrames) //78 frames is durration of charge sound + { + Time++; + if (CurrentChargingFrames == OpalStriker.FullChargeFrames) + OpalChargeLoopSlot = SoundEngine.PlaySound(OpalStriker.ChargeLoop, Projectile.position); + if (Time % OpalStriker.ChargeLoopSoundFrames == 0) + { + OpalChargeLoopSlot = SoundEngine.PlaySound(OpalStriker.ChargeLoop, Projectile.position); + } + } + + if (CurrentChargingFrames == OpalStriker.FullChargeFrames) + { + for (int i = 0; i < 36; i++) + { + Dust chargefull = Dust.NewDustPerfect(tipPosition, 162); + chargefull.velocity = (MathHelper.TwoPi * i / 36f).ToRotationVector2() * 13f + Owner.velocity; + chargefull.scale = Main.rand.NextFloat(2f, 2.5f); + chargefull.noGravity = true; + } + } + } + if (SoundEngine.TryGetActiveSound(OpalChargeLoopSlot, out var OpalChargeLoop) && OpalChargeLoop.IsPlaying) + OpalChargeLoop.Position = Projectile.Center; + if (SoundEngine.TryGetActiveSound(OpalChargeSlot, out var OpalCharge) && OpalCharge.IsPlaying) + OpalCharge.Position = Projectile.Center; + if (SoundEngine.TryGetActiveSound(OpalChargeShotSlot, out var OpalChargeShot) && OpalChargeShot.IsPlaying) + OpalChargeShot.Position = Projectile.Center; + UpdateProjectileHeldVariables(armPosition); + ManipulatePlayerVariables(); + } + + private void UpdateProjectileHeldVariables(Vector2 armPosition) + { + if (Main.myPlayer == Projectile.owner) + { + float interpolant = Utils.GetLerpValue(5f, 25f, Projectile.Distance(Main.MouseWorld), true); + Vector2 oldVelocity = Projectile.velocity; + Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.SafeDirectionTo(Main.MouseWorld), interpolant); + } + Player player = Main.player[Projectile.owner]; + Projectile.Center = (player.RotatedRelativePoint(player.MountedCenter, true) + Projectile.velocity * 15) + new Vector2(0, 3); + Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + Projectile.spriteDirection = Projectile.direction; + Projectile.timeLeft = 2; + player.ChangeDir(Projectile.direction); + player.heldProj = Projectile.whoAmI; + player.itemTime = 2; + player.itemAnimation = 2; + player.itemRotation = (float)Math.Atan2(Projectile.velocity.Y * Projectile.direction, Projectile.velocity.X * Projectile.direction); + Projectile.position += Main.rand.NextVector2Circular(CurrentChargingFrames / 30f, CurrentChargingFrames / 30f); //rumble features + + } + + private void ManipulatePlayerVariables() + { + Owner.ChangeDir(Projectile.direction); + Owner.heldProj = Projectile.whoAmI; + Owner.itemTime = 2; + Owner.itemAnimation = 2; + Owner.itemRotation = (Projectile.velocity * Projectile.direction).ToRotation(); + } + public override void Kill(int timeLeft) + { + if (SoundEngine.TryGetActiveSound(OpalChargeSlot, out var OpalCharge)) + OpalCharge.Stop(); + if (SoundEngine.TryGetActiveSound(OpalChargeLoopSlot, out var OpalChargeLoop)) + OpalChargeLoop.Stop(); + CurrentChargingFrames = 0; + } + + public override bool? CanDamage() => false; + } +} diff --git a/Projectiles/Ranged/PlagueTaintedDrone.cs b/Projectiles/Ranged/PlagueTaintedDrone.cs index 53ef63d162..f42c9bea4f 100644 --- a/Projectiles/Ranged/PlagueTaintedDrone.cs +++ b/Projectiles/Ranged/PlagueTaintedDrone.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Ranged public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - if (target.Calamity().pFlames > 0) + if (target.Calamity().pFlames > 0 && Projectile.ai[1] != 1) modifiers.SetCrit(); } @@ -131,6 +131,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; + Projectile.damage = (int)(Projectile.damage * 0.4f); Projectile.Damage(); SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); for (int num621 = 0; num621 < 20; num621++) diff --git a/Projectiles/Ranged/PlagueTaintedProjectile.cs b/Projectiles/Ranged/PlagueTaintedProjectile.cs index 4fa554938d..8f07af011c 100644 --- a/Projectiles/Ranged/PlagueTaintedProjectile.cs +++ b/Projectiles/Ranged/PlagueTaintedProjectile.cs @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Ranged public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { float maxDamageScalingDistance = 800f; - float maxDamageMultiplier = 1.5f; + float maxDamageMultiplier = 1.4f; float distanceFromOwner = target.Distance(Main.player[Projectile.owner].Center); if (distanceFromOwner < maxDamageScalingDistance) { @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 60); // Spawn a drone on crit, with a cooldown...I guess. if (Projectile.owner == Main.myPlayer) diff --git a/Projectiles/Ranged/ToxicannonDrop.cs b/Projectiles/Ranged/ToxicannonDrop.cs index a03fe4d0d9..c556ecd097 100644 --- a/Projectiles/Ranged/ToxicannonDrop.cs +++ b/Projectiles/Ranged/ToxicannonDrop.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.friendly = true; Projectile.tileCollide = true; Projectile.ignoreWater = false; - Projectile.timeLeft = 420; + Projectile.timeLeft = 300; Projectile.DamageType = DamageClass.Ranged; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 17; diff --git a/Projectiles/Ranged/ToxicannonShot.cs b/Projectiles/Ranged/ToxicannonShot.cs index 8b742e3c3b..a7a171ea4d 100644 --- a/Projectiles/Ranged/ToxicannonShot.cs +++ b/Projectiles/Ranged/ToxicannonShot.cs @@ -71,16 +71,13 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[idx].scale = 3f; Main.dust[idx].noGravity = true; } - if (Main.rand.NextBool(3)) + float count = Main.rand.Next(1, 2 + 1); + for (int i = 0; i < count; i++) { - int count = Main.rand.Next(1, 3 + 1); - for (int i = 0; i < count; i++) - { - float angle = MathHelper.TwoPi * i / count; - angle += Main.rand.NextFloat(0.1f, 0.35f) * Main.rand.NextBool(2).ToDirectionInt(); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, angle.ToRotationVector2() * Main.rand.NextFloat(4f, 16f), + float angle = MathHelper.TwoPi * i / count; + angle += Main.rand.NextFloat(0.1f, 0.35f) * Main.rand.NextBool(2).ToDirectionInt(); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, angle.ToRotationVector2() * Main.rand.NextFloat(4f, 16f), ModContent.ProjectileType(), Projectile.damage, 2.5f, Projectile.owner); - } } } diff --git a/Projectiles/Rogue/CursedDaggerBlastHitbox.cs b/Projectiles/Rogue/CursedDaggerBlastHitbox.cs new file mode 100644 index 0000000000..4e75f956fd --- /dev/null +++ b/Projectiles/Rogue/CursedDaggerBlastHitbox.cs @@ -0,0 +1,65 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Audio; +using Terraria.Utilities; +using CalamityMod.Items.Weapons.Rogue; +using static Humanizer.In; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using System.Reflection.Metadata; + +namespace CalamityMod.Projectiles.Rogue +{ + public class CursedDaggerBlastHitbox : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Rogue"; + + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public override void SetDefaults() + { + Projectile.width = 200; + Projectile.height = 200; + Projectile.friendly = true; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.timeLeft = 300; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 15; + } + + public override void AI() + { + if (Projectile.timeLeft % 30 == 0) + SoundEngine.PlaySound(SoundID.DD2_SkyDragonsFurySwing with { Volume = 1.2f }, Projectile.position); + + Dust dust2 = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(200f, 200f), 75); + dust2.scale = Main.rand.NextFloat(0.8f, 1.1f); + dust2.noGravity = true; + + int sparkCount = Main.rand.Next(18); + float offset = Main.rand.NextFloat(MathHelper.TwoPi); + for (int i = 0; i < sparkCount; i++) + { + float angle = i / (float)sparkCount * MathHelper.TwoPi + offset; + Vector2 sparkPos = Projectile.Center + angle.ToRotationVector2() * Main.rand.Next(65, 200); + int sparkLifetime = Main.rand.Next(10, 18); + float sparkScale = Main.rand.NextFloat(0.8f, 1f) * 0.955f; + Color sparkColor = Color.Lerp(Color.LawnGreen, Color.Green, Main.rand.NextFloat(0.7f)); + sparkColor = Color.Lerp(sparkColor, Color.LawnGreen, Main.rand.NextFloat()); + SparkParticle spark = new SparkParticle(sparkPos, (angle - MathHelper.PiOver2 * Projectile.direction).ToRotationVector2() * Main.rand.NextFloat(2f, 5.5f), false, sparkLifetime, sparkScale, sparkColor); + GeneralParticleHandler.SpawnParticle(spark); + } + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(BuffID.CursedInferno, 600); + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.width, targetHitbox); + } +} diff --git a/Projectiles/Rogue/CursedDaggerProj.cs b/Projectiles/Rogue/CursedDaggerProj.cs index 8c60f77ab5..faf3301706 100644 --- a/Projectiles/Rogue/CursedDaggerProj.cs +++ b/Projectiles/Rogue/CursedDaggerProj.cs @@ -1,9 +1,12 @@ using CalamityMod.Dusts; +using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; +using static Humanizer.In; namespace CalamityMod.Projectiles.Rogue { @@ -11,11 +14,12 @@ namespace CalamityMod.Projectiles.Rogue { public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/CursedDagger"; - + public bool slowstart = true; + public int speedup = 0; public override void SetDefaults() { Projectile.localNPCHitCooldown = 10; - Projectile.penetrate = 3; + Projectile.penetrate = 2; Projectile.timeLeft = 600; Projectile.width = Projectile.height = 38; @@ -28,57 +32,42 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (Main.rand.NextBool(4)) + if (Main.rand.NextBool(Projectile.Calamity().stealthStrike ? 3 : 7)) { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, (int)CalamityDusts.SulfurousSeaAcid, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); + Dust dust = Main.dust[Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, (int)CalamityDusts.SulfurousSeaAcid, Projectile.velocity.X * -3f, Projectile.velocity.Y * -3f, 0, default, Projectile.Calamity().stealthStrike ? Main.rand.NextFloat(2.5f, 3.2f) : 1.5f)]; + dust.noGravity = true; } if (Projectile.Calamity().stealthStrike) { - if (Projectile.timeLeft % 6 == 0) + if (slowstart) { - if (Projectile.owner == Main.myPlayer) - { - Vector2 velocity = new Vector2(Main.rand.NextFloat(-14f, 14f), Main.rand.NextFloat(-14f, 14f)); - int flame = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, Main.rand.NextBool(2) ? ProjectileID.CursedFlameFriendly : ProjectileID.CursedDartFlame, Projectile.damage, Projectile.knockBack, Projectile.owner); - if (flame.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[flame].DamageType = RogueDamageClass.Instance; - Main.projectile[flame].usesLocalNPCImmunity = true; - Main.projectile[flame].localNPCHitCooldown = 10; - } - } + Projectile.velocity *= 0.5f; + Projectile.penetrate = 1; + slowstart = false; } + if (speedup <= 50) + { + Projectile.velocity *= 1.03f; + speedup++; + } + Projectile.aiStyle = 0; + Projectile.extraUpdates = 1; } } public override void Kill(int timeLeft) { - for (int i = 0; i <= 10; i++) + int numberofdusts = Projectile.Calamity().stealthStrike ? 14 : 5; + for (int i = 0; i <= numberofdusts; i++) { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, (int)CalamityDusts.SulfurousSeaAcid, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - Projectile.penetrate--; - if (Projectile.penetrate <= 0) + if (Projectile.Calamity().stealthStrike) { - Projectile.Kill(); + SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact, Projectile.position); + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage), Projectile.knockBack * 2, Projectile.owner, 0, 0f); } - else - { - if (Projectile.velocity.X != oldVelocity.X) - { - Projectile.velocity.X = -oldVelocity.X; - } - if (Projectile.velocity.Y != oldVelocity.Y) - { - Projectile.velocity.Y = -oldVelocity.Y; - } - } - return false; } public override bool PreDraw(ref Color lightColor) @@ -88,8 +77,14 @@ namespace CalamityMod.Projectiles.Rogue return false; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.CursedInferno, Projectile.Calamity().stealthStrike ? 600 : 120); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.CursedInferno, Projectile.Calamity().stealthStrike ? 900 : 90); + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + Projectile.damage = (int)(Projectile.damage * 0.8f); + if (Projectile.damage < 1) + Projectile.damage = 1; + } public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.CursedInferno, Projectile.Calamity().stealthStrike ? 600 : 120); } } diff --git a/Projectiles/Rogue/EclipseStealthBoom.cs b/Projectiles/Rogue/EclipseStealthBoom.cs index dc1441f7be..d258de5353 100644 --- a/Projectiles/Rogue/EclipseStealthBoom.cs +++ b/Projectiles/Rogue/EclipseStealthBoom.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Rogue { Texture2D glow = ModContent.Request(Texture + "Glow").Value; Rectangle frame = glow.Frame(1, Main.projFrames[Type], 0, Projectile.frame); - Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, frame.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, SpriteEffects.None); } } } diff --git a/Projectiles/Rogue/EclipsesFallMain.cs b/Projectiles/Rogue/EclipsesFallMain.cs index c533adb17c..f311e5090e 100644 --- a/Projectiles/Rogue/EclipsesFallMain.cs +++ b/Projectiles/Rogue/EclipsesFallMain.cs @@ -13,8 +13,7 @@ namespace CalamityMod.Projectiles.Rogue public override string Texture => "CalamityMod/Items/Weapons/Rogue/EclipsesFall"; // these also affect KB - public const float RainDamageMultMin = 0.4f; - public const float RainDamageMultMax = 0.5f; + public static float RainDamageMult = 0.4f; public override void SetStaticDefaults() { @@ -56,12 +55,11 @@ namespace CalamityMod.Projectiles.Rogue private void SpawnSpears(Vector2 targetPos) { - int spearAmt = Main.rand.Next(3, 5 + 1); // 3 to 5 spears + int spearAmt = Main.rand.Next(3, 4 + 1); // 3 or 4 spears var source = Projectile.GetSource_FromThis(); for (int n = 0; n < spearAmt; n++) - { - float dmgMult = Main.rand.NextFloat(RainDamageMultMin, RainDamageMultMax); - CalamityUtils.ProjectileRain(source, targetPos, 400f, 100f, 500f, 800f, 29f, ModContent.ProjectileType(), (int)(Projectile.damage * dmgMult), Projectile.knockBack * dmgMult, Projectile.owner); + {; + CalamityUtils.ProjectileRain(source, targetPos, 400f, 100f, 500f, 800f, 29f, ModContent.ProjectileType(), (int)(Projectile.damage * RainDamageMult), Projectile.knockBack * RainDamageMult, Projectile.owner); } } @@ -74,7 +72,7 @@ namespace CalamityMod.Projectiles.Rogue public override void PostDraw(Color lightColor) { Texture2D glow = ModContent.Request(Texture + "Glow").Value; - Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, glow.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, glow.Size() * 0.5f, Projectile.scale, SpriteEffects.None); } } } diff --git a/Projectiles/Rogue/EclipsesSmol.cs b/Projectiles/Rogue/EclipsesSmol.cs index 1000f9603e..0e5261b383 100644 --- a/Projectiles/Rogue/EclipsesSmol.cs +++ b/Projectiles/Rogue/EclipsesSmol.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetDefaults() { - Projectile.width = Projectile.height = 32; + Projectile.width = Projectile.height = 24; Projectile.friendly = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; @@ -29,14 +29,14 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { Texture2D tex = ModContent.Request(Texture).Value; - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None); return false; } public override void PostDraw(Color lightColor) { Texture2D glow = ModContent.Request(Texture + "Glow").Value; - Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, glow.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, glow.Size() * 0.5f, Projectile.scale, SpriteEffects.None); } } } diff --git a/Projectiles/Rogue/EclipsesStealth.cs b/Projectiles/Rogue/EclipsesStealth.cs index 1b71e7d58d..e2819ada60 100644 --- a/Projectiles/Rogue/EclipsesStealth.cs +++ b/Projectiles/Rogue/EclipsesStealth.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Rogue public override string Texture => "CalamityMod/Items/Weapons/Rogue/EclipsesFall"; // these also affect KB - public const float RainDamageMult = 0.25f; + public const float RainDamageMult = 0.2f; public const float ExplosionDamageMult = 0.5f; // For more consistent DPS, always alternates between spawning 1 and 2 spears instead of picking randomly @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.localAI[1] <= 0f) { // Set up the spear counter for next time. Used to be every 5 frames there was a 50% chance; now it's more reliable but slower. - Projectile.localAI[1] = Main.rand.Next(8, 13); // 8 to 12 frames between each spearfall + Projectile.localAI[1] = Main.rand.Next(10, 13); // 10 to 12 frames between each spearfall int type = ModContent.ProjectileType(); // Used to be a 50% chance each spearfall for 1 or 2. Now is consistent. @@ -116,7 +116,7 @@ namespace CalamityMod.Projectiles.Rogue public override void PostDraw(Color lightColor) { Texture2D glow = ModContent.Request(Texture + "Glow").Value; - Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, glow.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, glow.Size() * 0.5f, Projectile.scale, SpriteEffects.None); } public override bool? CanHitNPC(NPC target) => Projectile.ai[0] == 1f ? false : base.CanHitNPC(target); diff --git a/Projectiles/Rogue/GodsParanoiaDart.cs b/Projectiles/Rogue/GodsParanoiaDart.cs index 4269418051..1cc2762da4 100644 --- a/Projectiles/Rogue/GodsParanoiaDart.cs +++ b/Projectiles/Rogue/GodsParanoiaDart.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Projectiles/Rogue/GodsParanoiaProj.cs b/Projectiles/Rogue/GodsParanoiaProj.cs index df85ae3aba..3bb451b73d 100644 --- a/Projectiles/Rogue/GodsParanoiaProj.cs +++ b/Projectiles/Rogue/GodsParanoiaProj.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/GodsParanoia"; - public int kunaiStabbing = 12; + public int kunaiStabbing = 10; public override void SetStaticDefaults() { @@ -22,8 +22,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetDefaults() { - Projectile.width = 15; - Projectile.height = 15; + Projectile.width = 20; + Projectile.height = 20; Projectile.ignoreWater = true; Projectile.friendly = true; Projectile.tileCollide = false; @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.ai[0] == 1f) { kunaiStabbing++; - if (kunaiStabbing >= 20) + if (kunaiStabbing >= 30 || (Projectile.Calamity().stealthStrike && kunaiStabbing >=20)) { kunaiStabbing = 0; float startOffsetX = Main.rand.NextFloat(100f, 200f) * (Main.rand.NextBool() ? -1f : 1f); @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Rogue { for (int i = 0; i < 3; i++) { - int idx = Projectile.NewProjectile(Projectile.GetSource_FromThis(), startPos, kunaiSp, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack / 2f, Projectile.owner, 0f, 0f); + int idx = Projectile.NewProjectile(Projectile.GetSource_FromThis(), startPos, kunaiSp, ModContent.ProjectileType(), Projectile.damage / 3, Projectile.knockBack / 3f, Projectile.owner, 0f, 0f); Main.projectile[idx].rotation = angle; } } @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Rogue else { Projectile.rotation += 0.2f * (float)Projectile.direction; - CalamityUtils.HomeInOnNPC(Projectile, true, 300f, Projectile.Calamity().stealthStrike ? 12f : 7f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, false, 200f, Projectile.Calamity().stealthStrike ? 10f : 5f, 20f); } Player player = Main.player[Projectile.owner]; diff --git a/Projectiles/Rogue/HypothermiaChunk.cs b/Projectiles/Rogue/HypothermiaChunk.cs index b91060d034..9e5b96f6a9 100644 --- a/Projectiles/Rogue/HypothermiaChunk.cs +++ b/Projectiles/Rogue/HypothermiaChunk.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Rogue if (Main.rand.NextBool(10)) { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 191, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f, 0, default, 0.8f); + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 318, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f, 0, default, 0.8f); } } @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Rogue { for (int i = 0; i <= 3; i++) { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 191, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f, 0, default, 0.8f); + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 318, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f, 0, default, 0.8f); } if (Projectile.owner == Main.myPlayer) { @@ -74,14 +74,14 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(BuffID.Frostburn, 300); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn2, 300); + target.AddBuff(ModContent.BuffType(), 150); } public override void OnHitPlayer(Player target, Player.HurtInfo info) { - target.AddBuff(BuffID.Frostburn, 300); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn2, 300); + target.AddBuff(ModContent.BuffType(), 150); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Rogue/HypothermiaShard.cs b/Projectiles/Rogue/HypothermiaShard.cs index 04ad13358c..c875c7c484 100644 --- a/Projectiles/Rogue/HypothermiaShard.cs +++ b/Projectiles/Rogue/HypothermiaShard.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Rogue counter += 0.25f; if (Main.rand.NextBool(10)) { - int num300 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 191, 0f, 0f, 0, default, 0.8f); + int num300 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 318, 0f, 0f, 0, default, 0.8f); Main.dust[num300].noGravity = true; Main.dust[num300].velocity *= 0.2f; } @@ -66,13 +66,13 @@ namespace CalamityMod.Projectiles.Rogue { for (int k = 0; k < 3; k++) { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 191, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f, 0, default, 0.8f); + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 318, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f, 0, default, 0.8f); } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Frostburn, 120); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Frostburn2, 120); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Frostburn, 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Frostburn2, 120); public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Rogue/IchorSpearProj.cs b/Projectiles/Rogue/IchorSpearProj.cs index 9b5d98a920..592d105bac 100644 --- a/Projectiles/Rogue/IchorSpearProj.cs +++ b/Projectiles/Rogue/IchorSpearProj.cs @@ -1,7 +1,12 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Pets; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using Mono.Cecil; using System; +using System.Reflection.Metadata; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -9,53 +14,72 @@ namespace CalamityMod.Projectiles.Rogue { public class IchorSpearProj : ModProjectile, ILocalizedModType { + public static readonly SoundStyle Hitsound = new("CalamityMod/Sounds/Item/WulfrumKnifeTileHit2") { PitchVariance = 0.3f, Volume = 0.5f }; public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/IchorSpear"; - + public bool posthit = false; + public int framesInAir = 0; public override void SetDefaults() { - Projectile.width = 12; - Projectile.height = 12; + Projectile.width = 14; + Projectile.height = 14; Projectile.friendly = true; Projectile.ignoreWater = true; - Projectile.penetrate = 2; - Projectile.aiStyle = ProjAIStyleID.StickProjectile; - Projectile.timeLeft = 600; - AIType = ProjectileID.BoneJavelin; + Projectile.penetrate = 6; + Projectile.timeLeft = 900; + Projectile.aiStyle = 0; Projectile.DamageType = RogueDamageClass.Instance; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; + Projectile.localNPCHitCooldown = 50; } public override void AI() { - if (Main.rand.NextBool(4)) + framesInAir++; + if (framesInAir > 90 && !Projectile.Calamity().stealthStrike) { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 246, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); - } - Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X) + 0.785f; - if (Projectile.spriteDirection == -1) - { - Projectile.rotation -= 1.57f; + Projectile.velocity.X *= 0.998f; + Projectile.velocity.Y += 0.3f; } + Projectile.scale = 1.2f; + if (!Projectile.Calamity().stealthStrike) + Projectile.extraUpdates = 1; + + if (Main.rand.NextBool(2) && !posthit) + { + Vector2 position = Projectile.Center + Vector2.Normalize(Projectile.velocity); + Dust dust = Main.dust[Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.Next(169, 170), 0f, 0f, 0, default, Projectile.Calamity().stealthStrike ? Main.rand.NextFloat(2.1f, 3.2f) : Main.rand.NextFloat(1.2f, 1.5f))]; + dust.position = position; + dust.velocity = Projectile.velocity.RotatedBy(1.9707963705062866, default) * 0.1f + Projectile.velocity / 8f; + dust.position += Projectile.velocity.RotatedBy(0.3, default); + dust.fadeIn = 0.5f; + dust.noGravity = true; + dust = Main.dust[Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.Next(169, 170), 0f, 0f, 0, default, Projectile.Calamity().stealthStrike ? Main.rand.NextFloat(2.1f, 3.2f) : Main.rand.NextFloat(1.2f, 1.5f))]; + dust.position = position; + dust.velocity = Projectile.velocity.RotatedBy(-1.9707963705062866, default) * 0.1f + Projectile.velocity / 8f; + dust.position += Projectile.velocity.RotatedBy(-0.3, default); + dust.fadeIn = 0.5f; + dust.noGravity = true; + } + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; + + bool defaultsonce = true; if (Projectile.Calamity().stealthStrike) { - if (Projectile.timeLeft % 6 == 0) + Projectile.tileCollide = false; + Projectile.aiStyle = 0; + Projectile.extraUpdates = 2; + if (Projectile.ai[0] == 0f) { - if (Projectile.owner == Main.myPlayer) + if (defaultsonce) { - Vector2 velocity = new Vector2(Main.rand.NextFloat(-14f, 14f), Main.rand.NextFloat(-14f, 14f)); - int ichor = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, Main.rand.NextBool(2) ? ProjectileID.GoldenShowerFriendly : ProjectileID.IchorSplash, Projectile.damage, Projectile.knockBack, Projectile.owner); - if (ichor.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[ichor].DamageType = RogueDamageClass.Instance; - Main.projectile[ichor].usesLocalNPCImmunity = true; - Main.projectile[ichor].localNPCHitCooldown = 10; - Main.projectile[ichor].extraUpdates = 2; - } + Projectile.penetrate = 10; + Projectile.localNPCHitCooldown = 60; + defaultsonce = false; } } + Projectile.StickyProjAI(10); } } @@ -66,16 +90,63 @@ namespace CalamityMod.Projectiles.Rogue return false; } - public override void Kill(int timeLeft) + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - for (int i = 0; i <= 10; i++) + Vector2 bloodSpawnPosition = target.Center + Main.rand.NextVector2Circular(target.width, target.height) * 0.04f; + Vector2 splatterDirection = (Projectile.Center - bloodSpawnPosition).SafeNormalize(Vector2.UnitY); + int sparkCount = Main.rand.Next(5); + for (int i = 0; i < sparkCount; i++) { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 246, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); + Vector2 sparkVelocity = splatterDirection.RotatedByRandom(0.5f) * Main.rand.NextFloat(5f, 9f); + int sparkLifetime = Main.rand.Next(23, 25); + float sparkScale = Main.rand.NextFloat(0.8f, 1f) * 0.955f; + Color sparkColor = Color.Lerp(Color.Gold, Color.Goldenrod, Main.rand.NextFloat(0.7f)); + sparkColor = Color.Lerp(sparkColor, Color.Gold, Main.rand.NextFloat()); + SparkParticle spark = new SparkParticle(Projectile.Center, sparkVelocity * -2, true, sparkLifetime, sparkScale, sparkColor); + GeneralParticleHandler.SpawnParticle(spark); + } + SoundEngine.PlaySound(Hitsound, Projectile.position); + target.AddBuff(BuffID.Ichor, Projectile.Calamity().stealthStrike ? 900 : 180); + if (Projectile.Calamity().stealthStrike) + { + posthit = true; + for (int i = 0; i <= 17; i++) + { + Dust dust2 = Main.dust[Dust.NewDust(target.position, Projectile.width, Projectile.height, Main.rand.Next(169, 170), 0, 0, 0, default, 3.2f)]; + dust2.noGravity = true; + dust2.velocity.Y -= Main.rand.NextFloat(2.5f, 10.5f); + dust2.velocity.X += Main.rand.NextFloat(-3f, 3f); + } + SoundEngine.PlaySound(SoundID.NPCHit18, Projectile.position); } } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (Projectile.Calamity().stealthStrike && !posthit) + { + Projectile.ModifyHitNPCSticky(2); + posthit = true; + } + Projectile.damage = (int)(Projectile.damage * 0.9f); + if (Projectile.damage < 1) + Projectile.damage = 1; + } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Ichor, Projectile.Calamity().stealthStrike ? 600 : 120); - + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (targetHitbox.Width > 8 && targetHitbox.Height > 8 && Projectile.Calamity().stealthStrike) + { + targetHitbox.Inflate(-targetHitbox.Width / 8, -targetHitbox.Height / 8); + } + return null; + } + public override void Kill(int timeLeft) + { + for (int i = 0; i <= 9; i++) + { + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, Main.rand.Next(169, 170), Projectile.oldVelocity.X * 0.3f, Projectile.oldVelocity.Y * 0.3f, 0, default, Main.rand.NextFloat(1.2f, 1.6f)); + } + } public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Ichor, Projectile.Calamity().stealthStrike ? 600 : 120); } } diff --git a/Projectiles/Rogue/LanceofDestiny.cs b/Projectiles/Rogue/LanceofDestiny.cs new file mode 100644 index 0000000000..d496bff2c9 --- /dev/null +++ b/Projectiles/Rogue/LanceofDestiny.cs @@ -0,0 +1,120 @@ +using CalamityMod.Particles; +using CalamityMod.Projectiles.Pets; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Mono.Cecil; +using System; +using System.Reflection.Metadata; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class LanceofDestiny : ModProjectile, ILocalizedModType + { + public static readonly SoundStyle Hitsound = new("CalamityMod/Sounds/NPCKilled/DevourerSegmentBreak2") { Volume = 0.6f, PitchVariance = 0.3f}; + public new string LocalizationCategory => "Projectiles.Rogue"; + public override string Texture => "CalamityMod/Projectiles/Rogue/LanceofDestiny"; + public bool posthit = false; + public int Time = 0; + public override void SetDefaults() + { + Projectile.width = 20; + Projectile.height = 20; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.penetrate = 6; + Projectile.timeLeft = 900; + Projectile.aiStyle = 0; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 50; + Projectile.tileCollide = false; + Projectile.extraUpdates = 6; + } + + public override void AI() + { + Time++; + Projectile.scale = 1.5f; + Projectile.velocity *= 1.02f; + if (!Projectile.Calamity().stealthStrike) + Projectile.extraUpdates = 1; + + if (Projectile.timeLeft % 5 == 0) + { + float radiusFactor = MathHelper.Lerp(0f, 1f, Utils.GetLerpValue(10f, 50f, Time, true)); + for (int i = 0; i < 4; i++) + { + float offsetRotationAngle = Projectile.velocity.ToRotation() + Time / 20f; + float radius = (30f + (float)Math.Cos(Time / 13f) * 6f) * radiusFactor; + Vector2 dustPosition = Projectile.Center; + dustPosition += offsetRotationAngle.ToRotationVector2().RotatedBy(i / 5f * MathHelper.TwoPi) * radius; + CritSpark spark = new CritSpark(dustPosition, -Projectile.velocity, Color.PaleGoldenrod, Color.Goldenrod, Main.rand.NextFloat(1.1f, 1.5f), Main.rand.Next(5, 8), 5f); + GeneralParticleHandler.SpawnParticle(spark); + } + } + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; + + bool defaultsonce = true; + if (Projectile.Calamity().stealthStrike) + { + Projectile.aiStyle = 0; + Projectile.extraUpdates = 2; + if (Projectile.ai[0] == 0f) + { + if (defaultsonce) + { + Projectile.penetrate = 10; + Projectile.localNPCHitCooldown = 60; + defaultsonce = false; + } + } + } + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = ModContent.Request(Texture).Value; + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + return false; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + for (int i = 0; i <= 3; i++) + { + Dust dust2 = Main.dust[Dust.NewDust(target.position, Projectile.width, Projectile.height, Main.rand.NextBool(3) ? 130 : 133, Projectile.oldVelocity.X * Main.rand.NextFloat(1.1f, 1.3f), Projectile.oldVelocity.Y * Main.rand.NextFloat(1.1f, 1.3f), 0, default, 1.1f)]; + } + SoundEngine.PlaySound(Hitsound, Projectile.position); + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (Projectile.Calamity().stealthStrike && !posthit) + { + posthit = true; + } + Projectile.damage = (int)(Projectile.damage * 0.9f); + if (Projectile.damage < 1) + Projectile.damage = 1; + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (targetHitbox.Width > 8 && targetHitbox.Height > 8 && Projectile.Calamity().stealthStrike) + { + targetHitbox.Inflate(-targetHitbox.Width / 8, -targetHitbox.Height / 8); + } + return null; + } + public override void Kill(int timeLeft) + { + for (int i = 0; i <= 9; i++) + { + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, Main.rand.Next(169, 170), Projectile.oldVelocity.X * 0.3f, Projectile.oldVelocity.Y * 0.3f, 0, default, Main.rand.NextFloat(1.2f, 1.6f)); + } + } + } +} diff --git a/Projectiles/Rogue/LanceofDestiny.png b/Projectiles/Rogue/LanceofDestiny.png new file mode 100644 index 0000000000..72395d8fa7 Binary files /dev/null and b/Projectiles/Rogue/LanceofDestiny.png differ diff --git a/Projectiles/Rogue/LuminousShard.cs b/Projectiles/Rogue/LuminousShard.cs deleted file mode 100644 index fdfc7cfd08..0000000000 --- a/Projectiles/Rogue/LuminousShard.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Rogue -{ - public class LuminousShard : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Rogue"; - bool gravity = false; - - public override void SetDefaults() - { - Projectile.width = 10; - Projectile.height = 18; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.penetrate = 1; - Projectile.timeLeft = 120; - Projectile.DamageType = RogueDamageClass.Instance; - } - - public override bool? CanHitNPC(NPC target) => Projectile.timeLeft < 90 && target.CanBeChasedBy(Projectile); - - public override void AI() - { - if (Projectile.ai[0] == 0f && Projectile.velocity.X == 0f && Projectile.velocity.Y == -2f) - gravity = true; - - Projectile.ai[0] = 1f; - Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver2; - - if (gravity) - Projectile.velocity.Y *= 1.05f; - - if (Projectile.timeLeft < 90) - CalamityUtils.HomeInOnNPC(Projectile, true, 600f, 10f, 20f); - } - - public override void Kill(int timeLeft) - { - for (int i = 0; i <= 2; i++) - { - int num195 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 176, Projectile.oldVelocity.X / 4, Projectile.oldVelocity.Y / 4, 0, default, 0.75f); - Main.dust[num195].noGravity = true; - Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 177, Projectile.oldVelocity.X / 4, Projectile.oldVelocity.Y / 4, 0, default, 0.75f); - Main.dust[num195].noGravity = true; - Main.dust[num195].velocity *= 3f; - } - } - } -} diff --git a/Projectiles/Rogue/LuminousShard.png b/Projectiles/Rogue/LuminousShard.png deleted file mode 100644 index c41a239169..0000000000 Binary files a/Projectiles/Rogue/LuminousShard.png and /dev/null differ diff --git a/Projectiles/Rogue/LuminousStrikerProj.cs b/Projectiles/Rogue/LuminousStrikerProj.cs deleted file mode 100644 index bf416c93ae..0000000000 --- a/Projectiles/Rogue/LuminousStrikerProj.cs +++ /dev/null @@ -1,110 +0,0 @@ -using System; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Rogue -{ - public class LuminousStrikerProj : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Rogue"; - public override string Texture => "CalamityMod/Items/Weapons/Rogue/LuminousStriker"; - - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - } - - public override void SetDefaults() - { - Projectile.width = 30; - Projectile.height = 30; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.penetrate = 4; - Projectile.localNPCHitCooldown = 13; - Projectile.usesLocalNPCImmunity = true; - Projectile.timeLeft = 120; - Projectile.DamageType = RogueDamageClass.Instance; - } - - public override void AI() - { - if (Projectile.ai[0] == 0f && Projectile.Calamity().stealthStrike) - { - Projectile.timeLeft = 600; - Projectile.ai[0] = 1f; - } - - if (Main.rand.NextBool(4)) - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 176, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); - - Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver4; - - if (Projectile.timeLeft % 4 == 0) - { - if (Projectile.owner == Main.myPlayer) - { - if (Projectile.Calamity().stealthStrike) - { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X + Main.rand.NextFloat(-15f, 15f), Projectile.Center.Y + Main.rand.NextFloat(-15f, 15f), Projectile.velocity.X, Projectile.velocity.Y, ModContent.ProjectileType(), (int)(Projectile.damage * 0.25), Projectile.knockBack * 0.25f, Projectile.owner); - } - else - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, Projectile.velocity.X * 0f, -2f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.25), Projectile.knockBack * 0.25f, Projectile.owner); - } - } - } - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); - return false; - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - if (Projectile.owner == Main.myPlayer) - { - for (int i = 0; i < 7; i++) - { - Vector2 speed = new Vector2(Main.rand.Next(-50, 51), Main.rand.Next(-50, 51)); - while (speed.X == 0f && speed.Y == 0f) - { - speed = new Vector2(Main.rand.Next(-50, 51), Main.rand.Next(-50, 51)); - } - speed.Normalize(); - speed *= Main.rand.Next(30, 61) * 0.1f * 2f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, speed.X, speed.Y, ModContent.ProjectileType(), (int)(Projectile.damage * 0.25), Projectile.knockBack * 0.25f, Projectile.owner); - } - } - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (Projectile.owner == Main.myPlayer) - { - for (int i = 0; i < 7; i++) - { - Vector2 speed = new Vector2(Main.rand.Next(-50, 51), Main.rand.Next(-50, 51)); - while (speed.X == 0f && speed.Y == 0f) - { - speed = new Vector2(Main.rand.Next(-50, 51), Main.rand.Next(-50, 51)); - } - speed.Normalize(); - speed *= Main.rand.Next(30, 61) * 0.1f * 2f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, speed.X, speed.Y, ModContent.ProjectileType(), (int)(Projectile.damage * 0.25), Projectile.knockBack * 0.25f, Projectile.owner); - } - } - } - - public override void Kill(int timeLeft) - { - for (int i = 0; i <= 10; i++) - { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 176, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); - } - } - } -} diff --git a/Projectiles/Rogue/MeteorFistProj.cs b/Projectiles/Rogue/MeteorFistProj.cs index 64bb8c806d..2b1f9ae01b 100644 --- a/Projectiles/Rogue/MeteorFistProj.cs +++ b/Projectiles/Rogue/MeteorFistProj.cs @@ -25,19 +25,19 @@ namespace CalamityMod.Projectiles.Rogue { if (Projectile.velocity.Length() >= 4f) { - for (int num246 = 0; num246 < 2; num246++) + for (int i = 0; i < 2; i++) { - float num247 = 0f; - float num248 = 0f; - if (num246 == 1) + float dustyX = 0f; + float dustyY = 0f; + if (i == 1) { - num247 = Projectile.velocity.X * 0.5f; - num248 = Projectile.velocity.Y * 0.5f; + dustyX = Projectile.velocity.X * 0.5f; + dustyY = Projectile.velocity.Y * 0.5f; } - int num249 = Dust.NewDust(new Vector2(Projectile.position.X + 3f + num247, Projectile.position.Y + 3f + num248) - Projectile.velocity * 0.5f, Projectile.width - 8, Projectile.height - 8, 6, 0f, 0f, 100, default, 0.5f); - Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; - Main.dust[num249].velocity *= 0.2f; - Main.dust[num249].noGravity = true; + int meteorDust = Dust.NewDust(new Vector2(Projectile.position.X + 3f + dustyX, Projectile.position.Y + 3f + dustyY) - Projectile.velocity * 0.5f, Projectile.width - 8, Projectile.height - 8, 6, 0f, 0f, 100, default, 0.5f); + Main.dust[meteorDust].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[meteorDust].velocity *= 0.2f; + Main.dust[meteorDust].noGravity = true; } } @@ -48,16 +48,16 @@ namespace CalamityMod.Projectiles.Rogue } else if (Main.rand.NextBool(2)) { - int num252 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 0.5f); - Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; - Main.dust[num252].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f; - Main.dust[num252].noGravity = true; - Main.dust[num252].position = Projectile.Center + new Vector2(0f, (float)(-(float)Projectile.height / 2)).RotatedBy((double)Projectile.rotation, default) * 1.1f; + int fieryDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 0.5f); + Main.dust[fieryDust].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; + Main.dust[fieryDust].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f; + Main.dust[fieryDust].noGravity = true; + Main.dust[fieryDust].position = Projectile.Center + new Vector2(0f, (float)(-(float)Projectile.height / 2)).RotatedBy((double)Projectile.rotation, default) * 1.1f; Main.rand.Next(2); - num252 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 0.5f); - Main.dust[num252].scale = 1f + (float)Main.rand.Next(5) * 0.1f; - Main.dust[num252].noGravity = true; - Main.dust[num252].position = Projectile.Center + new Vector2(0f, (float)(-(float)Projectile.height / 2 - 6)).RotatedBy((double)Projectile.rotation, default) * 1.1f; + fieryDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 0.5f); + Main.dust[fieryDust].scale = 1f + (float)Main.rand.Next(5) * 0.1f; + Main.dust[fieryDust].noGravity = true; + Main.dust[fieryDust].position = Projectile.Center + new Vector2(0f, (float)(-(float)Projectile.height / 2 - 6)).RotatedBy((double)Projectile.rotation, default) * 1.1f; } Projectile.ai[0] += 1f; @@ -74,9 +74,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.netUpdate = true; } } - - if (!Projectile.Calamity().stealthStrike) - Projectile.velocity.Y += 0.1f; + Projectile.velocity.Y += 0.1f; } } @@ -88,23 +86,23 @@ namespace CalamityMod.Projectiles.Rogue Projectile.localNPCHitCooldown = 10; Projectile.Damage(); SoundEngine.PlaySound(SoundID.Item14, Projectile.position); - for (int num621 = 0; num621 < 40; num621++) + for (int j = 0; j < 40; j++) { - int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 1f); - Main.dust[num622].velocity *= 3f; + int boomDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 1f); + Main.dust[boomDust].velocity *= 3f; if (Main.rand.NextBool(2)) { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[boomDust].scale = 0.5f; + Main.dust[boomDust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - for (int num623 = 0; num623 < 70; num623++) + for (int k = 0; k < 70; k++) { - int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 2f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 1f); - Main.dust[num624].velocity *= 2f; + int boomDust2 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 2f); + Main.dust[boomDust2].noGravity = true; + Main.dust[boomDust2].velocity *= 5f; + boomDust2 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 1f); + Main.dust[boomDust2].velocity *= 2f; } if (Main.netMode != NetmodeID.Server) @@ -152,43 +150,7 @@ namespace CalamityMod.Projectiles.Rogue } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(BuffID.OnFire, 120); - float minDist = 999f; - int index = 0; - // Get the closest enemy to the fist - if (Projectile.Calamity().stealthStrike && Projectile.ai[1] > 0f && Projectile.penetrate != -1) - { - for (int i = 0; i < Main.npc.Length; i++) - { - NPC npc = Main.npc[i]; - if (npc.CanBeChasedBy(Projectile, false) && npc != target) - { - float dist = (Projectile.Center - npc.Center).Length(); - if (dist < minDist) - { - minDist = dist; - index = i; - } - } - } - Vector2 newFistVelocity; - if (minDist < 999f) - { - newFistVelocity = Main.npc[index].Center - Projectile.Center; - } - else - { - newFistVelocity = -Projectile.velocity; - } - newFistVelocity.Normalize(); - newFistVelocity *= 10f; - float AI1 = Projectile.ai[1] - 1f; - int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.position, newFistVelocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, AI1); - Main.projectile[p].Calamity().stealthStrike = true; - } - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.OnFire, 120); public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.OnFire, 120); } diff --git a/Projectiles/Rogue/MeteorFistStealth.cs b/Projectiles/Rogue/MeteorFistStealth.cs new file mode 100644 index 0000000000..2b84a03b68 --- /dev/null +++ b/Projectiles/Rogue/MeteorFistStealth.cs @@ -0,0 +1,193 @@ +using Microsoft.Xna.Framework; +using System; +using System.Collections.Generic; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Audio; + +namespace CalamityMod.Projectiles.Rogue +{ + public class MeteorFistStealth : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Rogue"; + public override string Texture => "CalamityMod/Projectiles/Rogue/MeteorFistProj"; + public override void SetDefaults() + { + Projectile.width = 20; + Projectile.height = 20; + Projectile.friendly = true; + Projectile.penetrate = 4; + Projectile.extraUpdates = 1; + Projectile.timeLeft = 360; + Projectile.DamageType = RogueDamageClass.Instance; + } + + public override void AI() + { + if (Projectile.velocity.Length() >= 4f) + { + for (int i = 0; i < 2; i++) + { + float dustyX = 0f; + float dustyY = 0f; + if (i == 1) + { + dustyX = Projectile.velocity.X * 0.5f; + dustyY = Projectile.velocity.Y * 0.5f; + } + int meteorDust = Dust.NewDust(new Vector2(Projectile.position.X + 3f + dustyX, Projectile.position.Y + 3f + dustyY) - Projectile.velocity * 0.5f, Projectile.width - 8, Projectile.height - 8, 6, 0f, 0f, 100, default, 0.5f); + Main.dust[meteorDust].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[meteorDust].velocity *= 0.2f; + Main.dust[meteorDust].noGravity = true; + } + } + + // Almost instantly accelerate to very high speed + if (Projectile.velocity.Length() < 12f) + { + Projectile.velocity *= 1.25f; + } + else if (Main.rand.NextBool(2)) + { + int fieryDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 0.5f); + Main.dust[fieryDust].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; + Main.dust[fieryDust].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f; + Main.dust[fieryDust].noGravity = true; + Main.dust[fieryDust].position = Projectile.Center + new Vector2(0f, (float)(-(float)Projectile.height / 2)).RotatedBy((double)Projectile.rotation, default) * 1.1f; + Main.rand.Next(2); + fieryDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 0.5f); + Main.dust[fieryDust].scale = 1f + (float)Main.rand.Next(5) * 0.1f; + Main.dust[fieryDust].noGravity = true; + Main.dust[fieryDust].position = Projectile.Center + new Vector2(0f, (float)(-(float)Projectile.height / 2 - 6)).RotatedBy((double)Projectile.rotation, default) * 1.1f; + } + + Projectile.ai[0] += 1f; + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + if (Projectile.ai[0] > 10f || Projectile.ai[0] > 5f) + { + Projectile.ai[0] = 10f; + if (Projectile.velocity.Y == 0f && Projectile.velocity.X != 0f) + { + Projectile.velocity.X *= 0.97f; + if (Math.Abs(Projectile.velocity.X) < 0.01f) + { + Projectile.velocity.X = 0f; + Projectile.netUpdate = true; + } + } + } + } + + public override void Kill(int timeLeft) + { + Projectile.ExpandHitboxBy(32); + Projectile.maxPenetrate = Projectile.penetrate = -1; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 10; + Projectile.Damage(); + SoundEngine.PlaySound(SoundID.Item14, Projectile.position); + for (int j = 0; j < 40; j++) + { + int boomDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 1f); + Main.dust[boomDust].velocity *= 3f; + if (Main.rand.NextBool(2)) + { + Main.dust[boomDust].scale = 0.5f; + Main.dust[boomDust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int k = 0; k < 70; k++) + { + int boomDust2 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 2f); + Main.dust[boomDust2].noGravity = true; + Main.dust[boomDust2].velocity *= 5f; + boomDust2 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 1f); + Main.dust[boomDust2].velocity *= 2f; + } + + if (Main.netMode != NetmodeID.Server) + { + Vector2 goreSource = Projectile.Center; + int goreAmt = 3; + Vector2 source = new Vector2(goreSource.X - 24f, goreSource.Y - 24f); + for (int goreIndex = 0; goreIndex < goreAmt; goreIndex++) + { + float velocityMult = 0.33f; + if (goreIndex < (goreAmt / 3)) + { + velocityMult = 0.66f; + } + if (goreIndex >= (2 * goreAmt / 3)) + { + velocityMult = 1f; + } + Mod mod = ModContent.GetInstance(); + int type = Main.rand.Next(61, 64); + int smoke = Gore.NewGore(Projectile.GetSource_Death(), source, default, type, 1f); + Gore gore = Main.gore[smoke]; + gore.velocity *= velocityMult; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; + type = Main.rand.Next(61, 64); + smoke = Gore.NewGore(Projectile.GetSource_Death(), source, default, type, 1f); + gore = Main.gore[smoke]; + gore.velocity *= velocityMult; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; + type = Main.rand.Next(61, 64); + smoke = Gore.NewGore(Projectile.GetSource_Death(), source, default, type, 1f); + gore = Main.gore[smoke]; + gore.velocity *= velocityMult; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; + type = Main.rand.Next(61, 64); + smoke = Gore.NewGore(Projectile.GetSource_Death(), source, default, type, 1f); + gore = Main.gore[smoke]; + gore.velocity *= velocityMult; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; + } + } + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(BuffID.OnFire, 120); + Projectile.damage /= 2; + float minDist = 999f; + int index = 0; + // Get the closest enemy to the fist + if (Projectile.penetrate != -1) + { + for (int i = 0; i < Main.npc.Length; i++) + { + NPC npc = Main.npc[i]; + if (npc.CanBeChasedBy(Projectile, false) && npc != target) + { + float dist = (Projectile.Center - npc.Center).Length(); + if (dist < minDist) + { + minDist = dist; + index = i; + } + } + } + Vector2 newFistVelocity; + if (minDist < 999f) + { + newFistVelocity = Main.npc[index].Center - Projectile.Center; + } + else + { + newFistVelocity = -Projectile.velocity; + } + newFistVelocity.Normalize(); + newFistVelocity *= 10f; + Projectile.velocity = newFistVelocity; + } + } + + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.OnFire, 120); + } +} diff --git a/Projectiles/Rogue/PenumbraBomb.cs b/Projectiles/Rogue/PenumbraBomb.cs index 767b6de5c6..eb3fe21ea3 100644 --- a/Projectiles/Rogue/PenumbraBomb.cs +++ b/Projectiles/Rogue/PenumbraBomb.cs @@ -3,6 +3,8 @@ using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; using Terraria.Audio; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Rogue { @@ -23,7 +25,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.height = 32; Projectile.friendly = true; Projectile.tileCollide = false; - Projectile.timeLeft = 150; + Projectile.timeLeft = 300; Projectile.extraUpdates = 2; Projectile.DamageType = RogueDamageClass.Instance; Projectile.ignoreWater = true; @@ -72,6 +74,11 @@ namespace CalamityMod.Projectiles.Rogue } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(BuffID.Daybreak, 240); + target.AddBuff(ModContent.BuffType(), 240); + } public override void Kill(int timeLeft) { //Dark soul projectiles diff --git a/Projectiles/Rogue/PenumbraSoul.cs b/Projectiles/Rogue/PenumbraSoul.cs index 4174bf0a10..86e6897a8c 100644 --- a/Projectiles/Rogue/PenumbraSoul.cs +++ b/Projectiles/Rogue/PenumbraSoul.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Rogue private void HomingAI() { - CalamityUtils.HomeInOnNPC(Projectile, true, 200f, Penumbra.ShootSpeed * 1.5f, 35f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 35f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Rogue/PhantasmalRuinGhost.cs b/Projectiles/Rogue/PhantasmalRuinGhost.cs deleted file mode 100644 index 6a818b5677..0000000000 --- a/Projectiles/Rogue/PhantasmalRuinGhost.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Rogue -{ - public class PhantasmalRuinGhost : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Rogue"; - public override void SetDefaults() - { - Projectile.width = 30; - Projectile.height = 30; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.penetrate = 1; - Projectile.tileCollide = false; - Projectile.timeLeft = 240; - Projectile.extraUpdates = 1; - Projectile.DamageType = RogueDamageClass.Instance; - } - - public override void AI() - { - // Set the projectile's direction correctly - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; - - // The projectile rapidly fades in as it starts existing - if (Projectile.timeLeft >= 207) - Projectile.alpha += 6; - - CalamityUtils.HomeInOnNPC(Projectile, true, 300f, 12f, 40f); - } - - public override Color? GetAlpha(Color lightColor) => new Color(100, 200, 255, 100); - - public override bool PreDraw(ref Color lightColor) - { - if (Projectile.timeLeft > 239) - return false; - - Texture2D tex = ModContent.Request(Texture).Value; - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); - return false; - } - } -} diff --git a/Projectiles/Rogue/PhantasmalRuinGhost.png b/Projectiles/Rogue/PhantasmalRuinGhost.png deleted file mode 100644 index 2eeba11d83..0000000000 Binary files a/Projectiles/Rogue/PhantasmalRuinGhost.png and /dev/null differ diff --git a/Projectiles/Rogue/PhantasmalRuinProj.cs b/Projectiles/Rogue/PhantasmalRuinProj.cs index 897d31c337..b6d6c5e2d0 100644 --- a/Projectiles/Rogue/PhantasmalRuinProj.cs +++ b/Projectiles/Rogue/PhantasmalRuinProj.cs @@ -1,5 +1,8 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Projectiles.Melee; +using Microsoft.Xna.Framework; +using Mono.Cecil; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -9,9 +12,8 @@ namespace CalamityMod.Projectiles.Rogue { public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/PhantasmalRuin"; - + public static readonly SoundStyle HitSound = new("CalamityMod/Sounds/Item/WulfrumKnifeThrowSingle") { Volume = 0.8f}; private const int Lifetime = 600; - private const int FramesPerSubProjectile = 13; public override void SetStaticDefaults() { @@ -28,7 +30,9 @@ namespace CalamityMod.Projectiles.Rogue Projectile.penetrate = 1; Projectile.tileCollide = false; Projectile.timeLeft = Lifetime; - Projectile.extraUpdates = 1; + Projectile.extraUpdates = 2; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 20 * Projectile.MaxUpdates; Projectile.DamageType = RogueDamageClass.Instance; } @@ -44,22 +48,14 @@ namespace CalamityMod.Projectiles.Rogue Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; // Dust and light - Dust d = Dust.NewDustDirect(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 175, Projectile.velocity.X * 0.25f, Projectile.velocity.Y * 0.25f, 0, default, 0.85f); + Dust d = Dust.NewDustDirect(Projectile.position + Projectile.velocity, Projectile.width - (Projectile.Calamity().stealthStrike ? 6 : 0), Projectile.height - (Projectile.Calamity().stealthStrike ? 6 : 0), Projectile.Calamity().stealthStrike ? 132 : 180, Projectile.velocity.X * -0.8f, Projectile.velocity.Y * -0.8f, 0, default, Projectile.Calamity().stealthStrike ? 1.2f : 0.8f); d.noLight = true; - Lighting.AddLight(Projectile.Center + Projectile.velocity * 0.1f, 0.4f, 0.7f, 0.9f); + d.noGravity = true; + Lighting.AddLight(Projectile.Center + Projectile.velocity * 0.2f, 0.2f, 0.7f, 0.9f); - // Fire sub projectiles occasionally - bool shouldFireSubProjectile = (Lifetime - Projectile.timeLeft) % (Projectile.MaxUpdates * FramesPerSubProjectile) == 8; - if (Projectile.owner == Main.myPlayer && shouldFireSubProjectile) + if (Projectile.Calamity().stealthStrike) { - bool ss = Projectile.Calamity().stealthStrike; - int projID = ss ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = (int)(Projectile.damage * 0.25f); - float kb = Projectile.knockBack * (ss ? 1f : 0.25f); - Vector2 velocity = ss - ? (Projectile.velocity * 0.4f).RotatedBy(Main.rand.NextFloat(-0.04f, 0.04f)) - : (Projectile.velocity * 0.08f) + Main.rand.NextVector2Circular(0.4f, 0.4f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, projID, damage, kb, Projectile.owner); + Projectile.extraUpdates = 3; } } @@ -71,24 +67,45 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.owner != Main.myPlayer) return; - int numSouls = 4; - int projID = ModContent.ProjectileType(); - int soulDamage = (int)(Projectile.damage * 0.1f); - float soulKB = 0f; - float speed = 5f; - float startAngle = Main.rand.NextFloat(-0.07f, 0.07f) + MathHelper.PiOver4; - Vector2 velocity = (Vector2.UnitX * speed).RotatedBy(startAngle); - for (int i = 0; i < numSouls; i += 2) - { - // Each pair of souls has randomized player homing strength - float ai1 = Main.rand.NextFloat() + 0.5f; - if (Main.rand.NextBool(2)) - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, projID, soulDamage, soulKB, Projectile.owner, 0f, ai1); - if (Main.rand.NextBool(2)) - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, projID, soulDamage, soulKB, Projectile.owner, 0f, ai1); + SoundEngine.PlaySound(HitSound with { PitchVariance = 0.4f }, Projectile.position); - // Rotate direction for the next pair of souls. - velocity = velocity.RotatedBy(MathHelper.TwoPi / numSouls); + if (Projectile.Calamity().stealthStrike) + { + for (int i = 0; i < 5; i += 2) + { + int soulDamage = (int)(Projectile.damage * 0.3f); + Vector2 velocity = new Vector2(0f, -15f); + velocity = velocity.RotatedByRandom(0.5f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + new Vector2(0, 600f), velocity, ModContent.ProjectileType(), soulDamage, 0f, Projectile.owner, 0f); + } + } + else + { + int numSouls = 4; + int projID = ModContent.ProjectileType(); + int soulDamage = (int)(Projectile.damage * 0.2f); + float soulKB = 0f; + float speed = 4f; + float startAngle = Main.rand.NextFloat(-0.07f, 0.07f) + MathHelper.PiOver4; + Vector2 velocity = (Vector2.UnitX * speed).RotatedBy(startAngle); + for (int i = 0; i < numSouls; i += 2) + { + Vector2 velocityrandom = velocity.RotatedByRandom(1.5f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity + velocityrandom, projID, soulDamage, soulKB, Projectile.owner, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity - velocityrandom, projID, soulDamage, soulKB, Projectile.owner, 0f); + // Rotate direction for the next pair of souls. + velocity = velocity.RotatedBy(MathHelper.TwoPi / numSouls); + } + for (int i = 0; i < 8; i += 2) + { + // d, du, dus, dust :) + Dust du = Dust.NewDustPerfect(Projectile.Center, 180, velocity, 0, default, Main.rand.NextFloat(1.1f, 1.4f)); + Dust dus = Dust.NewDustPerfect(Projectile.Center, 180, -velocity, 0, default, Main.rand.NextFloat(1.1f, 1.4f)); + du.noGravity = true; + dus.noGravity = true; + // Rotate direction for the next dust. + velocity = velocity.RotatedBy(MathHelper.TwoPi / numSouls); + } } } } diff --git a/Projectiles/Rogue/PhantasmalSoul.cs b/Projectiles/Rogue/PhantasmalSoul.cs index 1384fd4ffc..020d83b9dc 100644 --- a/Projectiles/Rogue/PhantasmalSoul.cs +++ b/Projectiles/Rogue/PhantasmalSoul.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Melee; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Rogue { public new string LocalizationCategory => "Projectiles.Rogue"; private const int Lifetime = 300; - private const int NoHomingFrames = 40; + private const int NoHomingFrames = 35; private const int NoHitFrames = 10; private const int NoDrawFrames = 5; diff --git a/Projectiles/Rogue/PhantasmalSoul.png b/Projectiles/Rogue/PhantasmalSoul.png index 43ec7bc42b..6c676ecd82 100644 Binary files a/Projectiles/Rogue/PhantasmalSoul.png and b/Projectiles/Rogue/PhantasmalSoul.png differ diff --git a/Projectiles/Rogue/PhantasmalSoulBlue.cs b/Projectiles/Rogue/PhantasmalSoulBlue.cs new file mode 100644 index 0000000000..9fa1490ff4 --- /dev/null +++ b/Projectiles/Rogue/PhantasmalSoulBlue.cs @@ -0,0 +1,119 @@ +using CalamityMod.Items.Weapons.Melee; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Audio; + +namespace CalamityMod.Projectiles.Rogue +{ + public class PhantasmalSoulBlue : ModProjectile, ILocalizedModType + { + public static readonly SoundStyle HitSound = new("CalamityMod/Sounds/Item/PhantomSpirit") { Volume = 0.2f }; + public new string LocalizationCategory => "Projectiles.Rogue"; + private const int Lifetime = 300; + private const int NoHomingFrames = 45; + private const int NoHitFrames = 20; + private const int NoDrawFrames = 5; + + public override void SetStaticDefaults() + { + Main.projFrames[Projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; + ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + } + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 36; + Projectile.alpha = 100; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.extraUpdates = 1; + Projectile.penetrate = 1; + Projectile.timeLeft = Lifetime; + } + + public override bool? CanHitNPC(NPC target) => Projectile.timeLeft < Lifetime - NoHomingFrames && target.CanBeChasedBy(Projectile); + + public override void AI() + { + // Handle animation + Projectile.frameCounter++; + if (Projectile.frameCounter > 6) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + if (Projectile.frame > 3) + Projectile.frame = 0; + + // Activate homing on enemies after a brief delay + if (Projectile.timeLeft < Lifetime - NoHomingFrames) + Projectile.ai[0] = 1f; + + // Occasional dust + if (Main.rand.NextBool(4)) + { + int dustID = 180; + Dust d = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, dustID); + d.velocity *= 0.1f; + d.scale = 1.3f; + d.noGravity = true; + d.noLight = true; + } + + // Blue light + Lighting.AddLight(Projectile.Center, 0.2f, 0.2f, 0.7f); + + // Make sure the soul is always facing forwards + Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; + + if (Projectile.ai[0] == 1f) + CalamityUtils.HomeInOnNPC(Projectile, true, 900f, 15f, 20f); + } + + public override bool PreDraw(ref Color lightColor) + { + if (Projectile.timeLeft > Lifetime - NoDrawFrames) + return false; + + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + return false; + } + + // Get darker when about to disappear + public override Color? GetAlpha(Color lightColor) + { + if (Projectile.timeLeft < 85) + { + byte b2 = (byte)(Projectile.timeLeft * 3); + byte a2 = (byte)(100f * ((float)b2 / 255f)); + return new Color((int)b2, (int)b2, (int)b2, (int)a2); + } + return new Color(255, 255, 255, 100); + } + + public override void Kill(int timeLeft) + { + int dustCount = 36; + int dustID = 180; + for (int i = 0; i < dustCount; i++) + { + Vector2 velocity = Main.rand.NextVector2Circular(1f, 1f); + velocity = 12f * velocity + Projectile.velocity * 0.1f; + Dust d = Dust.NewDustDirect(Projectile.Center, 0, 0, dustID); + d.velocity = velocity; + d.noGravity = true; + d.noLight = true; + } + + SoundEngine.PlaySound(HitSound with { PitchVariance = 0.4f }, Projectile.position); + } + + // Cannot deal damage for the first several frames of existence. + public override bool CanHitPvp(Player target) => Projectile.timeLeft < Lifetime - NoHitFrames; + } +} diff --git a/Projectiles/Rogue/PhantasmalSoulBlue.png b/Projectiles/Rogue/PhantasmalSoulBlue.png new file mode 100644 index 0000000000..028c2215ff Binary files /dev/null and b/Projectiles/Rogue/PhantasmalSoulBlue.png differ diff --git a/Projectiles/Rogue/PhantomLanceProj.cs b/Projectiles/Rogue/PhantomLanceProj.cs deleted file mode 100644 index 15a9ac13bc..0000000000 --- a/Projectiles/Rogue/PhantomLanceProj.cs +++ /dev/null @@ -1,81 +0,0 @@ -using CalamityMod.Projectiles.Magic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Rogue -{ - public class PhantomLanceProj : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Rogue"; - public override string Texture => "CalamityMod/Items/Weapons/Rogue/PhantomLance"; - - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - } - - public override void SetDefaults() - { - Projectile.width = 20; - Projectile.height = 20; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.penetrate = 1; - Projectile.tileCollide = false; - Projectile.timeLeft = 300; - Projectile.extraUpdates = 1; - Projectile.DamageType = RogueDamageClass.Instance; - } - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); - return false; - } - - public override void AI() - { - if (!Projectile.Calamity().stealthStrike) - { - if (Projectile.timeLeft <= 255) - Projectile.alpha += 1; - if (Projectile.timeLeft >= 75) - { - Projectile.velocity.X *= 0.995f; - Projectile.velocity.Y *= 0.995f; - } - } - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 175, Projectile.velocity.X * 0.25f, Projectile.velocity.Y * 0.25f, 0, default, 0.85f); - Projectile.ai[0]++; - if (Projectile.ai[0] % 18f == 0f) - { - if (Projectile.owner == Main.myPlayer) - { - float damageMult = Projectile.timeLeft * 0.7f / 300f; - if (Projectile.Calamity().stealthStrike) - damageMult = 0.7f; - int soulDamage = (int)(Projectile.damage * damageMult); - int soul = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), soulDamage, Projectile.knockBack, Projectile.owner); - if (soul.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[soul].DamageType = RogueDamageClass.Instance; - Main.projectile[soul].usesLocalNPCImmunity = true; - Main.projectile[soul].localNPCHitCooldown = -2; - } - } - } - } - - public override void Kill(int timeLeft) - { - for (int i = 0; i <= 10; i++) - { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 175, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); - } - } - } -} diff --git a/Projectiles/Rogue/RealityRuptureLance.cs b/Projectiles/Rogue/RealityRuptureLance.cs new file mode 100644 index 0000000000..524d425efb --- /dev/null +++ b/Projectiles/Rogue/RealityRuptureLance.cs @@ -0,0 +1,92 @@ +using System; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class RealityRuptureLance : ModProjectile, ILocalizedModType + { + public static readonly SoundStyle Hitsound = new("CalamityMod/Sounds/NPCKilled/DevourerSegmentBreak2") { Volume = 0.6f, PitchVariance = 0.3f }; + public new string LocalizationCategory => "Projectiles.Rogue"; + public override string Texture => "CalamityMod/Items/Weapons/Rogue/RealityRupture"; + public int Time = 0; + public ref float Timer => ref Projectile.ai[0]; + public override void SetDefaults() + { + Projectile.width = 30; + Projectile.height = 30; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.penetrate = 8; + Projectile.timeLeft = 900; + Projectile.aiStyle = 0; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 50; + Projectile.tileCollide = false; + Projectile.extraUpdates = 5; + } + + public override void AI() + { + Timer++; + Time++; + Lighting.AddLight(Projectile.Center + Projectile.velocity * 0.6f, 0.6f, 0.2f, 0.9f); + float radiusFactor = MathHelper.Lerp(0f, 1f, Utils.GetLerpValue(10f, 50f, Time, true)); + for (int i = 0; i < 9; i++) + { + float offsetRotationAngle = Projectile.velocity.ToRotation() + Time / 20f; + float radius = (20f + (float)Math.Cos(Time / 3f) * 12f) * radiusFactor; + Vector2 dustPosition = Projectile.Center; + dustPosition += offsetRotationAngle.ToRotationVector2().RotatedBy(i / 5f * MathHelper.TwoPi) * radius; + Dust dust = Dust.NewDustPerfect(dustPosition, Main.rand.NextBool(2) ? 234 : 310); + dust.noGravity = true; + dust.velocity = Projectile.velocity * 0.8f; + dust.scale = Main.rand.NextFloat(1.1f, 1.7f); + } + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = ModContent.Request(Texture).Value; + + int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + int frameY = frameHeight * Projectile.frame; + float scale = Projectile.scale; + float rotation = Projectile.rotation; + + Rectangle rectangle = new Rectangle(0, frameY, texture.Width, frameHeight); + Vector2 origin = rectangle.Size() / 2f; + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), rectangle, Color.White, rotation, origin, scale, SpriteEffects.None, 0); + return false; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + for (int i = 0; i <= 4; i++) + { + Dust dust2 = Main.dust[Dust.NewDust(target.position, Projectile.width, Projectile.height, Main.rand.NextBool(4) ? 242 : 310, Projectile.oldVelocity.X * Main.rand.NextFloat(1.1f, 1.3f), Projectile.oldVelocity.Y * Main.rand.NextFloat(1.1f, 1.3f), 0, default, 1.1f)]; + } + SoundEngine.PlaySound(Hitsound, Projectile.position); + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + Projectile.damage = (int)(Projectile.damage * 0.95f); + if (Projectile.damage < 1) + Projectile.damage = 1; + } + public override void Kill(int timeLeft) + { + for (int i = 0; i <= 9; i++) + { + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 272, Projectile.oldVelocity.X * 0.3f, Projectile.oldVelocity.Y * 0.3f, 0, default, Main.rand.NextFloat(1.2f, 1.6f)); + } + } + } +} diff --git a/Projectiles/Rogue/RealityRuptureMini.cs b/Projectiles/Rogue/RealityRuptureMini.cs new file mode 100644 index 0000000000..222f9f2de3 --- /dev/null +++ b/Projectiles/Rogue/RealityRuptureMini.cs @@ -0,0 +1,111 @@ +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class RealityRuptureMini : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Rogue"; + public override string Texture => "CalamityMod/Projectiles/Rogue/RealityRuptureMini"; + public static readonly SoundStyle Hitsound = new("CalamityMod/Sounds/Item/WulfrumKnifeTileHit2") { PitchVariance = 0.3f, Volume = 0.5f }; + + public int framesInAir = 0; + public int SparkChance = 7; + + public override void SetDefaults() + { + Projectile.width = 34; + Projectile.height = 34; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.penetrate = 3; + Projectile.timeLeft = 800; + AIType = 0; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 10; + Projectile.extraUpdates = 3; + Projectile.tileCollide = false; + } + + public override void AI() + { + framesInAir++; + if (framesInAir < 120) + { + Lighting.AddLight(Projectile.Center + Projectile.velocity * 0.6f, 0.6f, 0.2f, 0.5f); + } + + if (Main.rand.NextBool(SparkChance)) + { + Vector2 SparkVelocity1 = Projectile.velocity.RotatedBy(-3, default) * 0.1f - Projectile.velocity / 2f; + Vector2 SparkPosition1 = Projectile.velocity.RotatedBy(-0.8, default); + SparkParticle spark = new SparkParticle(Projectile.Center + SparkPosition1, SparkVelocity1, false, Main.rand.Next(6, 8), Main.rand.NextFloat(0.6f, 0.8f), Color.Plum); + GeneralParticleHandler.SpawnParticle(spark); + + } + if (Main.rand.NextBool(SparkChance)) + { + Vector2 SparkVelocity2 = Projectile.velocity.RotatedBy(3, default) * 0.1f - Projectile.velocity / 2f; + Vector2 SparkPosition2 = Projectile.velocity.RotatedBy(0.8, default); + SparkParticle spark2 = new SparkParticle(Projectile.Center + SparkPosition2, SparkVelocity2, false, Main.rand.Next(6, 8), Main.rand.NextFloat(0.6f, 0.8f), Color.Plum); + GeneralParticleHandler.SpawnParticle(spark2); + } + + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; + + Vector2 center = Projectile.Center; + float maxDistance = 350f; + bool homeIn = false; + + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].CanBeChasedBy(Projectile, false)) + { + float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2); + bool canHit = Projectile.Calamity().stealthStrike || Collision.CanHit(Projectile.Center, 1, 1, Main.npc[i].Center, 1, 1); + + if (Vector2.Distance(Main.npc[i].Center, Projectile.Center) < (maxDistance + extraDistance) && canHit) + { + center = Main.npc[i].Center; + homeIn = true; + break; + } + } + } + + if (homeIn) + { + SparkChance = 14; + Projectile.extraUpdates = 4; + Vector2 moveDirection = Projectile.SafeDirectionTo(center, Vector2.UnitY); + Projectile.velocity = (Projectile.velocity * 20f + moveDirection * 12f) / (21f); + } + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + for (int i = 0; i <= 2; i++) + { + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 272, Projectile.oldVelocity.X * Main.rand.NextFloat(1.1f, 1.3f), Projectile.oldVelocity.Y * Main.rand.NextFloat(1.1f, 1.3f)); + } + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + Projectile.damage = (int)(Projectile.damage * 0.8f); + if (Projectile.damage < 1) + Projectile.damage = 1; + } + public override void Kill(int timeLeft) + { + SoundEngine.PlaySound(Hitsound, Projectile.position); + } + + //public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Ichor, 120); + } +} diff --git a/Projectiles/Rogue/RealityRuptureMini.png b/Projectiles/Rogue/RealityRuptureMini.png new file mode 100644 index 0000000000..bc7b3f6767 Binary files /dev/null and b/Projectiles/Rogue/RealityRuptureMini.png differ diff --git a/Projectiles/Rogue/RealityRuptureStealth.cs b/Projectiles/Rogue/RealityRuptureStealth.cs new file mode 100644 index 0000000000..d5c0e1887f --- /dev/null +++ b/Projectiles/Rogue/RealityRuptureStealth.cs @@ -0,0 +1,102 @@ +using CalamityMod.Particles; +using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Pets; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Mono.Cecil; +using System; +using System.Reflection.Metadata; +using Terraria; +using Terraria.Audio; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class RealityRuptureStealth : ModProjectile, ILocalizedModType + { + public static readonly SoundStyle Hitsound = new("CalamityMod/Sounds/Item/RealityRuptureStealthHit") { Volume = 0.7f, PitchVariance = 0.3f}; + public new string LocalizationCategory => "Projectiles.Rogue"; + public override string Texture => "CalamityMod/Items/Weapons/Rogue/RealityRupture"; + public bool posthit = false; + public int Time = 0; + public override void SetDefaults() + { + Projectile.width = 43; + Projectile.height = 43; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.penetrate = 1; + Projectile.timeLeft = 900; + Projectile.aiStyle = 0; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 50; + Projectile.tileCollide = false; + Projectile.extraUpdates = 7; + } + + public override void AI() + { + Time++; + Projectile.velocity *= 1.003f; + Projectile.scale = 1.3f; + + if (Main.rand.NextBool(2)) + { + Vector2 SparkVelocity1 = Projectile.velocity.RotatedBy(-2.5f, default) * 0.1f - Projectile.velocity / 2f; + Vector2 SparkPosition1 = Projectile.velocity.RotatedBy(-0.8, default); + SparkParticle spark = new SparkParticle(Projectile.Center + SparkPosition1, SparkVelocity1, false, Main.rand.Next(22, 25), Main.rand.NextFloat(1.2f, 1.9f), Color.Plum); + GeneralParticleHandler.SpawnParticle(spark); + + } + if (Main.rand.NextBool(2)) + { + Vector2 SparkVelocity2 = Projectile.velocity.RotatedBy(2.5f, default) * 0.1f - Projectile.velocity / 2f; + Vector2 SparkPosition2 = Projectile.velocity.RotatedBy(0.8, default); + SparkParticle spark2 = new SparkParticle(Projectile.Center + SparkPosition2, SparkVelocity2, false, Main.rand.Next(22, 25), Main.rand.NextFloat(1.2f, 1.9f), Color.Plum); + GeneralParticleHandler.SpawnParticle(spark2); + } + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + SoundEngine.PlaySound(Hitsound, Projectile.position); + posthit = true; + for (int i = 0; i < 7; i++) + { + Vector2 vel = Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(20f)); + float Scale = Main.rand.NextFloat(0.8f, 3.8f); + CrackParticle crack = new CrackParticle(Projectile.Center, vel, Color.Plum, new Vector2(1f, 1f), 0, Scale, Scale - 0.5f, Main.rand.Next(18, 23)); + GeneralParticleHandler.SpawnParticle(crack); + } + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0f, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack * 2, Projectile.owner, 0f); + Main.player[Projectile.owner].Calamity().GeneralScreenShakePower = 8; + } + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = ModContent.Request(Texture).Value; + + int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + int frameY = frameHeight * Projectile.frame; + float scale = Projectile.scale; + float rotation = Projectile.rotation; + + Rectangle rectangle = new Rectangle(0, frameY, texture.Width, frameHeight); + Vector2 origin = rectangle.Size() / 2f; + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), rectangle, Color.White, rotation, origin, scale, SpriteEffects.None, 0); + return false; + } + public override void Kill(int timeLeft) + { + for (int i = 0; i <= 15; i++) + { + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 272, Projectile.oldVelocity.X * 0.3f, Projectile.oldVelocity.Y * 0.3f, 0, default, Main.rand.NextFloat(1.7f, 2.1f)); + } + Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Plum, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 1f, 13); + GeneralParticleHandler.SpawnParticle(pulse); + } + } +} diff --git a/Projectiles/Rogue/ReaperProjectile.cs b/Projectiles/Rogue/ReaperProjectile.cs index d5a5a1af30..6a69508887 100644 --- a/Projectiles/Rogue/ReaperProjectile.cs +++ b/Projectiles/Rogue/ReaperProjectile.cs @@ -5,6 +5,11 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Particles; +using Terraria.Graphics.Shaders; +using Microsoft.Xna.Framework.Graphics; +using CalamityMod.Dusts; +using Microsoft.CodeAnalysis; namespace CalamityMod.Projectiles.Rogue { @@ -15,27 +20,27 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; + ProjectileID.Sets.TrailingMode[Projectile.type] = 2; } public override void SetDefaults() { - Projectile.width = 70; - Projectile.height = 70; + Projectile.width = 100; + Projectile.height = 100; Projectile.friendly = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.penetrate = -1; - Projectile.extraUpdates = 3; - Projectile.timeLeft = Projectile.MaxUpdates * 90; + Projectile.extraUpdates = 2; + Projectile.timeLeft = Projectile.MaxUpdates * 120; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 26; // can't hit too fast, but can hit many many times + Projectile.localNPCHitCooldown = Projectile.MaxUpdates * 9; // can't hit too fast, but can hit many many times Projectile.DamageType = RogueDamageClass.Instance; } - public override void AI() { + Projectile.rotation += 0.4f; if (Projectile.soundDelay == 0) { Projectile.soundDelay = 8; @@ -55,20 +60,20 @@ namespace CalamityMod.Projectiles.Rogue // Initial homing before landing a hit. else - CalamityUtils.HomeInOnNPC(Projectile, true, 250f, 12f, 14f); + CalamityUtils.HomeInOnNPC(Projectile, true, 250f, 14f, 14f); } // Homing after landing a hit. This homing repeatedly turns on and off. else { - float homingRange = 700f; + float homingRange = 1100f; //tbh 700 works for fat targets but then we'll get so many bug reports cuz it doesnt work on dummies bool noHomingThisFrame = false; if (Projectile.ai[0] == 1f) { Projectile.ai[1] += 1f; - if (Projectile.ai[1] > 40f) + if (Projectile.ai[1] > 30f) { - Projectile.ai[1] = 1f; + Projectile.ai[1] = 0f; Projectile.ai[0] = 0f; Projectile.netUpdate = true; } @@ -81,87 +86,86 @@ namespace CalamityMod.Projectiles.Rogue Vector2 homingTarget = Projectile.Center; bool foundTarget = false; + Vector2 targetVelocity = new Vector2(0f); for (int i = 0; i < Main.maxNPCs; i++) { - NPC nPC2 = Main.npc[i]; - if (nPC2.CanBeChasedBy(Projectile, false)) + NPC potentialTarget = Main.npc[i]; + if (potentialTarget.CanBeChasedBy(Projectile, false) && Projectile.WithinRange(Main.npc[i].Center, homingRange)) { - float npcDist = Vector2.Distance(nPC2.Center, Projectile.Center); if (!foundTarget) { - homingRange = npcDist; - homingTarget = nPC2.Center; + homingRange = Vector2.Distance(Projectile.Center, potentialTarget.Center); + homingTarget = potentialTarget.Center; + targetVelocity = potentialTarget.velocity; foundTarget = true; break; } } } + if (foundTarget && Projectile.ai[0] == 0f) { - Vector2 delta = homingTarget - Projectile.Center; - float distance = delta.Length(); - delta /= distance; - - if (distance > 200f) - { - float homingScalar = 11f; - delta *= homingScalar; - Projectile.velocity = (Projectile.velocity * 40f + delta) / 41f; - } + bool perfectAim = Main.rand.NextBool(3); + if (perfectAim) + Projectile.velocity = CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, homingTarget, targetVelocity, Main.rand.NextFloat(18f, 20f)); else { - float homingScalar = 3.6f; - delta *= -homingScalar; // yes this is intentionally backwards - Projectile.velocity = (Projectile.velocity * 40f + delta) / 41f; + float angularTurnSpeed = 0.35f; + float angleToTargetCoords = Projectile.AngleTo(homingTarget); + Projectile.velocity = Projectile.velocity.ToRotation().AngleTowards(angleToTargetCoords, angularTurnSpeed).ToRotationVector2() * Main.rand.NextFloat(18f, 20f); } } if (Projectile.ai[1] > 0f) - { - Projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (Projectile.ai[1] > 40f) + Projectile.ai[1] += (float)Main.rand.Next(1, 5); + if (Projectile.ai[1] > 30f) { Projectile.ai[1] = 0f; Projectile.netUpdate = true; } + if (Projectile.ai[0] == 0f) { if (Projectile.ai[1] == 0f && foundTarget && homingRange < 500f) { Projectile.ai[1] += 1f; if (Main.myPlayer == Projectile.owner) - { Projectile.ai[0] = 1f; - Vector2 value20 = homingTarget - Projectile.Center; - value20.Normalize(); - Projectile.velocity = value20 * 8f; - Projectile.netUpdate = true; - } } } } - Projectile.rotation += 0.07f; } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + if (Projectile.ai[0] == 1) + { + //Glowing + Main.spriteBatch.EnterShaderRegion(); + GameShaders.Misc["CalamityMod:BasicTint"].UseColor(Main.hslToRgb(1.64f, 0.8f, 0.5f)); //Using RGB directly fails, gotta use HSL + float opacityFactor = Projectile.ai[1] - 5; + if (opacityFactor < 0f) + opacityFactor = 0f; + GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(opacityFactor / 40f); + GameShaders.Misc["CalamityMod:BasicTint"].Apply(); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + Main.spriteBatch.ExitShaderRegion(); + } + else + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); return false; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(ModContent.BuffType(), 180); target.AddBuff(ModContent.BuffType(), 180); } public override void OnHitPlayer(Player target, Player.HurtInfo info) { target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(ModContent.BuffType(), 180); target.AddBuff(ModContent.BuffType(), 180); } @@ -176,7 +180,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, (int)CalamityDusts.SulfurousSeaAcid, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -186,10 +190,10 @@ namespace CalamityMod.Projectiles.Rogue } for (int num623 = 0; num623 < 8; num623++) { - int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, (int)CalamityDusts.SulfurousSeaAcid, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, (int)CalamityDusts.SulfurousSeaAcid, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Rogue/SpearofDestinyGlow.png b/Projectiles/Rogue/SpearofDestinyGlow.png deleted file mode 100644 index b6523b8969..0000000000 Binary files a/Projectiles/Rogue/SpearofDestinyGlow.png and /dev/null differ diff --git a/Projectiles/Rogue/SpearofDestinyProjectile.cs b/Projectiles/Rogue/SpearofDestinyProjectile.cs index 3b4b9b5a5d..471176651c 100644 --- a/Projectiles/Rogue/SpearofDestinyProjectile.cs +++ b/Projectiles/Rogue/SpearofDestinyProjectile.cs @@ -1,6 +1,8 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -10,14 +12,11 @@ namespace CalamityMod.Projectiles.Rogue { public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/SpearofDestiny"; + public static readonly SoundStyle Hitsound = new("CalamityMod/Sounds/Item/WulfrumKnifeTileHit2") { PitchVariance = 0.3f, Volume = 0.5f }; + public int framesInAir = 0; private bool initialized = false; - - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - } + public int SparkChance = 8; public override void SetDefaults() { @@ -26,16 +25,23 @@ namespace CalamityMod.Projectiles.Rogue Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.penetrate = 2; - Projectile.aiStyle = ProjAIStyleID.StickProjectile; Projectile.timeLeft = 600; - AIType = ProjectileID.BoneJavelin; + AIType = 0; Projectile.DamageType = RogueDamageClass.Instance; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; + Projectile.extraUpdates = 2; } public override void AI() { + framesInAir++; + if (framesInAir > 90 && !Projectile.Calamity().stealthStrike) + { + Projectile.velocity.X *= 0.998f; + Projectile.velocity.Y += 0.3f; + } + if (!initialized) { if (Projectile.Calamity().stealthStrike) @@ -45,14 +51,26 @@ namespace CalamityMod.Projectiles.Rogue } initialized = true; } - if (Main.rand.NextBool(4)) + if (Main.rand.NextBool(SparkChance)) { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 246, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); + Vector2 SparkVelocity1 = Projectile.velocity.RotatedBy(-3, default) * 0.1f - Projectile.velocity / 8f; + Vector2 SparkPosition1 = Projectile.velocity.RotatedBy(-0.8, default); + SparkParticle spark = new SparkParticle(Projectile.Center + SparkPosition1, SparkVelocity1, false, Main.rand.Next(6, 8), Main.rand.NextFloat(0.7f, 1f), Color.PaleGoldenrod); + GeneralParticleHandler.SpawnParticle(spark); + } + if (Main.rand.NextBool(SparkChance)) + { + Vector2 SparkVelocity2 = Projectile.velocity.RotatedBy(3, default) * 0.1f - Projectile.velocity / 8f; + Vector2 SparkPosition2 = Projectile.velocity.RotatedBy(0.8, default); + SparkParticle spark2 = new SparkParticle(Projectile.Center + SparkPosition2, SparkVelocity2, false, Main.rand.Next(6, 8), Main.rand.NextFloat(0.7f, 1f), Color.PaleGoldenrod); + GeneralParticleHandler.SpawnParticle(spark2); + } + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; Vector2 center = Projectile.Center; - float maxDistance = 300f; + float maxDistance = 200f; bool homeIn = false; for (int i = 0; i < Main.maxNPCs; i++) @@ -73,37 +91,45 @@ namespace CalamityMod.Projectiles.Rogue if (homeIn) { - Projectile.extraUpdates = 2; + SparkChance = 16; + Projectile.extraUpdates = 3; Vector2 moveDirection = Projectile.SafeDirectionTo(center, Vector2.UnitY); Projectile.velocity = (Projectile.velocity * 20f + moveDirection * 12f) / (21f); } } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + for (int i = 0; i <= 2; i++) + { + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 133, Projectile.oldVelocity.X * Main.rand.NextFloat(1.1f, 1.3f), Projectile.oldVelocity.Y * Main.rand.NextFloat(1.1f, 1.3f)); + } + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + Projectile.damage = (int)(Projectile.damage * 0.8f); + if (Projectile.damage < 1) + Projectile.damage = 1; + } + public override void Kill(int timeLeft) + { + SoundEngine.PlaySound(Hitsound, Projectile.position); + } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + Texture2D texture = ModContent.Request(Texture).Value; + + int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + int frameY = frameHeight * Projectile.frame; + float scale = Projectile.scale; + float rotation = Projectile.rotation; + + Rectangle rectangle = new Rectangle(0, frameY, texture.Width, frameHeight); + Vector2 origin = rectangle.Size() / 2f; + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), rectangle, Color.White, rotation, origin, scale, SpriteEffects.None, 0); return false; } - public override void Kill(int timeLeft) - { - for (int i = 0; i <= 10; i++) - { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 246, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Ichor, 120); - - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Ichor, 120); - - public override void PostDraw(Color lightColor) - { - if (Projectile.Calamity().stealthStrike) - { - Texture2D tex = ModContent.Request("CalamityMod/Projectiles/Rogue/SpearofDestinyGlow").Value; - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, tex.Size() / 2, Projectile.scale, SpriteEffects.None, 0); - } - } + //public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Ichor, 120); } } diff --git a/Projectiles/Rogue/SpearofDestinyStealth.cs b/Projectiles/Rogue/SpearofDestinyStealth.cs new file mode 100644 index 0000000000..0033d3317b --- /dev/null +++ b/Projectiles/Rogue/SpearofDestinyStealth.cs @@ -0,0 +1,103 @@ +using CalamityMod.Particles; +using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Pets; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Mono.Cecil; +using System; +using System.Reflection.Metadata; +using Terraria; +using Terraria.Audio; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class SpearofDestinyStealth : ModProjectile, ILocalizedModType + { + public static readonly SoundStyle Hitsound = new("CalamityMod/Sounds/Item/BlazingCoreParry") { Volume = 0.7f, PitchVariance = 0.3f}; + public new string LocalizationCategory => "Projectiles.Rogue"; + public override string Texture => "CalamityMod/Projectiles/Rogue/LanceofDestiny"; + public bool posthit = false; + public int Time = 0; + public ref float Timer => ref Projectile.ai[0]; + public override void SetDefaults() + { + Projectile.width = 23; + Projectile.height = 23; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.penetrate = 1; + Projectile.timeLeft = 900; + Projectile.aiStyle = 0; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 50; + Projectile.tileCollide = false; + Projectile.extraUpdates = 3; + } + + public override void AI() + { + Timer++; + Time++; + Projectile.scale = 1.5f; + Projectile.velocity *= 1.02f; + if (!Projectile.Calamity().stealthStrike) + Projectile.extraUpdates = 1; + + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; + + float radiusFactor = MathHelper.Lerp(0f, 1f, Utils.GetLerpValue(10f, 50f, Time, true)); + for (int i = 0; i < 10; i++) + { + float offsetRotationAngle = Projectile.velocity.ToRotation() + Time / 20f; + float radius = (50f + (float)Math.Cos(Time / 3f) * 12f) * radiusFactor; + Vector2 dustPosition = Projectile.Center; + dustPosition += offsetRotationAngle.ToRotationVector2().RotatedBy(i / 5f * MathHelper.TwoPi) * radius; + Dust dust = Dust.NewDustPerfect(dustPosition, Main.rand.NextBool(2) ? 279 : 159); + dust.noGravity = true; + dust.velocity = Projectile.velocity * 0.5f; + dust.scale = 1.3f; + } + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + SoundEngine.PlaySound(Hitsound, Projectile.position); + posthit = true; + float numberOfDusts = 35f; + float rotFactor = 360f / numberOfDusts; + for (int i = 0; i < numberOfDusts; i++) + { + float rot = MathHelper.ToRadians(i * rotFactor); + Vector2 offset = new Vector2(18f, 0).RotatedBy(rot); + Vector2 velOffset = new Vector2(9f, 0).RotatedBy(rot); + SparkParticle spark = new SparkParticle(Projectile.position + offset, new Vector2(velOffset.X, velOffset.Y) * Main.rand.NextFloat( 1.5f, 2.3f), false, Main.rand.Next(23, 28), 1.9f, Main.rand.NextBool(5) ? Color.Gold : Color.PaleGoldenrod); + GeneralParticleHandler.SpawnParticle(spark); + } + for (int i = 0; i <= 17; i++) + { + Dust dust2 = Main.dust[Dust.NewDust(target.position, Projectile.width, Projectile.height, 130, 0, 0, 0, default, 1.5f)]; + dust2.velocity.Y -= Main.rand.NextFloat(2.5f, 10.5f); + dust2.velocity.X += Main.rand.NextFloat(-3f, 3f); + } + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0f, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack * 2, Projectile.owner, 0f); + } + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = ModContent.Request(Texture).Value; + + int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + int frameY = frameHeight * Projectile.frame; + float scale = Projectile.scale; + float rotation = Projectile.rotation; + + Rectangle rectangle = new Rectangle(0, frameY, texture.Width, frameHeight); + Vector2 origin = rectangle.Size() / 2f; + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), rectangle, Color.White, rotation, origin, scale, SpriteEffects.None, 0); + return false; + } + } +} diff --git a/Projectiles/Rogue/SpearofDestinyStealthExplosion.cs b/Projectiles/Rogue/SpearofDestinyStealthExplosion.cs new file mode 100644 index 0000000000..c1775b9709 --- /dev/null +++ b/Projectiles/Rogue/SpearofDestinyStealthExplosion.cs @@ -0,0 +1,35 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class SpearofDestinyStealthExplosion : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Rogue"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public Player Owner => Main.player[Projectile.owner]; + private static float ExplosionRadius = 148f; + + public override void SetDefaults() + { + //These shouldn't matter because its circular + Projectile.width = 148; + Projectile.height = 148; + Projectile.friendly = true; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.penetrate = -1; + Projectile.timeLeft = 2; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 10; + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox); + } +} diff --git a/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs b/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs index 4c38ee01cf..130de6ab78 100644 --- a/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs +++ b/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs @@ -37,11 +37,10 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.timeLeft % 20 == 0 && Main.myPlayer == Projectile.owner) { for (int i = 0; i < 2; i++) - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity.RotatedByRandom(0.1f) * -0.6f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.35), 0f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity.RotatedByRandom(0.1f) * -0.6f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.25), 0f, Projectile.owner); } Projectile.rotation += 0.06f * (Projectile.velocity.X > 0).ToDirectionInt(); } - // Boomerang rotation Projectile.rotation += 0.4f * Projectile.direction; diff --git a/Projectiles/Rogue/DeificThunderboltProj.cs b/Projectiles/Rogue/TwistingThunderProj.cs similarity index 98% rename from Projectiles/Rogue/DeificThunderboltProj.cs rename to Projectiles/Rogue/TwistingThunderProj.cs index 827e1af053..a91ab52364 100644 --- a/Projectiles/Rogue/DeificThunderboltProj.cs +++ b/Projectiles/Rogue/TwistingThunderProj.cs @@ -7,7 +7,7 @@ using CalamityMod.Sounds; namespace CalamityMod.Projectiles.Rogue { - public class DeificThunderboltProj : ModProjectile, ILocalizedModType + public class TwistingThunderProj : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; private bool playedSound = false; diff --git a/Projectiles/Rogue/DeificThunderboltProj.png b/Projectiles/Rogue/TwistingThunderProj.png similarity index 100% rename from Projectiles/Rogue/DeificThunderboltProj.png rename to Projectiles/Rogue/TwistingThunderProj.png diff --git a/Projectiles/Rogue/UmbraphileBoom.cs b/Projectiles/Rogue/UmbraphileBoom.cs index fb9924cd18..4bdbbd87e0 100644 --- a/Projectiles/Rogue/UmbraphileBoom.cs +++ b/Projectiles/Rogue/UmbraphileBoom.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Rogue { Texture2D glow = ModContent.Request(Texture + "Glow").Value; Rectangle frame = glow.Frame(1, Main.projFrames[Type], 0, Projectile.frame); - Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, frame.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, SpriteEffects.None); } } } diff --git a/Projectiles/Summon/BlackHawkGlow.png b/Projectiles/Summon/BlackHawkGlow.png index 24479cb839..0f050a39f9 100644 Binary files a/Projectiles/Summon/BlackHawkGlow.png and b/Projectiles/Summon/BlackHawkGlow.png differ diff --git a/Projectiles/Summon/BlackHawkSummon.cs b/Projectiles/Summon/BlackHawkSummon.cs index c0a0c0901d..0637fce633 100644 --- a/Projectiles/Summon/BlackHawkSummon.cs +++ b/Projectiles/Summon/BlackHawkSummon.cs @@ -18,15 +18,14 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - Main.projFrames[Projectile.type] = 3; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; + Main.projFrames[Type] = 6; } public override void SetDefaults() { - Projectile.width = 36; - Projectile.height = 36; + Projectile.width = Projectile.height = 32; Projectile.netImportant = true; Projectile.friendly = true; Projectile.ignoreWater = true; @@ -95,7 +94,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -306,13 +305,10 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { Texture2D texture = ModContent.Request(Texture).Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; - int y6 = frameHeight * Projectile.frame; - SpriteEffects spriteEffects = SpriteEffects.None; - if (Projectile.spriteDirection == -1) - spriteEffects = SpriteEffects.FlipHorizontally; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), Projectile.scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, spriteEffects); return false; } @@ -320,13 +316,10 @@ namespace CalamityMod.Projectiles.Summon public override void PostDraw(Color lightColor) { Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Summon/BlackHawkGlow").Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; - int y6 = frameHeight * Projectile.frame; - SpriteEffects spriteEffects = SpriteEffects.None; - if (Projectile.spriteDirection == -1) - spriteEffects = SpriteEffects.FlipHorizontally; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, frameHeight)), Color.White, Projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), Projectile.scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, spriteEffects); } } } diff --git a/Projectiles/Summon/BlackHawkSummon.png b/Projectiles/Summon/BlackHawkSummon.png index 0567fd7c2d..ddb588f9b1 100644 Binary files a/Projectiles/Summon/BlackHawkSummon.png and b/Projectiles/Summon/BlackHawkSummon.png differ diff --git a/Projectiles/Summon/BloodClotMinion.cs b/Projectiles/Summon/BloodClotMinion.cs deleted file mode 100644 index 5df7b760fa..0000000000 --- a/Projectiles/Summon/BloodClotMinion.cs +++ /dev/null @@ -1,232 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.Summon; -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Summon -{ - public class BloodClotMinion : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - public override void SetStaticDefaults() - { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - Main.projFrames[Projectile.type] = 4; - } - - public override void SetDefaults() - { - Projectile.width = 36; - Projectile.height = 36; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.minionSlots = 1; - Projectile.timeLeft = 18000; - Projectile.penetrate = -1; - Projectile.timeLeft *= 5; - Projectile.minion = true; - Projectile.tileCollide = false; - Projectile.MaxUpdates = 3; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = Projectile.MaxUpdates * 30; - Projectile.DamageType = DamageClass.Summon; - } - - public override void AI() - { - Player player = Main.player[Projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - if (Projectile.localAI[0] == 0f) - { - int num226 = 36; - for (int num227 = 0; num227 < num226; num227++) - { - Vector2 vector6 = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + Projectile.Center; - Vector2 vector7 = vector6 - Projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 5, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.4f); - Main.dust[num228].noGravity = true; - Main.dust[num228].noLight = true; - Main.dust[num228].velocity = vector7; - } - Projectile.localAI[0] += 1f; - } - int num1262 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 5, 0f, 0f, 0, default, 1f); - Main.dust[num1262].velocity *= 0.1f; - Main.dust[num1262].scale = 0.7f; - Main.dust[num1262].noGravity = true; - Projectile.frameCounter++; - if (Projectile.frameCounter > 5) - { - Projectile.frame++; - Projectile.frameCounter = 0; - } - if (Projectile.frame > 3) - { - Projectile.frame = 0; - } - bool flag64 = Projectile.type == ModContent.ProjectileType(); - player.AddBuff(ModContent.BuffType(), 3600); - if (flag64) - { - if (player.dead) - { - modPlayer.bClot = false; - } - if (modPlayer.bClot) - { - Projectile.timeLeft = 2; - } - } - Projectile.MinionAntiClump(); - float num535 = Projectile.position.X; - float num536 = Projectile.position.Y; - float num537 = 1300f; - bool flag19 = false; - int num538 = 1100; - if (Projectile.ai[1] != 0f) - { - num538 = 1800; - } - if (Math.Abs(Projectile.Center.X - player.Center.X) + Math.Abs(Projectile.Center.Y - player.Center.Y) > (float)num538) - { - Projectile.ai[0] = 1f; - } - if (Projectile.ai[0] == 0f) - { - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(Projectile, false)) - { - float num539 = npc.position.X + (float)(npc.width / 2); - float num540 = npc.position.Y + (float)(npc.height / 2); - float num541 = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - num539) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - num540); - if (num541 < num537 && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, npc.position, npc.width, npc.height)) - { - num535 = num539; - num536 = num540; - flag19 = true; - } - } - } - if (!flag19) - { - for (int num542 = 0; num542 < Main.maxNPCs; num542++) - { - if (Main.npc[num542].CanBeChasedBy(Projectile, false)) - { - float num543 = Main.npc[num542].position.X + (float)(Main.npc[num542].width / 2); - float num544 = Main.npc[num542].position.Y + (float)(Main.npc[num542].height / 2); - float num545 = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - num543) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - num544); - if (num545 < num537 && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, Main.npc[num542].position, Main.npc[num542].width, Main.npc[num542].height)) - { - num537 = num545; - num535 = num543; - num536 = num544; - flag19 = true; - } - } - } - } - } - if (!flag19) - { - float num546 = 8f; - if (Projectile.ai[0] == 1f) - { - num546 = 12f; - } - Vector2 vector42 = new Vector2(Projectile.position.X + (float)Projectile.width * 0.5f, Projectile.position.Y + (float)Projectile.height * 0.5f); - float num547 = player.Center.X - vector42.X; - float num548 = player.Center.Y - vector42.Y - 60f; - float num549 = (float)Math.Sqrt((double)(num547 * num547 + num548 * num548)); - if (num549 < 100f && Projectile.ai[0] == 1f && !Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height)) - { - Projectile.ai[0] = 0f; - } - if (num549 > 2000f) - { - Projectile.position.X = player.Center.X - (float)(Projectile.width / 2); - Projectile.position.Y = player.Center.Y - (float)(Projectile.width / 2); - } - if (num549 > 70f) - { - num549 = num546 / num549; - num547 *= num549; - num548 *= num549; - Projectile.velocity.X = (Projectile.velocity.X * 20f + num547) / 21f; - Projectile.velocity.Y = (Projectile.velocity.Y * 20f + num548) / 21f; - } - else - { - if (Projectile.velocity.X == 0f && Projectile.velocity.Y == 0f) - { - Projectile.velocity.X = -0.15f; - Projectile.velocity.Y = -0.05f; - } - Projectile.velocity *= 1.01f; - } - Projectile.rotation = Projectile.velocity.X * 0.05f; - if ((double)Math.Abs(Projectile.velocity.X) > 0.2) - { - Projectile.spriteDirection = -Projectile.direction; - return; - } - } - else - { - if (Projectile.ai[1] == -1f) - { - Projectile.ai[1] = 11f; - } - if (Projectile.ai[1] > 0f) - { - Projectile.ai[1] -= 1f; - } - if (Projectile.ai[1] == 0f) - { - float num550 = 8f; //12 - Vector2 vector43 = new Vector2(Projectile.position.X + (float)Projectile.width * 0.5f, Projectile.position.Y + (float)Projectile.height * 0.5f); - float num551 = num535 - vector43.X; - float num552 = num536 - vector43.Y; - float num553 = (float)Math.Sqrt((double)(num551 * num551 + num552 * num552)); - if (num553 < 100f) - { - num550 = 10f; //14 - } - num553 = num550 / num553; - num551 *= num553; - num552 *= num553; - Projectile.velocity.X = (Projectile.velocity.X * 40f + num551) / 41f; - Projectile.velocity.Y = (Projectile.velocity.Y * 40f + num552) / 41f; - } - else - { - if (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y) < 10f) - { - Projectile.velocity *= 1.05f; - } - } - Projectile.rotation = Projectile.velocity.X * 0.05f; - if ((double)Math.Abs(Projectile.velocity.X) > 0.2) - { - Projectile.spriteDirection = -Projectile.direction; - return; - } - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 120); - Projectile.ai[1] = -1f; - Projectile.netUpdate = true; - } - } -} diff --git a/Projectiles/Summon/BloodClotMinion.png b/Projectiles/Summon/BloodClotMinion.png deleted file mode 100644 index d31947d5bb..0000000000 Binary files a/Projectiles/Summon/BloodClotMinion.png and /dev/null differ diff --git a/Projectiles/Summon/CalamariInk.cs b/Projectiles/Summon/CalamariInk.cs deleted file mode 100644 index 79cb180a18..0000000000 --- a/Projectiles/Summon/CalamariInk.cs +++ /dev/null @@ -1,153 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.Audio; -namespace CalamityMod.Projectiles.Summon -{ - public class CalamariInk : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - public override void SetStaticDefaults() - { - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.MinionShot[Projectile.type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 14; - Projectile.height = 14; - Projectile.friendly = true; - Projectile.penetrate = 5; - Projectile.timeLeft = 180; - Projectile.minion = true; - Projectile.minionSlots = 0f; - Projectile.extraUpdates = 2; - Projectile.DamageType = DamageClass.Summon; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; - } - - public override void AI() - { - Projectile.frameCounter++; - if (Projectile.frameCounter > 8) - { - Projectile.frame++; - Projectile.frameCounter = 0; - } - if (Projectile.frame > 4) - { - Projectile.frame = 0; - } - Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) - MathHelper.PiOver2; - - Player player = Main.player[Projectile.owner]; - int targetIdx = -1; - float maxHomingRange = 400f; - bool hasHomingTarget = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(Projectile, false)) - { - float dist = (Projectile.Center - npc.Center).Length(); - if (dist < maxHomingRange) - { - targetIdx = player.MinionAttackTargetNPC; - maxHomingRange = dist; - hasHomingTarget = true; - } - } - } - else if (Main.npc[(int)Projectile.ai[0]].active && Projectile.ai[0] != -1f) - { - NPC npc = Main.npc[(int)Projectile.ai[0]]; - if (npc.CanBeChasedBy(Projectile, false)) - { - float dist = (Projectile.Center - npc.Center).Length(); - if (dist < maxHomingRange) - { - targetIdx = (int)Projectile.ai[0]; - maxHomingRange = dist; - hasHomingTarget = true; - } - } - } - if (!hasHomingTarget) - { - for (int i = 0; i < Main.npc.Length; ++i) - { - NPC npc = Main.npc[i]; - if (npc is null || !npc.active) - continue; - - if (npc.CanBeChasedBy(Projectile, false)) - { - float dist = (Projectile.Center - npc.Center).Length(); - if (dist < maxHomingRange) - { - targetIdx = i; - maxHomingRange = dist; - hasHomingTarget = true; - } - } - } - } - - // Home in on said closest NPC. - if (hasHomingTarget) - { - NPC target = Main.npc[targetIdx]; - Vector2 homingVector = (target.Center - Projectile.Center).SafeNormalize(Vector2.Zero) * 10f; - float homingRatio = 20f; - Projectile.velocity = (Projectile.velocity * homingRatio + homingVector) / (homingRatio + 1f); - } - } - - public override bool PreDraw(ref Color lightColor) - { - Texture2D texture2D13 = ModContent.Request(Texture).Value; - int num214 = texture2D13.Height / Main.projFrames[Projectile.type]; - int y6 = num214 * Projectile.frame; - Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); - return false; - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 180); - } - - public override void Kill(int timeLeft) - { - Projectile.position = Projectile.Center; - Projectile.width = Projectile.height = 48; - Projectile.position.X = Projectile.position.X - (Projectile.width / 2); - Projectile.position.Y = Projectile.position.Y - (Projectile.height / 2); - SoundEngine.PlaySound(SoundID.NPCDeath28, Projectile.Center); - for (int num621 = 0; num621 < 10; num621++) - { - int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 54, 0f, 0f, 100, default, 1f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 15; num623++) - { - int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 109, 0f, 0f, 100, default, 1.5f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 109, 0f, 0f, 100, default, 1f); - Main.dust[num624].velocity *= 2f; - } - } - } -} diff --git a/Projectiles/Summon/CalamariMinion.cs b/Projectiles/Summon/CalamariMinion.cs deleted file mode 100644 index a1b221c5d0..0000000000 --- a/Projectiles/Summon/CalamariMinion.cs +++ /dev/null @@ -1,359 +0,0 @@ -using CalamityMod.Buffs.Summon; -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.Audio; - -namespace CalamityMod.Projectiles.Summon -{ - public class CalamariMinion : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - public override void SetStaticDefaults() - { - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 40; - Projectile.height = 40; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.minionSlots = 1f; - Projectile.timeLeft = 18000; - Projectile.penetrate = -1; - Projectile.timeLeft *= 5; - Projectile.minion = true; - Projectile.tileCollide = false; - Projectile.DamageType = DamageClass.Summon; - } - - public override void AI() - { - if (Projectile.owner < 0 || Projectile.owner >= Main.maxPlayers) - { - Projectile.Kill(); - return; - } - Player player = Main.player[Projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - - // Spawn dust on frame 1 - if (Projectile.localAI[1] == 0f) - { - int dustAmt = 36; - for (int i = 0; i < dustAmt; i++) - { - Vector2 spawnPos = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.75f; - spawnPos = spawnPos.RotatedBy((double)((float)(i - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + Projectile.Center; - Vector2 velocity = spawnPos - Projectile.Center; - int idx = Dust.NewDust(spawnPos + velocity, 0, 0, 109, velocity.X * 1.5f, velocity.Y * 1.5f, 100, default, 1.4f); - Main.dust[idx].noGravity = true; - Main.dust[idx].noLight = true; - Main.dust[idx].velocity = velocity; - } - Projectile.localAI[1] += 1f; - } - - // Update frames - Projectile.frameCounter++; - if (Projectile.frameCounter > 8) - { - Projectile.frame++; - Projectile.frameCounter = 0; - } - if (Projectile.frame > 4) - { - Projectile.frame = 0; - } - - // Update buffs and player bools - bool isMinion = Projectile.type == ModContent.ProjectileType(); - player.AddBuff(ModContent.BuffType(), 3600); - if (isMinion) - { - if (player.dead) - { - modPlayer.calamari = false; - } - if (modPlayer.calamari) - { - Projectile.timeLeft = 2; - } - } - - // Randomly make noise - if (Main.rand.NextBool(600)) - { - SoundEngine.PlaySound(SoundID.Zombie35, Projectile.position); - } - - if (Projectile.ai[0] == 2f) - { - Projectile.ai[1] -= 1f; - if (Projectile.ai[1] > 3f) - { - SoundEngine.PlaySound(SoundID.Zombie34, Projectile.position); - int num = Dust.NewDust(Projectile.Center, 0, 0, 109, Projectile.velocity.X, Projectile.velocity.Y, 100, default, 1.4f); - Main.dust[num].scale = 0.5f + (float)Main.rand.NextDouble() * 0.3f; - Main.dust[num].velocity /= 2.5f; - Main.dust[num].noGravity = true; - Main.dust[num].noLight = true; - } - if (Projectile.ai[1] != 0f) - { - return; - } - Projectile.ai[1] = 15f; - Projectile.ai[0] = 0f; - Projectile.velocity /= 5f; - Projectile.velocity.Y = 0f; - Projectile.extraUpdates = 0; - Projectile.numUpdates = 0; - Projectile.netUpdate = true; - Projectile.extraUpdates = 0; - Projectile.numUpdates = 0; - } - if (Projectile.extraUpdates > 1) - { - Projectile.extraUpdates = 0; - } - if (Projectile.numUpdates > 1) - { - Projectile.numUpdates = 0; - } - if (Projectile.localAI[0] > 0f) - { - Projectile.localAI[0] -= 1f; - } - - // Prevent clumping - Projectile.MinionAntiClump(); - - // Find a target - Vector2 shootPosition = Projectile.position; - float range = 3500f; - bool foundTarget = false; - Vector2 center = player.Center; - Vector2 half = new Vector2(0.5f); - half.Y = 0f; - int targetIndex = -1; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(Projectile, false)) - { - Vector2 npcPos = npc.position + npc.Size * half; - float npcDist = Vector2.Distance(npcPos, center); - if (!foundTarget && npcDist < range && Collision.CanHitLine(Projectile.position, Projectile.width, Projectile.height, npc.position, npc.width, npc.height)) - { - shootPosition = npcPos; - foundTarget = true; - targetIndex = npc.whoAmI; - } - } - } - if (!foundTarget) - { - for (int k = 0; k < Main.maxNPCs; k++) - { - NPC npc = Main.npc[k]; - if (npc.CanBeChasedBy(Projectile, false)) - { - Vector2 npcPos = npc.position + npc.Size * half; - float npcDist = Vector2.Distance(npcPos, center); - if (!foundTarget && npcDist < range && Collision.CanHitLine(Projectile.position, Projectile.width, Projectile.height, npc.position, npc.width, npc.height)) - { - range = npcDist; - shootPosition = npcPos; - foundTarget = true; - targetIndex = k; - } - } - } - } - - // Return to the player when far away - int returnDist = 3500; - if (foundTarget) - { - returnDist = 4000; - } - if (Vector2.Distance(player.Center, Projectile.Center) > returnDist) - { - Projectile.ai[0] = 1f; - Projectile.netUpdate = true; - } - - // Position towards the target - if (foundTarget && Projectile.ai[0] == 0f) - { - Vector2 shootDir = shootPosition - Projectile.Center; - shootDir.Normalize(); - shootDir = shootPosition - Vector2.UnitY * 80f; - int tileY = (int)shootDir.Y / 16; - if (tileY < 0) - { - tileY = 0; - } - Tile tile = Main.tile[(int)shootDir.X / 16, tileY]; - if (tile != null && tile.HasTile && Main.tileSolid[tile.TileType] && !Main.tileSolidTop[tile.TileType]) - { - shootDir += Vector2.UnitY * 16f; - tile = Main.tile[(int)shootDir.X / 16, (int)shootDir.Y / 16]; - if (tile != null && tile.HasTile && Main.tileSolid[tile.TileType] && !Main.tileSolidTop[tile.TileType]) - { - shootDir += Vector2.UnitY * 16f; - } - } - shootDir -= Projectile.Center; - float distance = shootDir.Length(); - shootDir.Normalize(); - if (distance > 300f && distance <= 1600f && Projectile.localAI[0] == 0f) - { - Projectile.ai[0] = 2f; - Projectile.ai[1] = (int)(distance / 10f); - Projectile.extraUpdates = (int)(Projectile.ai[1] * 2f) + 1; - Projectile.velocity = shootDir * 20f; - Projectile.localAI[0] = 60f; - return; - } - if (distance > 200f) - { - float scaleFactor2 = 20f; - shootDir *= scaleFactor2; - Projectile.velocity.X = (Projectile.velocity.X * 30f + shootDir.X) / 31f; - Projectile.velocity.Y = (Projectile.velocity.Y * 30f + shootDir.Y) / 31f; - } - if (distance > 70f && distance < 130f) - { - float scaleFactor3 = 18f; - if (distance < 100f) - { - scaleFactor3 = -7.5f; - } - shootDir *= scaleFactor3; - Projectile.velocity = (Projectile.velocity * 15f + shootDir) / 16f; - if (Math.Abs(shootDir.X) > Math.Abs(shootDir.Y)) - { - Projectile.velocity.X = (Projectile.velocity.X * 6f + shootDir.X) / 7f; - } - } - else - { - Projectile.velocity *= 0.99f; - } - } - - // Idle Behavior - else - { - if (!Collision.CanHitLine(Projectile.Center, 1, 1, Main.player[Projectile.owner].Center, 1, 1)) - { - Projectile.ai[0] = 1f; - } - float returnSpd = 12f; //6 - if (Projectile.ai[0] == 1f) - { - returnSpd = 18f; //15 - } - Vector2 returnPos = player.Center - Projectile.Center + new Vector2(0f, -60f); - float returnPosDist = returnPos.Length(); - if (returnPosDist > 200f && returnSpd < 13.5f) - { - returnSpd = 13.5f; //9 - } - if (returnPosDist < 800f && Projectile.ai[0] == 1f) - { - Projectile.ai[0] = 0f; - Projectile.netUpdate = true; - } - if (returnPosDist > 4000f) - { - Projectile.position.X = player.Center.X - (Projectile.width / 2); - Projectile.position.Y = player.Center.Y - (Projectile.width / 2); - } - if (returnPosDist > 70f) - { - returnPos.Normalize(); - returnPos *= returnSpd; - Projectile.velocity = (Projectile.velocity * 20f + returnPos) / 21f; - } - else - { - if (Projectile.velocity.X == 0f && Projectile.velocity.Y == 0f) - { - Projectile.velocity.X = -0.15f; - Projectile.velocity.Y = -0.05f; - } - Projectile.velocity *= 1.01f; - } - } - - // Update rotation - Projectile.rotation = Projectile.velocity.X * 0.025f; - - // Update shoot cooldown - if (Projectile.ai[1] > 0f) - { - Projectile.ai[1] += 1f; - if (Main.rand.Next(2) != 0) - { - Projectile.ai[1] += 1f; - } - } - if (Projectile.ai[1] > 20f) - { - Projectile.ai[1] = 0f; - Projectile.netUpdate = true; - } - - // Shoot projectiles - if (Projectile.ai[0] == 0f) - { - float inkShootSpeed = 15f; - int projID = ModContent.ProjectileType(); - if (foundTarget) - { - if (Math.Abs((shootPosition - Projectile.Center).ToRotation() - MathHelper.PiOver2) > MathHelper.PiOver4) - { - Projectile.velocity += (shootPosition - Projectile.Center - Vector2.UnitY * 100f).SafeNormalize(Vector2.Zero) * 2f; - return; - } - if ((shootPosition - Projectile.Center).Length() <= 600f && Projectile.ai[1] == 0f) - { - Projectile.ai[1] += 1f; - if (Main.myPlayer == Projectile.owner) - { - SoundEngine.PlaySound(SoundID.Item111, Projectile.position); - Vector2 inkShootVelocity = Projectile.SafeDirectionTo(shootPosition, Vector2.UnitY) * inkShootSpeed; - int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + Vector2.UnitY * 20f, inkShootVelocity, projID, Projectile.damage, 0f, Main.myPlayer, targetIndex, 0f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Projectile.originalDamage; - Projectile.netUpdate = true; - } - } - } - } - } - - public override bool PreDraw(ref Color lightColor) - { - Texture2D texture2D13 = ModContent.Request(Texture).Value; - int num214 = texture2D13.Height / Main.projFrames[Projectile.type]; - int y6 = num214 * Projectile.frame; - Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); - return false; - } - - public override bool? CanDamage() => false; - } -} diff --git a/Projectiles/Summon/CalamarisLamentMinion.cs b/Projectiles/Summon/CalamarisLamentMinion.cs new file mode 100644 index 0000000000..5ace23037d --- /dev/null +++ b/Projectiles/Summon/CalamarisLamentMinion.cs @@ -0,0 +1,229 @@ +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class CalamarisLamentMinion : BaseMinionProjectile + { + public override int AssociatedProjectileTypeID => ModContent.ProjectileType(); + public override int AssociatedBuffTypeID => ModContent.BuffType(); + public override ref bool AssociatedMinionBool => ref ModdedOwner.CalamarisLament; + + // Increased to be able to target DoG reliably. + public override float EnemyDistanceDetection => CalamarisLament.EnemyDistanceDetection; + + // It's an Abyss-origin summon, it deserves having visibility in Abyss areas. + public override bool PreventTargettingUntilTargetHit => false; + + public ref float ShootingTimer => ref Projectile.ai[0]; + public enum AIState { Idle, Shooting, Latching } + public AIState State { get => (AIState)Projectile.ai[1]; set => Projectile.ai[1] = (int)value; } + + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + Main.projFrames[Type] = 5; + } + + public override void SetDefaults() + { + base.SetDefaults(); + + // Half the size of one frame so it looks better while latching to a target. + Projectile.width = Projectile.height = 31; + } + + public override void MinionAI() + { + // Ambient idle sounds. + if (Main.zenithWorld) + { + if (Main.rand.NextBool(750)) + { + SoundEngine.PlaySound(CalamarisLament.GFB, Projectile.Center); + } + } + else + { + if (Main.rand.NextBool(600)) + { + SoundStyle glubNoise = Main.rand.NextBool() ? SoundID.Zombie35 : SoundID.Zombie34; + SoundStyle trollBirdChirpingSound = SoundID.Zombie16; + + // 1/200th chance to do a bird chirping sound. + SoundEngine.PlaySound(Main.rand.NextBool(200) ? trollBirdChirpingSound : glubNoise, Projectile.Center); + } + } + + switch (State) + { + case AIState.Idle: + IdleState(); + break; + case AIState.Shooting: + ShootingState(); + break; + case AIState.Latching: + LatchingState(); + break; + } + } + + #region AI Methods + + private void IdleState() + { + // The minion will hover around the owner. + if (!Projectile.WithinRange(Owner.Center, 320f)) + { + Projectile.velocity = (Projectile.velocity + Projectile.SafeDirectionTo(Owner.Center)) * 0.9f; + SyncVariables(); + } + + // The minion will teleport on the owner if they get far enough. + if (!Projectile.WithinRange(Owner.Center, 1200f)) + { + Projectile.Center = Owner.Center; + SyncVariables(); + } + + Projectile.rotation = Projectile.rotation.AngleTowards(MathHelper.ToRadians(Projectile.velocity.X * 2f), .1f); + Projectile.MinionAntiClump(0.5f); + + if (Target is not null) + SwitchState(AIState.Shooting); + } + + private void ShootingState() + { + if (Target is not null) + { + Vector2 toTargetDirection = Projectile.SafeDirectionTo(Target.Center); + + // The minion will hover around the owner more strongly. + if (!Projectile.WithinRange(Owner.Center, 320f)) + { + float inertia = 8f; + Projectile.velocity = (Projectile.velocity * inertia + Projectile.SafeDirectionTo(Owner.Center) * 25f) / (inertia + 1f); + SyncVariables(); + } + + // A random chance to increase the fire rate timer a bit so they're not always synced and looks nicer. + // In balance terms, this barely means anything, it's probably like a 5% DMG increase or less. + ShootingTimer += Main.rand.NextBool(30) ? 2 : 1; + if (ShootingTimer >= CalamarisLament.ShootingFireRate && Main.myPlayer == Projectile.owner) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, (toTargetDirection * (CalamarisLament.ShootingProjectileSpeed + 10f)).RotatedByRandom(MathHelper.PiOver4), ModContent.ProjectileType(), Projectile.damage, 1f, Projectile.owner, Target.whoAmI); + + // Flavor recoil effect. + Projectile.velocity -= toTargetDirection * 3f; + + // Flavor dust effect. + for (int i = 0; i < 15; i++) + { + Dust shootDust = Dust.NewDustPerfect(Projectile.Center + (Projectile.rotation + MathHelper.PiOver2).ToRotationVector2() * Projectile.height / 2, 109, toTargetDirection.RotatedByRandom(MathHelper.PiOver4) * Main.rand.NextFloat(3f, 7f), Scale: Main.rand.NextFloat(0.5f, 1.5f), Alpha: 127); + shootDust.noGravity = true; + } + + SoundEngine.PlaySound(SoundID.Item111, Projectile.Center); + + ShootingTimer = 0f; + SyncVariables(); + } + + Projectile.rotation = Projectile.rotation.AngleTowards(toTargetDirection.ToRotation() - MathHelper.PiOver2, .1f); + Projectile.MinionAntiClump(0.5f); + + if (Owner.WithinRange(Target.Center, CalamarisLament.LatchingDistanceRequired)) + SwitchState(AIState.Latching); + } + else + SwitchState(AIState.Idle); + } + + private void LatchingState() + { + if (Target is not null) + { + Vector2 toTargetDirection = Projectile.SafeDirectionTo(Target.Center); + + // If the minion is not on the target's hithox, which means they're not "latched", go to the target. + if (!Projectile.getRect().Intersects(Target.getRect())) + { + float inertia = 10f; + Projectile.velocity = (Projectile.velocity * inertia + toTargetDirection * (Target.velocity.Length() + CalamarisLament.LatchingExtraTargettingSpeed)) / (inertia + 1f); + Projectile.rotation = Projectile.rotation.AngleTowards(toTargetDirection.ToRotation() - MathHelper.PiOver2, .3f); + Projectile.MinionAntiClump(0.5f); + SyncVariables(); + } + + // Deaccelerate fast but not instantly stop so it doesn't bug. + else + { + Projectile.velocity *= 0.2f; + SyncVariables(); + } + + if (!Owner.WithinRange(Target.Center, CalamarisLament.LatchingDistanceRequired)) + SwitchState(AIState.Shooting); + } + else + SwitchState(AIState.Idle); + } + + private void SwitchState(AIState state) + { + State = state; + SyncVariables(); + } + + private void SyncVariables() + { + Projectile.netUpdate = true; + Projectile.netSpam = 0; + } + + #endregion + + public override void OnSpawn(IEntitySource source) + { + IFrames = 30; + + int dustAmount = 40; + for (int dustIndex = 0; dustIndex < dustAmount; dustIndex++) + { + float angle = MathHelper.TwoPi / dustAmount * dustIndex; + Vector2 velocity = angle.ToRotationVector2() * 8f; + Dust spawnDust = Dust.NewDustPerfect(Projectile.Center, 109, velocity); + spawnDust.noGravity = true; + spawnDust.noLight = true; + } + } + + // The minion will only have contact damage if it's on latching mode. + public override bool? CanDamage() => (State == AIState.Latching) ? null : false; + + // The minion will do 1.5x damage if it's latched on. + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.SourceDamage *= CalamarisLament.LatchingDamageMultiplier; + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = ModContent.Request(Texture).Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Vector2 origin = frame.Size() * 0.5f; + + Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None); + + return false; + } + } +} diff --git a/Projectiles/Summon/CalamariMinion.png b/Projectiles/Summon/CalamarisLamentMinion.png similarity index 100% rename from Projectiles/Summon/CalamariMinion.png rename to Projectiles/Summon/CalamarisLamentMinion.png diff --git a/Projectiles/Summon/CalamarisLamentProjectile.cs b/Projectiles/Summon/CalamarisLamentProjectile.cs new file mode 100644 index 0000000000..8d1b89a015 --- /dev/null +++ b/Projectiles/Summon/CalamarisLamentProjectile.cs @@ -0,0 +1,100 @@ +using CalamityMod.Items.Weapons.Summon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class CalamarisLamentProjectile : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Summon"; + + public ref float TargetShotID => ref Projectile.ai[0]; + public NPC TargetShot => Main.npc[(int)TargetShotID]; + + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 5; + ProjectileID.Sets.MinionShot[Type] = true; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = (int)CalamarisLament.EnemyDistanceDetection; + } + + public override void SetDefaults() + { + Projectile.DamageType = DamageClass.Summon; + Projectile.localNPCHitCooldown = -1; + Projectile.timeLeft = 240; + Projectile.width = Projectile.height = 28; + + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + } + + public override void AI() + { + if (TargetShot is not null && TargetShot.active) + { + float inertia = 20f; + Projectile.velocity = (Projectile.velocity * inertia + Projectile.SafeDirectionTo(TargetShot.Center) * CalamarisLament.ShootingProjectileSpeed) / (inertia + 1f); + Projectile.extraUpdates = 1; + + Projectile.netUpdate = true; + Projectile.netSpam = 0; + } + else + Projectile.extraUpdates = 0; + + Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; + Projectile.alpha = (int)Utils.Remap(Projectile.timeLeft, 30f, 0f, 0f, 255f); + + Dust trailDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, 109, Scale: Main.rand.NextFloat(0.5f, 0.8f), Alpha: 127); + trailDust.noGravity = true; + trailDust.noLight = true; + trailDust.alpha = (int)Utils.Remap(Projectile.timeLeft, 30f, 0f, 127f, 0f); + + Projectile.frameCounter++; + if (Projectile.frameCounter >= 4) + { + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; + Projectile.frameCounter = 0; + } + } + + // Made for DoG so the projectile can go through segments without spamming numbers + // and hit DoG's head and/or tail reliably and without penetration. + public override bool? CanDamage() => Projectile.getRect().Intersects(TargetShot.getRect()) ? null : false; + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 15; i++) + { + Dust deathDust = Dust.NewDustPerfect(Projectile.Center, 109, Projectile.velocity.SafeNormalize(Vector2.Zero).RotatedByRandom(MathHelper.PiOver4) * Main.rand.NextFloat(3f, 7f), Scale: Main.rand.NextFloat(0.5f, 1.5f), Alpha: 127); + deathDust.noGravity = true; + deathDust.noLight = true; + } + + SoundEngine.PlaySound(SoundID.NPCDeath28, Projectile.Center); + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = ModContent.Request(Texture).Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Vector2 origin = frame.Size() * 0.5f; + + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); + + Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None); + + return false; + } + } +} diff --git a/Projectiles/Summon/CalamariInk.png b/Projectiles/Summon/CalamarisLamentProjectile.png similarity index 100% rename from Projectiles/Summon/CalamariInk.png rename to Projectiles/Summon/CalamarisLamentProjectile.png diff --git a/Projectiles/Summon/DeathstareEyePupil.png b/Projectiles/Summon/DeathstareEyePupil.png index ea9db1fb5d..487e286d6a 100644 Binary files a/Projectiles/Summon/DeathstareEyePupil.png and b/Projectiles/Summon/DeathstareEyePupil.png differ diff --git a/Projectiles/Summon/DeathstareEyeball.cs b/Projectiles/Summon/DeathstareEyeball.cs index cb96b98350..e634522270 100644 --- a/Projectiles/Summon/DeathstareEyeball.cs +++ b/Projectiles/Summon/DeathstareEyeball.cs @@ -23,15 +23,15 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.NeedsUUID[Projectile.type] = true; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 6; + ProjectileID.Sets.NeedsUUID[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() { - Projectile.width = Projectile.height = 16; + Projectile.width = Projectile.height = 22; Projectile.netImportant = true; Projectile.friendly = true; Projectile.ignoreWater = true; @@ -159,16 +159,15 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { Texture2D eyeTexture = ModContent.Request(Texture).Value; - Rectangle frame = eyeTexture.Frame(1, 4, 0, Projectile.frame); - Vector2 origin = frame.Size() * 0.5f; + Rectangle frame = eyeTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); SpriteEffects spriteEffects = Owner.gravDir == 1 ? SpriteEffects.None : SpriteEffects.FlipVertically; - Main.EntitySpriteDraw(eyeTexture, Projectile.Center - Main.screenPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(eyeTexture, Projectile.Center - Main.screenPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, SpriteEffects.None); // Pupil drawing. Texture2D pupilTexture = ModContent.Request("CalamityMod/Projectiles/Summon/DeathstareEyePupil").Value; Vector2 pupilDrawPosition = Projectile.Center - Main.screenPosition + PupilAngle.ToRotationVector2() * PupilOutwardness; - pupilDrawPosition -= Vector2.UnitY * 4f; - Main.EntitySpriteDraw(pupilTexture, pupilDrawPosition, null, Projectile.GetAlpha(lightColor), PupilAngle, pupilTexture.Size() * 0.5f, PupilScale, SpriteEffects.None, 0); + pupilDrawPosition -= Vector2.UnitY * 6f; + Main.EntitySpriteDraw(pupilTexture, pupilDrawPosition, null, Projectile.GetAlpha(lightColor), PupilAngle, pupilTexture.Size() * 0.5f, PupilScale, SpriteEffects.None); return false; } diff --git a/Projectiles/Summon/DeathstareEyeball.png b/Projectiles/Summon/DeathstareEyeball.png index 6825c3c664..6e6ab72a1b 100644 Binary files a/Projectiles/Summon/DeathstareEyeball.png and b/Projectiles/Summon/DeathstareEyeball.png differ diff --git a/Projectiles/Summon/FleshBallMinion.cs b/Projectiles/Summon/FleshBallMinion.cs index bcef28f3bf..8997f26b4d 100644 --- a/Projectiles/Summon/FleshBallMinion.cs +++ b/Projectiles/Summon/FleshBallMinion.cs @@ -1,52 +1,43 @@ -using CalamityMod.Buffs.Summon; -using CalamityMod.CalPlayer; +using System; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; -using System; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class FleshBallMinion : ModProjectile, ILocalizedModType + public class FleshBallMinion : BaseMinionProjectile { - public new string LocalizationCategory => "Projectiles.Summon"; - public Player Owner => Main.player[Projectile.owner]; - public NPC Target => Owner.Center.MinionHoming(950f, Owner, CalamityPlayer.areThereAnyDamnBosses); - public bool SittingOnGround => Math.Abs(Projectile.velocity.X) < 1.55f && Projectile.velocity.Y == 0f; + public override int AssociatedProjectileTypeID => ModContent.ProjectileType(); + public override int AssociatedBuffTypeID => ModContent.BuffType(); + public override ref bool AssociatedMinionBool => ref ModdedOwner.fleshBall; + public override bool PreHardmodeMinionTileVision => true; + public ref float HopTimer => ref Projectile.ai[0]; public ref float HopAmount => ref Projectile.ai[1]; + public bool SittingOnGround => Math.Abs(Projectile.velocity.X) < 1.55f && Projectile.velocity.Y == 0f; public const float Gravity = 0.25f; public const float MaxFallSpeed = 12f; + public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + base.SetStaticDefaults(); + Main.projFrames[Type] = 6; } public override void SetDefaults() { + base.SetDefaults(); Projectile.width = 46; Projectile.height = 38; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.minionSlots = 1f; - Projectile.timeLeft = 90000; - Projectile.penetrate = -1; Projectile.extraUpdates = 1; - Projectile.tileCollide = false; - Projectile.minion = true; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 60; - Projectile.DamageType = DamageClass.Summon; } - public override void AI() + public override void MinionAI() { - ProvidePlayerMinionBuffs(); - DetermineFrames(); GenerateVisuals(); HopTimer++; @@ -58,27 +49,7 @@ namespace CalamityMod.Projectiles.Summon EnforceGravity(); } - internal void ProvidePlayerMinionBuffs() - { - Owner.AddBuff(ModContent.BuffType(), 3600); - - // Verify player/minion state integrity. The minion cannot stay alive if the - // owner is dead or if the caller of the AI is invalid. - if (Projectile.type != ModContent.ProjectileType()) - return; - - if (Owner.dead) - Owner.Calamity().fleshBall = false; - if (Owner.Calamity().fleshBall) - Projectile.timeLeft = 2; - } - - internal void DetermineFrames() - { - Projectile.frameCounter++; - if (Projectile.frameCounter % 5 == 6) - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; - } + #region AI Methods internal void EnforceGravity() { @@ -152,6 +123,10 @@ namespace CalamityMod.Projectiles.Summon } } + #endregion + + public override void OnSpawn(IEntitySource source) => IFrames = 30; + // Prevent immediate death on tile collision, and slow down on tile collision. public override bool OnTileCollide(Vector2 oldVelocity) { diff --git a/Projectiles/Summon/MiniGuardianAttack.cs b/Projectiles/Summon/MiniGuardianAttack.cs index 0e551b5250..a0df1da3ec 100644 --- a/Projectiles/Summon/MiniGuardianAttack.cs +++ b/Projectiles/Summon/MiniGuardianAttack.cs @@ -1,7 +1,5 @@ using System; -using System.IO; using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -41,11 +39,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { // Despawn properly - if (Owner.Calamity().donutBabs) + if (Owner.Calamity().pSoulGuardians) Projectile.timeLeft = 2; - if (!Owner.Calamity().pArtifact || Owner.dead || !Owner.active) + if (!Owner.Calamity().pSoulArtifact || Owner.dead || !Owner.active) { - Owner.Calamity().donutBabs = false; + Owner.Calamity().pSoulGuardians = false; Projectile.active = false; return; } @@ -144,18 +142,34 @@ namespace CalamityMod.Projectiles.Summon { if (Owner.Calamity().angelicAlliance) target.AddBuff(ModContent.BuffType(), 300); + if (!Owner.Calamity().profanedCrystal) + { + if (Projectile.ai[1] == 0f) + Owner.Calamity().rollBabSpears(1, target.chaseable); + Projectile.ai[1] -= 1f; + if (Projectile.ai[1] < 0f) + Projectile.ai[1] = 15; + } } public override void OnHitPlayer(Player target, Player.HurtInfo info) { if (Owner.Calamity().angelicAlliance) target.AddBuff(ModContent.BuffType(), 300); + if (!Owner.Calamity().profanedCrystal) + { + if (Projectile.ai[1] == 0f) + Owner.Calamity().rollBabSpears(1, true); + Projectile.ai[1] -= 1f; + if (Projectile.ai[1] < 0f) + Projectile.ai[1] = 15; + } } public override bool PreDraw(ref Color lightColor) { // Has afterimages if maximum empowerment - if (!ForcedVanity && !Owner.Calamity().endoCooper && !Owner.Calamity().magicHat) + if (!ForcedVanity && SpawnedFromPSC) { CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); return false; diff --git a/Projectiles/Summon/MiniGuardianDefense.cs b/Projectiles/Summon/MiniGuardianDefense.cs index 82a60efbed..ca8c3e78d6 100644 --- a/Projectiles/Summon/MiniGuardianDefense.cs +++ b/Projectiles/Summon/MiniGuardianDefense.cs @@ -1,7 +1,6 @@ using System; using System.IO; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.CalPlayer; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -11,11 +10,23 @@ namespace CalamityMod.Projectiles.Summon { public class MiniGuardianDefense : ModProjectile, ILocalizedModType { + public enum MiniDefenderAIState + { + ShieldActive, + ShieldInactive, + Vanity + } public new string LocalizationCategory => "Projectiles.Summon"; public Player Owner => Main.player[Projectile.owner]; public bool SpawnedFromPSC => Projectile.ai[0] == 1f; public bool ForcedVanity => SpawnedFromPSC && !Owner.Calamity().profanedCrystalBuffs; + public bool shieldActive => !ForcedVanity && Owner.Calamity().pSoulShieldDurability > 0; + + public bool shieldActiveBefore = false; + + + public MiniDefenderAIState AIState => ForcedVanity ? MiniDefenderAIState.Vanity : (shieldActive ? MiniDefenderAIState.ShieldActive : MiniDefenderAIState.ShieldInactive); public override void SetStaticDefaults() { @@ -35,44 +46,145 @@ namespace CalamityMod.Projectiles.Summon Projectile.minion = true; Projectile.friendly = true; Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; + } + + + private void HandleRocks(bool spawnRocks = false, bool yeetRocks = false) + { + if (spawnRocks) + { + //spawn rocks + bool psc = Owner.Calamity().profanedCrystalBuffs; + int rockCount = psc ? 10 : 5; + int[] validRockTypes = psc ? new int[]{ 1, 3, 4, 5, 6 } : new int[]{ 3, 5, 6 }; //1 and 4 are chonkier and psc pushes shield so it looks less weirdge + float angleVariance = MathHelper.TwoPi / rockCount; + float angle = 0f; + for (int i = 0; i < rockCount; i++) + { + int rockType = validRockTypes[Main.rand.Next(0, validRockTypes.Length)]; + var rockyRoad = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.position, + angle.ToRotationVector2() * 8f, ModContent.ProjectileType(), 1, 2f, Owner.whoAmI, 0f, angle, rockType); + rockyRoad.originalDamage = Projectile.originalDamage; + angle += angleVariance; + } + } + else if (yeetRocks) + { + //flag the rocks for yeetage + int rock = ModContent.ProjectileType(); + foreach (var proj in Main.projectile) + { + if (proj.active && proj.owner == Owner.whoAmI && proj.type == rock) + { + proj.ai[0] = 1f; + } + } + } } public override void AI() { // Despawn properly - if (Owner.Calamity().donutBabs) + if (Owner.Calamity().pSoulGuardians) Projectile.timeLeft = 2; - if (!Owner.Calamity().pArtifact || Owner.dead || !Owner.active) + if (!Owner.Calamity().pSoulArtifact || Owner.dead || !Owner.active) { - Owner.Calamity().donutBabs = false; + Owner.Calamity().pSoulGuardians = false; Projectile.active = false; return; } + //dust and framing + Projectile.frameCounter++; + Projectile.frame = Projectile.frameCounter / 6 % Main.projFrames[Projectile.type]; + + var shieldIsActive = shieldActive; //avoid checkiing cooldowns multiple times per frame + + bool shouldSpawnRocks = !shieldActiveBefore && shieldIsActive; + bool shouldYeetRocks = shieldActiveBefore && !shieldIsActive; + HandleRocks(shouldSpawnRocks, shouldYeetRocks); + + bool shouldDust = shouldSpawnRocks || shouldYeetRocks; + + if (shouldDust) + { + for (int i = 0; i < 20; i++) + { + Vector2 dustPos = new Vector2(Owner.Center.X + Main.rand.NextFloat(-10, 10), Owner.Center.Y + Main.rand.NextFloat(-10, 10)); + Vector2 velocity = (Owner.Center - dustPos).SafeNormalize(Vector2.Zero); + velocity *= 3f; + Dust.NewDustPerfect(Owner.Center, (int)CalamityDusts.ProfanedFire, velocity, 0, default(Color), 2f); + } + } + // Dynamically update stats here, originalDamage can be found in MiscEffects + // Doesn't deal damage directly, damage used for rocks Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - Projectile.localNPCHitCooldown = (SpawnedFromPSC ? 6 : 9); - - // Find minion and charge if possible, make sure vanity minions are not chasing - NPC potentialTarget = Projectile.Center.MinionHoming(3000f, Owner); - if (potentialTarget != null && !ForcedVanity) + NPC potentialTarget = Projectile.Center.MinionHoming(1500f, Owner); + Vector2 playerDestination = Owner.Center - Projectile.Center; + switch (AIState) { - Vector2 targetDestination = potentialTarget.Center - Projectile.Center; - float targetDist = targetDestination.Length(); - // Moves faster if from PSC - float baseSpeed = (targetDist < 100f ? 28f : 24f) * (SpawnedFromPSC ? 2f : 0.95f); - float inertia = SpawnedFromPSC ? 20f : 12f; + case MiniDefenderAIState.ShieldActive: + case MiniDefenderAIState.ShieldInactive: + if (AIState == MiniDefenderAIState.ShieldInactive) //dust only while inactive + { + for (int i = 0; i < 2; i++) + { + if (!Main.rand.NextBool(3)) + continue; - targetDist = baseSpeed / targetDist; - targetDestination *= targetDist; - Projectile.velocity = (Projectile.velocity * inertia + targetDestination) / (inertia + 1f); + Dust dust = Dust.NewDustDirect(Owner.position, Owner.width, Owner.height, (int)CalamityDusts.ProfanedFire); + dust.velocity = Main.rand.NextVector2Circular(3.5f, 3.5f); + dust.velocity.Y -= Main.rand.NextFloat(1f, 3f); + dust.scale = Main.rand.NextFloat(1.15f, 1.45f); + dust.noGravity = true; + } + } + + if (potentialTarget != null) + { + Vector2 angle = Owner.Center + Owner.SafeDirectionTo(potentialTarget.Center) * (shieldIsActive ? (Owner.Calamity().profanedCrystalBuffs ? 125f : 75f) : -50f); + playerDestination = angle; + playerDestination.X += Main.rand.NextFloat(-5f, 5f); + playerDestination.Y += Main.rand.NextFloat(-5f, 5f); + } + else + { + playerDestination.X += Main.rand.NextFloat(-10f, 10f) + (75f * (shieldIsActive ? Owner.direction : -Owner.direction)); + playerDestination.Y += Main.rand.NextFloat(-10f, 10f); + } + break; + case MiniDefenderAIState.Vanity: + playerDestination.X += Main.rand.NextFloat(-10f, 20f) - (60f * Owner.direction); + playerDestination.Y += Main.rand.NextFloat(-10f, 20f) - 60f; + break; } - else // Idle movement + + if (potentialTarget != null && AIState != MiniDefenderAIState.Vanity) + { + float dist = Projectile.Center.Distance(playerDestination); + float num543 = playerDestination.X; + float num544 = playerDestination.Y; + float num550 = 40f; + Vector2 vector43 = new Vector2(Projectile.position.X + (float)Projectile.width * 0.5f, Projectile.position.Y + (float)Projectile.height * 0.5f); + float num551 = num543 - vector43.X; + float num552 = num544 - vector43.Y; + float num553 = (float)Math.Sqrt((double)(num551 * num551 + num552 * num552)); + if (num553 < 100f) + { + num550 = 28f; //14 + } + num553 = num550 / num553; + num551 *= num553; + num552 *= num553; + Projectile.velocity.X = (Projectile.velocity.X * 14f + num551) / 13.5f; + Projectile.velocity.Y = (Projectile.velocity.Y * 14f + num552) / 13.5f; + + Projectile.velocity *= dist > 10 ? 0.9f : 0.5f; + Projectile.spriteDirection = Projectile.DirectionTo(potentialTarget.Center).X > 0 ? 1 : -1; + } + else { - Vector2 playerDestination = Owner.Center - Projectile.Center; - playerDestination.X += Main.rand.NextFloat(-10f, 20f) - (60f * Owner.direction); - playerDestination.Y += Main.rand.NextFloat(-10f, 20f) - 60f; float playerDist = playerDestination.Length(); float acceleration = 0.5f; float returnSpeed = 18f; @@ -100,62 +212,61 @@ namespace CalamityMod.Projectiles.Summon playerDist = returnSpeed / playerDist; playerDestination *= playerDist; - } - - // Turning (wtf is this) - if (Projectile.velocity.X < playerDestination.X) - { - Projectile.velocity.X += acceleration; - if (acceleration > 0.05f && Projectile.velocity.X < 0f) + // Turning (wtf is this) (idk ask phup lmao) + if (Projectile.velocity.X < playerDestination.X) + { Projectile.velocity.X += acceleration; - } - if (Projectile.velocity.X > playerDestination.X) - { - Projectile.velocity.X -= acceleration; - if (acceleration > 0.05f && Projectile.velocity.X > 0f) + if (acceleration > 0.05f && Projectile.velocity.X < 0f) + Projectile.velocity.X += acceleration; + } + + if (Projectile.velocity.X > playerDestination.X) + { Projectile.velocity.X -= acceleration; + if (acceleration > 0.05f && Projectile.velocity.X > 0f) + Projectile.velocity.X -= acceleration; + } + + if (Projectile.velocity.Y < playerDestination.Y) + { + Projectile.velocity.Y += acceleration; + if (acceleration > 0.05f && Projectile.velocity.Y < 0f) + Projectile.velocity.Y += acceleration * 2f; + } + + if (Projectile.velocity.Y > playerDestination.Y) + { + Projectile.velocity.Y -= acceleration; + if (acceleration > 0.05f && Projectile.velocity.Y > 0f) + Projectile.velocity.Y -= acceleration * 2f; + } } - if (Projectile.velocity.Y < playerDestination.Y) - { - Projectile.velocity.Y += acceleration; - if (acceleration > 0.05f && Projectile.velocity.Y < 0f) - Projectile.velocity.Y += acceleration * 2f; - } - if (Projectile.velocity.Y > playerDestination.Y) - { - Projectile.velocity.Y -= acceleration; - if (acceleration > 0.05f && Projectile.velocity.Y > 0f) - Projectile.velocity.Y -= acceleration * 2f; - } + + // Direction + if (Math.Abs(Projectile.velocity.X) > 0.2f) + Projectile.direction = Projectile.spriteDirection = Math.Sign(Projectile.velocity.X); } + + Projectile.netUpdate = Projectile.netUpdate || (shieldIsActive != shieldActiveBefore); + shieldActiveBefore = shieldIsActive; + } + + public override bool? CanDamage() => false; - // Direction and frames - if (Math.Abs(Projectile.velocity.X) > 0.2f) - Projectile.direction = Projectile.spriteDirection = Math.Sign(Projectile.velocity.X); - - Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 6 % Main.projFrames[Projectile.type]; + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(shieldActiveBefore); } - // Vanity stuff can't damage - public override bool? CanDamage() => !ForcedVanity; - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + public override void ReceiveExtraAI(BinaryReader reader) { - if (Owner.Calamity().angelicAlliance) - target.AddBuff(ModContent.BuffType(), 300); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (Owner.Calamity().angelicAlliance) - target.AddBuff(ModContent.BuffType(), 300); + shieldActiveBefore = reader.ReadBoolean(); } public override bool PreDraw(ref Color lightColor) { // Has afterimages if maximum empowerment - if (!ForcedVanity && !Owner.Calamity().endoCooper && !Owner.Calamity().magicHat) + if (SpawnedFromPSC && !ForcedVanity) { CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); return false; diff --git a/Projectiles/Summon/MiniGuardianHealer.cs b/Projectiles/Summon/MiniGuardianHealer.cs index 703baf0dc5..35ba77df58 100644 --- a/Projectiles/Summon/MiniGuardianHealer.cs +++ b/Projectiles/Summon/MiniGuardianHealer.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Summon public override bool? CanCutTiles() { CalamityPlayer modPlayer = Main.player[Projectile.owner].Calamity(); - bool psa = modPlayer.pArtifact && !modPlayer.profanedCrystal; + bool psa = modPlayer.pSoulArtifact && !modPlayer.profanedCrystal; if (!psa && !modPlayer.profanedCrystalBuffs) return false; return null; @@ -45,13 +45,13 @@ namespace CalamityMod.Projectiles.Summon Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.donutBabs) + if (modPlayer.pSoulGuardians) { Projectile.timeLeft = 2; } - if (!modPlayer.pArtifact || player.dead || !player.active) + if (!modPlayer.pSoulArtifact || player.dead || !player.active) { - modPlayer.donutBabs = false; + modPlayer.pSoulGuardians = false; Projectile.active = false; return; } diff --git a/Projectiles/Summon/MiniGuardianRock.cs b/Projectiles/Summon/MiniGuardianRock.cs new file mode 100644 index 0000000000..29a5fc8fa6 --- /dev/null +++ b/Projectiles/Summon/MiniGuardianRock.cs @@ -0,0 +1,130 @@ +using System; +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class MiniGuardianRock : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Summon"; + public Player Owner => Main.player[Projectile.owner]; + + public override string Texture => "CalamityMod/NPCs/ProfanedGuardians/ProfanedRocks"; + + + public override void SetStaticDefaults() + { + Main.projFrames[Projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; + ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + } + + public override void SetDefaults() + { + Projectile.netImportant = true; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; //the sounds get grating otherwise + Projectile.width = 50; + Projectile.height = 50; + Projectile.minion = true; + Projectile.friendly = true; + Projectile.penetrate = 1; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 1; + } + + + public override void AI() + { + // Dynamically update stats here, originalDamage can be found in MiscEffects + Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); + // Despawn properly + if (Owner.Calamity().pSoulGuardians && Projectile.ai[0] == 0f) + Projectile.timeLeft = 4; + if (!Owner.Calamity().pSoulArtifact || Owner.dead || !Owner.active || (Owner.Calamity().profanedCrystal && !Owner.Calamity().profanedCrystalBuffs)) + { + Owner.Calamity().pSoulGuardians = false; + Projectile.active = false; + return; + } + + if (Projectile.ai[0] == 0f) //regular expected behaviour of floaty rocks + { + // Rotation velocity + float minRotationVelocity = 0.5f; + float rotationVelocityIncrease = 0.2f; + rotationVelocityIncrease += rotationVelocityIncrease * (Projectile.ai[1] * 0.5f); + + // Rotate around Player + var psc = Owner.Calamity().profanedCrystalBuffs; + float angle = MathHelper.TwoPi / (psc ? 10 : 5) * Projectile.ai[1]; + float distance = psc ? 90f : 50f; + Projectile.Center = Owner.Center + Projectile.ai[1].ToRotationVector2() * distance; + Projectile.rotation = Projectile.ai[1] + (float)Math.Atan(90); + Projectile.ai[1] -= MathHelper.ToRadians(2f); + } + else if (Projectile.ai[0] == 1f) //rock yeetage begins + { + Projectile.velocity = Projectile.Center - Owner.Center; + Projectile.velocity.Normalize(); + Projectile.velocity *= Owner.Calamity().profanedCrystalBuffs ? 25f : 20f; + Projectile.ai[0] = 2f; + Projectile.timeLeft = 300; + } + else if (Projectile.ai[0] == 2f) //rocks have been yeeted, handle the aftermath + { + if (Projectile.timeLeft > 275) //slow them down a little + Projectile.velocity *= 0.9725f; + + for (int i = 0; i < 2; i++) + { + if (i == 0 || Projectile.timeLeft > 285) + Dust.NewDust(Projectile.position, Projectile.width / 2, Projectile.height / 2, (int)CalamityDusts.ProfanedFire, 0f, -1f, 0, default, 1f); + } + + } + } + + public override bool? CanDamage() => Projectile.ai[0] >= 1f ? null : false; + + public override bool PreDraw(ref Color lightColor) + { + bool psc = Owner.Calamity().profanedCrystalBuffs; + int rockType = (int)MathHelper.Clamp(Projectile.ai[2], 1f, 6f);; + Texture2D texture = ModContent.Request("CalamityMod/NPCs/ProfanedGuardians/ProfanedRocks" + rockType.ToString()).Value; + + Vector2 drawOrigin = new Vector2(texture.Width / 2, texture.Height / 2); + Vector2 drawPos = Projectile.Center - Main.screenPosition; + drawPos -= new Vector2(texture.Width, texture.Height) * Projectile.scale / 2f; + drawPos += drawOrigin * Projectile.scale + new Vector2(0f, Projectile.gfxOffY); + Rectangle frame = new Rectangle(0, 0, texture.Width, texture.Height); + if (CalamityConfig.Instance.Afterimages && Projectile.ai[0] >= 1f) //handle afterimages manually since the utility broke it and didn't render correctly + { + for (int i = 0; i < Projectile.oldPos.Length; ++i) + { + drawPos = Projectile.oldPos[i] + (Projectile.Size / 2f) - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + // DO NOT REMOVE THESE "UNNECESSARY" FLOAT CASTS. THIS WILL BREAK THE AFTERIMAGES. + Color color = Projectile.GetAlpha(lightColor) * ((float)(Projectile.oldPos.Length - i) / (float)Projectile.oldPos.Length); + Main.spriteBatch.Draw(texture, drawPos, frame, color, Projectile.rotation, drawOrigin, Projectile.scale, SpriteEffects.None, 0f); + } + } + else + { + Main.spriteBatch.Draw(texture, drawPos, frame, Color.White, Projectile.rotation, drawOrigin, Projectile.scale, SpriteEffects.None, 0f); + } + + return false; + } + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 10; k++) + Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.ProfanedFire, 0f, -1f, 0, default, 1f); + } + } +} diff --git a/Projectiles/Summon/MiniSandShark.cs b/Projectiles/Summon/MiniSandShark.cs index a71818b08e..d8acacc493 100644 --- a/Projectiles/Summon/MiniSandShark.cs +++ b/Projectiles/Summon/MiniSandShark.cs @@ -22,6 +22,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.minion = true; Projectile.friendly = true; Projectile.ignoreWater = true; + Projectile.extraUpdates = 1; + Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Summon; } diff --git a/Projectiles/Summon/PlantSeed.cs b/Projectiles/Summon/PlantSeed.cs deleted file mode 100644 index 13cfc8669a..0000000000 --- a/Projectiles/Summon/PlantSeed.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Summon -{ - public class PlantSeed : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - public override void SetStaticDefaults() - { - Main.projFrames[Projectile.type] = 2; - ProjectileID.Sets.MinionShot[Projectile.type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 14; - Projectile.height = 14; - Projectile.light = 0.5f; - Projectile.alpha = 255; - Projectile.extraUpdates = 2; - Projectile.tileCollide = false; - Projectile.friendly = true; - Projectile.minion = true; - Projectile.minionSlots = 0f; - Projectile.ignoreWater = true; - Projectile.aiStyle = ProjAIStyleID.Arrow; - AIType = ProjectileID.BulletHighVelocity; - Projectile.penetrate = 1; - Projectile.timeLeft = 600; - Projectile.DamageType = DamageClass.Summon; - } - - public override void AI() - { - Projectile.frameCounter++; - if (Projectile.frameCounter > 8) - { - Projectile.frame++; - Projectile.frameCounter = 0; - } - if (Projectile.frame >= 2) - { - Projectile.frame = 0; - } - } - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); - return false; - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Poisoned, 60); - - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Poisoned, 60); - } -} diff --git a/Projectiles/Summon/PlantSeedGreen.cs b/Projectiles/Summon/PlantSeedGreen.cs deleted file mode 100644 index 9fec88577c..0000000000 --- a/Projectiles/Summon/PlantSeedGreen.cs +++ /dev/null @@ -1,69 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Summon -{ - public class PlantSeedGreen : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - public override void SetStaticDefaults() - { - Main.projFrames[Projectile.type] = 2; - ProjectileID.Sets.MinionShot[Projectile.type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 14; - Projectile.height = 14; - Projectile.light = 0.5f; - Projectile.alpha = 255; - Projectile.extraUpdates = 3; - Projectile.tileCollide = false; - Projectile.friendly = true; - Projectile.minion = true; - Projectile.minionSlots = 0f; - Projectile.ignoreWater = true; - Projectile.aiStyle = ProjAIStyleID.Arrow; - AIType = ProjectileID.BulletHighVelocity; - Projectile.penetrate = 1; - Projectile.timeLeft = 600; - Projectile.DamageType = DamageClass.Summon; - } - - public override void AI() - { - Projectile.frameCounter++; - if (Projectile.frameCounter > 8) - { - Projectile.frame++; - Projectile.frameCounter = 0; - } - if (Projectile.frame >= 2) - { - Projectile.frame = 0; - } - } - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); - return false; - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(BuffID.Poisoned, 180); - if (Projectile.ai[1] == 1f) - target.AddBuff(BuffID.Venom, 90); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(BuffID.Poisoned, 180); - if (Projectile.ai[1] == 1f) - target.AddBuff(BuffID.Venom, 90); - } - } -} diff --git a/Projectiles/Summon/PlantSporeCloud.cs b/Projectiles/Summon/PlantSporeCloud.cs deleted file mode 100644 index 85c121e00e..0000000000 --- a/Projectiles/Summon/PlantSporeCloud.cs +++ /dev/null @@ -1,65 +0,0 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Summon -{ - public class PlantSporeCloud : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - private int counter = 0; - - public override void SetStaticDefaults() - { - ProjectileID.Sets.MinionShot[Projectile.type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 32; - Projectile.height = 32; - Projectile.friendly = true; - Projectile.alpha = 60; - Projectile.penetrate = -1; - Projectile.tileCollide = false; - Projectile.minion = true; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 30; - Projectile.DamageType = DamageClass.Summon; - } - - public override void AI() - { - Projectile.velocity.X *= 0.985f; - Projectile.velocity.Y *= 0.985f; - Projectile.rotation += Projectile.direction * 0.05f; - - if (counter % 5 == 0) - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 107, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); - - counter++; - if (counter > 300) - Projectile.alpha += 5; - if (Projectile.alpha >= 255) - Projectile.Kill(); - } - - public override bool PreDraw(ref Color lightColor) - { - Texture2D tex = ModContent.Request(Texture).Value; - if (Projectile.ai[0] == 1f) - tex = ModContent.Request("CalamityMod/Projectiles/Summon/PlantSporeCloud2").Value; - if (Projectile.ai[0] == 2f) - tex = ModContent.Request("CalamityMod/Projectiles/Summon/PlantSporeCloud3").Value; - - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); - return false; - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Poisoned, 180); - - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Poisoned, 180); - } -} diff --git a/Projectiles/Summon/PlantSummon.cs b/Projectiles/Summon/PlantSummon.cs deleted file mode 100644 index 2c66d1100e..0000000000 --- a/Projectiles/Summon/PlantSummon.cs +++ /dev/null @@ -1,501 +0,0 @@ -using CalamityMod.Buffs.Summon; -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.Audio; - -namespace CalamityMod.Projectiles.Summon -{ - public class PlantSummon : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - private bool initialized = false; - private bool enraged = false; - private int pinkSeed = ModContent.ProjectileType(); - private int greenSeed = ModContent.ProjectileType(); - private int thornBall = ModContent.ProjectileType(); - private int sporeClouds = ModContent.ProjectileType(); - - public override void SetStaticDefaults() - { - Main.projFrames[Projectile.type] = 8; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - ProjectileID.Sets.NeedsUUID[Projectile.type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 38; - Projectile.height = 38; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.minionSlots = 3f; - Projectile.timeLeft = 18000; - Projectile.penetrate = -1; - Projectile.tileCollide = false; - Projectile.timeLeft *= 5; - Projectile.minion = true; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 12; - Projectile.extraUpdates = 0; - Projectile.DamageType = DamageClass.Summon; - } - - public override void AI() - { - Player player = Main.player[Projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - CalamityGlobalProjectile modProj = Projectile.Calamity(); - - if (player.statLife <= (int)(player.statLifeMax2 * 0.75)) - { - if (Main.myPlayer == Projectile.owner) - { - enraged = true; - } - } - else - { - enraged = false; - Projectile.extraUpdates = 0; - } - - Framing(); - - if (!initialized) - { - SpawnDust(); - SpawnTentacles(); - initialized = true; - } - bool correctMinion = Projectile.type == ModContent.ProjectileType(); - player.AddBuff(ModContent.BuffType(), 3600); - if (correctMinion) - { - if (player.dead) - { - modPlayer.plantera = false; - } - if (modPlayer.plantera) - { - Projectile.timeLeft = 2; - } - } - - float range = 1000f; - - //shouldn't need anti clump because there can only be one - - if (!enraged) - { - if (Projectile.ai[0] >= 2f) - Projectile.ai[0] = 0f; - Vector2 targetVec = Projectile.position; - bool foundTarget = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(Projectile, false)) - { - float extraDist = (npc.width / 2) + (npc.height / 2); - //Calculate distance between target and the projectile to know if it's too far or not - float npcDist = Vector2.Distance(npc.Center, Projectile.Center); - if (!foundTarget && npcDist < (range + extraDist)) - { - range = npcDist; - targetVec = npc.Center; - foundTarget = true; - } - } - } - else - { - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC npc = Main.npc[i]; - if (npc.CanBeChasedBy(Projectile, false)) - { - float extraDist = (npc.width / 2) + (npc.height / 2); - //Calculate distance between target and the projectile to know if it's too far or not - float npcDist = Vector2.Distance(npc.Center, Projectile.Center); - if (!foundTarget && npcDist < (range + extraDist)) - { - range = npcDist; - targetVec = npc.Center; - foundTarget = true; - } - } - } - } - - CheckIfShouldReturnToPlayer(foundTarget); - - if (foundTarget && Projectile.ai[0] == 0f) - { - StayCertainDistFromTarget(targetVec); - } - else - { - PassiveAI(); - } - - HandleRotation(foundTarget, targetVec); - - IncrementAttackCounter(); - if (Projectile.ai[0] == 0f) - { - float projSpeed = 6f; - int projType = Main.rand.NextBool(2) ? greenSeed : pinkSeed; - int projDmg = (int)(Projectile.damage * 0.7f); - float speedMult = 1f; - if (Main.rand.NextBool(4)) - { - projType = thornBall; - } - if (projType == thornBall) - { - speedMult = 2f; - projDmg = (int)(Projectile.damage * 1.2f); - } - if (Projectile.ai[1] == 0f && foundTarget && range < 500f) - { - SoundEngine.PlaySound(SoundID.Item20, Projectile.position); - Projectile.ai[1] += 1f; - if (Main.myPlayer == Projectile.owner) - { - Vector2 velocity = targetVec - Projectile.Center; - if (projType != thornBall && Main.rand.NextBool(3)) - { - FireShotgun(velocity, 0.7f); - } - else - { - velocity.Normalize(); - velocity *= projSpeed; - velocity *= speedMult; - int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, projType, projDmg, Projectile.knockBack, Projectile.owner, 0f, 0f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Projectile.originalDamage; - } - Projectile.netUpdate = true; - } - } - } - } - else //enraged - { - bool charging = false; - if (Projectile.ai[0] == 2f) - { - Projectile.ai[1] += 1f; - Projectile.extraUpdates = 1; - if (Projectile.ai[1] > 30f) - { - Projectile.ai[1] = 1f; - Projectile.ai[0] = 0f; - Projectile.extraUpdates = 0; - Projectile.numUpdates = 0; - Projectile.netUpdate = true; - } - else - { - charging = true; - } - } - if (charging) - { - return; - } - Vector2 targetVec = Projectile.position; - bool foundTarget = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(Projectile, false)) - { - float extraDist = (npc.width / 2) + (npc.height / 2); - //Calculate distance between target and the projectile to know if it's too far or not - float npcDist = Vector2.Distance(npc.Center, Projectile.Center); - if (!foundTarget && npcDist < (range + extraDist)) - { - range = npcDist; - targetVec = npc.Center; - foundTarget = true; - } - } - } - if (!foundTarget) - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC npc = Main.npc[num645]; - if (npc.CanBeChasedBy(Projectile, false)) - { - float extraDist = (npc.width / 2) + (npc.height / 2); - //Calculate distance between target and the projectile to know if it's too far or not - float npcDist = Vector2.Distance(npc.Center, Projectile.Center); - if (!foundTarget && npcDist < (range + extraDist)) - { - range = npcDist; - targetVec = npc.Center; - foundTarget = true; - } - } - } - } - - HandleRotation(foundTarget, targetVec); - - CheckIfShouldReturnToPlayer(foundTarget); - - if (foundTarget && Projectile.ai[0] == 0f) - { - StayCertainDistFromTarget(targetVec); - } - else - { - PassiveAI(); - } - IncrementAttackCounter(); - if (Projectile.ai[0] == 0f) - { - if (Projectile.ai[1] == 0f && foundTarget && range < 500f) - { - Projectile.ai[1] += 1f; - if (Main.myPlayer == Projectile.owner) - { - Projectile.ai[0] = 2f; - Vector2 whereIsTarget = targetVec - Projectile.Center; - whereIsTarget.Normalize(); - int projType = thornBall; - if (Main.rand.NextBool(2)) - { - Vector2 projVelocity = whereIsTarget * 2f; - int projDmg = (int)(Projectile.damage * 1.5f); - int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, projVelocity, projType, projDmg, Projectile.knockBack, Projectile.owner, 0f, 1f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Projectile.originalDamage; - } - if (Main.rand.NextBool(3)) - { - FireShotgun(whereIsTarget, 0.8f); - } - float chargeSpeed = 8f; - Projectile.velocity = whereIsTarget * chargeSpeed; - Projectile.netUpdate = true; - } - } - } - } - } - - private void CheckIfShouldReturnToPlayer(bool targetLocated) - { - Player player = Main.player[Projectile.owner]; - float separationAnxietyDist = 1300f; - if (targetLocated) - { - separationAnxietyDist = 2600f; - } - if (Vector2.Distance(player.Center, Projectile.Center) > separationAnxietyDist) - { - Projectile.ai[0] = 1f; - Projectile.netUpdate = true; - } - } - - private void StayCertainDistFromTarget(Vector2 whereIsTarget) - { - Vector2 targetPos = whereIsTarget - Projectile.Center; - float targetDist = targetPos.Length(); - targetPos.Normalize(); - if (targetDist > 200f) - { - float speedMult = 8f; - targetPos *= speedMult; - Projectile.velocity = (Projectile.velocity * 40f + targetPos) / 41f; - } - else - { - float reverseSpeedMult = 4f; - targetPos *= -reverseSpeedMult; - Projectile.velocity = (Projectile.velocity * 40f + targetPos) / 41f; - } - } - - private void PassiveAI() - { - Player player = Main.player[Projectile.owner]; - bool returningToPlayer = false; - if (!returningToPlayer) - { - returningToPlayer = Projectile.ai[0] == 1f; - } - float returnSpeed = 12f; - if (returningToPlayer) - { - returnSpeed = 30f; - } - Vector2 playerVec = player.Center - Projectile.Center + new Vector2(0f, -120f); - float playerDist = playerVec.Length(); - if (playerDist > 200f && returnSpeed < 16f) - { - returnSpeed = 16f; - } - if (playerDist < 600f && returningToPlayer) - { - Projectile.ai[0] = 0f; - Projectile.netUpdate = true; - } - if (playerDist > 2000f) - { - Projectile.position.X = player.Center.X - (float)(Projectile.width / 2); - Projectile.position.Y = player.Center.Y - (float)(Projectile.height / 2); - Projectile.netUpdate = true; - } - if (playerDist > 70f) - { - playerVec.Normalize(); - playerVec *= returnSpeed; - Projectile.velocity = (Projectile.velocity * 40f + playerVec) / 41f; - } - else if (Projectile.velocity.X == 0f && Projectile.velocity.Y == 0f) - { - Projectile.velocity.X = -0.15f; - Projectile.velocity.Y = -0.05f; - } - } - - private void IncrementAttackCounter() - { - if (Projectile.ai[1] > 0f) - { - Projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (Projectile.ai[1] > 40f) - { - Projectile.ai[1] = 0f; - Projectile.netUpdate = true; - } - } - - private void FireShotgun(Vector2 whereIsTarget, float attackMult) - { - whereIsTarget.Normalize(); - float projSpeedMult = 3f; - int projType = pinkSeed; - if (Main.rand.NextBool(2) && CalamityUtils.CountProjectiles(sporeClouds) < 9) - { - projType = sporeClouds; - projSpeedMult = 10f; - } - else - { - projType = Main.rand.NextBool(2) ? greenSeed : pinkSeed; - } - int projDmg = (int)(Projectile.damage * attackMult); - Vector2 projVelocity = whereIsTarget * projSpeedMult; - for (int i = -8; i <= 8; i += 8) - { - Vector2 perturbedSpeed = projVelocity.RotatedBy(MathHelper.ToRadians(i)); - int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, perturbedSpeed, projType, projDmg, Projectile.knockBack * attackMult, Projectile.owner, Main.rand.Next(3), 1f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Projectile.originalDamage; - } - } - - private void HandleRotation(bool targetFound, Vector2 whereIsTarget) - { - if (targetFound && !enraged) - { - Projectile.rotation = Projectile.rotation.AngleTowards(Projectile.AngleTo(whereIsTarget) + MathHelper.Pi, 0.1f); - } - else - { - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.Pi; - } - } - - private void Framing() - { - if (Projectile.frameCounter++ % 8 == 7) - { - Projectile.frame++; - } - if (!enraged) - { - if (Projectile.frame >= 4) - { - Projectile.frame = 0; - } - } - else - { - if (Projectile.frame >= 8) - { - Projectile.frame = 4; - } - } - } - - private void SpawnDust() - { - int dustAmt = 36; - for (int dustIndex = 0; dustIndex < dustAmt; dustIndex++) - { - Vector2 source = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.75f; - source = source.RotatedBy((double)((float)(dustIndex - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + Projectile.Center; - Vector2 dustVel = source - Projectile.Center; - int terra = Dust.NewDust(source + dustVel, 0, 0, 107, dustVel.X * 1.75f, dustVel.Y * 1.75f, 100, default, 1.1f); - Main.dust[terra].noGravity = true; - Main.dust[terra].velocity = dustVel; - } - } - - private void SpawnTentacles() - { - if (Projectile.owner == Main.myPlayer) - { - int tentacleAmt = 6; - for (int tentacleIndex = 0; tentacleIndex < tentacleAmt; tentacleIndex++) - { - int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, tentacleIndex, Projectile.GetByUUID(Projectile.owner, Projectile.whoAmI)); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Projectile.originalDamage; - } - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(BuffID.Poisoned, 180); - target.AddBuff(BuffID.Venom, 90); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(BuffID.Poisoned, 180); - target.AddBuff(BuffID.Venom, 90); - } - - public override bool? CanDamage() => enraged; - - public override bool PreDraw(ref Color lightColor) - { - Texture2D texture = ModContent.Request(Texture).Value; - int height = texture.Height / Main.projFrames[Projectile.type]; - int frameHeight = height * Projectile.frame; - SpriteEffects spriteEffects = SpriteEffects.None; - if (Projectile.spriteDirection == -1) - spriteEffects = SpriteEffects.FlipHorizontally; - - Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)height / 2f), Projectile.scale, spriteEffects, 0); - return false; - } - } -} diff --git a/Projectiles/Summon/PlantSummon.png b/Projectiles/Summon/PlantSummon.png deleted file mode 100644 index 81ca69a658..0000000000 Binary files a/Projectiles/Summon/PlantSummon.png and /dev/null differ diff --git a/Projectiles/Summon/PlantTentacle.cs b/Projectiles/Summon/PlantTentacle.cs deleted file mode 100644 index ce240e52bf..0000000000 --- a/Projectiles/Summon/PlantTentacle.cs +++ /dev/null @@ -1,237 +0,0 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.GameContent; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Summon -{ - public class PlantTentacle : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - private int counter = 0; - private float desiredDistance = 150f; - - public override void SetStaticDefaults() - { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 22; - Projectile.height = 24; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.minionSlots = 0f; - Projectile.timeLeft = 18000; - Projectile.penetrate = -1; - Projectile.tileCollide = false; - Projectile.timeLeft *= 5; - Projectile.minion = true; - Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 12; - Projectile.DamageType = DamageClass.Summon; - } - - public override void AI() - { - Player player = Main.player[Projectile.owner]; - if (Projectile.ai[1] < 0 || Projectile.ai[1] >= Main.maxProjectiles) - { - Projectile.Kill(); - return; - } - // If something has gone wrong with either the tentacle or the host plant, destroy the proj. - Projectile hostPlant = Main.projectile[(int)Projectile.ai[1]]; - if (Projectile.type != ModContent.ProjectileType() || !hostPlant.active || hostPlant.type != ModContent.ProjectileType()) - { - Projectile.Kill(); - return; - } - - if (Projectile.frameCounter++ % 6 == 0) - { - Projectile.frame++; - } - if (Projectile.frame >= Main.projFrames[Projectile.type]) - { - Projectile.frame = 0; - } - - if (player.Calamity().plantera) - { - Projectile.timeLeft = 2; - } - - Projectile.rotation = (Projectile.Center - hostPlant.Center).ToRotation() + MathHelper.Pi; - - Projectile.MinionAntiClump(1f); - - counter++; - if (counter % 30 == 0) //changes every half second - { - desiredDistance = Main.rand.NextFloat(175f, 225f); - } - Vector2 targetPos = hostPlant.Center - Projectile.Center; - float targetDist = targetPos.Length(); - targetPos.Normalize(); - if (targetDist > desiredDistance) - { - float speedMult = 10f; - speedMult += (targetDist - desiredDistance) * 0.2f; //+0.2f for every 1f away from the desired distance - targetPos *= speedMult; - Projectile.velocity = (Projectile.velocity * 40f + targetPos) / 41f; - } - else - { - float reverseSpeedMult = 5f; - targetPos *= -reverseSpeedMult; - Projectile.velocity = (Projectile.velocity * 40f + targetPos) / 41f; - } - - if (targetDist > 2000f) - { - Projectile.position.X = hostPlant.Center.X - (float)(Projectile.width / 2); - Projectile.position.Y = hostPlant.Center.Y - (float)(Projectile.height / 2); - Projectile.netUpdate = true; - } - - if (Projectile.ai[0] >= 3f) - { - if (hostPlant.Center.X - Projectile.Center.X > 0) - { - Projectile.velocity.X += 0.05f; - } - } - else - { - if (hostPlant.Center.X - Projectile.Center.X < 0) - { - Projectile.velocity.X -= 0.05f; - } - } - - if (Projectile.ai[0] % 2f == 0f) - { - if (hostPlant.Center.Y - Projectile.Center.Y > 0) - { - Projectile.velocity.Y += 0.05f; - } - } - else - { - if (hostPlant.Center.Y - Projectile.Center.Y < 0) - { - Projectile.velocity.Y -= 0.05f; - } - } - } - - public override void Kill(int timeLeft) - { - for (int i = 0; i < 10; i++) - { - Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 107); - } - } - - public override bool PreDraw(ref Color lightColor) - { - if (Projectile.ai[1] < 0 || Projectile.ai[1] >= Main.maxProjectiles) - { - return false; - } - - // If something has gone wrong with either the tentacle or the host plant, return. - Projectile hostPlant = Main.projectile[(int)Projectile.ai[1]]; - if (Projectile.type != ModContent.ProjectileType() || !hostPlant.active || hostPlant.type != ModContent.ProjectileType()) - { - return false; - } - - Vector2 source = hostPlant.Center; - Texture2D chain = ModContent.Request("CalamityMod/Projectiles/Summon/PlantationChain").Value; - Vector2 goal = Projectile.Center; - Rectangle? sourceRectangle = null; - float textureHeight = (float)chain.Height; - Vector2 drawVector = source - goal; - float rotation = (float)Math.Atan2((double)drawVector.Y, (double)drawVector.X) - MathHelper.PiOver2; - bool shouldDraw = true; - if (float.IsNaN(goal.X) && float.IsNaN(goal.Y)) - { - shouldDraw = false; - } - if (float.IsNaN(drawVector.X) && float.IsNaN(drawVector.Y)) - { - shouldDraw = false; - } - while (shouldDraw) - { - if (drawVector.Length() < textureHeight + 1f) - { - shouldDraw = false; - } - else - { - Vector2 value2 = drawVector; - value2.Normalize(); - goal += value2 * textureHeight; - drawVector = source - goal; - Color color = Lighting.GetColor((int)goal.X / 16, (int)(goal.Y / 16f)); - Main.EntitySpriteDraw(chain, goal - Main.screenPosition, sourceRectangle, color, rotation, chain.Size() / 2f, 1f, SpriteEffects.None, 0); - } - } - return true; - } - - //It draws the host plant in here in order to have it draw over the tentacles - public override void PostDraw(Color lightColor) - { - //Only 1 tentacle needs to draw this, the last one spawned because it's latest in the projectile array. - if (Projectile.ai[0] < 5) - { - return; - } - - if (Projectile.ai[1] < 0 || Projectile.ai[1] >= Main.maxProjectiles) - { - return; - } - - // If something has gone wrong with either the tentacle or the host plant, return. - Projectile hostPlant = Main.projectile[(int)Projectile.ai[1]]; - if (Projectile.type != ModContent.ProjectileType() || !hostPlant.active || hostPlant.type != ModContent.ProjectileType()) - { - return; - } - - Texture2D texture = TextureAssets.Projectile[hostPlant.type].Value; - int height = texture.Height / Main.projFrames[hostPlant.type]; - int frameHeight = height * hostPlant.frame; - SpriteEffects spriteEffects = SpriteEffects.None; - if (hostPlant.spriteDirection == -1) - spriteEffects = SpriteEffects.FlipHorizontally; - Color color = Lighting.GetColor((int)hostPlant.Center.X / 16, (int)(hostPlant.Center.Y / 16f)); - - Main.EntitySpriteDraw(texture, hostPlant.Center - Main.screenPosition + new Vector2(0f, hostPlant.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), color, hostPlant.rotation, new Vector2((float)texture.Width / 2f, (float)height / 2f), hostPlant.scale, spriteEffects, 0); - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(BuffID.Poisoned, 120); - target.AddBuff(BuffID.Venom, 60); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(BuffID.Poisoned, 120); - target.AddBuff(BuffID.Venom, 60); - } - } -} diff --git a/Projectiles/Summon/PlantTentacle.png b/Projectiles/Summon/PlantTentacle.png deleted file mode 100644 index 78dbdaa9f6..0000000000 Binary files a/Projectiles/Summon/PlantTentacle.png and /dev/null differ diff --git a/Projectiles/Summon/PlantThornBall.cs b/Projectiles/Summon/PlantThornBall.cs deleted file mode 100644 index ba731971b9..0000000000 --- a/Projectiles/Summon/PlantThornBall.cs +++ /dev/null @@ -1,67 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Summon -{ - public class PlantThornBall : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - public override void SetStaticDefaults() - { - ProjectileID.Sets.MinionShot[Projectile.type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 30; - Projectile.height = 30; - Projectile.friendly = true; - Projectile.penetrate = 3; - Projectile.timeLeft = 300; - Projectile.minion = true; - Projectile.aiStyle = ProjAIStyleID.GroundProjectile; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.extraUpdates = 1; - Projectile.DamageType = DamageClass.Summon; - } - - public override void AI() - { - if (Main.rand.NextBool(12)) - { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 44, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); - } - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - if (Projectile.velocity.X != oldVelocity.X) - { - Projectile.velocity.X = -oldVelocity.X * 1.001f; - } - if (Projectile.velocity.Y != oldVelocity.Y) - { - Projectile.velocity.Y = -oldVelocity.Y * 1.001f; - } - return false; - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(BuffID.Poisoned, 180); - if (Projectile.ai[1] == 1f) - target.AddBuff(BuffID.Venom, 90); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(BuffID.Poisoned, 180); - if (Projectile.ai[1] == 1f) - target.AddBuff(BuffID.Venom, 90); - } - } -} - diff --git a/Projectiles/Summon/PlantationStaffSeed.cs b/Projectiles/Summon/PlantationStaffSeed.cs new file mode 100644 index 0000000000..1073e5d10a --- /dev/null +++ b/Projectiles/Summon/PlantationStaffSeed.cs @@ -0,0 +1,77 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class PlantationStaffSeed : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Summon"; + + public ref float RandomTexture => ref Projectile.ai[0]; + + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 2; + ProjectileID.Sets.MinionShot[Type] = true; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + } + + public override void SetDefaults() + { + Projectile.DamageType = DamageClass.Summon; + Projectile.width = Projectile.height = 14; + Projectile.timeLeft = 600; + + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + } + + public override void AI() + { + DoAnimation(); + + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + } + + #region AI Methods + + private void DoAnimation() + { + Projectile.frameCounter++; + if (Projectile.frameCounter >= 8) + { + Projectile.frameCounter = 0; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; + } + } + + #endregion + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = (RandomTexture == 0f) ? ModContent.Request(Texture).Value : ModContent.Request("CalamityMod/Projectiles/Summon/PlantationStaffSeed2").Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Vector2 origin = frame.Size() * 0.5f; + + if (CalamityConfig.Instance.Afterimages) + { + for (int i = 0; i < Projectile.oldPos.Length; i++) + { + Color afterimageDrawColor = ((RandomTexture == 0f) ? Color.Green : Color.Pink) with { A = 25 } * Projectile.Opacity * (1f - i / (float)Projectile.oldPos.Length); + Vector2 afterimageDrawPosition = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition; + Main.EntitySpriteDraw(texture, afterimageDrawPosition, frame, afterimageDrawColor, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + } + } + + Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + + return false; + } + } +} diff --git a/Projectiles/Summon/PlantSeedGreen.png b/Projectiles/Summon/PlantationStaffSeed.png similarity index 100% rename from Projectiles/Summon/PlantSeedGreen.png rename to Projectiles/Summon/PlantationStaffSeed.png diff --git a/Projectiles/Summon/PlantSeed.png b/Projectiles/Summon/PlantationStaffSeed2.png similarity index 100% rename from Projectiles/Summon/PlantSeed.png rename to Projectiles/Summon/PlantationStaffSeed2.png diff --git a/Projectiles/Summon/PlantationStaffSporeCloud.cs b/Projectiles/Summon/PlantationStaffSporeCloud.cs new file mode 100644 index 0000000000..f8406ef3dd --- /dev/null +++ b/Projectiles/Summon/PlantationStaffSporeCloud.cs @@ -0,0 +1,65 @@ +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class PlantationStaffSporeCloud : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Summon"; + + public ref float RandomTexture => ref Projectile.ai[0]; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.MinionShot[Type] = true; + } + + public override void SetDefaults() + { + Projectile.DamageType = DamageClass.Summon; + Projectile.idStaticNPCHitCooldown = 30; + Projectile.timeLeft = 600; + Projectile.width = Projectile.height = 32; + Projectile.penetrate = -1; + + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.usesIDStaticNPCImmunity = true; + } + + public override void AI() + { + Projectile.velocity *= 0.985f; + Projectile.rotation += MathHelper.ToRadians(Projectile.velocity.X); + Projectile.alpha = (int)Utils.Remap(Projectile.timeLeft, 180f, 0f, 0f, 255f); + + if (Main.rand.NextBool(10)) + { + Particle smoke = new SmallSmokeParticle(Projectile.Center + Main.rand.NextVector2Circular(Projectile.width / 2, Projectile.height / 2), Main.rand.NextVector2Circular(1f, 1f), Color.Green, Color.DarkGreen, Utils.Remap(Projectile.timeLeft, 180f, 0f, 1.2f, 0.2f), Utils.Remap(Projectile.timeLeft, 180f, 0f, 150f, 0f)); + GeneralParticleHandler.SpawnParticle(smoke); + + Dust sporeDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, 46); + sporeDust.noGravity = true; + sporeDust.velocity = Vector2.Zero; + sporeDust.alpha = (int)Utils.Remap(Projectile.timeLeft, 180f, 0f, 0f, 255f); + } + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = ModContent.Request(Texture).Value; + if (RandomTexture == 1f) + tex = ModContent.Request("CalamityMod/Projectiles/Summon/PlantationStaffSporeCloud2").Value; + if (RandomTexture == 2f) + tex = ModContent.Request("CalamityMod/Projectiles/Summon/PlantationStaffSporeCloud3").Value; + + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + return false; + } + } +} diff --git a/Projectiles/Summon/PlantSporeCloud.png b/Projectiles/Summon/PlantationStaffSporeCloud.png similarity index 100% rename from Projectiles/Summon/PlantSporeCloud.png rename to Projectiles/Summon/PlantationStaffSporeCloud.png diff --git a/Projectiles/Summon/PlantSporeCloud2.png b/Projectiles/Summon/PlantationStaffSporeCloud2.png similarity index 100% rename from Projectiles/Summon/PlantSporeCloud2.png rename to Projectiles/Summon/PlantationStaffSporeCloud2.png diff --git a/Projectiles/Summon/PlantSporeCloud3.png b/Projectiles/Summon/PlantationStaffSporeCloud3.png similarity index 100% rename from Projectiles/Summon/PlantSporeCloud3.png rename to Projectiles/Summon/PlantationStaffSporeCloud3.png diff --git a/Projectiles/Summon/PlantationStaffSummon.cs b/Projectiles/Summon/PlantationStaffSummon.cs new file mode 100644 index 0000000000..0082fdc829 --- /dev/null +++ b/Projectiles/Summon/PlantationStaffSummon.cs @@ -0,0 +1,352 @@ +using System; +using System.IO; +using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Weapons.Summon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class PlantationStaffSummon : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Summon"; + + public Player Owner => Main.player[Projectile.owner]; + public CalamityPlayer ModdedOwner => Owner.Calamity(); + public NPC Target => Owner.Center.MinionHoming(PlantationStaff.EnemyDistanceDetection, Owner); + + public enum AIState + { + Idle, + Thornball, + Seeds, + Ramming + } + public AIState State + { + get => (AIState)Projectile.ai[0]; + set => Projectile.ai[0] = (int)value; + } + public ref float AITimer => ref Projectile.ai[1]; + public ref float ShootSeedsTimer => ref Projectile.ai[2]; + public ref float SeedBurstsShot => ref Projectile.localAI[0]; + + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 8; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + } + + public override void SetDefaults() + { + Projectile.DamageType = DamageClass.Summon; + Projectile.minionSlots = 3f; + Projectile.localNPCHitCooldown = 10; + Projectile.width = Projectile.height = 48; + Projectile.penetrate = -1; + + Projectile.friendly = true; + Projectile.minion = true; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.netImportant = true; + } + + #region Variable Syncing + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(SeedBurstsShot); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + SeedBurstsShot = reader.ReadSingle(); + } + + #endregion + + public override void AI() + { + CheckMinionExistence(); + DoAnimation(); + + switch (State) + { + case AIState.Idle: + IdleState(); + break; + case AIState.Thornball: + ThornballState(); + break; + case AIState.Seeds: + SeedsState(); + break; + case AIState.Ramming: + RammingState(); + break; + } + } + + #region AI Methods + + private void IdleState() + { + // The projectile points towards its direction. + Projectile.rotation = Projectile.velocity.ToRotation(); + + // The minion will hover around the owner at a certain distance. + if (!Projectile.WithinRange(Owner.Center, 160f)) + { + Projectile.velocity = (Projectile.velocity + Projectile.SafeDirectionTo(Owner.Center)) * 0.9f; + Projectile.netUpdate = true; + } + + // If the owner starts to get far, the minion will follow straight to the owner. + if (!Projectile.WithinRange(Owner.Center, 320f)) + { + Projectile.velocity = Projectile.SafeDirectionTo(Owner.Center) * MathF.Max(5f, Owner.velocity.Length()); + Projectile.netUpdate = true; + } + + // If the owner's far enough, teleport the minion on the owner. + if (!Projectile.WithinRange(Owner.Center, PlantationStaff.EnemyDistanceDetection)) + { + Projectile.Center = Owner.Center; + Projectile.netUpdate = true; + } + + if (Target is not null) + SwitchState(AIState.Thornball); + } + + private void ThornballState() + { + if (Target is not null) + { + Vector2 targetDirection = Projectile.SafeDirectionTo(Target.Center); + + ShootingMovement(); + + AITimer++; + if (AITimer % PlantationStaff.ThornballFireRate == 0f && Main.myPlayer == Projectile.owner) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, targetDirection * PlantationStaff.ThornballSpeed, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Owner.whoAmI); + + // Flavor recoil effect. + Projectile.velocity -= targetDirection * 3f; + + ShootEffect(); + + SoundEngine.PlaySound(SoundID.Item17, Projectile.Center); + + Projectile.netUpdate = true; + } + + if (AITimer >= PlantationStaff.ThornballAmount * PlantationStaff.ThornballFireRate) + SwitchState(AIState.Seeds); + } + else + SwitchState(AIState.Idle); + } + + private void SeedsState() + { + if (Target is not null) + { + ShootingMovement(); + + AITimer++; + if (AITimer >= PlantationStaff.SeedBurstDelay) + { + ShootSeedsTimer++; + + if (ShootSeedsTimer % PlantationStaff.SeedBetweenBurstDelay == 0f && Main.myPlayer == Projectile.owner) + { + Vector2 velocity = CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, Target, PlantationStaff.SeedSpeed); + + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Owner.whoAmI, Main.rand.Next(2)); + + // Flavor recoil effect. + Projectile.velocity -= velocity.SafeNormalize(Vector2.Zero) * 2f; + + ShootEffect(); + + SoundEngine.PlaySound(SoundID.Item17, Projectile.Center); + + Projectile.netUpdate = true; + } + + if (ShootSeedsTimer >= PlantationStaff.SeedBetweenBurstDelay * PlantationStaff.SeedAmountPerBurst) + { + AITimer = 0f; + ShootSeedsTimer = 0f; + SeedBurstsShot++; + Projectile.netUpdate = true; + } + } + + if (SeedBurstsShot >= PlantationStaff.SeedBurstAmount) + SwitchState(AIState.Ramming); + } + else + SwitchState(AIState.Idle); + } + + private void RammingState() + { + if (Target is not null) + { + AITimer++; + if (AITimer <= PlantationStaff.TimeBeforeRamming) + { + // The minion slows down to give a flavor effect of preparation. + Projectile.velocity *= 0.985f; + } + else + { + // If the minion's not withing a certain range of the target, go towards it. + // When it reaches that range, the velocity will not change anymore until they hit + // the outside range, repeating this process and giving the effect of ramming. + if (!Projectile.WithinRange(Target.Center, 400f)) + RamMovement(); + + // But, if the minion was already inside the target when it appeared, + // meaning it doesn't have the velocity to go to the outside range. + // We'll make it ram once to be start the effect of ramming, + // with an amount of grace so the minion doesn't change it's velocity constantly. + else if (Projectile.velocity.Length() < PlantationStaff.ChargingSpeed - 5f) + RamMovement(); + + if (AITimer >= PlantationStaff.RamTime + PlantationStaff.TimeBeforeRamming) + SwitchState(AIState.Thornball); + } + } + else + SwitchState(AIState.Idle); + } + + private void ShootingMovement() + { + Vector2 targetDirection = Projectile.SafeDirectionTo(Target.Center); + + // The minion will look towards the target. + Projectile.rotation = targetDirection.ToRotation(); + + // If the minion is not within a certain range of the target, go towards it. + if (!Projectile.WithinRange(Target.Center, 480f)) + { + Projectile.velocity = (Projectile.velocity * 30f + targetDirection * PlantationStaff.ChargingSpeed) / 31f; + Projectile.netUpdate = true; + } + + // But if the minion gets to close, separate it from the target. + if (Projectile.WithinRange(Target.Center, 400f)) + { + Projectile.velocity = (Projectile.velocity * 30f + -targetDirection * PlantationStaff.ChargingSpeed) / 31f; + Projectile.netUpdate = true; + } + } + + private void RamMovement() + { + Projectile.velocity = Projectile.SafeDirectionTo(Target.Center) * PlantationStaff.ChargingSpeed; + Projectile.rotation = Projectile.velocity.ToRotation(); + Projectile.netUpdate = true; + } + + private void SwitchState(AIState state) + { + State = state; + AITimer = 0f; + ShootSeedsTimer = 0f; + SeedBurstsShot = 0f; + + if (state == AIState.Ramming) + { + int sporeCloudAmount = 12; + for (int sporeCloudIndex = 0; sporeCloudIndex < sporeCloudAmount; sporeCloudIndex++) + { + float angle = MathHelper.TwoPi / sporeCloudAmount * sporeCloudIndex; + Vector2 velocity = angle.ToRotationVector2() * PlantationStaff.SporeStartVelocity; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, 10f, Owner.whoAmI, Main.rand.Next(3)); + } + + int tentacleAmount = 6; + for (int tentacleIndex = 0; tentacleIndex < tentacleAmount; tentacleIndex++) + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Owner.whoAmI, tentacleIndex, Projectile.whoAmI); + + SoundEngine.PlaySound(SoundID.Roar with { Volume = .3f, Pitch = 1f, PitchVariance = .1f }, Projectile.Center); + } + + Projectile.netUpdate = true; + } + + private void CheckMinionExistence() + { + Owner.AddBuff(ModContent.BuffType(), 2); + if (Type != ModContent.ProjectileType()) + return; + + if (Owner.dead) + ModdedOwner.PlantationSummon = false; + if (ModdedOwner.PlantationSummon) + Projectile.timeLeft = 2; + } + + private void DoAnimation() + { + Projectile.frameCounter++; + if (Projectile.frameCounter >= 8) + { + Projectile.frameCounter = 0; + + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; + + if (State == AIState.Ramming && Projectile.frame < 4) + Projectile.frame = 4; + + if (State != AIState.Ramming && Projectile.frame > 3) + Projectile.frame = 0; + } + } + + private void ShootEffect() + { + for (int i = 0; i < 5; i++) + Dust.NewDustPerfect(Projectile.Center, 40, Projectile.rotation.ToRotationVector2().RotatedByRandom(MathHelper.PiOver4) * Main.rand.NextFloat(3f, 5f)); + } + + #endregion + + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (State == AIState.Ramming) + modifiers.SourceDamage *= 2; + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = ModContent.Request(Texture).Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Vector2 origin = frame.Size() * 0.5f; + + if (State == AIState.Ramming && CalamityConfig.Instance.Afterimages) + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); + + Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + + return false; + } + } +} diff --git a/Projectiles/Summon/PlantationStaffSummon.png b/Projectiles/Summon/PlantationStaffSummon.png new file mode 100644 index 0000000000..9fb833b4e5 Binary files /dev/null and b/Projectiles/Summon/PlantationStaffSummon.png differ diff --git a/Projectiles/Summon/PlantationStaffTentacle.cs b/Projectiles/Summon/PlantationStaffTentacle.cs new file mode 100644 index 0000000000..0c9da5370b --- /dev/null +++ b/Projectiles/Summon/PlantationStaffTentacle.cs @@ -0,0 +1,265 @@ +using System.IO; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Weapons.Summon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class PlantationStaffTentacle : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Summon"; + + public Player Owner => Main.player[Projectile.owner]; + public CalamityPlayer ModdedOwner => Owner.Calamity(); + public NPC Target => Projectile.Center.MinionHoming(PlantationStaff.EnemyDistanceDetection, Owner); + public Projectile MainMinion => Main.projectile[(int)MainMinionIndex]; + + public ref float TentacleIndex => ref Projectile.ai[0]; + public ref float MainMinionIndex => ref Projectile.ai[1]; + public ref float AITimer => ref Projectile.localAI[0]; + public enum AIState + { + Attached, + Seeking + } + public AIState State + { + get => (AIState)Projectile.ai[2]; + set => Projectile.ai[2] = (int)value; + } + + public Vector2 DesiredLocation; + + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionShot[Type] = true; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + } + + public override void SetDefaults() + { + Projectile.DamageType = DamageClass.Summon; + Projectile.localNPCHitCooldown = -1; + Projectile.width = Projectile.height = 22; + Projectile.penetrate = -1; + + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.netImportant = true; + } + + #region Variable Syncing + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(AITimer); + writer.WritePackedVector2(DesiredLocation); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + AITimer = reader.ReadSingle(); + DesiredLocation = reader.ReadPackedVector2(); + } + + #endregion + + public override void AI() + { + CheckMinionExistence(); + DoAnimation(); + + switch (State) + { + case AIState.Attached: + AttachedState(); + break; + case AIState.Seeking: + SeekingState(); + break; + } + } + + #region AI Methods + + private void AttachedState() + { + AITimer++; + float interpolant = Utils.Remap(AITimer, 0f, PlantationStaff.TimeBeforeRamming, 0f, .4f); + + Projectile.Center = Vector2.Lerp(Projectile.Center, MainMinion.Center + DesiredLocation, interpolant); + Projectile.rotation = (Projectile.Center - MainMinion.Center).ToRotation(); + + for (int i = 0; i < Main.maxProjectiles; i++) + { + Projectile proj = Main.projectile[i]; + + if (proj is null || !proj.active || proj.owner != Owner.whoAmI || proj.type != ModContent.ProjectileType() || proj.ModProjectile().State == PlantationStaffSummon.AIState.Ramming) + continue; + + State = AIState.Seeking; + AITimer = 0f; + Projectile.velocity = Vector2.Zero; + Projectile.penetrate = 1; + + for (int dustIndex = 0; dustIndex < 20; dustIndex++) + Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, 40); + + SoundEngine.PlaySound(SoundID.NPCDeath1, Projectile.Center); + + Projectile.netUpdate = true; + } + } + + private void SeekingState() + { + if (Target is not null) + { + AITimer++; + + if (AITimer <= 30f) + { + Projectile.velocity = Projectile.rotation.ToRotationVector2() * 10f; + } + else + { + Projectile.velocity = (Projectile.velocity * 35f + Projectile.SafeDirectionTo(Target.Center) * PlantationStaff.TentacleSpeed) / 36f; + Projectile.rotation = Projectile.velocity.ToRotation(); + } + } + else + Projectile.Kill(); + } + + private void CheckMinionExistence() + { + if (Projectile.ai[1] < 0 || Projectile.ai[1] >= Main.maxProjectiles) + { + Projectile.Kill(); + return; + } + + // If something has gone wrong with either the tentacle or the host plant, destroy the projectile. + if (Projectile.type != ModContent.ProjectileType() || !MainMinion.active || MainMinion.type != ModContent.ProjectileType()) + { + Projectile.Kill(); + return; + } + + if (ModdedOwner.PlantationSummon) + Projectile.timeLeft = 2; + } + + private void DoAnimation() + { + Projectile.frameCounter++; + if (Projectile.frameCounter >= 3) + { + Projectile.frameCounter = 0; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; + } + } + + #endregion + + public override void OnSpawn(IEntitySource source) + { + DesiredLocation = (MathHelper.TwoPi / 6f * TentacleIndex).ToRotationVector2().RotatedByRandom(MathHelper.PiOver4 / 1.5f) * 100f; + Projectile.netUpdate = true; + } + + public override bool? CanDamage() => (State == AIState.Seeking) ? null : false; + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 10; i++) + Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, 40); + } + + public override bool PreDraw(ref Color lightColor) + { + if (MainMinionIndex < 0 || MainMinionIndex >= Main.maxProjectiles) + return false; + + // If something has gone wrong with either the tentacle or the host plant, return. + if (Type != ModContent.ProjectileType() || !MainMinion.active || MainMinion.type != ModContent.ProjectileType()) + return false; + + if (State == AIState.Attached) + { + Vector2 source = MainMinion.Center; + Texture2D chain = ModContent.Request("CalamityMod/Projectiles/Summon/PlantationStaffTentacleChain").Value; + Vector2 goal = Projectile.Center; + Rectangle? sourceRectangle = null; + float textureHeight = chain.Height; + Vector2 drawVector = source - goal; + float rotation = drawVector.ToRotation() - MathHelper.PiOver2; + bool shouldDraw = true; + if (float.IsNaN(goal.X) && float.IsNaN(goal.Y)) + { + shouldDraw = false; + } + if (float.IsNaN(drawVector.X) && float.IsNaN(drawVector.Y)) + { + shouldDraw = false; + } + while (shouldDraw) + { + if (drawVector.Length() < textureHeight + 1f) + { + shouldDraw = false; + } + else + { + Vector2 value2 = drawVector; + value2.Normalize(); + goal += value2 * textureHeight; + drawVector = source - goal; + Color color = Lighting.GetColor((int)goal.X / 16, (int)(goal.Y / 16f)); + Main.EntitySpriteDraw(chain, goal - Main.screenPosition, sourceRectangle, color, rotation, chain.Size() / 2f, 1f, SpriteEffects.None, 0); + } + } + } + else if (CalamityConfig.Instance.Afterimages) + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); + + return true; + } + + // It draws the host plant in here in order to have it draw over the tentacles. + public override void PostDraw(Color lightColor) + { + // Only 1 tentacle needs to draw this, the last one spawned because it's latest in the projectile array. + if (TentacleIndex < 5) + return; + + if (MainMinionIndex < 0 || MainMinionIndex >= Main.maxProjectiles) + return; + + // If something has gone wrong with either the tentacle or the host plant, return. + if (Projectile.type != ModContent.ProjectileType() || !MainMinion.active || MainMinion.type != ModContent.ProjectileType()) + return; + + Texture2D texture = TextureAssets.Projectile[MainMinion.type].Value; + int height = texture.Height / Main.projFrames[MainMinion.type]; + int frameHeight = height * MainMinion.frame; + SpriteEffects spriteEffects = SpriteEffects.None; + if (MainMinion.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + Color color = Lighting.GetColor((int)MainMinion.Center.X / 16, (int)(MainMinion.Center.Y / 16f)); + + Main.EntitySpriteDraw(texture, MainMinion.Center - Main.screenPosition + new Vector2(0f, MainMinion.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), color, MainMinion.rotation, new Vector2((float)texture.Width / 2f, (float)height / 2f), MainMinion.scale, spriteEffects, 0); + } + } +} diff --git a/Projectiles/Summon/PlantationStaffTentacle.png b/Projectiles/Summon/PlantationStaffTentacle.png new file mode 100644 index 0000000000..014c3fd8b4 Binary files /dev/null and b/Projectiles/Summon/PlantationStaffTentacle.png differ diff --git a/Projectiles/Summon/PlantationChain.png b/Projectiles/Summon/PlantationStaffTentacleChain.png similarity index 100% rename from Projectiles/Summon/PlantationChain.png rename to Projectiles/Summon/PlantationStaffTentacleChain.png diff --git a/Projectiles/Summon/PlantationStaffThornball.cs b/Projectiles/Summon/PlantationStaffThornball.cs new file mode 100644 index 0000000000..d2855cb43b --- /dev/null +++ b/Projectiles/Summon/PlantationStaffThornball.cs @@ -0,0 +1,81 @@ +using CalamityMod.Items.Weapons.Summon; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class PlantationStaffThornball : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Summon"; + + public Player Owner => Main.player[Projectile.owner]; + public NPC Target => Projectile.Center.MinionHoming(PlantationStaff.EnemyDistanceDetection, Owner); + + public ref float IsSticked => ref Projectile.ai[0]; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.MinionShot[Type] = true; + } + + public override void SetDefaults() + { + Projectile.DamageType = DamageClass.Summon; + Projectile.localNPCHitCooldown = 60; + Projectile.width = Projectile.height = 30; + Projectile.timeLeft = 300; + Projectile.penetrate = -1; + + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + } + + public override void AI() + { + if (IsSticked == 0f) + { + // Home towards the target, if there's one. + if (Target is not null) + Projectile.velocity = (Projectile.velocity * 25f + Projectile.SafeDirectionTo(Target.Center) * PlantationStaff.ThornballSpeed) / 26f; + + Projectile.rotation += MathHelper.ToRadians(Projectile.velocity.X); + } + else + { + // Making the projectile's velocity same as the target's means it stays with it and moves with it, + // giving it an effect of attachment. + if (Target is not null) + Projectile.velocity = Target.velocity; + else + Projectile.Kill(); + } + } + + #region AI Methods + + #endregion + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + // If the projectile hits once after it's attached: die. + if (IsSticked == 1f) + Projectile.Kill(); + + // On enemy hit, make it stick. + IsSticked = 1f; + + Projectile.netUpdate = true; + } + + public override void Kill(int timeLeft) + { + for (int dustIndex = 0; dustIndex < 10; dustIndex++) + Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, 40, newColor: Color.Pink); + } + } +} + diff --git a/Projectiles/Summon/PlantThornBall.png b/Projectiles/Summon/PlantationStaffThornball.png similarity index 100% rename from Projectiles/Summon/PlantThornBall.png rename to Projectiles/Summon/PlantationStaffThornball.png diff --git a/Projectiles/Summon/SandnadoMinion.cs b/Projectiles/Summon/SandnadoMinion.cs index 364096e900..d2356c97a6 100644 --- a/Projectiles/Summon/SandnadoMinion.cs +++ b/Projectiles/Summon/SandnadoMinion.cs @@ -143,11 +143,16 @@ namespace CalamityMod.Projectiles.Summon public void ShootTarget(NPC target) { - if (TimerForShooting == SandSharknadoStaff.FireSpeed && Main.myPlayer == Projectile.owner) + int randomDelay = Main.rand.Next(-5, 6); + Vector2 targetPos = target.Center; + Vector2 ProjVel = targetPos - Projectile.Center; + ProjVel.Normalize(); + ProjVel *= SandSharknadoStaff.ProjSpeed; + if (TimerForShooting == SandSharknadoStaff.FireSpeed + randomDelay && Main.myPlayer == Projectile.owner) { int sandSharkProj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, - CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, target, SandSharknadoStaff.ProjVel), + ProjVel, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, diff --git a/Projectiles/Typeless/VoidFieldGenerator.cs b/Projectiles/Typeless/VoidFieldGenerator.cs index f297efa1a9..50350b04b1 100644 --- a/Projectiles/Typeless/VoidFieldGenerator.cs +++ b/Projectiles/Typeless/VoidFieldGenerator.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Typeless var proj = Main.projectile[k]; if (proj.active && proj.owner == Projectile.owner && proj.arrow && !proj.Calamity().nihilicArrow && proj.friendly && Vector2.Distance(proj.Center, Projectile.Center) < 65) { - Main.projectile[k].damage = (int)(proj.damage * 2f); + Main.projectile[k].damage = (int)(proj.damage * 1.75f); proj.extraUpdates += 1; Main.projectile[k].Calamity().nihilicArrow = true; SoundEngine.PlaySound(SoundID.Item104 with { Volume = SoundID.Item104.Volume * 0.75f }, Projectile.Center); diff --git a/Scenes/BossBackgroundScenes/DrunkCrabBackgroundScene.cs b/Scenes/BossBackgroundScenes/DrunkCrabBackgroundScene.cs index 81d8a07fe3..c67ba8504e 100644 --- a/Scenes/BossBackgroundScenes/DrunkCrabBackgroundScene.cs +++ b/Scenes/BossBackgroundScenes/DrunkCrabBackgroundScene.cs @@ -1,8 +1,8 @@ using CalamityMod.NPCs; using CalamityMod.NPCs.Crabulon; using CalamityMod.NPCs.SupremeCalamitas; -using CalamityMod.World; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Systems @@ -13,17 +13,31 @@ namespace CalamityMod.Systems public override bool IsSceneEffectActive(Player player) { + // Case 1: Zenith Seed Crabulon. + if (Main.zenithWorld && NPC.AnyNPCs(ModContent.NPCType())) + return true; + + // Case 2: Supreme Cirrus BH5. bool cirrusSpecialAttack = false; - if (CalamityGlobalNPC.SCal != -1) + + // Try to find Supreme Cirrus, if she exists. She might not. + try { - if (Main.npc[CalamityGlobalNPC.SCal].active) + // Is there an index reference to Supreme Calamitas/Cirrus available? Is it valid? I sure hope so. Thanks TML + if (CalamityGlobalNPC.SCal >= 0 && CalamityGlobalNPC.SCal < Main.maxNPCs && Main.npc[CalamityGlobalNPC.SCal].active) { - if (Main.npc[CalamityGlobalNPC.SCal].ModNPC().cirrus) - cirrusSpecialAttack = Main.npc[CalamityGlobalNPC.SCal].ModNPC().gettingTired5; + NPC npc = Main.npc[CalamityGlobalNPC.SCal]; + SupremeCalamitas supremeSomeone = npc.ModNPC(); + cirrusSpecialAttack = supremeSomeone is not null && supremeSomeone.cirrus && supremeSomeone.gettingTired5; } } + catch + { + if (Main.netMode == NetmodeID.SinglePlayer) + Main.NewText("Supreme Cirrus code attempted to crash the game. Did you do something weird?"); + } - return (NPC.AnyNPCs(ModContent.NPCType()) && Main.zenithWorld) || cirrusSpecialAttack; + return cirrusSpecialAttack; } public override void SpecialVisuals(Player player, bool isActive) diff --git a/Sounds/Item/ArcNovaDiffuserBigShot.ogg b/Sounds/Item/ArcNovaDiffuserBigShot.ogg new file mode 100644 index 0000000000..61860629ad Binary files /dev/null and b/Sounds/Item/ArcNovaDiffuserBigShot.ogg differ diff --git a/Sounds/Item/ArcNovaDiffuserChargeImpact.ogg b/Sounds/Item/ArcNovaDiffuserChargeImpact.ogg new file mode 100644 index 0000000000..bc6982213c Binary files /dev/null and b/Sounds/Item/ArcNovaDiffuserChargeImpact.ogg differ diff --git a/Sounds/Item/ArcNovaDiffuserChargeLV1.ogg b/Sounds/Item/ArcNovaDiffuserChargeLV1.ogg new file mode 100644 index 0000000000..d1d1080c9c Binary files /dev/null and b/Sounds/Item/ArcNovaDiffuserChargeLV1.ogg differ diff --git a/Sounds/Item/ArcNovaDiffuserChargeLV2.ogg b/Sounds/Item/ArcNovaDiffuserChargeLV2.ogg new file mode 100644 index 0000000000..ebf4a686b8 Binary files /dev/null and b/Sounds/Item/ArcNovaDiffuserChargeLV2.ogg differ diff --git a/Sounds/Item/ArcNovaDiffuserChargeLoop.ogg b/Sounds/Item/ArcNovaDiffuserChargeLoop.ogg new file mode 100644 index 0000000000..230a3dbd19 Binary files /dev/null and b/Sounds/Item/ArcNovaDiffuserChargeLoop.ogg differ diff --git a/Sounds/Item/ArcNovaDiffuserChargeStart.ogg b/Sounds/Item/ArcNovaDiffuserChargeStart.ogg new file mode 100644 index 0000000000..b91ceb13d5 Binary files /dev/null and b/Sounds/Item/ArcNovaDiffuserChargeStart.ogg differ diff --git a/Sounds/Item/ArcNovaDiffuserCompleteCharge.ogg b/Sounds/Item/ArcNovaDiffuserCompleteCharge.ogg new file mode 100644 index 0000000000..13c9cb6dd8 Binary files /dev/null and b/Sounds/Item/ArcNovaDiffuserCompleteCharge.ogg differ diff --git a/Sounds/Item/ArcNovaDiffuserSmallShot.ogg b/Sounds/Item/ArcNovaDiffuserSmallShot.ogg new file mode 100644 index 0000000000..c437b3380f Binary files /dev/null and b/Sounds/Item/ArcNovaDiffuserSmallShot.ogg differ diff --git a/Sounds/Item/CursedDaggerThrow.ogg b/Sounds/Item/CursedDaggerThrow.ogg new file mode 100644 index 0000000000..304cbb599a Binary files /dev/null and b/Sounds/Item/CursedDaggerThrow.ogg differ diff --git a/Sounds/Item/IchorSpearThrow.ogg b/Sounds/Item/IchorSpearThrow.ogg new file mode 100644 index 0000000000..36b9da89d4 Binary files /dev/null and b/Sounds/Item/IchorSpearThrow.ogg differ diff --git a/Sounds/Item/Inkling1.ogg b/Sounds/Item/Inkling1.ogg new file mode 100644 index 0000000000..8fb629b301 Binary files /dev/null and b/Sounds/Item/Inkling1.ogg differ diff --git a/Sounds/Item/Inkling2.ogg b/Sounds/Item/Inkling2.ogg new file mode 100644 index 0000000000..02942d79f5 Binary files /dev/null and b/Sounds/Item/Inkling2.ogg differ diff --git a/Sounds/Item/Inkling3.ogg b/Sounds/Item/Inkling3.ogg new file mode 100644 index 0000000000..abaaa49609 Binary files /dev/null and b/Sounds/Item/Inkling3.ogg differ diff --git a/Sounds/Item/Inkling4.ogg b/Sounds/Item/Inkling4.ogg new file mode 100644 index 0000000000..2e18c1f374 Binary files /dev/null and b/Sounds/Item/Inkling4.ogg differ diff --git a/Sounds/Item/Inkling5.ogg b/Sounds/Item/Inkling5.ogg new file mode 100644 index 0000000000..6e4f4c4aee Binary files /dev/null and b/Sounds/Item/Inkling5.ogg differ diff --git a/Sounds/Item/LanceofDestiny.ogg b/Sounds/Item/LanceofDestiny.ogg new file mode 100644 index 0000000000..bee16d01ad Binary files /dev/null and b/Sounds/Item/LanceofDestiny.ogg differ diff --git a/Sounds/Item/LanceofDestinyStrong.ogg b/Sounds/Item/LanceofDestinyStrong.ogg new file mode 100644 index 0000000000..2108fb4a18 Binary files /dev/null and b/Sounds/Item/LanceofDestinyStrong.ogg differ diff --git a/Sounds/Item/MagnaCannonChargeFull.ogg b/Sounds/Item/MagnaCannonChargeFull.ogg new file mode 100644 index 0000000000..4e88ba64e0 Binary files /dev/null and b/Sounds/Item/MagnaCannonChargeFull.ogg differ diff --git a/Sounds/Item/MagnaCannonChargeLoop.ogg b/Sounds/Item/MagnaCannonChargeLoop.ogg new file mode 100644 index 0000000000..c473436275 Binary files /dev/null and b/Sounds/Item/MagnaCannonChargeLoop.ogg differ diff --git a/Sounds/Item/MagnaCannonChargeStart.ogg b/Sounds/Item/MagnaCannonChargeStart.ogg new file mode 100644 index 0000000000..7bc364e605 Binary files /dev/null and b/Sounds/Item/MagnaCannonChargeStart.ogg differ diff --git a/Sounds/Item/MagnaCannonShot.ogg b/Sounds/Item/MagnaCannonShot.ogg new file mode 100644 index 0000000000..0a28cdd548 Binary files /dev/null and b/Sounds/Item/MagnaCannonShot.ogg differ diff --git a/Sounds/Item/OpalCharge.ogg b/Sounds/Item/OpalCharge.ogg new file mode 100644 index 0000000000..5743a5c015 Binary files /dev/null and b/Sounds/Item/OpalCharge.ogg differ diff --git a/Sounds/Item/OpalChargeLoop.ogg b/Sounds/Item/OpalChargeLoop.ogg new file mode 100644 index 0000000000..abe65ad315 Binary files /dev/null and b/Sounds/Item/OpalChargeLoop.ogg differ diff --git a/Sounds/Item/OpalChargedFire.ogg b/Sounds/Item/OpalChargedFire.ogg new file mode 100644 index 0000000000..1e50865fdc Binary files /dev/null and b/Sounds/Item/OpalChargedFire.ogg differ diff --git a/Sounds/Item/OpalFire.ogg b/Sounds/Item/OpalFire.ogg new file mode 100644 index 0000000000..4eb5b3da9e Binary files /dev/null and b/Sounds/Item/OpalFire.ogg differ diff --git a/Sounds/Item/OpalStrike.ogg b/Sounds/Item/OpalStrike.ogg deleted file mode 100644 index 61b2230825..0000000000 Binary files a/Sounds/Item/OpalStrike.ogg and /dev/null differ diff --git a/Sounds/Item/PhantomSpirit.ogg b/Sounds/Item/PhantomSpirit.ogg new file mode 100644 index 0000000000..c20726b841 Binary files /dev/null and b/Sounds/Item/PhantomSpirit.ogg differ diff --git a/Sounds/Item/RealityRupture.ogg b/Sounds/Item/RealityRupture.ogg new file mode 100644 index 0000000000..1133d86bba Binary files /dev/null and b/Sounds/Item/RealityRupture.ogg differ diff --git a/Sounds/Item/RealityRuptureStealth.ogg b/Sounds/Item/RealityRuptureStealth.ogg new file mode 100644 index 0000000000..a255e4c74b Binary files /dev/null and b/Sounds/Item/RealityRuptureStealth.ogg differ diff --git a/Sounds/Item/RealityRuptureStealthHit.ogg b/Sounds/Item/RealityRuptureStealthHit.ogg new file mode 100644 index 0000000000..62467822ea Binary files /dev/null and b/Sounds/Item/RealityRuptureStealthHit.ogg differ diff --git a/Sounds/Item/SpearofDestiny.ogg b/Sounds/Item/SpearofDestiny.ogg new file mode 100644 index 0000000000..a6cff09dae Binary files /dev/null and b/Sounds/Item/SpearofDestiny.ogg differ diff --git a/Systems/UIManagementSystem.cs b/Systems/UIManagementSystem.cs index 9da8ba9fc7..e467e32e43 100644 --- a/Systems/UIManagementSystem.cs +++ b/Systems/UIManagementSystem.cs @@ -62,13 +62,6 @@ namespace CalamityMod.Systems return true; }, InterfaceScaleType.UI)); - // Special Teleport overlay (if open) - layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Special Teleport UI", delegate () - { - SpecialTeleportUI.UpdateAndDraw(Main.spriteBatch); - return true; - }, InterfaceScaleType.None)); - // Speedrun Timer layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Speedrun Timer", delegate () { diff --git a/Tiles/Abyss/AbyssTreasureChest.cs b/Tiles/Abyss/AbyssTreasureChest.cs index 522cfdff9a..7e3dbcc0f4 100644 --- a/Tiles/Abyss/AbyssTreasureChest.cs +++ b/Tiles/Abyss/AbyssTreasureChest.cs @@ -27,8 +27,8 @@ namespace CalamityMod.Tiles.Abyss public override bool IsLockedChest(int i, int j) => Main.tile[i, j].TileFrameX / 36 == 1; public override bool UnlockChest(int i, int j, ref short frameXAdjustment, ref int dustType, ref bool manual) { - //Skeletron must be dead, NPC.downedBoss3 is added as a safety measure for worlds generated before this was placed or in case the first bool gets cleared - // since tmod has not fixed the modded data disappearing bug + //Skeletron must be dead, NPC.downedBoss3 is added as failsave in case chests fail to open in the Abyss' method. AbleToUnlockChests should be false unless + //the Abyss' unlock method is being run to prevent chests spawning already unlocked. if (World.Abyss.AbleToUnlockChests || NPC.downedBoss3) return true; else diff --git a/Tiles/Furniture/BabyCannonballJellyfishBowlTile.cs b/Tiles/Furniture/BabyCannonballJellyfishBowlTile.cs new file mode 100644 index 0000000000..8cd09a2165 --- /dev/null +++ b/Tiles/Furniture/BabyCannonballJellyfishBowlTile.cs @@ -0,0 +1,63 @@ +using CalamityMod.Items.Placeables.Furniture; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Furniture +{ + public class BabyCannonballJellyfishBowlTile : ModTile + { + public override void SetStaticDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); + TileObjectData.addTile(Type); + AnimationFrameHeight = 36; + AddMapEntry(new Color(64, 224, 208), CalamityUtils.GetItemName()); + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 13, 0f, 0f, 0, new Color(), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + int frameAmt = 8; + int timeNeeded = 10; + frameCounter++; + if (frameCounter >= timeNeeded) + { + frame++; + frameCounter = 0; + } + if (frame >= frameAmt) + { + frame = 0; + } + } + + public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset) + { + frameYOffset = this.GetAnimationOffset(i, j, 8, 18, 18, 2, 2, AnimationFrameHeight); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0.26f; + g = 0.85f; + b = 0.65f; + } + } +} diff --git a/Tiles/Furniture/BabyCannonballJellyfishBowlTile.png b/Tiles/Furniture/BabyCannonballJellyfishBowlTile.png new file mode 100644 index 0000000000..aa6c53127b Binary files /dev/null and b/Tiles/Furniture/BabyCannonballJellyfishBowlTile.png differ diff --git a/Tiles/Furniture/BossRelics/CalamitasCloneRelic.png b/Tiles/Furniture/BossRelics/CalamitasCloneRelic.png index e53d4d05a3..65aba51865 100644 Binary files a/Tiles/Furniture/BossRelics/CalamitasCloneRelic.png and b/Tiles/Furniture/BossRelics/CalamitasCloneRelic.png differ diff --git a/Tiles/Furniture/BossRelics/CryogenRelic.png b/Tiles/Furniture/BossRelics/CryogenRelic.png index 50dc7a9f14..26aded2fc8 100644 Binary files a/Tiles/Furniture/BossRelics/CryogenRelic.png and b/Tiles/Furniture/BossRelics/CryogenRelic.png differ diff --git a/Tiles/Furniture/BossRelics/DragonfollyRelic.png b/Tiles/Furniture/BossRelics/DragonfollyRelic.png index 921f989445..179a47924f 100644 Binary files a/Tiles/Furniture/BossRelics/DragonfollyRelic.png and b/Tiles/Furniture/BossRelics/DragonfollyRelic.png differ diff --git a/Tiles/MonsterBanner.cs b/Tiles/MonsterBanner.cs index aebf2f8eb3..d2b432c163 100644 --- a/Tiles/MonsterBanner.cs +++ b/Tiles/MonsterBanner.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Tiles TileObjectData.newTile.Height = 3; TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom | AnchorType.PlatformNonHammered, TileObjectData.newTile.Width, 0); TileObjectData.addTile(Type); DustType = -1; TileID.Sets.DisableSmartCursor[Type] = true; @@ -52,5 +52,18 @@ namespace CalamityMod.Tiles spriteEffects = SpriteEffects.FlipHorizontally; } } + + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, + ref short tileFrameY) + { + Tile tile = Main.tile[i, j]; + TileObjectData data = TileObjectData.GetTileData(tile); + int topLeftX = i - tile.TileFrameX / 18 % data.Width; + int topLeftY = j - tile.TileFrameY / 18 % data.Height; + if (WorldGen.IsBelowANonHammeredPlatform(topLeftX, topLeftY)) + { + offsetY -= 8; + } + } } } diff --git a/Tiles/MonsterBanner.png b/Tiles/MonsterBanner.png index 245cf26343..78d5000425 100644 Binary files a/Tiles/MonsterBanner.png and b/Tiles/MonsterBanner.png differ diff --git a/UI/MiscTextures/SpecialTeleportCircles.png b/UI/MiscTextures/SpecialTeleportCircles.png deleted file mode 100644 index 2368842261..0000000000 Binary files a/UI/MiscTextures/SpecialTeleportCircles.png and /dev/null differ diff --git a/UI/PurityUI.cs b/UI/PurityUI.cs deleted file mode 100644 index 2767f40817..0000000000 --- a/UI/PurityUI.cs +++ /dev/null @@ -1,215 +0,0 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Events; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria; -using Terraria.Audio; -using Terraria.GameContent; -using Terraria.ID; -using Terraria.Localization; -using Terraria.ModLoader; - -namespace CalamityMod.UI -{ - // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. - public static class SpecialTeleportUI - { - enum CircleStyle - { - Normal, - Selected - } - - private const int WindowBorder = 50; - private const int CircleTextureSize = 40; //don't change unless textures change size - private const int CircleOffset = 36; - - private static Vector2 CenterPoint; - private static bool Open; - - private static Texture2D CircleTextures; - - private static int LastHovered; - - public static void Load(Mod mod) - { - CircleTextures = ModContent.Request("CalamityMod/UI/MiscTextures/SpecialTeleportCircles", AssetRequestMode.ImmediateLoad).Value; - } - - public static void Unload() - { - CircleTextures = null; - } - - public static void Toggle() - { - Open = !Open; - - if (Open) - { - CenterPoint = new Vector2(Main.mouseX, Main.mouseY); - //Clamp center so UI doesn't go off screen - CenterPoint.X = MathHelper.Clamp(CenterPoint.X, WindowBorder, Main.screenWidth - WindowBorder); - CenterPoint.Y = MathHelper.Clamp(CenterPoint.Y, WindowBorder, Main.screenHeight - WindowBorder); - } - else - { - // Closed, do stuff in here if need be. - } - } - - public static void UpdateAndDraw(SpriteBatch sb) - { - // Don't do anything if not open. - if (!Open) - return; - - // Draw center circle - DrawCircle(sb, CenterPoint, 0, CircleStyle.Normal); - - Vector2 centerToMouse = Main.MouseScreen - CenterPoint; - float rotation = centerToMouse.ToRotation(); - - // Draw the arrow that points towards the mouse. - sb.Draw(CircleTextures, CenterPoint, new Rectangle(0, CircleTextureSize, 24, 10), Color.White, rotation, new Vector2(12, 5f), 1f, SpriteEffects.None, 0f); - - int current = 0; - int selectedCircle = -1; - int offset = CircleOffset * 2; - int radius = CircleTextureSize / 2; - - for (int x = 0; x < 2; x++) - { - for (int y = 0; y < 2; y++) - { - Vector2 center = new Vector2( - CenterPoint.X - CircleOffset + x * offset, - CenterPoint.Y - CircleOffset + y * offset); - - Circle c = new Circle(center, radius); - - CircleStyle style = CircleStyle.Normal; - - // If the mouse is in the circle. - if (c.Contains(Main.MouseScreen)) - { - style = CircleStyle.Selected; - - Main.LocalPlayer.mouseInterface = true; - - selectedCircle = current; - - // If left clicked. - if ((Main.mouseLeft && Main.mouseLeftRelease)) - { - Main.mouseLeftRelease = false; - Main.mouseLeft = false; - - DoTeleportation(current); - } - } - - DrawCircle(sb, center, 1 + current, style); - - current++; - } - } - - // Literally so the sound plays. - if (LastHovered != selectedCircle) - { - LastHovered = selectedCircle; - if (LastHovered != -1) - SoundEngine.PlaySound(SoundID.MenuTick); - } - - // Default to "Select" - string text = Language.GetTextValue("LegacyMisc.53"); - - switch (selectedCircle) - { - case 0: - text = Language.GetTextValue("Bestiary_Biomes.TheUnderworld"); - break; - case 1: - text = Language.GetTextValue("Bestiary_Biomes.TheDungeon"); - break; - case 2: - text = Language.GetTextValue("Bestiary_Biomes.Jungle"); - break; - case 3: // Random - text = Language.GetTextValue("LegacyMenu.27"); - break; - default: - break; - } - - Vector2 size = FontAssets.MouseText.Value.MeasureString(text); - Utils.DrawBorderStringFourWay(sb, FontAssets.MouseText.Value, text, CenterPoint.X - size.X / 2f, CenterPoint.Y + CircleOffset + CircleTextureSize / 2 + 4, Color.White, Color.Black, default); - } - - public static void DoTeleportation(int circle) - { - Open = false; - - Player p = Main.LocalPlayer; - - switch (circle) - { - case 0: - Vector2? underworld = CalamityPlayer.GetUnderworldPosition(p); - if (!underworld.HasValue) - return; - CalamityPlayer.ModTeleport(p, underworld.Value, true, TeleportationStyleID.DemonConch); - break; - case 1: - CalamityPlayer.ModTeleport(p, new Vector2(Main.dungeonX * 16, Main.dungeonY * 16 - 8)); - break; - case 2: - Vector2? jungle = CalamityPlayer.GetJunglePosition(p); - if (!jungle.HasValue) - return; - CalamityPlayer.ModTeleport(p, jungle.Value); - break; - case 3: - if (Main.netMode == NetmodeID.SinglePlayer) - { - p.TeleportationPotion(); - SoundEngine.PlaySound(SoundID.Item6, p.position); - } - else if (Main.netMode == NetmodeID.MultiplayerClient) - { - NetMessage.SendData(MessageID.RequestTeleportationByServer, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - break; - default: - break; - } - } - - private static void DrawCircle(SpriteBatch sb, Vector2 center, int circle, CircleStyle style) - { - sb.Draw(CircleTextures, center, new Rectangle(circle * CircleTextureSize, (int)style * CircleTextureSize, CircleTextureSize, CircleTextureSize), Color.White, 0f, new Vector2(CircleTextureSize / 2), 1f, SpriteEffects.None, 0f); - } - - private class Circle - { - public Vector2 Center; - public float Radius; - public Circle(Vector2 C, float R) - { - this.Center = C; - this.Radius = R; - } - public bool Contains(Vector2 point) - { - return Vector2.Distance(Center, point) < Radius; - } - public bool Contains(Point point) - { - return Contains(point.ToVector2()); - } - } - } -} diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index 75a77e5ee8..795f9ebd4c 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -827,6 +827,7 @@ namespace CalamityMod { Vanilla(ItemID.BundleofBalloons), AddIngredient(ModContent.ItemType(), 3) }, { r => r.HasResult(ItemID.HorseshoeBundle) && !r.HasIngredient(ItemID.BundleofBalloons), AddIngredient(ModContent.ItemType(), 3) }, { Vanilla(ItemID.NightsEdge), AddIngredient(ModContent.ItemType(), 5) }, + { Vanilla(ItemID.FairyBoots), AddIngredient(ItemID.SoulofLight, 5) }, { Vanilla(ItemID.SpiritFlame), AddGroup(AnyAdamantiteBar, 2) }, { Vanilla(ItemID.TerraBlade), AddIngredient(ModContent.ItemType(), 12) }, { Vanilla(ItemID.FireGauntlet), AddIngredient(ModContent.ItemType(), 5) }, @@ -992,7 +993,7 @@ namespace CalamityMod #region Astral Clay private static void AddAstralClayRecipes() { - // Intentionally excluding Red Brick and Red Stucco recipes + // Intentionally excluding Red Brick and Red Stucco recipes // Bowl Recipe r = Recipe.Create(ItemID.Bowl); @@ -1089,7 +1090,8 @@ namespace CalamityMod ItemID.StinkPotion, ItemID.RecallPotion, ItemID.PotionOfReturn, - ItemID.LuckPotionLesser + ItemID.LuckPotionLesser, + ItemID.BiomeSightPotion }; Recipe r; @@ -1785,8 +1787,8 @@ namespace CalamityMod r.AddIngredient(ItemID.Waterleaf, 5); r.AddIngredient(ItemID.Blinkroot, 5); r.AddIngredient(ItemID.Daybloom, 5); - r.AddIngredient(ModContent.ItemType(), 3); - r.AddTile(TileID.Anvils); + r.AddIngredient(ModContent.ItemType(), 10); + r.AddTile(TileID.AlchemyTable); r.Register(); r.DisableDecraft(); diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs index 569908cb38..cc00083258 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -724,6 +724,12 @@ namespace CalamityMod case 126: npc = ModContent.NPCType(); break; + case 127: + npc = ModContent.NPCType(); + break; + case 128: + npc = ModContent.NPCType(); + break; default: break; } diff --git a/Utilities/NPCDebuffs.cs b/Utilities/NPCDebuffs.cs index 65f546e246..d05fd5b673 100644 --- a/Utilities/NPCDebuffs.cs +++ b/Utilities/NPCDebuffs.cs @@ -249,6 +249,8 @@ namespace CalamityMod { ModContent.NPCType(), new Tuple(false, CalamityMod.sunkenSeaEnemyImmunities) }, { ModContent.NPCType(), new Tuple(false, CalamityMod.sunkenSeaEnemyImmunities) }, + { ModContent.NPCType(), new Tuple(false, CalamityMod.abyssEnemyImmunities) }, + { ModContent.NPCType(), new Tuple(false, CalamityMod.abyssEnemyImmunities) }, { ModContent.NPCType(), new Tuple(false, CalamityMod.abyssEnemyImmunities) }, { ModContent.NPCType(), new Tuple(false, CalamityMod.abyssEnemyImmunities) }, { ModContent.NPCType(), new Tuple(false, CalamityMod.abyssEnemyImmunities) }, diff --git a/World/Abyss.cs b/World/Abyss.cs index 36921246e3..7cdca25089 100644 --- a/World/Abyss.cs +++ b/World/Abyss.cs @@ -1179,6 +1179,7 @@ namespace CalamityMod.World } } } + AbleToUnlockChests = false; //reseting the variable in case players generate multiple worlds to prevent already unlocked chests from spawning } } } diff --git a/World/AstralBiome.cs b/World/AstralBiome.cs index 2547f5eb8e..d43940cfeb 100644 --- a/World/AstralBiome.cs +++ b/World/AstralBiome.cs @@ -21,7 +21,7 @@ namespace CalamityMod.World public class AstralBiome { public static int YStart { get; set; } = (int)Main.worldSurface; - + public static readonly SoundStyle MeteorSound = new("CalamityMod/Sounds/Custom/AstralStarFall"); public static bool CanAstralMeteorSpawn() { @@ -131,7 +131,7 @@ namespace CalamityMod.World //clamp so it doesnt crash hopefully int x = Utils.Clamp(realX, SulphurousSea.BiomeWidth + 400, Main.maxTilesX - SulphurousSea.BiomeWidth - 400); - + //world surface = 920 large 740 medium 560 small int y = (int)(Main.worldSurface * 0.5); //Large = 522, Medium = 444, Small = 336 while (y < Main.maxTilesY) @@ -218,6 +218,29 @@ namespace CalamityMod.World { WorldGen.gen = true; + // Pre-cache a list of Magic Storage tiles to avoid, for performance reasons + // It is plausible that only StorageComponent and StorageConnector are needed, but I aint gonna risk corrupting worlds + // or crashes as containers can do some serious shit as seen with the Abyss chests - Shade + Mod magicStorage = CalamityMod.Instance.magicStorage; + IList MSTilesToAvoid = new List(16); + if (magicStorage is not null) + { + string[] MSTileNames = new string[] + { + "CraftingAccess", + "CreativeStorageUnit", + "EnvironmentAccess", + "RemoteAccess", + "StorageAccess", + "StorageComponent", + "StorageConnector", + "StorageHeart", + "StorageUnit", + }; + foreach (string tileName in MSTileNames) + MSTilesToAvoid.Add(magicStorage.Find(tileName).Type); + } + UnifiedRandom rand = WorldGen.genRand; if (i < 50 || i > Main.maxTilesX - 50) { @@ -430,7 +453,9 @@ namespace CalamityMod.World y += 5; } - if (Main.tile[x, y].HasTile || Main.tile[x, y].WallType > 0) + if (Main.tile[x, y].HasTile || Main.tile[x, y].WallType > 0 && (!CalamityUtils.TileActiveAndOfType(x, y, TileID.Torches) || + !CalamityUtils.TileActiveAndOfType(x, y, TileID.Containers) || !CalamityUtils.TileActiveAndOfType(x, y, TileID.Containers2) + || (magicStorage is not null && MSTilesToAvoid.Contains(Main.tile[x, y].TileType)))) //AVOID HOUSES { bool place = true; SchematicManager.PlaceSchematic>(SchematicManager.AstralBeaconKey, new Point(x, y - 5), SchematicAnchor.Center, ref place); diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index 8fafcd4428..72656745f4 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -4,7 +4,9 @@ using CalamityMod.NPCs.ExoMechs.Ares; using CalamityMod.NPCs.ExoMechs.Artemis; using CalamityMod.NPCs.ExoMechs.Thanatos; using Microsoft.Xna.Framework; +using System.Reflection; using Terraria; +using Terraria.DataStructures; using Terraria.ModLoader; namespace CalamityMod.World @@ -25,7 +27,18 @@ namespace CalamityMod.World public static bool revenge = false; // Revengeance Mode public static bool death = false; // Death Mode public static bool armageddon = false; // Armageddon Mode - public static bool LegendaryMode => Main.getGoodWorld && Main.masterMode; // Evaluates to whether vanilla's "Legendary Mode" is enabled (Master Mode on For the Worthy) + + // Evaluates to whether vanilla's "Legendary Mode" is enabled (Master Mode on For the Worthy) + public static bool LegendaryMode => Main.getGoodWorld && ReflectMasterMode(); + + // FTW automatically bumps difficulties up and has no proper check for Master since a world generated in Expert Mode will be classified as Master + // Therefore gotta reflect! + public static bool ReflectMasterMode() + { + FieldInfo findInfo = typeof(Main).GetField("_currentGameModeInfo", BindingFlags.Static | BindingFlags.NonPublic); + GameModeData data = (GameModeData)findInfo.GetValue(null); + return data.IsMasterMode; + } // Sunken Sea public static Rectangle SunkenSeaLocation = Rectangle.Empty; diff --git a/build.txt b/build.txt index b5488a9a8d..bf8ef633b6 100644 --- a/build.txt +++ b/build.txt @@ -1,5 +1,5 @@ author = Fabsol and the Dev Team -version = 2.0.3.002 +version = 2.0.3.004 displayName = Calamity Mod homepage = https://discord.gg/calamity buildIgnore = .vs\*, Properties\*, *.csproj, *.user, obj\*, bin\*, *.config, .git\*, .github\*, LICENSE, README.md, .editorconfig, .gitignore, .gitattributes, Effects\Compiler\*