diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index bc45bea855..b7cb6d137f 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -39,6 +39,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 +51,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 +68,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)), @@ -158,6 +149,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())))); @@ -241,8 +237,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 @@ -264,9 +258,12 @@ namespace CalamityMod.Balancing // 20% resist to Eclipse's Fall. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType(), ProjectileType())))); - // 20% resist to Yharim's Crystal + // 20% resist to Yharim's Crystal. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); + // 20% resist to Zenith. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.FinalFractal)))); + // 15% resist to Enforcer projectiles. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType())))); #endregion @@ -276,8 +273,8 @@ namespace CalamityMod.Balancing // TODO -- NPC sets (mostly worm bosses) should probably be their own holding class. int[] exoTwins = new int[] { NPCType(), NPCType() }; - // 20% resist to Dynamic Pursuer - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType(), ProjectileType(), ProjectileType())))); + // 20% resist to Dynamic Pursuer. + NPCSpecificBalancingChanges.AddRange(Bundle(exoTwins, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType(), ProjectileType(), ProjectileType())))); // 10% resist to Eclipse's Fall stealth strike. NPCSpecificBalancingChanges.AddRange(Bundle(exoTwins, Do(new ProjectileResistBalancingRule(0.9f, ProjectileType())))); @@ -302,9 +299,6 @@ namespace CalamityMod.Balancing // 50% resist to Chicken Cannon. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); - // 50% resist to Prismatic Breaker. (why is this more than BOTH Rancor and Yharim's Crystal? jesus fuck this weapon seriously) - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); - // 50% resist to Tarragon Throwing Darts Thorns. (LOL) NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType(), ProjectileType())))); @@ -320,6 +314,9 @@ 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)))); @@ -335,9 +332,15 @@ namespace CalamityMod.Balancing // 30% resist to Dragon Scales and The Wand's tornadoes NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType(), ProjectileType())))); + // 30% resist to Prismatic Breaker's laser beam. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + // 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())))); @@ -347,7 +350,6 @@ namespace CalamityMod.Balancing // 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())))); @@ -377,6 +379,9 @@ 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()))); + // 30% resist to Murasama. NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.7f, 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/Alcohol/BloodyMaryBuff.png b/Buffs/Alcohol/BloodyMaryBuff.png index bee4c0d4f1..04b959506c 100644 Binary files a/Buffs/Alcohol/BloodyMaryBuff.png and b/Buffs/Alcohol/BloodyMaryBuff.png differ diff --git a/Buffs/Alcohol/CaribbeanRumBuff.png b/Buffs/Alcohol/CaribbeanRumBuff.png index b6bd9fb903..c3e5464b05 100644 Binary files a/Buffs/Alcohol/CaribbeanRumBuff.png and b/Buffs/Alcohol/CaribbeanRumBuff.png differ diff --git a/Buffs/Alcohol/CinnamonRollBuff.png b/Buffs/Alcohol/CinnamonRollBuff.png index 2d2e710cd4..075531eacc 100644 Binary files a/Buffs/Alcohol/CinnamonRollBuff.png and b/Buffs/Alcohol/CinnamonRollBuff.png differ diff --git a/Buffs/Alcohol/EverclearBuff.png b/Buffs/Alcohol/EverclearBuff.png index a6f5af5315..fde2031fa3 100644 Binary files a/Buffs/Alcohol/EverclearBuff.png and b/Buffs/Alcohol/EverclearBuff.png differ diff --git a/Buffs/Alcohol/EvergreenGinBuff.png b/Buffs/Alcohol/EvergreenGinBuff.png index c7d719d065..5e41d87eb6 100644 Binary files a/Buffs/Alcohol/EvergreenGinBuff.png and b/Buffs/Alcohol/EvergreenGinBuff.png differ diff --git a/Buffs/Alcohol/FireballBuff.png b/Buffs/Alcohol/FireballBuff.png index 31c326dcfc..7ee9784312 100644 Binary files a/Buffs/Alcohol/FireballBuff.png and b/Buffs/Alcohol/FireballBuff.png differ diff --git a/Buffs/Alcohol/GrapeBeerBuff.png b/Buffs/Alcohol/GrapeBeerBuff.png index 37b192bf52..d951249d12 100644 Binary files a/Buffs/Alcohol/GrapeBeerBuff.png and b/Buffs/Alcohol/GrapeBeerBuff.png differ diff --git a/Buffs/Alcohol/MargaritaBuff.png b/Buffs/Alcohol/MargaritaBuff.png index 28c9daaea9..068aebf1e0 100644 Binary files a/Buffs/Alcohol/MargaritaBuff.png and b/Buffs/Alcohol/MargaritaBuff.png differ diff --git a/Buffs/Alcohol/MoonshineBuff.png b/Buffs/Alcohol/MoonshineBuff.png index 1655cd8ea4..b079231309 100644 Binary files a/Buffs/Alcohol/MoonshineBuff.png and b/Buffs/Alcohol/MoonshineBuff.png differ diff --git a/Buffs/Alcohol/MoscowMuleBuff.png b/Buffs/Alcohol/MoscowMuleBuff.png index 3339894ff2..969367e33f 100644 Binary files a/Buffs/Alcohol/MoscowMuleBuff.png and b/Buffs/Alcohol/MoscowMuleBuff.png differ diff --git a/Buffs/Alcohol/RedWineBuff.png b/Buffs/Alcohol/RedWineBuff.png index ed3caab2bf..a3e116c717 100644 Binary files a/Buffs/Alcohol/RedWineBuff.png and b/Buffs/Alcohol/RedWineBuff.png differ diff --git a/Buffs/Alcohol/RumBuff.png b/Buffs/Alcohol/RumBuff.png index ed16ae3277..29f7cd9fda 100644 Binary files a/Buffs/Alcohol/RumBuff.png and b/Buffs/Alcohol/RumBuff.png differ diff --git a/Buffs/Alcohol/ScrewdriverBuff.png b/Buffs/Alcohol/ScrewdriverBuff.png index f8eff84972..868d695c58 100644 Binary files a/Buffs/Alcohol/ScrewdriverBuff.png and b/Buffs/Alcohol/ScrewdriverBuff.png differ diff --git a/Buffs/Alcohol/StarBeamRyeBuff.png b/Buffs/Alcohol/StarBeamRyeBuff.png index 469bf8b6c8..e678986953 100644 Binary files a/Buffs/Alcohol/StarBeamRyeBuff.png and b/Buffs/Alcohol/StarBeamRyeBuff.png differ diff --git a/Buffs/Alcohol/TequilaBuff.png b/Buffs/Alcohol/TequilaBuff.png index e93e1d68f1..ca3a7b204e 100644 Binary files a/Buffs/Alcohol/TequilaBuff.png and b/Buffs/Alcohol/TequilaBuff.png differ diff --git a/Buffs/Alcohol/TequilaSunriseBuff.png b/Buffs/Alcohol/TequilaSunriseBuff.png index 10777fd43d..04c3901caf 100644 Binary files a/Buffs/Alcohol/TequilaSunriseBuff.png and b/Buffs/Alcohol/TequilaSunriseBuff.png differ diff --git a/Buffs/Alcohol/VodkaBuff.png b/Buffs/Alcohol/VodkaBuff.png index 47e680eede..b2c2eb1496 100644 Binary files a/Buffs/Alcohol/VodkaBuff.png and b/Buffs/Alcohol/VodkaBuff.png differ diff --git a/Buffs/Alcohol/WhiskeyBuff.png b/Buffs/Alcohol/WhiskeyBuff.png index 1c05b68602..56f2662420 100644 Binary files a/Buffs/Alcohol/WhiskeyBuff.png and b/Buffs/Alcohol/WhiskeyBuff.png differ diff --git a/Buffs/Alcohol/WhiteWineBuff.png b/Buffs/Alcohol/WhiteWineBuff.png index d294938dde..548844ed08 100644 Binary files a/Buffs/Alcohol/WhiteWineBuff.png and b/Buffs/Alcohol/WhiteWineBuff.png differ 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/Pets/AstrophageBuff.png b/Buffs/Pets/AstrophageBuff.png index 35a6326618..47802b9748 100644 Binary files a/Buffs/Pets/AstrophageBuff.png and b/Buffs/Pets/AstrophageBuff.png differ diff --git a/Buffs/Pets/BloodBound.png b/Buffs/Pets/BloodBound.png index e758299f55..0973fb7258 100644 Binary files a/Buffs/Pets/BloodBound.png and b/Buffs/Pets/BloodBound.png differ diff --git a/Buffs/Pets/ChibiiDoGBuff.png b/Buffs/Pets/ChibiiDoGBuff.png index 9dca168332..6040aa83ca 100644 Binary files a/Buffs/Pets/ChibiiDoGBuff.png and b/Buffs/Pets/ChibiiDoGBuff.png differ diff --git a/Buffs/Pets/DannyDevito.png b/Buffs/Pets/DannyDevito.png index d22e92e934..f1eb0f98b6 100644 Binary files a/Buffs/Pets/DannyDevito.png and b/Buffs/Pets/DannyDevito.png differ diff --git a/Buffs/Pets/GoldieBuff.png b/Buffs/Pets/GoldieBuff.png index 588b4378f9..f2d77b1de1 100644 Binary files a/Buffs/Pets/GoldieBuff.png and b/Buffs/Pets/GoldieBuff.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/Potions/WeaponImbueCrumbling.png b/Buffs/Potions/WeaponImbueCrumbling.png index 91c59e2816..3518e6bf34 100644 Binary files a/Buffs/Potions/WeaponImbueCrumbling.png and b/Buffs/Potions/WeaponImbueCrumbling.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/ChiBuff.png b/Buffs/StatBuffs/ChiBuff.png index b74e1690af..80c5d25cd9 100644 Binary files a/Buffs/StatBuffs/ChiBuff.png and b/Buffs/StatBuffs/ChiBuff.png differ diff --git a/Buffs/StatBuffs/ChiRegenBuff.cs b/Buffs/StatBuffs/ChiRegenBuff.cs index cfbc1a5d41..6f00856a7a 100644 --- a/Buffs/StatBuffs/ChiRegenBuff.cs +++ b/Buffs/StatBuffs/ChiRegenBuff.cs @@ -5,6 +5,7 @@ namespace CalamityMod.Buffs.StatBuffs { public class ChiRegenBuff : ModBuff { + public override string Texture => "CalamityMod/Buffs/StatBuffs/ChiBuff"; public override void SetStaticDefaults() { Main.buffNoTimeDisplay[Type] = true; diff --git a/Buffs/StatBuffs/ChiRegenBuff.png b/Buffs/StatBuffs/ChiRegenBuff.png deleted file mode 100644 index b74e1690af..0000000000 Binary files a/Buffs/StatBuffs/ChiRegenBuff.png and /dev/null 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/StatDebuffs/Crumbling.png b/Buffs/StatDebuffs/Crumbling.png index eacef7559f..b7ae6c8d3b 100644 Binary files a/Buffs/StatDebuffs/Crumbling.png and b/Buffs/StatDebuffs/Crumbling.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/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 c4a4bca9b0..b689d54f47 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -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; @@ -470,8 +476,14 @@ namespace CalamityMod.CalPlayer public bool gShell = false; public bool tortShell = false; public bool absorber = false; + public bool alwaysHoneyRegen = false; + public bool honeyTurboRegen = false; + public bool honeyDewHalveDebuffs = false; + public bool livingDewHalveDebuffs = false; + public int jewelBonusDefense = 0; public bool aAmpoule = false; public bool rOoze = false; + public bool JustWasDebuffed = false; public bool fBarrier = false; public bool aBrain = false; public bool amalgam = false; @@ -491,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; @@ -517,8 +528,9 @@ namespace CalamityMod.CalPlayer public bool coreOfTheBloodGod = false; public bool elementalHeart = false; public bool crownJewel = false; - public bool celestialJewel = false; - public bool astralArcanum = false; + public bool infectedJewel = false; + public bool purity = false; + public int PurityHealSlowdownFrames = 0; public bool harpyRing = false; public bool angelTreads = false; public bool harpyWingBoost = false; //harpy wings + harpy ring @@ -543,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; @@ -812,6 +824,7 @@ namespace CalamityMod.CalPlayer public bool fishAlert = false; public bool clamity = false; public bool NOU = false; + public bool absorberAffliction = false; public bool sulphurPoison = false; public bool nightwither = false; public bool eutrophication = false; @@ -936,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; @@ -1079,7 +1092,6 @@ namespace CalamityMod.CalPlayer public bool witheringWeaponEnchant = false; public bool witheredDebuff = false; - public bool absorberAffliction = false; public int witheredWeaponHoldTime = 0; public int witheringDamageDone = 0; @@ -1446,6 +1458,9 @@ namespace CalamityMod.CalPlayer LunicCorpsShieldDurability = 0; if (!sponge) SpongeShieldDurability = 0; + if (!pSoulArtifact) + pSoulShieldDurability = 0; + pSoulShieldVisible = false; roverDrive = false; roverDriveShieldVisible = false; sponge = false; @@ -1572,13 +1587,16 @@ namespace CalamityMod.CalPlayer gShell = false; tortShell = false; absorber = false; + alwaysHoneyRegen = false; + honeyTurboRegen = false; + honeyDewHalveDebuffs = false; + livingDewHalveDebuffs = false; aAmpoule = false; rOoze = false; fBarrier = false; aBrain = false; amalgam = false; frostFlare = false; - beeResist = false; uberBees = false; evolution = false; nanotech = false; @@ -1609,8 +1627,8 @@ namespace CalamityMod.CalPlayer coreOfTheBloodGod = false; elementalHeart = false; crownJewel = false; - celestialJewel = false; - astralArcanum = false; + infectedJewel = false; + purity = false; harpyRing = false; angelTreads = false; harpyWingBoost = false; //harpy wings + harpy ring @@ -1625,7 +1643,7 @@ namespace CalamityMod.CalPlayer eArtifact = false; dArtifact = false; auricSArtifact = false; - pArtifact = false; + pSoulArtifact = false; giantPearl = false; normalityRelocator = false; flameLickedShell = false; @@ -1940,7 +1958,7 @@ namespace CalamityMod.CalPlayer cLamp = false; pGuy = false; cEnergy = false; - donutBabs = false; + pSoulGuardians = false; sWaifu = false; dWaifu = false; cWaifu = false; @@ -1952,7 +1970,7 @@ namespace CalamityMod.CalPlayer sCrystal = false; sGod = false; sandnado = false; - plantera = false; + PlantationSummon = false; astralProbe = false; victideSnail = false; cSpirit = false; @@ -2243,6 +2261,7 @@ namespace CalamityMod.CalPlayer vaporfied = false; banishingFire = false; wither = false; + PurityHealSlowdownFrames = 0; #endregion #region Rogue @@ -2489,6 +2508,7 @@ namespace CalamityMod.CalPlayer RoverDriveShieldDurability = 0; LunicCorpsShieldDurability = 0; SpongeShieldDurability = 0; + pSoulShieldDurability = 0; #endregion #region UI @@ -2575,7 +2595,7 @@ namespace CalamityMod.CalPlayer { gSabatonHotkeyHoldTime = 0; } - + if (CalamityKeybinds.NormalityRelocatorHotKey.JustPressed && normalityRelocator && Main.myPlayer == Player.whoAmI) { if (!Player.CCed && !Player.chaosState) @@ -2882,25 +2902,7 @@ namespace CalamityMod.CalPlayer if (prismaticSet && !Player.HasCooldown(PrismaticLaser.ID) && prismaticLasers <= 0) prismaticLasers = CalamityUtils.SecondsToFrames(35f); } - if (CalamityKeybinds.AstralArcanumUIHotkey.JustPressed && astralArcanum && !areThereAnyDamnBosses) - { - AstralArcanumUI.Toggle(); - } - if (CalamityKeybinds.AstralTeleportHotKey.JustPressed) - { - if (celestialJewel && !areThereAnyDamnBosses) - { - if (Main.netMode == NetmodeID.SinglePlayer) - { - Player.TeleportationPotion(); - SoundEngine.PlaySound(SoundID.Item6, Player.Center); - } - else if (Main.netMode == NetmodeID.MultiplayerClient && Player.whoAmI == Main.myPlayer) - { - NetMessage.SendData(MessageID.RequestTeleportationByServer, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } - } + if (CalamityKeybinds.BlazingCoreHotKey.JustPressed) { if (blazingCore && blazingCoreParry == 0 && blazingCoreSuccessfulParry == 0) @@ -2964,7 +2966,7 @@ namespace CalamityMod.CalPlayer { float angle = MathHelper.TwoPi * i / skullCount; Vector2 initialVelocity = angle.ToRotationVector2().RotatedByRandom(MathHelper.ToRadians(12f)) * skullSpeed * new Vector2(0.82f, 1.5f) * - Main.rand.NextFloat(0.8f, 1.2f) * (i < skullCount / 2 ? 0.25f : 1f); + Main.rand.NextFloat(0.8f, 1.2f) * (i < skullCount / 2 ? 0.25f : 1f); int projectileIndex = Projectile.NewProjectile(source, Player.Center + initialVelocity * 3f, initialVelocity, ModContent.ProjectileType(), damage, 2f, Player.whoAmI); Main.projectile[projectileIndex].tileCollide = false; Main.projectile[projectileIndex].localAI[1] = (Main.projectile[projectileIndex].velocity.Y < 0f).ToInt(); @@ -3140,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; @@ -3285,7 +3260,7 @@ namespace CalamityMod.CalPlayer //Life Jelly regen aura spawn when using a healing potion if (timePotionSick == 1 && Player.whoAmI == Main.myPlayer && lifejelly && !GrandGelatin) - Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0, Player.whoAmI); + Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0, Player.whoAmI); //Cleansing Jelly cleansing aura spawn when using a healing potion if (timePotionSick == 1 && Player.whoAmI == Main.myPlayer && cleansingjelly && !GrandGelatin) @@ -3351,7 +3326,7 @@ namespace CalamityMod.CalPlayer //While holding hotkey, but before slam, bring Y velocity closer to 0 if (gSabatonHotkeyHoldTime < 60 && gSabatonHotkeyHoldTime != 0 && !gSabatonFalling) { - Player.velocity.Y *= (60 - (gSabatonHotkeyHoldTime/4f))/60f; + Player.velocity.Y *= (60 - (gSabatonHotkeyHoldTime / 4f)) / 60f; } //Play sound a bit early so it goes in time with the fall if (gSabatonHotkeyHoldTime == 45 && !gSabatonFalling) @@ -3372,11 +3347,11 @@ namespace CalamityMod.CalPlayer if (gSabatonFalling) { SpawnGravistarParticle(); - + //Cap time converted to damage at 2 seconds if (gSabatonFall < 120) gSabatonFall++; - + Player.maxFallSpeed = 40f; Player.gravity = 1.3f; //If the player can fly during the fall, the physics gets a bit funky @@ -3394,7 +3369,7 @@ namespace CalamityMod.CalPlayer gSabatonTempJumpSpeed = 40; } } - + } } #endregion @@ -3405,7 +3380,7 @@ namespace CalamityMod.CalPlayer //Infinite flight granted by some boss attacks if (infiniteFlight) Player.wingTime = Player.wingTimeMax; - + // Reset the Calamity shader. CalamityFireDyeShader = null; @@ -3604,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); } @@ -3715,7 +3690,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; } } @@ -3774,7 +3749,7 @@ namespace CalamityMod.CalPlayer if (Main.rand.NextBool(20)) { int confettiDust = Main.rand.Next(139, 143); - int confetti = Dust.NewDust(new Vector2(hitbox.X,hitbox.Y), hitbox.Width, hitbox.Height, confettiDust, Player.velocity.X, Player.velocity.Y, 0, new Color(), 1.2f); + int confetti = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, confettiDust, Player.velocity.X, Player.velocity.Y, 0, new Color(), 1.2f); Main.dust[confetti].velocity.X *= (float)(1.0 + Main.rand.Next(-50, 51) * 0.01); Main.dust[confetti].velocity.Y *= (float)(1.0 + Main.rand.Next(-50, 51) * 0.01); Main.dust[confetti].velocity.X += Main.rand.Next(-50, 51) * 0.05f; @@ -3915,7 +3890,7 @@ namespace CalamityMod.CalPlayer } } #endregion - + #region Shoot public override bool Shoot(Item item, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockBack) { @@ -3926,60 +3901,66 @@ namespace CalamityMod.CalPlayer { if (item.CountsAsClass()) { - float num72 = item.shootSpeed; - Vector2 vector2 = Player.RotatedRelativePoint(Player.MountedCenter, true); - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (Player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)Player.direction; - num79 = 0f; - num80 = num72; - } - else + if (!CalamityLists.VeneratedLocketBanlist.Contains(item.type)) { + float num72 = item.shootSpeed; + Vector2 vector2 = Player.RotatedRelativePoint(Player.MountedCenter, true); + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (Player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)Player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + + 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 -= 100f; + num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (num79 < 0f) + { + num79 *= -1f; + } + if (num79 < 20f) + { + num79 = 20f; + } + num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); num80 = num72 / num80; - } + num78 *= num80; + num79 *= num80; + float speedX4 = num78 + (float)Main.rand.Next(-30, 31) * 0.02f; + float speedY5 = num79 + (float)Main.rand.Next(-30, 31) * 0.02f; + int p = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, type, (int)(damage * 0.07), knockBack * 0.5f, Player.whoAmI); - 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 -= 100f; - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) - { - num79 *= -1f; - } - if (num79 < 20f) - { - num79 = 20f; - } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float speedX4 = num78 + (float)Main.rand.Next(-30, 31) * 0.02f; - float speedY5 = num79 + (float)Main.rand.Next(-30, 31) * 0.02f; - int p = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, type, (int)(damage * 0.075), knockBack * 0.5f, Player.whoAmI); + if (p.WithinBounds(Main.maxProjectiles)) + { + Main.projectile[p].DamageType = DamageClass.Generic; //Makes it not proc shit like nanotech, extorter and other stuff + Main.projectile[p].Calamity().LocketClone = true; //To not have clones trigger effects like Sacrifice's Lifesteal and Final Dawn's stealth generation + } - if (p.WithinBounds(Main.maxProjectiles)) - Main.projectile[p].DamageType = DamageClass.Generic; //in case melee/rogue variants bug out - - // Handle AI edge-cases. - if (item.type == ModContent.ItemType()) - Main.projectile[p].ai[1] = 1f; - if (item.type == ModContent.ItemType()) - Main.projectile[p].ai[0] = -1f; + // Handle AI edge-cases. These are like overlapping projectiles and the projectile not spawning at all + if (item.type == ModContent.ItemType()) + Main.projectile[p].ai[1] = 1f; //MUST BE 1 OTHERWISE CLONES GENERATE STEALTH AAAAAAAAAAA + if (item.type == ModContent.ItemType()) + Main.projectile[p].ai[0] = -1f; + } if (StealthStrikeAvailable()) { - int knifeCount = 16; - int knifeDamage = (int)Player.GetTotalDamage().ApplyTo(60); + int knifeCount = 12; + int knifeDamage = (int)Player.GetTotalDamage().ApplyTo(70); float angleStep = MathHelper.TwoPi / knifeCount; float speed = 15f; @@ -4063,7 +4044,7 @@ namespace CalamityMod.CalPlayer } else if (AresExoskeleton.ArmExists(Player)) Player.body = EquipLoader.GetEquipSlot(Mod, "AresExoskeleton", EquipType.Body); - + else if ((abyssalDivingSuitPower || abyssalDivingSuitForce) && !abyssalDivingSuitHide) { Player.legs = EquipLoader.GetEquipSlot(Mod, "AbyssalDivingSuit", EquipType.Legs); @@ -4657,6 +4638,7 @@ 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) @@ -4664,24 +4646,15 @@ namespace CalamityMod.CalPlayer 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) + 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 +4703,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 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 b2bef00ec8..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; @@ -330,7 +331,7 @@ namespace CalamityMod.CalPlayer if (vHex) { // Unique messages appear half the time during each individual stage of SCal's fight - string vHexKeyToUse = "Status.Death.VulnerabilityHex"; + string vHexKeyToUse = "Status.Death.VulnerabilityHex" + Main.rand.Next(1, 3 + 1); if (Main.rand.NextBool() && CalamityGlobalNPC.SCal != -1) { if (CalamityGlobalNPC.SCalGrief != -1) @@ -349,26 +350,26 @@ namespace CalamityMod.CalPlayer } if (ZoneCalamity && Player.lavaWet) { - damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SearingLava").Format(Player.name)); + damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SearingLava" + Main.rand.Next(1, 2 + 1)).Format(Player.name)); } if (gsInferno) { - damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.GodSlayerInferno").Format(Player.name)); + damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.GodSlayerInferno" + Main.rand.Next(1, 3 + 1)).Format(Player.name)); } if (sulphurPoison) { - if (Main.rand.NextBool(2)) - damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SulphuricPoisoning").Format(Player.name)); + if (!Main.rand.NextBool(4)) // 75% custom + damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SulphuricPoisoning" + Main.rand.Next(1, 3 + 1)).Format(Player.name)); else - damageSource = PlayerDeathReason.ByOther(9); + damageSource = PlayerDeathReason.ByOther(9); // 25% generic Poisoned death text } if (dragonFire) { - damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Dragonfire").Format(Player.name)); + damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Dragonfire" + Main.rand.Next(1, 4 + 1)).Format(Player.name)); } if (miracleBlight) { - damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.MiracleBlight" + Main.rand.Next(1, 2 + 1)).Format(Player.name)); + damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.MiracleBlight" + Main.rand.Next(1, 3 + 1)).Format(Player.name)); } if (hInferno) { @@ -376,7 +377,7 @@ namespace CalamityMod.CalPlayer } if (hFlames || banishingFire) { - damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HolyFlames").Format(Player.name)); + damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HolyFlames" + Main.rand.Next(1, 3 + 1)).Format(Player.name)); } if (shadowflame) { @@ -384,27 +385,27 @@ namespace CalamityMod.CalPlayer } if (bBlood) { - damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BurningBlood").Format(Player.name)); + damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BurningBlood" + Main.rand.Next(1, 2 + 1)).Format(Player.name)); } if (cDepth) { - damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.CrushDepth" + Main.rand.Next(1, 2 + 1)).Format(Player.name)); + damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.CrushDepth" + Main.rand.Next(1, 3 + 1)).Format(Player.name)); } if (rTide) { - damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Riptide").Format(Player.name)); + damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Riptide" + Main.rand.Next(1, 2 + 1)).Format(Player.name)); } if (bFlames || weakBrimstoneFlames) { - damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BrimstoneFlames").Format(Player.name)); + damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BrimstoneFlames" + Main.rand.Next(1, 3 + 1)).Format(Player.name)); } if (pFlames) { - damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Plague" + Main.rand.Next(1, 2 + 1)).Format(Player.name)); + damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Plague" + Main.rand.Next(1, 3 + 1)).Format(Player.name)); } if (astralInfection) { - damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AstralInfection" + Main.rand.Next(1, 2 + 1)).Format(Player.name)); + damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AstralInfection" + Main.rand.Next(1, 3 + 1)).Format(Player.name)); } if (nightwither) { @@ -746,7 +747,7 @@ namespace CalamityMod.CalPlayer } // Can't have any cooldowns here because dodges grrrrr.... - if (fleshTotem && !Player.HasCooldown(Cooldowns.FleshTotem.ID)) + if (fleshTotem && !Player.HasCooldown(Cooldowns.FleshTotem.ID) && TotalEnergyShielding <= 0) contactDamageReduction += 0.5; if (tarragonCloak && tarraMelee && !Player.HasCooldown(Cooldowns.TarragonCloak.ID)) @@ -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; @@ -1157,20 +1146,20 @@ namespace CalamityMod.CalPlayer // As such, to avoid cooldowns proccing from dodge hits, do it here if (fleshTotem && !Player.HasCooldown(Cooldowns.FleshTotem.ID) && hurtInfo.Damage > 0) Player.AddCooldown(Cooldowns.FleshTotem.ID, CalamityUtils.SecondsToFrames(20), true, coreOfTheBloodGod ? "bloodgod" : "default"); + if (NPC.AnyNPCs(ModContent.NPCType())) - { Player.AddBuff(ModContent.BuffType(), 15, true); - } + if (crawCarapace) { - npc.AddBuff(ModContent.BuffType(), 720); + npc.AddBuff(ModContent.BuffType(), 900); SoundEngine.PlaySound(SoundID.NPCHit33 with { Volume = 0.5f }, Player.Center); } if (baroclaw) { - npc.AddBuff(ModContent.BuffType(), 1800); - npc.AddBuff(ModContent.BuffType(), 1800); + npc.AddBuff(ModContent.BuffType(), 900); + npc.AddBuff(ModContent.BuffType(), 900); SoundEngine.PlaySound(BaroclawHit, Player.Center); Vector2 bloodSpawnPosition = Player.Center + Main.rand.NextVector2Circular(Player.width, Player.height) * 0.04f; Vector2 splatterDirection = (Player.Center - bloodSpawnPosition).SafeNormalize(Vector2.UnitY); @@ -1189,7 +1178,7 @@ namespace CalamityMod.CalPlayer if (absorber) { - npc.AddBuff(ModContent.BuffType(), 1800); + npc.AddBuff(ModContent.BuffType(), 900); SoundEngine.PlaySound(AbsorberHit, Player.Center); Vector2 bloodSpawnPosition = Player.Center + Main.rand.NextVector2Circular(Player.width, Player.height) * 0.04f; Vector2 splatterDirection = (Player.Center - bloodSpawnPosition).SafeNormalize(Vector2.UnitY); @@ -1407,9 +1396,9 @@ namespace CalamityMod.CalPlayer #region Free and Consumable Dodge Hooks public override bool FreeDodge(Player.HurtInfo info) { - // God Slayer Damage Resistance makes you ignore hits that came in as less than 80. - // Alternatively, if the incoming damage is somehow less than 1 (TML doesn't allow this, but...), the hit is completely ignored. - if (info.Damage < 1 || (godSlayerDamage && info.Damage <= 80)) + // 22AUG2023: Ozzatron: god slayer damage resistance removed due to it being strong enough to godmode rev yharon + // If the incoming damage is somehow less than 1 (TML doesn't allow this, but...), the hit is completely ignored. + if (info.Damage < 1 /* || (godSlayerDamage && info.Damage <= 80) */) return true; // If this hit was marked to be completely ignored due to shield absorption, then ignore it. @@ -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(); @@ -1629,9 +1624,10 @@ namespace CalamityMod.CalPlayer private void ModifyHurtInfo_Calamity(ref Player.HurtInfo info) { // Boss Rush's damage floor is implemented as a dirty modifier + // TODO -- implementing this correctly would require fully reimplementing all of DR and ADR if (BossRushEvent.BossRushActive) { - int bossRushDamageFloor = (Main.expertMode ? 400 : 240) + (BossRushEvent.BossRushStage * 2); + int bossRushDamageFloor = (Main.expertMode ? 160 : 100) + (BossRushEvent.BossRushStage * 2); if (info.Damage < bossRushDamageFloor) info.Damage += (bossRushDamageFloor - info.Damage); } @@ -1643,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. @@ -1720,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) @@ -1767,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. @@ -1791,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; @@ -1808,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); @@ -2185,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; @@ -2542,7 +2589,7 @@ namespace CalamityMod.CalPlayer if (abyssDeath) { SoundEngine.PlaySound(DrownSound, Player.Center); - damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AbyssDrown" + Main.rand.Next(1, 2 + 1)).Format(Player.name)); + damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AbyssDrown" + Main.rand.Next(1, 3 + 1)).Format(Player.name)); } else if (CalamityWorld.armageddon && areThereAnyDamnBosses) { diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index d358a1c42f..b904ffeb75 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -1,18 +1,19 @@ -using CalamityMod.Items.Accessories; +using System; +using System.Linq; using CalamityMod.Buffs.Alcohol; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Cooldowns; -using CalamityMod.Events; +using CalamityMod.Items.Accessories; using CalamityMod.NPCs; using CalamityMod.Projectiles.Ranged; +using CalamityMod.Systems; using CalamityMod.World; using Microsoft.Xna.Framework; -using System; using Terraria; -using Terraria.ModLoader; using Terraria.DataStructures; -using CalamityMod.Systems; -using System.Linq; +using Terraria.GameContent.ItemDropRules; +using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.CalPlayer { @@ -24,141 +25,94 @@ namespace CalamityMod.CalPlayer if (Player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) noLifeRegen = true; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - double lifeRegenMult = death ? 1.5 : 1D; - if (reaverDefense) - lifeRegenMult *= 0.8; - int lifeRegenLost = 0; + // Universal +50% increase to DoT debuff damage in Death Mode + float deathNegativeRegenBonus = 0.5f; + float calamityDebuffMultiplier = 1f + (CalamityWorld.death ? deathNegativeRegenBonus : 0f); - // Initial Debuffs + // Cumulative amount of DoT debuff negative life regen from Calamity debuffs (or changes to vanilla debuffs) + float totalNegativeLifeRegen = 0; - // Get fucked, Nebula Armor - Player.nebulaLevelLife = 0; + #region Damage over Time Debuffs (Negative Life Regen) - // Vanilla - if (death) + // Vanilla debuffs (+50% damage over time in Death Mode is applied here) + if (CalamityWorld.death) { - if (Player.poisoned) - lifeRegenLost += 4; + int totalVanillaDoT = 0; - if (Player.onFire) - lifeRegenLost += 8; + if (Player.poisoned && !purity) + totalVanillaDoT += 4; + + if (Player.onFire && !purity) + totalVanillaDoT += 8; if (Player.tongued) - lifeRegenLost += 100; + totalVanillaDoT += 100; - if (Player.venom) - lifeRegenLost += 12; + if (Player.venom && !purity) + totalVanillaDoT += 12; - if (Player.onFrostBurn) - lifeRegenLost += 12; + if (Player.onFrostBurn && !purity) + totalVanillaDoT += 12; - if (Player.onFire2) - lifeRegenLost += 12; + if (Player.onFire2 && !purity) + totalVanillaDoT += 12; if (Player.burned) - lifeRegenLost += 60; + totalVanillaDoT += 60; if (Player.suffocating) - lifeRegenLost += 40; + totalVanillaDoT += 40; - if (Player.electrified) + if (Player.electrified && !purity) { - lifeRegenLost += 8; + totalVanillaDoT += 8; if (Player.controlLeft || Player.controlRight) - lifeRegenLost += 32; + totalVanillaDoT += 32; } + + // Tally up total current vanilla DoT so it can be added as extra DoT from Death Mode + totalNegativeLifeRegen += totalVanillaDoT * deathNegativeRegenBonus; } - // Calamity - if (shadowflame) + // + // Calamity debuffs (Vanilla Shadowflame is added here) + // + void ApplyDoTDebuff(bool hasDebuff, int negativeLifeRegenToApply, bool immuneCondition = false) { + if (!hasDebuff || immuneCondition) + return; + if (Player.lifeRegen > 0) Player.lifeRegen = 0; Player.lifeRegenTime = 0; - lifeRegenLost += 30; + totalNegativeLifeRegen += negativeLifeRegenToApply * calamityDebuffMultiplier; } - if (wDeath) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; + // Whispering Death sets positive regen to zero but doesn't actually deal any damage + ApplyDoTDebuff(wDeath, 0); - Player.lifeRegenTime = 0; - } - - if (weakBrimstoneFlames) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 7; - } - - if (bFlames) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 16; - } - - if (nightwither) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 16; - } - - if (vaporfied) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 8; - } - - if (cragsLava) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 30; - } - - if (gsInferno) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += profanedCrystalBuffs ? 35 : 30; - } - - if (astralInfection) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 20; - } - - if (irradiated) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 4; - } + ApplyDoTDebuff(irradiated, 4, purity); + int sulphurDoT = 6 - (sulfurSet ? 2 : 0) - (sulphurskin ? 2 : 0); + ApplyDoTDebuff(sulphurPoison, sulphurDoT, purity); + ApplyDoTDebuff(rTide, 6, purity); + ApplyDoTDebuff(weakBrimstoneFlames, 7); + ApplyDoTDebuff(bBlood, 8, purity); + ApplyDoTDebuff(vaporfied, 8, purity); + ApplyDoTDebuff(bFlames, 16, purity); + ApplyDoTDebuff(nightwither, 16, purity); + ApplyDoTDebuff(hFlames, 16, purity); + ApplyDoTDebuff(vHex, 16); + ApplyDoTDebuff(cDepth, 18, purity); + ApplyDoTDebuff(astralInfection, 20, infectedJewel || purity); + ApplyDoTDebuff(pFlames, 20, purity); + ApplyDoTDebuff(cragsLava, 30); + ApplyDoTDebuff(shadowflame, 30, purity); + // Profaned Soul Crystal turns you into Providence, a God, and you take more damage from God Slayer Inferno + ApplyDoTDebuff(gsInferno, profanedCrystalBuffs ? 35 : 30); + ApplyDoTDebuff(dragonFire, 36); + ApplyDoTDebuff(miracleBlight, 40); + ApplyDoTDebuff(banishingFire, 60); // Slowly increase the sulphuric water poisoning effect. Once it's high enough, the player starts taking damage over time. bool nearSafeZone = false; @@ -199,116 +153,20 @@ namespace CalamityMod.CalPlayer } else SulphWaterPoisoningLevel = MathHelper.Clamp(SulphWaterPoisoningLevel - 1f / SulphSeaWaterRecoveryTime, 0f, 1f); + #endregion - if (sulphurPoison) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 6; - if (sulfurSet) - { - lifeRegenLost -= 2; - } - if (sulphurskin) - { - lifeRegenLost -= 2; - } - } - - if (hFlames) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 16; - } - - if (banishingFire) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 60; - } - - if (pFlames) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 20; - } - - if (bBlood) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 8; - } - - if (vHex) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 16; - } - - if (dragonFire) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 36; - } - - if (miracleBlight) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 40; - } - - if (cDepth) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 18; - } - - if (rTide) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 6; - } - + #region Alcohol if (vodka) { alcoholPoisonLevel++; - lifeRegenLost += 1; + totalNegativeLifeRegen += 1; } if (redWine) { alcoholPoisonLevel++; - lifeRegenLost += 1; + totalNegativeLifeRegen += 1; if (baguette) - lifeRegenLost += 3; + totalNegativeLifeRegen += 3; } if (grapeBeer) { @@ -317,7 +175,7 @@ namespace CalamityMod.CalPlayer if (moonshine) { alcoholPoisonLevel++; - lifeRegenLost += 1; + totalNegativeLifeRegen += 1; } if (rum) { @@ -330,7 +188,7 @@ namespace CalamityMod.CalPlayer if (fireball) { alcoholPoisonLevel++; - lifeRegenLost += 1; + totalNegativeLifeRegen += 1; } if (whiskey) { @@ -339,27 +197,27 @@ namespace CalamityMod.CalPlayer if (everclear) { alcoholPoisonLevel += 2; - lifeRegenLost += 10; + totalNegativeLifeRegen += 10; } if (bloodyMary) { alcoholPoisonLevel++; - lifeRegenLost += 4; + totalNegativeLifeRegen += 4; } if (tequila) { alcoholPoisonLevel++; - lifeRegenLost += 1; + totalNegativeLifeRegen += 1; } if (tequilaSunrise) { alcoholPoisonLevel++; - lifeRegenLost += 2; + totalNegativeLifeRegen += 2; } if (screwdriver) { alcoholPoisonLevel++; - lifeRegenLost += 1; + totalNegativeLifeRegen += 1; } if (caribbeanRum) { @@ -372,27 +230,27 @@ namespace CalamityMod.CalPlayer if (margarita) { alcoholPoisonLevel++; - lifeRegenLost += 1; + totalNegativeLifeRegen += 1; } if (starBeamRye) { alcoholPoisonLevel++; - lifeRegenLost += 2; + totalNegativeLifeRegen += 2; } if (moscowMule) { alcoholPoisonLevel++; - lifeRegenLost += 4; + totalNegativeLifeRegen += 4; } if (whiteWine) { alcoholPoisonLevel++; - lifeRegenLost += 1; + totalNegativeLifeRegen += 1; } if (evergreenGin) { alcoholPoisonLevel++; - lifeRegenLost += 1; + totalNegativeLifeRegen += 1; } if (Player.tipsy) { @@ -410,14 +268,16 @@ namespace CalamityMod.CalPlayer Player.lifeRegen = 0; Player.lifeRegenTime = 0; - lifeRegenLost += 3 * alcoholPoisonLevel; + totalNegativeLifeRegen += 3 * alcoholPoisonLevel; } + #endregion if (manaOverloader) { if (Player.statMana > (int)(Player.statManaMax2 * 0.5)) - lifeRegenLost += 3; + totalNegativeLifeRegen += 3; } + if (brimflameFrenzy) { Player.manaRegen = 0; @@ -425,7 +285,7 @@ namespace CalamityMod.CalPlayer Player.manaRegenDelay = (int) Player.maxRegenDelay; if (Player.lifeRegen > 0) Player.lifeRegen = 0; - lifeRegenLost += 42; //the meaning of death + totalNegativeLifeRegen += 42; //the meaning of death } if (witheredDebuff) @@ -437,7 +297,7 @@ namespace CalamityMod.CalPlayer } else { - lifeRegenLost += (int)(5D * Math.Pow(1.5D, witheredWeaponHoldTime / 87D)); + totalNegativeLifeRegen += (int)(5D * Math.Pow(1.5D, witheredWeaponHoldTime / 87D)); if (Player.lifeRegen > 0) Player.lifeRegen = 0; } @@ -450,14 +310,62 @@ namespace CalamityMod.CalPlayer int debuffIndex = Player.FindBuffIndex(ModContent.BuffType()); float debuffIntensity = debuffIndex == -1 ? 0f : Player.buffTime[debuffIndex] / (float)Player.manaSickTimeMax; - lifeRegenLost += (int)(Math.Sqrt(debuffIntensity) * Math.Pow(6D, debuffIntensity + 1f)); + totalNegativeLifeRegen += (int)(Math.Sqrt(debuffIntensity) * Math.Pow(6D, debuffIntensity + 1f)); if (Player.lifeRegen > 0) Player.lifeRegen = 0; } - Player.lifeRegen -= (int)(lifeRegenLost * lifeRegenMult); + // + // ACTUALLY APPLY NEGATIVE LIFE REGEN + // - // Buffs + // At the last second, Reaver defense helm reduces DoT debuffs by 20% + if (reaverDefense) + totalNegativeLifeRegen = (int)(0.8f * totalNegativeLifeRegen); + + Player.lifeRegen -= (int)totalNegativeLifeRegen; + + #region Life Regen That Works Even During DoT Debuffs + + // Honey Dew (and upgrades) + if (alwaysHoneyRegen) + { + // Exact copy of vanilla Honey behavior, but does not stack with actually standing in Honey + if (!Player.honey) + { + Player.lifeRegen += 2; + Player.lifeRegenTime += 1; + + // Grants +2 life regen if negative life regen would otherwise occur. + // However, this can't bring regen into the positives. + if (Player.lifeRegen < 0) + { + Player.lifeRegen += 2; + if (Player.lifeRegen > 0) + Player.lifeRegen = 0; + } + } + } + + if (honeyDewHalveDebuffs) + { + // Tick down all sickness debuffs; this makes them expire 2x faster + // Upgrades increase the sets of debuffs which expire faster + for (int l = 0; l < Player.MaxBuffs; ++l) + { + int buffID = Player.buffType[l]; + if (Player.buffTime[l] <= 2) + continue; + bool shouldHalveDuration = CalamityLists.sicknessDebuffList.Contains(buffID); + if (livingDewHalveDebuffs) + shouldHalveDuration |= CalamityLists.fireDebuffList.Contains(buffID); + if (purity) + shouldHalveDuration |= CalamityLists.debuffList.Contains(buffID); + + if (shouldHalveDuration) + --Player.buffTime[l]; + } + } if (divineBless) { @@ -496,76 +404,136 @@ namespace CalamityMod.CalPlayer } // Permafrost's Concoction increases life regen while afflicted with a fire debuff - if (permafrostsConcoction) + if (permafrostsConcoction && Player.buffType.Any(CalamityLists.fireDebuffList.Contains)) { - if (Player.onFire || Player.onFire2 || Player.onFire3 || Player.burned || shadowflame || weakBrimstoneFlames || bFlames || cragsLava || gsInferno || hFlames || banishingFire || dragonFire) + if (Player.lifeRegenTime < 1800) + Player.lifeRegenTime = 1800; + + Player.lifeRegen += 6; + } + + // Grant life regen based on missing health for Radiant Ooze, Ambrosial Ampule, and purity + if (rOoze || aAmpoule || purity) + { + float missingLifeRatio = (Player.statLifeMax2 - Player.statLife) / Player.statLifeMax2; + //Ambrosial Ampule and ooze give between 2 and 6 hp/s, Purity gives between 3 and 7 hp/s + float lifeRegenToGive = MathHelper.Lerp( purity ? 6f : 4f, purity ? 14f : 12f, missingLifeRatio); + Player.lifeRegen += (int)lifeRegenToGive; + } + + if (purity) + { + int intendedPurityDefense = 0; + int currentDebuffs = Player.buffType.Count(CalamityLists.debuffList.Contains); + if (currentDebuffs > 0) { + // Healing rate is normally 5 HP/s (+1 every 12 frames) + // However, that 12 frames can and will slowly increase if you try to abuse this accessory + int healFrameCadence = 12; + + // Healing slows down after 5 seconds (300 frames) debuffed. For every 15 frames thereafter the cadence slows + // There is no upper limit to how slow it can get and it can take a very long time to reset to normal + int punishmentFrames = PurityHealSlowdownFrames - 300; + //lowest punishment is three full seconds between the one health heal + if (healFrameCadence < 180) + healFrameCadence += (punishmentFrames < 0) ? 0 : punishmentFrames / 15; + + if (Player.miscCounter % healFrameCadence == healFrameCadence - 1) + Player.Heal(1); + if (Player.lifeRegenTime < 1800) Player.lifeRegenTime = 1800; - Player.lifeRegen += 6; + intendedPurityDefense = 20 + (currentDebuffs - 1) * 8; + if (jewelBonusDefense < intendedPurityDefense) + jewelBonusDefense = intendedPurityDefense; + + // Count up total frames spent healing for slowdown. + ++PurityHealSlowdownFrames; } + + // If the defense should be ticking down to some lower value, do that. + // Purity loses 1 point of defense every second. + if (Player.miscCounter % 60 == 0 && jewelBonusDefense > intendedPurityDefense) + --jewelBonusDefense; + + // If the player is clear of all debuffs then gradually reduce the slowdown frames + if (currentDebuffs <= 0) + { + --PurityHealSlowdownFrames; + if (PurityHealSlowdownFrames < 0) + PurityHealSlowdownFrames = 0; + } + + // Actually apply defense bonus + Player.statDefense += jewelBonusDefense; } - if (celestialJewel || astralArcanum) + // Infected Jewel does not stack with Purity + else if (infectedJewel) { - bool lesserEffect = false; - for (int l = 0; l < Player.MaxBuffs; l++) + Player.lifeRegen += 2; + + // If the player has any debuffs, give the extra life regen and defense + // More defense is given for each additional debuff + int intendedJewelDefense = 0; + int currentDebuffs = Player.buffType.Count(CalamityLists.debuffList.Contains); + if (currentDebuffs > 0) { - int hasBuff = Player.buffType[l]; - lesserEffect = CalamityLists.alcoholList.Contains(hasBuff); + Player.lifeRegen += 4; + if (Player.lifeRegenTime < 1800) + Player.lifeRegenTime = 1800; + + intendedJewelDefense = 16 + (currentDebuffs - 1) * 5; + if (jewelBonusDefense < intendedJewelDefense) + jewelBonusDefense = intendedJewelDefense; } - int defenseBoost = astralArcanum ? 15 : 11; - if (lesserEffect) - { - Player.lifeRegen += astralArcanum ? 2 : 1; - Player.statDefense += defenseBoost; - } - else - { - if (Player.lifeRegen < 0) - { - if (Player.lifeRegenTime < 1800) - Player.lifeRegenTime = 1800; + // If the defense should be ticking down to some lower value, do that. + // Infected Jewel loses 1 point of defense every 20 frames. + if (Player.miscCounter % 60 == 0 && jewelBonusDefense > intendedJewelDefense) + --jewelBonusDefense; - Player.lifeRegen += astralArcanum ? 6 : 4; - Player.statDefense += defenseBoost; - } - else - Player.lifeRegen += astralArcanum ? 3 : 2; - } + // Actually apply defense bonus + Player.statDefense += jewelBonusDefense; } + + // Crown Jewel does not stack with Purity or Infected Jewel else if (crownJewel) { - bool lesserEffect = false; - for (int l = 0; l < Player.MaxBuffs; l++) - { - int hasBuff = Player.buffType[l]; - lesserEffect = CalamityLists.alcoholList.Contains(hasBuff); - } + Player.lifeRegen += 2; - if (lesserEffect) - Player.statDefense += 8; - else + // If any debuff is detected, provide even more life regen and massively accelerate it + if (Player.buffType.Any(CalamityLists.debuffList.Contains)) { - if (Player.lifeRegen < 0) - { - if (Player.lifeRegenTime < 1800) - Player.lifeRegenTime = 1800; - - Player.lifeRegen += 4; - Player.statDefense += 8; - } - else - Player.lifeRegen += 2; + Player.lifeRegen += 3; + if (Player.lifeRegenTime < 1800) + Player.lifeRegenTime = 1800; } } + #endregion - // Last Debuffs + // During Silva revive or God Slayer dash, all negative life regen is canceled + if ((silvaCountdown > 0 && hasSilvaEffect && silvaSet) || (DashID == GodSlayerDash.ID && Player.dashDelay < 0)) + { + if (Player.lifeRegen < 0) + Player.lifeRegen = 0; + } + + #region Things That Disable Even That Life Regen + // + // Yes, really, there's a list of conditions under which life regen doesn't work + // even if it's life regen that normally works during a damage over time debuff. + // + // 1. No life regen bool (Blood Boiler usage or wearing Omega Blue armor) + // 2. Being too far from Providence cocoon ("Holy Inferno") + // 3. Air drowning in the Abyss + // if (noLifeRegen) { + Player.nebulaLevelLife = 0; + if (Player.lifeRegen > 0) Player.lifeRegen = 0; @@ -585,7 +553,7 @@ namespace CalamityMod.CalPlayer Player.lifeRegen = 0; Player.lifeRegenTime = 0; - Player.lifeRegen -= (int)(hInfernoBoost * lifeRegenMult); + Player.lifeRegen -= (int)(hInfernoBoost * calamityDebuffMultiplier); if (Player.lifeRegen < -200) Player.lifeRegen = -200; @@ -605,22 +573,18 @@ namespace CalamityMod.CalPlayer Player.lifeRegen = 0; Player.lifeRegenTime = 0; - Player.lifeRegen -= (int)(160D * lifeRegenMult); + Player.lifeRegen -= (int)(160D * calamityDebuffMultiplier); } } } + // TODO -- Why is this here? if (weakPetrification) { if (Player.mount.Active) Player.mount.Dismount(Player); } - - if ((silvaCountdown > 0 && hasSilvaEffect && silvaSet) || (DashID == GodSlayerDash.ID && Player.dashDelay < 0)) - { - if (Player.lifeRegen < 0) - Player.lifeRegen = 0; - } + #endregion } #endregion @@ -673,9 +637,6 @@ namespace CalamityMod.CalPlayer if (trinketOfChi || chiRegen) Player.lifeRegen += 2; - if (rOoze) - Player.lifeRegen += 4; - if (ursaSergeant) { @@ -810,101 +771,55 @@ namespace CalamityMod.CalPlayer Player.lifeRegenTime += (int)MathHelper.Lerp(1f, 3f, regenBenefitFactor); } - // Standing still healing bonuses (all exclusive with vanilla Shiny Stone) - if (!Player.shinyStone) - { - int lifeRegenTimeMaxBoost = areThereAnyDamnBosses ? 450 : 1800; - int lifeRegenMaxBoost = areThereAnyDamnBosses ? 1 : 4; - float lifeRegenLifeRegenTimeMaxBoost = areThereAnyDamnBosses ? 8f : 30f; + #region Standing Still Life Regen + // Standing still healing bonuses (all are exclusive with vanilla Shiny Stone, but all function similarly) + if (!Player.shinyStone && Player.StandingStill() && Player.velocity.Y == 0 && Player.itemAnimation == 0) + { + bool honeyDewWorking = honeyTurboRegen && Player.honeyWet; + bool anyStandingStillLifeRegen = shadeRegen || cFreeze || honeyDewWorking || photosynthesis || aAmpoule || purity; + bool onlyPhotosynthesisAtNight = !shadeRegen && !cFreeze && !honeyDewWorking && photosynthesis && !Main.dayTime; - if (Player.StandingStill() && Player.itemAnimation == 0) + // Divides all negative life regen by two before applying any other effects. + if (anyStandingStillLifeRegen && Player.lifeRegen < 0) + Player.lifeRegen /= 2; + + // Spawn dust of some flavor while actually regenerating, aAmpule and purity have a slightly different looking style + if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife) { - bool boostedRegen = false; - bool noSunlight = false; - if (shadeRegen) + int dustType = shadeRegen ? 173 : cFreeze ? 67 : honeyDewWorking ? DustID.Honey2 : photosynthesis ? 244 : aAmpoule ? 228 : purity ? 187 : -1; + bool dustSpawnRolled = Main.rand.Next(30000) < Player.lifeRegenTime || purity ? Main.rand.NextBool(2) : aAmpoule ? Main.rand.NextBool(4) : Main.rand.NextBool(30); + if (dustType != -1 && dustSpawnRolled) { - boostedRegen = true; - if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife) - { - if (Main.rand.Next(30000) < Player.lifeRegenTime || Main.rand.NextBool(30)) - { - int regen = Dust.NewDust(Player.position, Player.width, Player.height, 173, 0f, 0f, 200, default, 1f); - Main.dust[regen].noGravity = true; - Main.dust[regen].fadeIn = 1.3f; - Vector2 velocity = CalamityUtils.RandomVelocity(100f, 50f, 100f, 0.04f); - Main.dust[regen].velocity = velocity; - velocity.Normalize(); - velocity *= 34f; - Main.dust[regen].position = Player.Center - velocity; - } - } - } - else if (cFreeze) - { - boostedRegen = true; - if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife) - { - if (Main.rand.Next(30000) < Player.lifeRegenTime || Main.rand.NextBool(30)) - { - int regen = Dust.NewDust(Player.position, Player.width, Player.height, 67, 0f, 0f, 200, new Color(150, Main.DiscoG, 255), 0.75f); - Main.dust[regen].noGravity = true; - Main.dust[regen].fadeIn = 1.3f; - Vector2 velocity = CalamityUtils.RandomVelocity(100f, 50f, 100f, 0.04f); - Main.dust[regen].velocity = velocity; - velocity.Normalize(); - velocity *= 34f; - Main.dust[regen].position = Player.Center - velocity; - } - } - } - else if (photosynthesis) - { - boostedRegen = true; - if (!Main.dayTime) - noSunlight = true; - if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife) - { - if (Main.rand.Next(30000) < Player.lifeRegenTime || Main.rand.NextBool(2)) - { - int regen = Dust.NewDust(Player.position, Player.width, Player.height, 244, 0f, 0f, 200, default, 1f); - Main.dust[regen].noGravity = true; - Main.dust[regen].fadeIn = 1.3f; - Vector2 velocity = CalamityUtils.RandomVelocity(100f, 50f, 100f, 0.04f); - Main.dust[regen].velocity = velocity; - velocity.Normalize(); - velocity *= 34f; - Main.dust[regen].position = Player.Center - velocity; - } - } - } - if (boostedRegen) - { - int lifeRegenTimeMaxBoost2 = !noSunlight ? lifeRegenTimeMaxBoost : (lifeRegenTimeMaxBoost / 5); - int lifeRegenMaxBoost2 = !noSunlight ? lifeRegenMaxBoost : (lifeRegenMaxBoost / 5); - float lifeRegenLifeRegenTimeMaxBoost2 = !noSunlight ? lifeRegenLifeRegenTimeMaxBoost : (lifeRegenLifeRegenTimeMaxBoost / 5); - - if (Player.lifeRegenTime > 90 && Player.lifeRegenTime < lifeRegenTimeMaxBoost2) - Player.lifeRegenTime = lifeRegenTimeMaxBoost2; - - Player.lifeRegenTime += lifeRegenMaxBoost2; - Player.lifeRegen += lifeRegenMaxBoost2; - - float num3 = Player.lifeRegenTime * 2.5f; // lifeRegenTime max is 3600 - num3 /= 300f; - if (num3 > 0f) - { - if (num3 > lifeRegenLifeRegenTimeMaxBoost2) - num3 = lifeRegenLifeRegenTimeMaxBoost2; - - Player.lifeRegen += (int)num3; - } - if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife) - { - Player.lifeRegenCount++; - } + int regen = Dust.NewDust(Player.position, Player.width, Player.height, dustType, 0f, 0f, purity || aAmpoule ? 80 : 200, default, purity || aAmpoule ? 0.5f : 1f); + Main.dust[regen].noGravity = true; + Main.dust[regen].fadeIn = 1.3f; + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 50f, 100f, 0.04f); + Main.dust[regen].velocity = velocity; + velocity.Normalize(); + velocity *= purity || aAmpoule ? 55f : 34f; + Main.dust[regen].position = Player.Center - velocity; } } + + // Actually apply "standing still" regeneration (the stats are granted even at full health) + float regenTimeNeededForTurboRegen = shadeRegen ? 40f : cFreeze ? 60f : honeyDewWorking ? 90f : photosynthesis ? 90f : aAmpoule ? 90f : purity ? 60f : -1f; + + // 4 = vanilla Shiny Stone + int turboRegenPower = shadeRegen || cFreeze || purity ? 4 : honeyDewWorking || aAmpoule ? 3 : photosynthesis ? 1 : -1; + + if (turboRegenPower > 0) + { + // After a brief delay determined by your form of standing still regen, min-cap life regen time at 1800 / 3600. + // Photosynthesis Potion does not do this at night. + if (Player.lifeRegenTime > regenTimeNeededForTurboRegen && Player.lifeRegenTime < 1800f && !onlyPhotosynthesisAtNight) + Player.lifeRegenTime = 1800f; + + Player.lifeRegen += turboRegenPower; + Player.lifeRegenTime += turboRegenPower; + } + } + #endregion // The Camper counteracts the regen loss while moving horizontally if (camper && (Player.velocity.X != 0 && Player.grappling[0] <= 0)) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 4e101ef4f9..8cba5de028 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using CalamityMod.Balancing; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.Potions; @@ -1038,19 +1037,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--; @@ -1153,7 +1146,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); } @@ -1577,23 +1570,7 @@ namespace CalamityMod.CalPlayer Player.GetDamage() += 0.1f; } - // Ambrosial Ampoule bonus and other light-granting bonuses float[] light = new float[3]; - if ((rOoze && !Main.dayTime) || aAmpoule) - { - light[0] += 1f; - light[1] += 1f; - light[2] += 0.6f; - } - if (aAmpoule) - { - Player.endurance += 0.05f; - Player.buffImmune[BuffID.Frozen] = true; - Player.buffImmune[BuffID.Chilled] = true; - Player.buffImmune[BuffID.Frostburn] = true; - Player.buffImmune[BuffID.CursedInferno] = true; - Player.buffImmune[ModContent.BuffType()] = true; - } if (cFreeze) { light[0] += 0.3f; @@ -2383,8 +2360,8 @@ namespace CalamityMod.CalPlayer if (AbsorberRegen) { - Player.GetDamage() += 0.1f; - Player.endurance += 0.07f; + Player.GetDamage() += 0.08f; + Player.endurance += 0.05f; } if (crawCarapace) @@ -2698,25 +2675,25 @@ namespace CalamityMod.CalPlayer Player.lifeMagnet = true; } - if (wDeath) + if (wDeath && !purity) Player.GetDamage() -= 0.25f; - if (astralInfection) + if (astralInfection && !(infectedJewel || purity)) Player.GetDamage() -= 0.15f; - if (pFlames) + if (pFlames && !purity) { Player.blind = true; Player.GetDamage() -= 0.15f; } - if (aCrunch && !laudanum) + if (aCrunch && !laudanum && !purity) { Player.statDefense -= ArmorCrunch.DefenseReduction; Player.endurance *= ArmorCrunch.MultiplicativeDamageReductionPlayer; } - if (wither) + if (wither && !purity) { Player.statDefense -= WitherDebuff.DefenseReduction; } @@ -2729,10 +2706,10 @@ namespace CalamityMod.CalPlayer Player.velocity.Y = 15f; } - if (eutrophication) + if (eutrophication && !purity) Player.velocity = Vector2.Zero; - if (vaporfied || galvanicCorrosion) + if ((vaporfied && !purity) || galvanicCorrosion) Player.velocity *= 0.98f; if (molluskSet) @@ -3021,15 +2998,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; @@ -3046,7 +3023,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; } } @@ -3085,7 +3063,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); @@ -3550,6 +3528,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) @@ -3629,7 +3667,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 diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 0784b84d49..978844a665 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) @@ -707,7 +693,7 @@ namespace CalamityMod.CalPlayer } } - // Fearmonger set's colossal life regeneration + // Fearmonger set gains +10 frames (max 90) of regen when any minion lands any hit if (fearmongerSet) { fearmongerRegenFrames += 10; @@ -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(120); + int damage = (int)Player.GetTotalDamage().ApplyTo(125); Projectile.NewProjectile(spawnSource, source, velocity, ProjectileType(), damage, 3f, proj.owner); } } @@ -1065,7 +1051,7 @@ namespace CalamityMod.CalPlayer } if (summon) { - if (pArtifact && !profanedCrystal) + if (pSoulArtifact && !profanedCrystal) target.AddBuff(BuffType(), 300); if (profanedCrystalBuffs) diff --git a/CalamityKeybinds.cs b/CalamityKeybinds.cs index fc27dabb6c..c76f1a98c2 100644 --- a/CalamityKeybinds.cs +++ b/CalamityKeybinds.cs @@ -9,8 +9,6 @@ namespace CalamityMod public static ModKeybind SetBonusHotKey { get; private set; } public static ModKeybind RageHotKey { get; private set; } public static ModKeybind AdrenalineHotKey { get; private set; } - public static ModKeybind AstralTeleportHotKey { get; private set; } - public static ModKeybind AstralArcanumUIHotkey { get; private set; } public static ModKeybind SandCloakHotkey { get; private set; } public static ModKeybind SpectralVeilHotKey { get; private set; } public static ModKeybind PlaguePackHotKey { get; private set; } @@ -28,8 +26,6 @@ namespace CalamityMod AdrenalineHotKey = KeybindLoader.RegisterKeybind(Mod, "AdrenalineMode", "B"); BlazingCoreHotKey = KeybindLoader.RegisterKeybind(Mod, "BlazingCoreParry", "N"); SetBonusHotKey = KeybindLoader.RegisterKeybind(Mod, "ArmorSetBonus", "Y"); - AstralTeleportHotKey = KeybindLoader.RegisterKeybind(Mod, "AstralTeleport", "P"); - AstralArcanumUIHotkey = KeybindLoader.RegisterKeybind(Mod, "AstralArcanumUIToggle", "O"); SandCloakHotkey = KeybindLoader.RegisterKeybind(Mod, "SandCloakEffect", "C"); SpectralVeilHotKey = KeybindLoader.RegisterKeybind(Mod, "SpectralVeilTeleport", "Z"); PlaguePackHotKey = KeybindLoader.RegisterKeybind(Mod, "BoosterDash", "Q"); @@ -47,8 +43,6 @@ namespace CalamityMod AdrenalineHotKey = null; BlazingCoreHotKey = null; SetBonusHotKey = null; - AstralTeleportHotKey = null; - AstralArcanumUIHotkey = null; SandCloakHotkey = null; SpectralVeilHotKey = null; PlaguePackHotKey = null; diff --git a/CalamityLists.cs b/CalamityLists.cs index 878f01aa30..031a8077a5 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -1,11 +1,13 @@ -using CalamityMod.Buffs.Alcohol; +using System.Collections.Generic; +using CalamityMod.Buffs; +using CalamityMod.Buffs.Alcohol; +using CalamityMod.Buffs.Cooldowns; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.Potions; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.DraedonMisc; -using CalamityMod.Items.Fishing.BrimstoneCragCatches; using CalamityMod.Items.Fishing.FishingRods; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; @@ -64,7 +66,6 @@ using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; using CalamityMod.Tiles.LivingFire; -using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -82,11 +83,11 @@ 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; + public static List fireDebuffList; + public static List sicknessDebuffList; public static List alcoholList; public static List spearAutoreuseList; public static List pumpkinMoonBuffList; @@ -160,6 +161,8 @@ namespace CalamityMod public static List DisabledSummonerNerfItems; public static List DisabledSummonerNerfMinions; + public static List VeneratedLocketBanlist; //To ban projectiles from locket, mainly spikeballs altho Toasty asked me to add mod calls for adding stuff like Dreamtastic + public static void LoadLists() { donatorList = new List() @@ -1046,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, @@ -1155,7 +1131,47 @@ namespace CalamityMod BuffType(), BuffType(), BuffType(), - BuffType() + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + // BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType() + }; + + fireDebuffList = new List() + { + BuffID.OnFire, + BuffID.OnFire3, // Hellfire + BuffID.Burning, // Touching meteorite ore or hellstone without obsidian skull + BuffID.CursedInferno, + BuffID.ShadowFlame, // Vanilla Shadowflame, can normally never be applied to players + BuffType(), // Calamity Shadowflame copy for players + BuffType(), // Crags lava + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), // Aflame enchant self damage + BuffType(), + }; + + sicknessDebuffList = new List() + { + BuffID.Poisoned, + BuffID.Venom, + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType() }; alcoholList = new List() @@ -1938,58 +1954,67 @@ namespace CalamityMod pierceResistExceptionList = new List() { - ProjectileID.FlyingKnife, ProjectileID.Arkhalis, - ProjectileID.Terragrim, - ProjectileID.MonkStaffT3, - ProjectileID.LastPrismLaser, ProjectileID.ChargedBlasterLaser, - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), + ProjectileID.FinalFractal, + 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(), }; // Lists of enemies that resist piercing to some extent (mostly worms). @@ -2670,6 +2695,18 @@ namespace CalamityMod DisabledSummonerNerfItems = new(); DisabledSummonerNerfMinions = new(); + + VeneratedLocketBanlist = new List() + { + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType() + }; } public static void UnloadLists() @@ -2681,11 +2718,11 @@ namespace CalamityMod dungeonEnemyBuffList = null; dungeonProjectileBuffList = null; bossHPScaleList = null; - beeEnemyList = null; friendlyBeeList = null; - beeProjectileList = null; hardModeNerfList = null; debuffList = null; + fireDebuffList = null; + sicknessDebuffList = null; alcoholList = null; spearAutoreuseList = null; pumpkinMoonBuffList = null; @@ -2758,6 +2795,8 @@ namespace CalamityMod DisabledSummonerNerfItems = null; DisabledSummonerNerfMinions = null; + + VeneratedLocketBanlist = null; } } } diff --git a/CalamityMod.cs b/CalamityMod.cs index 8f665dadcf..15188a5ff9 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -361,7 +361,6 @@ namespace CalamityMod RipperUI.Load(); StealthUI.Load(); ChargeMeterUI.Load(); - AstralArcanumUI.Load(this); FlightBar.Load(); // TODO -- Is this not possible to place in ModNPC.Load or ModNPC.SetStaticDefaults ? @@ -465,7 +464,6 @@ namespace CalamityMod RipperUI.Unload(); StealthUI.Unload(); ChargeMeterUI.Unload(); - AstralArcanumUI.Unload(); FlightBar.Unload(); if (!Main.dedServ) 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/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index a6c0313621..0815435ac2 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -456,8 +456,14 @@ namespace CalamityMod.ILEditing private static string IncorporateEnchantmentInAffix(Terraria.On_Item.orig_AffixName orig, Item self) { string result = orig(self); - if (!self.IsAir && self.Calamity().AppliedEnchantment.HasValue) - result = $"{self.Calamity().AppliedEnchantment.Value.Name} {result}"; + + // This hook could occur before CalamityGlobalItem is loaded and throw an error. + try + { + if (!self.IsAir && self.Calamity().AppliedEnchantment.HasValue) + result = $"{self.Calamity().AppliedEnchantment.Value.Name} {result}"; + } + catch { } return result; } #endregion diff --git a/Items/Accessories/AmbrosialAmpoule.cs b/Items/Accessories/AmbrosialAmpoule.cs index e5c3c33fd1..0836aa2a59 100644 --- a/Items/Accessories/AmbrosialAmpoule.cs +++ b/Items/Accessories/AmbrosialAmpoule.cs @@ -1,6 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -12,37 +12,38 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { - Item.defense = 6; Item.width = 20; Item.height = 20; - Item.value = CalamityGlobalItem.Rarity5BuyPrice; - Item.rare = ItemRarityID.Pink; + Item.value = CalamityGlobalItem.Rarity9BuyPrice; + Item.rare = ItemRarityID.Cyan; Item.accessory = true; } public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); + player.statLifeMax2 += 70; + + // bool left in for abyss light purposes and life regen effects modPlayer.aAmpoule = true; - modPlayer.rOoze = true; + + // Inherits all effects of Honey Dew and Living Dew (except standing regen is not honey exclusive anymore) + modPlayer.alwaysHoneyRegen = true; + modPlayer.honeyDewHalveDebuffs = true; + modPlayer.livingDewHalveDebuffs = true; + + // Add light if the other accessories aren't equipped and visibility is turned on + if (!(modPlayer.rOoze || modPlayer.purity) && !hideVisual) + Lighting.AddLight(player.Center, new Vector3(1.2f, 1.2f, 0.72f)); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(). + AddIngredient(). AddIngredient(). - AddIngredient(5). - AddIngredient(10). - AddTile(TileID.MythrilAnvil). - Register(); - - CreateRecipe(). - AddIngredient(). - AddIngredient(). - AddIngredient(5). - AddIngredient(10). - AddTile(TileID.MythrilAnvil). + AddIngredient(3). + AddTile(TileID.LunarCraftingStation). Register(); } } diff --git a/Items/Accessories/AngelicAlliance.cs b/Items/Accessories/AngelicAlliance.cs index a4817de3e4..aa7c22ee77 100644 --- a/Items/Accessories/AngelicAlliance.cs +++ b/Items/Accessories/AngelicAlliance.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Accessories player.GetDamage() += 0.08f; player.GetDamage() += 0.07f; //7% + 8% = 15% player.maxMinions += 2; - if (player.controlJump) + if (player.wingTime < player.wingTimeMax) player.lifeRegen += 4; } diff --git a/Items/Accessories/AstralArcanum.cs b/Items/Accessories/AstralArcanum.cs deleted file mode 100644 index c5b266e111..0000000000 --- a/Items/Accessories/AstralArcanum.cs +++ /dev/null @@ -1,44 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.CalPlayer; -using CalamityMod.Items.Materials; -using CalamityMod.Rarities; -using System.Collections.Generic; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Accessories -{ - public class AstralArcanum : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Accessories"; - public override void SetDefaults() - { - Item.defense = 12; - Item.width = 26; - Item.height = 26; - Item.accessory = true; - Item.value = CalamityGlobalItem.Rarity12BuyPrice; - Item.rare = ModContent.RarityType(); - } - - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.AstralArcanumUIHotkey); - - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.astralArcanum = true; - player.buffImmune[ModContent.BuffType()] = true; - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(). - AddIngredient(3). - AddIngredient(ItemID.LunarBar, 5). - AddTile(TileID.LunarCraftingStation). - Register(); - } - } -} diff --git a/Items/Accessories/AstralArcanum.png b/Items/Accessories/AstralArcanum.png deleted file mode 100644 index 30af2e08c5..0000000000 Binary files a/Items/Accessories/AstralArcanum.png and /dev/null differ 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/CrownJewel.cs b/Items/Accessories/CrownJewel.cs index 617a17cd63..75b74c27da 100644 --- a/Items/Accessories/CrownJewel.cs +++ b/Items/Accessories/CrownJewel.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { - Item.defense = 5; + Item.defense = 4; Item.width = 26; Item.height = 26; Item.value = CalamityGlobalItem.Rarity1BuyPrice; 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..9672100ed0 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; 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/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/HoneyDew.cs b/Items/Accessories/HoneyDew.cs index 055720f5f6..247b8ed539 100644 --- a/Items/Accessories/HoneyDew.cs +++ b/Items/Accessories/HoneyDew.cs @@ -13,46 +13,27 @@ namespace CalamityMod.Items.Accessories { Item.width = 20; Item.height = 20; - Item.value = CalamityGlobalItem.Rarity5BuyPrice; - Item.rare = ItemRarityID.Pink; + Item.value = CalamityGlobalItem.Rarity2BuyPrice; + Item.rare = ItemRarityID.Green; Item.accessory = true; } public override void UpdateAccessory(Player player, bool hideVisual) { + player.statLifeMax2 += 30; CalamityPlayer modPlayer = player.Calamity(); - modPlayer.beeResist = true; - - if (player.ZoneJungle) - { - player.lifeRegen += 1; - player.statDefense += 9; - player.endurance += 0.05f; - } - - player.buffImmune[BuffID.Venom] = true; - player.buffImmune[BuffID.Poisoned] = true; - - if (!player.honey && player.lifeRegen < 0) - { - player.lifeRegen += 2; - if (player.lifeRegen > 0) - player.lifeRegen = 0; - } - - player.lifeRegenTime += 1; - player.lifeRegen += 2; + modPlayer.alwaysHoneyRegen = true; + modPlayer.honeyTurboRegen = true; + modPlayer.honeyDewHalveDebuffs = true; } public override void AddRecipes() { CreateRecipe(). - AddIngredient(). AddIngredient(ItemID.BottledHoney, 10). - AddIngredient(2). - AddIngredient(ItemID.ButterflyDust). - AddIngredient(3). - AddTile(TileID.MythrilAnvil). + AddIngredient(ItemID.BeeWax, 3). + AddIngredient(3). + AddTile(TileID.Anvils). Register(); } } 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/CelestialJewel.cs b/Items/Accessories/InfectedJewel.cs similarity index 61% rename from Items/Accessories/CelestialJewel.cs rename to Items/Accessories/InfectedJewel.cs index 565496846d..cd5e261296 100644 --- a/Items/Accessories/CelestialJewel.cs +++ b/Items/Accessories/InfectedJewel.cs @@ -1,19 +1,19 @@ -using CalamityMod.Items.Placeables; -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; using CalamityMod.Items.Potions; -using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class CelestialJewel : ModItem, ILocalizedModType + [LegacyName("CelestialJewel")] + public class InfectedJewel : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { - Item.defense = 8; + Item.defense = 6; Item.width = 26; Item.height = 26; Item.value = CalamityGlobalItem.Rarity7BuyPrice; @@ -21,21 +21,18 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.AstralTeleportHotKey); - public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.celestialJewel = true; + modPlayer.infectedJewel = true; } public override void AddRecipes() { CreateRecipe(). AddIngredient(). - AddIngredient(ItemID.TeleportationPotion, 3). - AddIngredient(15). - AddIngredient(15). + AddIngredient(10). + AddIngredient(25). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/CelestialJewel.png b/Items/Accessories/InfectedJewel.png similarity index 100% rename from Items/Accessories/CelestialJewel.png rename to Items/Accessories/InfectedJewel.png 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/LivingDew.cs b/Items/Accessories/LivingDew.cs index 7faeb35edd..1ef0b8db2c 100644 --- a/Items/Accessories/LivingDew.cs +++ b/Items/Accessories/LivingDew.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,30 +12,33 @@ namespace CalamityMod.Items.Accessories public override void SetDefaults() { Item.width = 34; - Item.height = 24; - Item.value = CalamityGlobalItem.Rarity3BuyPrice; - Item.rare = ItemRarityID.Orange; + Item.height = 22; + Item.value = CalamityGlobalItem.Rarity7BuyPrice; + Item.rare = ItemRarityID.Lime; Item.accessory = true; } public override void UpdateAccessory(Player player, bool hideVisual) { - if (player.ZoneJungle) - { - player.lifeRegen += 1; - player.statDefense += 5; - player.endurance += 0.05f; - } - player.buffImmune[BuffID.Poisoned] = true; + player.statLifeMax2 += 50; + + // Inherits all effects of Honey Dew + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.alwaysHoneyRegen = true; + modPlayer.honeyTurboRegen = true; + modPlayer.honeyDewHalveDebuffs = true; + modPlayer.livingDewHalveDebuffs = true; } public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.Bezoar). - AddIngredient(ItemID.Vine, 2). - AddIngredient(5). - AddTile(TileID.Anvils). + AddIngredient(). + AddIngredient(3). + AddIngredient(6). + // TODO -- Replace with Water Essence + AddIngredient(5). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Accessories/LivingDew.png b/Items/Accessories/LivingDew.png index d7cfdff8d2..a1689717e9 100644 Binary files a/Items/Accessories/LivingDew.png and b/Items/Accessories/LivingDew.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 new file mode 100644 index 0000000000..ca44f6c28c --- /dev/null +++ b/Items/Accessories/Purity.cs @@ -0,0 +1,62 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; +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 +{ + [LegacyName("AstralArcanum")] + 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; + Item.width = 18; + Item.height = 44; + Item.accessory = true; + Item.value = CalamityGlobalItem.Rarity15BuyPrice; + Item.rare = ModContent.RarityType(); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.Calamity(); + player.statLifeMax2 += 100; + + // Abyss light, debuff near-immunity, life regen effects, and massively enhances debuff halving + modPlayer.purity = true; + + // Inherits effects from Honey Dew and Living Dew + modPlayer.alwaysHoneyRegen = true; + modPlayer.honeyDewHalveDebuffs = true; + modPlayer.livingDewHalveDebuffs = true; + + // Add light if the other accessories aren't equipped and visibility is turned on + if (!(modPlayer.rOoze || modPlayer.aAmpoule) && !hideVisual) + Lighting.AddLight(player.Center, new Vector3(1.32f, 1.32f, 1.82f)); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(). + AddIngredient(). + AddIngredient(5). + AddIngredient(4). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Accessories/Purity.png b/Items/Accessories/Purity.png new file mode 100644 index 0000000000..c07a9cf112 Binary files /dev/null and b/Items/Accessories/Purity.png differ diff --git a/Items/Accessories/RadiantOoze.cs b/Items/Accessories/RadiantOoze.cs index 52825d6ca9..58f33eec38 100644 --- a/Items/Accessories/RadiantOoze.cs +++ b/Items/Accessories/RadiantOoze.cs @@ -1,4 +1,6 @@ -using CalamityMod.Items.Materials; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -19,7 +21,14 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.Calamity().rOoze = true; + CalamityPlayer modPlayer = player.Calamity(); + + // bool left in for abyss light purposes and life regen effects + modPlayer.rOoze = true; + + // Add light if the other accessories aren't equipped and visibility is turned on + if (!(modPlayer.aAmpoule || modPlayer.purity) && !hideVisual) + Lighting.AddLight(player.Center, new Vector3(1f, 1f, 0.6f)); } public override void AddRecipes() 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/StatisNinjaBelt.cs b/Items/Accessories/StatisNinjaBelt.cs index e6999438a6..acd6cc63b5 100644 --- a/Items/Accessories/StatisNinjaBelt.cs +++ b/Items/Accessories/StatisNinjaBelt.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -8,10 +9,16 @@ namespace CalamityMod.Items.Accessories public class StatisNinjaBelt : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + public override void SetStaticDefaults() + { + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 6)); + ItemID.Sets.AnimatesAsSoul[Type] = true; + } + public override void SetDefaults() { - Item.width = 28; - Item.height = 32; + Item.width = 30; + Item.height = 26; Item.value = CalamityGlobalItem.Rarity11BuyPrice; Item.rare = ItemRarityID.Purple; Item.accessory = true; diff --git a/Items/Accessories/StatisNinjaBelt.png b/Items/Accessories/StatisNinjaBelt.png index cbbc61f739..4427d55ae7 100644 Binary files a/Items/Accessories/StatisNinjaBelt.png and b/Items/Accessories/StatisNinjaBelt.png differ 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 dc8af18d29..87c9f5fe19 100644 --- a/Items/Accessories/TheAbsorber.cs +++ b/Items/Accessories/TheAbsorber.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { - Item.defense = 16; + Item.defense = 15; Item.width = 20; Item.height = 24; Item.value = CalamityGlobalItem.Rarity9BuyPrice; 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/TheCommunity.cs b/Items/Accessories/TheCommunity.cs index ccd0f1b00a..416d820142 100644 --- a/Items/Accessories/TheCommunity.cs +++ b/Items/Accessories/TheCommunity.cs @@ -93,7 +93,7 @@ namespace CalamityMod.Items.Accessories // Damage stat boosts public const float DamageMultiplier = 0.5f; // 2.5% to 10% (x100) - public const float CritMultiplier = 25f; // 1.25% to 5% + public const float CritMultiplier = 25f; // 1.25% to 5% (end result rounded down) // Defensive stat boosts public const float HealthMultiplier = 50f; // 2% to 10% (rounded down) @@ -112,11 +112,11 @@ namespace CalamityMod.Items.Accessories float power = CalculatePower(); string statList = this.GetLocalization("StatsList").Format( (DamageMultiplier * power * 100).ToString("N1"), - (CritMultiplier * power).ToString("N0"), + (int)(CritMultiplier * power), (int)(HealthMultiplier * power), (DRMultiplier * power * 100).ToString("N2"), (int)(DefenseMultiplier * power), - 1 + (int)(RegenMultiplier * power), + (0.5f * (1f + (int)(RegenMultiplier * power))).ToString("n1"), (SpeedMultiplier * power * 100).ToString("N1"), (FlightMultiplier * power * 100).ToString("N1"), (CalculatePower(true) * 100).ToString("N0")); diff --git a/Items/Accessories/TheEvolution.cs b/Items/Accessories/TheEvolution.cs index fc43a7c998..f7cae5cd24 100644 --- a/Items/Accessories/TheEvolution.cs +++ b/Items/Accessories/TheEvolution.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(6, 10)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 10)); 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 b9f75fbe5d..99a96e5c64 100644 --- a/Items/Accessories/TheSponge.cs +++ b/Items/Accessories/TheSponge.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Accessories public static readonly SoundStyle BreakSound = new("CalamityMod/Sounds/Custom/RoverDriveBreak") { Volume = 0.75f }; public static int ShieldDurabilityMax = 180; - public static int ShieldRechargeDelay = CalamityUtils.SecondsToFrames(6); + 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 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/Vanity/Popo.cs b/Items/Accessories/Vanity/Popo.cs index 62ff9861f6..dd3101f43c 100644 --- a/Items/Accessories/Vanity/Popo.cs +++ b/Items/Accessories/Vanity/Popo.cs @@ -21,7 +21,6 @@ namespace CalamityMod.Items.Accessories.Vanity public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) return; @@ -35,8 +34,8 @@ namespace CalamityMod.Items.Accessories.Vanity public override void SetDefaults() { - Item.width = 26; - Item.height = 30; + Item.width = 36; + Item.height = 44; Item.accessory = true; Item.value = CalamityGlobalItem.Rarity5BuyPrice; Item.rare = ItemRarityID.Pink; diff --git a/Items/Accessories/Vanity/Popo.png b/Items/Accessories/Vanity/Popo.png index 5466d48dbe..225b3509d3 100644 Binary files a/Items/Accessories/Vanity/Popo.png and b/Items/Accessories/Vanity/Popo.png differ diff --git a/Items/Accessories/VitalJelly.cs b/Items/Accessories/VitalJelly.cs index 445249fa27..c2b5f086ad 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; 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/Ammo/AccelerationRound.cs b/Items/Ammo/AccelerationRound.cs index c7b8def04d..7d95498944 100644 --- a/Items/Ammo/AccelerationRound.cs +++ b/Items/Ammo/AccelerationRound.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Items.Ammo { Item.damage = 10; Item.DamageType = DamageClass.Ranged; - Item.width = 8; - Item.height = 8; + Item.width = 10; + Item.height = 16; Item.maxStack = 9999; Item.consumable = true; Item.knockBack = 1.25f; diff --git a/Items/Ammo/AccelerationRound.png b/Items/Ammo/AccelerationRound.png index aaae66b94b..c2c6a926ad 100644 Binary files a/Items/Ammo/AccelerationRound.png and b/Items/Ammo/AccelerationRound.png differ diff --git a/Items/Ammo/HyperiusBullet.cs b/Items/Ammo/HyperiusBullet.cs index 886fa40d67..b9b5329f6b 100644 --- a/Items/Ammo/HyperiusBullet.cs +++ b/Items/Ammo/HyperiusBullet.cs @@ -12,14 +12,14 @@ namespace CalamityMod.Items.Ammo public override void SetStaticDefaults() { Item.ResearchUnlockCount = 99; - } + } public override void SetDefaults() { Item.damage = 18; Item.DamageType = DamageClass.Ranged; - Item.width = 8; - Item.height = 8; + Item.width = 24; + Item.height = 30; Item.maxStack = 9999; Item.consumable = true; Item.knockBack = 1.5f; diff --git a/Items/Ammo/HyperiusBullet.png b/Items/Ammo/HyperiusBullet.png index 10362f6c99..8a8e1ffaa8 100644 Binary files a/Items/Ammo/HyperiusBullet.png and b/Items/Ammo/HyperiusBullet.png differ diff --git a/Items/Armor/GemTech/GemTechHeadgear.cs b/Items/Armor/GemTech/GemTechHeadgear.cs index 1b212d446b..8a0b35a901 100644 --- a/Items/Armor/GemTech/GemTechHeadgear.cs +++ b/Items/Armor/GemTech/GemTechHeadgear.cs @@ -138,12 +138,15 @@ namespace CalamityMod.Items.Armor.GemTech tooltips.Insert(setBonusIndex, purpleGemTooltip); setBonusIndex++; - TooltipLine pinkGemTooltip = new TooltipLine(item.Mod, "CalamityMod:SetBonus7", CalamityUtils.GetTextFromModItem("PinkGemInfo").Format(BaseGemDefenseBoost, BaseGemLifeRegenBoost)); + string pinkLifeRegenString = (0.5f * BaseGemLifeRegenBoost).ToString("n1"); + TooltipLine pinkGemTooltip = new TooltipLine(item.Mod, "CalamityMod:SetBonus7", CalamityUtils.GetTextFromModItem("PinkGemInfo").Format(BaseGemDefenseBoost, pinkLifeRegenString)); pinkGemTooltip.OverrideColor = new Color(255, 115, 206); tooltips.Insert(setBonusIndex, pinkGemTooltip); setBonusIndex++; - TooltipLine liferegenTooltip = new TooltipLine(item.Mod, "CalamityMod:SetBonus8", CalamityUtils.GetTextFromModItem("GemBonusInfo").Format(AllGemsWeaponUseLifeRegenBoost, AllGemsLifeRegenBoostTime / 60, AllGemsMultiWeaponUseLifeRegenBoost, AllGemsMultiWeaponLifeRegenBoostTime / 60f)); + string baseLifeRegenString = (0.5f * AllGemsWeaponUseLifeRegenBoost).ToString("n1"); + string multiclassLifeRegenString = (0.5f * AllGemsMultiWeaponUseLifeRegenBoost).ToString("n1"); + TooltipLine liferegenTooltip = new TooltipLine(item.Mod, "CalamityMod:SetBonus8", CalamityUtils.GetTextFromModItem("GemBonusInfo").Format(baseLifeRegenString, AllGemsLifeRegenBoostTime / 60, multiclassLifeRegenString, AllGemsMultiWeaponLifeRegenBoostTime / 60f)); liferegenTooltip.OverrideColor = new Color(230, 230, 230); tooltips.Insert(setBonusIndex, liferegenTooltip); } diff --git a/Items/Armor/Vanity/BumblefuckMask.png b/Items/Armor/Vanity/BumblefuckMask.png index 3195e97651..ee872f5dd5 100644 Binary files a/Items/Armor/Vanity/BumblefuckMask.png and b/Items/Armor/Vanity/BumblefuckMask.png differ diff --git a/Items/Armor/Vanity/BumblefuckMask_Head.png b/Items/Armor/Vanity/BumblefuckMask_Head.png index 4d94c642e5..d6edeaa67f 100644 Binary files a/Items/Armor/Vanity/BumblefuckMask_Head.png and b/Items/Armor/Vanity/BumblefuckMask_Head.png differ diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index d4ded9bc69..c1131e861a 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -625,7 +625,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 +653,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 +791,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 c3e9b09f5d..9d3304d7fd 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)) }, @@ -105,7 +105,7 @@ namespace CalamityMod.Items // { ItemID.FireworksLauncher, Do(DamageRatio(2f)) }, // Celebration { ItemID.Flamarang, Do(DamageExact(43)) }, { ItemID.Flamelash, Do(DamageRatio(1.25f)) }, - { ItemID.Flamethrower, Do(DamageExact(42), ShootSpeedDelta(+3f)) }, + { ItemID.Flamethrower, Do(ShootSpeedDelta(+3f)) }, { ItemID.FlowerofFire, Do(AutoReuse, ManaExact(7), UseRatio(0.88f)) }, // Uses ratios due to remix seed { ItemID.FlowerofFrost, Do(AutoReuse, ManaExact(7), UseExact(30), DamageExact(70), ShootSpeedExact(14)) }, { ItemID.FlyingKnife, Do(DamageExact(70)) }, @@ -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)) }, @@ -212,7 +213,6 @@ namespace CalamityMod.Items { ItemID.StakeLauncher, Do(PointBlank, DamageRatio(2f), UseRatio(1.5f)) }, { ItemID.StarCannon, Do(DamageExact(25)) }, { ItemID.StardustDragonStaff, Do(AutoReuse, DamageExact(20), UseExact(19)) }, - { ItemID.StarWrath, Do(DamageRatio(0.9f)) }, { ItemID.StormTigerStaff, Do(AutoReuse, DamageExact(49), UseExact(20)) }, // Desert Tiger Staff { ItemID.StylistKilLaKillScissorsIWish, Do(AutoReuse, UseTurn, DamageExact(18)) }, // Stylish Scissors { ItemID.Swordfish, Do(AutoReuse, TrueMelee, DamageExact(24)) }, @@ -221,7 +221,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(106)) }, + { 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 diff --git a/Items/PermanentBoosters/MiracleFruit.cs b/Items/PermanentBoosters/MiracleFruit.cs index 4b6d640f7a..7ff881db9a 100644 --- a/Items/PermanentBoosters/MiracleFruit.cs +++ b/Items/PermanentBoosters/MiracleFruit.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Items.PermanentBoosters AddIngredient(ItemID.LifeFruit, 5). AddIngredient(5). AddIngredient(5). - AddIngredient(10). + AddIngredient(12). AddTile(TileID.MythrilAnvil). Register(); } 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/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/Furniture/DevPaintings/ThankYouPainting.cs b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs index ab2b6a4fb7..6b86d860fd 100644 --- a/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs +++ b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs @@ -66,6 +66,7 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "Atalya", "Ben-TK", "Cei", + "CongratsIsTrash", "Cooper", "CrabBar", "Done", @@ -91,7 +92,6 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "Shayy", "Spider Prov", "StipulateVenus", - "Sylvium", "Tomat", "Triangle", "Uberransy", @@ -182,6 +182,7 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "spooktacular", "Spoopyro", "Svante", + "Sylvium", "Teragat", "Terry N. Muse", "ThousandFields", 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/AstralInjection.cs b/Items/Potions/AstralInjection.cs index 27826b6014..fd3aed69f5 100644 --- a/Items/Potions/AstralInjection.cs +++ b/Items/Potions/AstralInjection.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Potions } if (player.statLife <= 0) { - player.KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AstralInjection").Format(player.name)), 1000.0, 0, false); + player.KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AstralInjection" + Main.rand.Next(1, 2 + 1)).Format(player.name)), 1000.0, 0, false); } } 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/VanillaArmorChanges/IronArmorSetChange.cs b/Items/VanillaArmorChanges/IronArmorSetChange.cs index 3bf3a7a576..a5af707c1c 100644 --- a/Items/VanillaArmorChanges/IronArmorSetChange.cs +++ b/Items/VanillaArmorChanges/IronArmorSetChange.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.VanillaArmorChanges public override void UpdateSetBonusText(ref string setBonusText) { StringBuilder sb = new StringBuilder(256); - sb.Append("\nIncreases damage reduction by 6%\n+2 life regen"); + sb.Append("\nIncreases damage reduction by 6%\n+1 HP/s life regen"); setBonusText += sb.ToString(); } diff --git a/Items/VanillaArmorChanges/LeadArmorSetChange.cs b/Items/VanillaArmorChanges/LeadArmorSetChange.cs index 5683e3af9d..0f35ce35f1 100644 --- a/Items/VanillaArmorChanges/LeadArmorSetChange.cs +++ b/Items/VanillaArmorChanges/LeadArmorSetChange.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.VanillaArmorChanges public override void UpdateSetBonusText(ref string setBonusText) { StringBuilder sb = new StringBuilder(256); - sb.Append("\nIncreases damage reduction by 3%\n+1 life regen\nGrants immunity to knockback"); + sb.Append("\nIncreases damage reduction by 3%\n+0.5 HP/s life regen\nGrants immunity to knockback"); setBonusText += sb.ToString(); } diff --git a/Items/VanillaArmorChanges/PlatinumArmorSetChange.cs b/Items/VanillaArmorChanges/PlatinumArmorSetChange.cs index 19b239eb06..bdfc2e50d1 100644 --- a/Items/VanillaArmorChanges/PlatinumArmorSetChange.cs +++ b/Items/VanillaArmorChanges/PlatinumArmorSetChange.cs @@ -18,9 +18,10 @@ namespace CalamityMod.Items.VanillaArmorChanges public const float HeadDamage = 0.06f; public const float ChestCrit = 5f; public const float LegsMoveSpeed = 0.1f; - public const float SetBonusLifeRegenPerDefense = 0.0666667f; // 15 defense = +1 life regen - public const float SetBonusCritPerDefense = 0.0666667f; // 15 defense = +1% crit chance - public const int SetBonusDefenseCap = 45; + public const float SetBonusLifeRegenPerDefense = 0.1f; // 10 defense = +1 life regen + 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; public override void ApplyHeadPieceEffect(Player player) => player.GetDamage() += HeadDamage; @@ -31,7 +32,7 @@ namespace CalamityMod.Items.VanillaArmorChanges public override void UpdateSetBonusText(ref string setBonusText) { StringBuilder sb = new StringBuilder(256); - sb.Append("\nEvery 15 defense gives you +1 life regen and 1% increased critical strike chance\nThese effects both cap at 45 defense"); + sb.Append("\nEvery 10 defense gives you +0.5 HP/s life regen, 1% increased damage and 1% increased critical strike chance\nThese effects cap at 40 defense"); setBonusText += sb.ToString(); } @@ -41,6 +42,7 @@ namespace CalamityMod.Items.VanillaArmorChanges if (defense > SetBonusDefenseCap) defense = SetBonusDefenseCap; player.lifeRegen += (int)(defense * SetBonusLifeRegenPerDefense); + player.GetDamage() += defense * SetBonusDamagePerDefense; player.GetCritChance() += defense * SetBonusCritPerDefense; } } diff --git a/Items/VanillaArmorChanges/SilverArmorSetChange.cs b/Items/VanillaArmorChanges/SilverArmorSetChange.cs index e7fa03d65f..c9e6246e0f 100644 --- a/Items/VanillaArmorChanges/SilverArmorSetChange.cs +++ b/Items/VanillaArmorChanges/SilverArmorSetChange.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.VanillaArmorChanges public override void UpdateSetBonusText(ref string setBonusText) { StringBuilder sb = new StringBuilder(256); - sb.Append("\n+1 life regen\nTwo seconds after getting hit for 20 or more damage, you heal for 10\nGetting hit again resets the timer, delaying the heal"); + sb.Append("\n+0.5 HP/s life regen\nTwo seconds after getting hit for 20 or more damage, you heal for 10\nGetting hit again resets the timer, delaying the heal"); setBonusText += sb.ToString(); } diff --git a/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs b/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs index f25fbec3e2..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 = 1378; + 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; @@ -40,19 +40,20 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.rare = ModContent.RarityType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 14f; + Item.shootSpeed = 11f; Item.DamageType = RogueDamageClass.Instance; modItem.UsesCharge = true; modItem.MaxCharge = 250f; - modItem.ChargePerUse = 0.2f; + modItem.ChargePerUse = 0.25f; } + public override float StealthDamageMultiplier => 0.9f; + public override float StealthVelocityMultiplier => 1.2f; + public override float StealthKnockbackMultiplier => 1.5f; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.Calamity().StealthStrikeAvailable()) - damage = (int)(damage * 1.05); - int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); if (proj.WithinBounds(Main.maxProjectiles)) Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); diff --git a/Items/Weapons/DraedonsArsenal/PulseRifle.cs b/Items/Weapons/DraedonsArsenal/PulseRifle.cs index e4afc89dbc..d2684920b4 100644 --- a/Items/Weapons/DraedonsArsenal/PulseRifle.cs +++ b/Items/Weapons/DraedonsArsenal/PulseRifle.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/PulseRifleFire"); - private int BaseDamage = 1280; + private int BaseDamage = 1200; public override void SetDefaults() { diff --git a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs index 4085c57b49..7d171cf708 100644 --- a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs +++ b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs @@ -1,10 +1,10 @@ -using CalamityMod.CustomRecipes; +using System; +using System.Collections.Generic; +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Rarities; using Microsoft.Xna.Framework; -using System; -using System.Collections.Generic; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -15,12 +15,16 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public class SnakeEyes : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; + + public static float EnemyDistanceDetection = 2000f; + public static float TimeToShoot = 30f; + public static float ProjectileSpeed = 40f; + public static float TimeToRedirect = 15f; + public static float TimeToRestart = 45f; + public override void SetDefaults() { - CalamityGlobalItem modItem = Item.Calamity(); - - Item.shootSpeed = 10f; - Item.damage = 65; + Item.damage = 200; Item.mana = 12; Item.width = 38; Item.height = 24; @@ -35,9 +39,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.UseSound = SoundID.Item15; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; + CalamityGlobalItem modItem = Item.Calamity(); modItem.UsesCharge = true; modItem.MaxCharge = 190f; modItem.ChargePerUse = 1f; @@ -46,10 +50,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int watcher = Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(watcher)) - Main.projectile[watcher].originalDamage = Item.damage; - + Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI); return false; } 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/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 index 834013be0a..5715458b8d 100644 --- a/Items/Weapons/Magic/CarnageRay.cs +++ b/Items/Weapons/Magic/CarnageRay.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Item.type] = true; } public override void SetDefaults() @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 24; Item.DamageType = DamageClass.Magic; Item.mana = 10; - Item.width = 46; + Item.width = 44; Item.height = 46; Item.useTime = 20; Item.useAnimation = 20; diff --git a/Items/Weapons/Magic/CarnageRay.png b/Items/Weapons/Magic/CarnageRay.png index a158f1ae28..774767edc3 100644 Binary files a/Items/Weapons/Magic/CarnageRay.png and b/Items/Weapons/Magic/CarnageRay.png differ 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/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/GruesomeEminence.cs b/Items/Weapons/Magic/GruesomeEminence.cs index b71835a0fd..928015d4d8 100644 --- a/Items/Weapons/Magic/GruesomeEminence.cs +++ b/Items/Weapons/Magic/GruesomeEminence.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() { - Item.damage = 888; + Item.damage = 666; Item.DamageType = DamageClass.Magic; Item.noUseGraphic = true; Item.channel = true; 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/NightsRay.cs b/Items/Weapons/Magic/NightsRay.cs index 6bc2641140..0fb6594049 100644 --- a/Items/Weapons/Magic/NightsRay.cs +++ b/Items/Weapons/Magic/NightsRay.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Item.type] = true; } public override void SetDefaults() @@ -20,8 +20,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 24; Item.DamageType = DamageClass.Magic; Item.mana = 10; - Item.width = 50; - Item.height = 50; + Item.width = 58; + Item.height = 54; Item.useTime = 20; Item.useAnimation = 20; Item.useStyle = ItemUseStyleID.Shoot; @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Magic Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 6f; } - public override void AddRecipes() { diff --git a/Items/Weapons/Magic/NightsRay.png b/Items/Weapons/Magic/NightsRay.png index 39da37b60d..ce0d6dcdad 100644 Binary files a/Items/Weapons/Magic/NightsRay.png and b/Items/Weapons/Magic/NightsRay.png differ 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/Poseidon.cs b/Items/Weapons/Magic/Poseidon.cs index 434ca31c28..d8f8451f9a 100644 --- a/Items/Weapons/Magic/Poseidon.cs +++ b/Items/Weapons/Magic/Poseidon.cs @@ -12,13 +12,13 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() { - Item.damage = 62; + Item.damage = 52; Item.DamageType = DamageClass.Magic; Item.mana = 12; Item.width = 28; Item.height = 32; - Item.useTime = 45; - Item.useAnimation = 45; + Item.useTime = 49; + Item.useAnimation = 49; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 6f; @@ -27,13 +27,12 @@ namespace CalamityMod.Items.Weapons.Magic Item.rare = ItemRarityID.Pink; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 20f; + Item.shootSpeed = 18f; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { int typhoon = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 0f); - Main.projectile[typhoon].penetrate = Main.rand.Next(4,11); return false; } } 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/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/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 33b2a5bbfd..e8f91b17a0 100644 --- a/Items/Weapons/Magic/SubsumingVortex.cs +++ b/Items/Weapons/Magic/SubsumingVortex.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Magic public const float ReleaseSpeed = 33f; - public const float ReleaseDamageFactor = 4.35f; + public const float ReleaseDamageFactor = 4.65f; public static readonly SoundStyle ExplosionSound = new("CalamityMod/Sounds/Custom/SubsumingVortexExplosion"); @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - Item.damage = 533; + Item.damage = 483; Item.DamageType = DamageClass.Magic; Item.useTime = Item.useAnimation = 20; Item.shootSpeed = 7f; diff --git a/Items/Weapons/Magic/TerraRay.cs b/Items/Weapons/Magic/TerraRay.cs index 1487295159..3101d05973 100644 --- a/Items/Weapons/Magic/TerraRay.cs +++ b/Items/Weapons/Magic/TerraRay.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - Item.damage = 50; + Item.damage = 60; Item.DamageType = DamageClass.Magic; Item.mana = 10; Item.width = 54; 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/VoidVortex.cs b/Items/Weapons/Magic/VoidVortex.cs index fdc6183b87..db4a6bd179 100644 --- a/Items/Weapons/Magic/VoidVortex.cs +++ b/Items/Weapons/Magic/VoidVortex.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic public class VoidVortex : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; - public const int OrbFireRate = 16; + public const int OrbFireRate = 20; public override void SetStaticDefaults() { @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - Item.damage = 112; + Item.damage = 106; Item.DamageType = DamageClass.Magic; Item.mana = 60; Item.width = 130; 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/DeathsAscension.cs b/Items/Weapons/Melee/DeathsAscension.cs index c548194692..cef1352042 100644 --- a/Items/Weapons/Melee/DeathsAscension.cs +++ b/Items/Weapons/Melee/DeathsAscension.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.damage = 1200; Item.knockBack = 9f; - Item.useTime = Item.useAnimation = 18; + Item.useTime = Item.useAnimation = 24; Item.DamageType = DamageClass.Melee; Item.noMelee = true; Item.channel = true; @@ -80,11 +80,11 @@ namespace CalamityMod.Items.Weapons.Melee int spreadfactor = 9; if (player.altFunctionUse == 2f) { - for (int index = 0; index < 5; ++index) + for (int index = 0; index < 4; ++index) { float SpeedX = velocity.X + Main.rand.NextFloat(-spreadfactor, spreadfactor + 1); float SpeedY = velocity.Y + Main.rand.NextFloat(-spreadfactor, spreadfactor + 1); - Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, (int)(damage * 0.15f), knockback, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, (int)(damage * 0.125f), knockback, player.whoAmI, 0f, 0f); } } else 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/ElementalShiv.cs b/Items/Weapons/Melee/ElementalShiv.cs index ca8df0a385..6ed09153d6 100644 --- a/Items/Weapons/Melee/ElementalShiv.cs +++ b/Items/Weapons/Melee/ElementalShiv.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Items.Weapons.Melee { Item.useStyle = ItemUseStyleID.Rapier; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 10; - Item.useTime = 10; + Item.useAnimation = 13; + Item.useTime = 13; Item.width = 44; Item.height = 44; Item.damage = 190; diff --git a/Items/Weapons/Melee/EmpyreanKnives.cs b/Items/Weapons/Melee/EmpyreanKnives.cs index e6a600fb90..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 = 198; + 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/Nadir.cs b/Items/Weapons/Melee/Nadir.cs index 09736a0e7d..cdd08c10b9 100644 --- a/Items/Weapons/Melee/Nadir.cs +++ b/Items/Weapons/Melee/Nadir.cs @@ -36,8 +36,8 @@ namespace CalamityMod.Items.Weapons.Melee Item.useStyle = ItemUseStyleID.Shoot; Item.UseSound = SoundID.Item1; - Item.value = CalamityGlobalItem.Rarity14BuyPrice; - Item.rare = ModContent.RarityType(); + Item.value = CalamityGlobalItem.Rarity15BuyPrice; + Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Melee/PrismaticBreaker.cs b/Items/Weapons/Melee/PrismaticBreaker.cs index fbc69b1a7a..43a1e1404d 100644 --- a/Items/Weapons/Melee/PrismaticBreaker.cs +++ b/Items/Weapons/Melee/PrismaticBreaker.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - Item.damage = 662; + Item.damage = 699; Item.useStyle = ItemUseStyleID.Swing; Item.useTime = Item.useAnimation = 13; Item.useTurn = true; @@ -84,7 +84,7 @@ namespace CalamityMod.Items.Weapons.Melee } else { - Projectile.NewProjectile(source, position.X, position.Y, velocity.X * 0.5f, velocity.Y * 0.5f, type, damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, position.X, position.Y, velocity.X * 0.5f, velocity.Y * 0.5f, type, (int)(damage * 1.1f), knockback, player.whoAmI); } return false; } diff --git a/Items/Weapons/Melee/SeekingScorcher.cs b/Items/Weapons/Melee/SeekingScorcher.cs index da30a835ad..9de2ff5f31 100644 --- a/Items/Weapons/Melee/SeekingScorcher.cs +++ b/Items/Weapons/Melee/SeekingScorcher.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.width = 60; - Item.damage = 177; + Item.damage = 232; Item.noMelee = true; Item.noUseGraphic = true; Item.autoReuse = 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/AngelicShotgun.cs b/Items/Weapons/Ranged/AngelicShotgun.cs index 0b92dcfb1a..a8914c159f 100644 --- a/Items/Weapons/Ranged/AngelicShotgun.cs +++ b/Items/Weapons/Ranged/AngelicShotgun.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Items.Weapons.Ranged Item.noMelee = true; Item.autoReuse = true; - Item.width = 44; - Item.height = 7; + Item.width = 86; + Item.height = 38; Item.useTime = 24; Item.useAnimation = 24; diff --git a/Items/Weapons/Ranged/AngelicShotgun.png b/Items/Weapons/Ranged/AngelicShotgun.png index 89731867c7..76155f3ca1 100644 Binary files a/Items/Weapons/Ranged/AngelicShotgun.png and b/Items/Weapons/Ranged/AngelicShotgun.png differ diff --git a/Items/Weapons/Ranged/ArterialAssault.cs b/Items/Weapons/Ranged/ArterialAssault.cs index c7284e7030..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.Items.Materials; +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; } @@ -97,4 +93,4 @@ namespace CalamityMod.Items.Weapons.Ranged Register(); } } -} +} \ No newline at end of file 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/BlossomFlux.cs b/Items/Weapons/Ranged/BlossomFlux.cs index 5ce6e69dcb..08bf441c83 100644 --- a/Items/Weapons/Ranged/BlossomFlux.cs +++ b/Items/Weapons/Ranged/BlossomFlux.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 20; + Item.damage = 14; Item.DamageType = DamageClass.Ranged; Item.width = 38; Item.height = 68; 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/DodusHandcannon.cs b/Items/Weapons/Ranged/DodusHandcannon.cs index 98aae42a20..103e91d86f 100644 --- a/Items/Weapons/Ranged/DodusHandcannon.cs +++ b/Items/Weapons/Ranged/DodusHandcannon.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 62; Item.height = 34; - Item.damage = 857; + Item.damage = 1020; Item.DamageType = DamageClass.Ranged; Item.useTime = 30; Item.useAnimation = 30; diff --git a/Items/Weapons/Ranged/DragonsBreath.cs b/Items/Weapons/Ranged/DragonsBreath.cs index d412ddaefb..7998f6fe0d 100644 --- a/Items/Weapons/Ranged/DragonsBreath.cs +++ b/Items/Weapons/Ranged/DragonsBreath.cs @@ -26,11 +26,10 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 130; + Item.damage = 162; Item.DamageType = DamageClass.Ranged; Item.width = 124; Item.height = 78; - Item.useTime = 9; Item.useAnimation = 18; Item.reuseDelay = BetweenShotsPause; diff --git a/Items/Weapons/Ranged/ElementalBlaster.cs b/Items/Weapons/Ranged/ElementalBlaster.cs index 8265d0d556..fab5898e68 100644 --- a/Items/Weapons/Ranged/ElementalBlaster.cs +++ b/Items/Weapons/Ranged/ElementalBlaster.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 55; + Item.damage = 67; Item.DamageType = DamageClass.Ranged; Item.width = 104; Item.height = 42; 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/FlarewingBow.cs b/Items/Weapons/Ranged/FlarewingBow.cs index 9e88e86d1b..5cde932d3d 100644 --- a/Items/Weapons/Ranged/FlarewingBow.cs +++ b/Items/Weapons/Ranged/FlarewingBow.cs @@ -13,12 +13,12 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 17; + Item.damage = 31; Item.DamageType = DamageClass.Ranged; Item.width = 40; Item.height = 72; - Item.useTime = 30; - Item.useAnimation = 30; + Item.useTime = 41; + Item.useAnimation = 41; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 1.5f; @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.UseSound = SoundID.Item5; Item.autoReuse = true; Item.shoot = ProjectileID.WoodenArrowFriendly; - Item.shootSpeed = 16f; + Item.shootSpeed = 18f; Item.useAmmo = AmmoID.Arrow; Item.Calamity().canFirePointBlankShots = true; } @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); float num117 = 0.314159274f; - int num118 = 4; + int num118 = 3; Vector2 vector7 = velocity; vector7.Normalize(); vector7 *= 50f; @@ -70,7 +70,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(5). AddIngredient(ItemID.LivingFireBlock, 50). AddIngredient(ItemID.Obsidian, 10). - AddTile(TileID.MythrilAnvil). + AddTile(TileID.Anvils). Register(); } } diff --git a/Items/Weapons/Ranged/HeavenlyGale.cs b/Items/Weapons/Ranged/HeavenlyGale.cs index c1675b64ba..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 = 300; + Item.damage = 215; Item.DamageType = DamageClass.Ranged; Item.width = 138; Item.height = 176; @@ -76,4 +76,4 @@ namespace CalamityMod.Items.Weapons.Ranged Register(); } } -} \ No newline at end of file +} 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/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/Monsoon.cs b/Items/Weapons/Ranged/Monsoon.cs index 1c4d7c7388..66559fea56 100644 --- a/Items/Weapons/Ranged/Monsoon.cs +++ b/Items/Weapons/Ranged/Monsoon.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 121; + Item.damage = 152; Item.DamageType = DamageClass.Ranged; Item.width = 46; Item.height = 78; diff --git a/Items/Weapons/Ranged/OnyxChainBlaster.cs b/Items/Weapons/Ranged/OnyxChainBlaster.cs index 21f3abf073..e155ee4dd2 100644 --- a/Items/Weapons/Ranged/OnyxChainBlaster.cs +++ b/Items/Weapons/Ranged/OnyxChainBlaster.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 40; + Item.damage = 51; Item.DamageType = DamageClass.Ranged; Item.width = 64; Item.height = 32; 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/PlagueTaintedSMG.cs b/Items/Weapons/Ranged/PlagueTaintedSMG.cs index 86bb183c37..dfaacfcded 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(), player.Calamity().alchFlask ? (int)(damage * 0.65f) : damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, barrelPosition, velocity.RotatedBy(Spread * (i + 1)), ModContent.ProjectileType(), player.Calamity().alchFlask ? (int)(damage * 0.65f) : damage, knockback, player.whoAmI); } } else 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/Starmageddon.cs b/Items/Weapons/Ranged/Starmageddon.cs index 07cf6bbe9a..d27be3cc48 100644 --- a/Items/Weapons/Ranged/Starmageddon.cs +++ b/Items/Weapons/Ranged/Starmageddon.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 90; + Item.damage = 100; Item.knockBack = 4f; Item.shootSpeed = 16f; Item.useStyle = ItemUseStyleID.Shoot; @@ -55,11 +55,8 @@ namespace CalamityMod.Items.Weapons.Ranged { CreateRecipe(). AddIngredient(). - AddIngredient(). AddIngredient(). - AddIngredient(). AddIngredient(5). - AddIngredient(10). AddIngredient(10). AddIngredient(15). AddTile(ModContent.TileType()). diff --git a/Items/Weapons/Ranged/TerraFlameburster.cs b/Items/Weapons/Ranged/TerraFlameburster.cs index 977c3893db..301887cddb 100644 --- a/Items/Weapons/Ranged/TerraFlameburster.cs +++ b/Items/Weapons/Ranged/TerraFlameburster.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Ranged CreateRecipe(). AddIngredient(ItemID.Flamethrower). AddIngredient(). - AddIngredient(7). + AddIngredient(12). AddIngredient(5). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Weapons/Ranged/TheHive.cs b/Items/Weapons/Ranged/TheHive.cs index ff0d2344a8..1816264b40 100644 --- a/Items/Weapons/Ranged/TheHive.cs +++ b/Items/Weapons/Ranged/TheHive.cs @@ -12,12 +12,12 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 80; + Item.damage = 60; Item.DamageType = DamageClass.Ranged; Item.width = 62; Item.height = 30; - Item.useTime = 21; - Item.useAnimation = 21; + Item.useTime = 34; + Item.useAnimation = 34; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 3.5f; 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 9955908404..200e977b24 100644 --- a/Items/Weapons/Rogue/EclipsesFall.cs +++ b/Items/Weapons/Rogue/EclipsesFall.cs @@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Rogue; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -14,16 +15,17 @@ namespace CalamityMod.Items.Weapons.Rogue { public override void SetDefaults() { - Item.damage = 564; + 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; Item.shoot = ModContent.ProjectileType(); Item.useStyle = ItemUseStyleID.Swing; - Item.width = Item.height = 72; + Item.width = 82; + Item.height = 88; Item.noMelee = true; Item.noUseGraphic = true; Item.UseSound = SoundID.Item1; @@ -42,6 +44,8 @@ namespace CalamityMod.Items.Weapons.Rogue return false; } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) => Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request(Texture + "Glow").Value); + public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Rogue/EclipsesFall.png b/Items/Weapons/Rogue/EclipsesFall.png index 358cd43775..2bd8a0a67c 100644 Binary files a/Items/Weapons/Rogue/EclipsesFall.png and b/Items/Weapons/Rogue/EclipsesFall.png differ diff --git a/Items/Weapons/Rogue/EclipsesFallGlow.png b/Items/Weapons/Rogue/EclipsesFallGlow.png new file mode 100644 index 0000000000..f0cd455dd5 Binary files /dev/null and b/Items/Weapons/Rogue/EclipsesFallGlow.png differ diff --git a/Items/Weapons/Rogue/Eradicator.cs b/Items/Weapons/Rogue/Eradicator.cs index 3a90a57e57..2283706320 100644 --- a/Items/Weapons/Rogue/Eradicator.cs +++ b/Items/Weapons/Rogue/Eradicator.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 62; Item.height = 58; - Item.damage = 563; + Item.damage = 620; Item.noMelee = true; Item.noUseGraphic = true; Item.autoReuse = true; @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override float StealthDamageMultiplier => 0.5f; + public override float StealthDamageMultiplier => 0.75f; 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/ExecutionersBlade.cs b/Items/Weapons/Rogue/ExecutionersBlade.cs index 3ace052a76..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 = 188; + Item.damage = 195; Item.noMelee = true; Item.noUseGraphic = true; Item.useTime = 3; @@ -41,19 +41,15 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/Rogue/ExecutionersBladeGlow").Value); } - public override bool AdditionalStealthCheck() => counter == 0; + public override float StealthDamageMultiplier => 0.6f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - bool usingStealth = player.Calamity().StealthStrikeAvailable() && counter == 0; + bool usingStealth = player.Calamity().StealthStrikeAvailable(); int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); if (usingStealth && stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; - - counter++; - if (counter >= Item.useAnimation / Item.useTime) - counter = 0; return false; } 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/Kylie.cs b/Items/Weapons/Rogue/Kylie.cs index e5f90f149f..8c373f21d4 100644 --- a/Items/Weapons/Rogue/Kylie.cs +++ b/Items/Weapons/Rogue/Kylie.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items.Weapons.Rogue Item.rare = ItemRarityID.Orange; Item.useTime = 25; Item.useAnimation = 25; - Item.width = 32; - Item.height = 46; + Item.width = 34; + Item.height = 50; Item.useStyle = ItemUseStyleID.Swing; Item.UseSound = SoundID.Item1; Item.shootSpeed = Speed; diff --git a/Items/Weapons/Rogue/Kylie.png b/Items/Weapons/Rogue/Kylie.png index f29f779e13..aa9b40e8c4 100644 Binary files a/Items/Weapons/Rogue/Kylie.png and b/Items/Weapons/Rogue/Kylie.png differ 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/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/Prismalline.cs b/Items/Weapons/Rogue/Prismalline.cs index 7eb87cb0a8..a5a8a8f6e7 100644 --- a/Items/Weapons/Rogue/Prismalline.cs +++ b/Items/Weapons/Rogue/Prismalline.cs @@ -13,7 +13,8 @@ namespace CalamityMod.Items.Weapons.Rogue { public override void SetDefaults() { - Item.width = 46; + Item.width = 54; + Item.height = 54; Item.damage = 36; Item.noMelee = true; Item.noUseGraphic = true; @@ -22,7 +23,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.knockBack = 5f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; - Item.height = 46; Item.value = CalamityGlobalItem.Rarity5BuyPrice; Item.rare = ItemRarityID.Pink; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Rogue/Prismalline.png b/Items/Weapons/Rogue/Prismalline.png index ebc98156a4..00e9231d34 100644 Binary files a/Items/Weapons/Rogue/Prismalline.png and b/Items/Weapons/Rogue/Prismalline.png differ diff --git a/Items/Weapons/Rogue/RadiantStar.cs b/Items/Weapons/Rogue/RadiantStar.cs index 980671fdb9..5f914b488f 100644 --- a/Items/Weapons/Rogue/RadiantStar.cs +++ b/Items/Weapons/Rogue/RadiantStar.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Items.Weapons.Rogue { public override void SetDefaults() { - Item.width = 52; - Item.height = 48; + Item.width = 54; + Item.height = 54; Item.damage = 55; //33 Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Rogue/RadiantStar.png b/Items/Weapons/Rogue/RadiantStar.png index e29e6807b2..d1e248a2f9 100644 Binary files a/Items/Weapons/Rogue/RadiantStar.png and b/Items/Weapons/Rogue/RadiantStar.png 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/ShatteredSun.cs b/Items/Weapons/Rogue/ShatteredSun.cs index 828daa95e9..30d63e01e2 100644 --- a/Items/Weapons/Rogue/ShatteredSun.cs +++ b/Items/Weapons/Rogue/ShatteredSun.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Items.Weapons.Rogue { public override void SetDefaults() { - Item.width = 56; - Item.height = 56; + Item.width = 66; + Item.height = 66; Item.damage = 80; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Rogue/ShatteredSun.png b/Items/Weapons/Rogue/ShatteredSun.png index 00d3d3be2b..41127a7353 100644 Binary files a/Items/Weapons/Rogue/ShatteredSun.png and b/Items/Weapons/Rogue/ShatteredSun.png differ 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..37480ed23e 100644 --- a/Items/Weapons/Rogue/TheOldReaper.cs +++ b/Items/Weapons/Rogue/TheOldReaper.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetDefaults() { Item.width = 106; - Item.damage = 122; + Item.damage = 143; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 22; @@ -32,14 +32,14 @@ namespace CalamityMod.Items.Weapons.Rogue Item.rare = ModContent.RarityType(); } - public override float StealthDamageMultiplier => 0.4f; + public override float StealthDamageMultiplier => 0.66f; 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); 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 index 4d53e483aa..0636ef149b 100644 --- a/Items/Weapons/Summon/BloodClotStaff.cs +++ b/Items/Weapons/Summon/BloodClotStaff.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public override void SetDefaults() { - Item.damage = 7; + Item.damage = 9; Item.mana = 10; Item.width = 58; Item.height = 64; diff --git a/Items/Weapons/Summon/DankStaff.cs b/Items/Weapons/Summon/DankStaff.cs index c1062c2e63..e56b5e9522 100644 --- a/Items/Weapons/Summon/DankStaff.cs +++ b/Items/Weapons/Summon/DankStaff.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public override void SetDefaults() { - Item.damage = 7; + Item.damage = 9; Item.mana = 10; Item.width = 58; Item.height = 58; 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/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/PolypLauncher.cs b/Items/Weapons/Summon/PolypLauncher.cs index 89b86bfa9a..1bd8d0065b 100644 --- a/Items/Weapons/Summon/PolypLauncher.cs +++ b/Items/Weapons/Summon/PolypLauncher.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Items.Weapons.Summon { Item.damage = 12; Item.mana = 10; - Item.width = 32; - Item.height = 54; + Item.width = 26; + Item.height = 56; Item.useTime = Item.useAnimation = 35; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; diff --git a/Items/Weapons/Summon/PolypLauncher.png b/Items/Weapons/Summon/PolypLauncher.png index 40f07bf8d0..87d623daa5 100644 Binary files a/Items/Weapons/Summon/PolypLauncher.png and b/Items/Weapons/Summon/PolypLauncher.png differ 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/StormjawStaff.cs b/Items/Weapons/Summon/StormjawStaff.cs index 28e74b34be..f32049a30c 100644 --- a/Items/Weapons/Summon/StormjawStaff.cs +++ b/Items/Weapons/Summon/StormjawStaff.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public override void SetDefaults() { - Item.damage = 8; + Item.damage = 11; Item.mana = 10; Item.width = 32; Item.height = 32; 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/Items/Weapons/Summon/VileFeeder.cs b/Items/Weapons/Summon/VileFeeder.cs index 8bbeba057f..c42b8e20d1 100644 --- a/Items/Weapons/Summon/VileFeeder.cs +++ b/Items/Weapons/Summon/VileFeeder.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Summon public class VileFeeder : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; - public static int BaseDamage = 9; + public static int BaseDamage = 14; public override void SetDefaults() { diff --git a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson index 7625ecc8f7..b7e743dc52 100644 --- a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson +++ b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson @@ -107,7 +107,7 @@ PestilentSlime: The virus hunts for any openings within one’s body to reprogra PlaguebringerMiniboss: Nothing can escape the Plague; everything is either assimilated or culled. Such is the case of queen bees. While strong enough to stave off plagued creatures, they are often forced to abandon their hives due to their subjects becoming infected. This leaves their larvae to be overtaken by nanites, and soon after, a plaguebringer is born. PlagueCharger: Spawn of the plaguebringers, these were born already taken by Draedon’s nanomachines. Nanites ensure they reach adulthood in a matter of hours by supercharging their aging process, even if this means their lifespan can be counted in days. Yet, this is exactly what makes them the perfect dispensable soldiers. Plagueshell: A turtle’s shell and nervous system are intertwined, making giant tortoises ideal targets for the Plague. Whatever pain is caused by the process of drilling into their shells is rapidly anesthetized, putting the tortoises under control without a single protest. -Viruling: Unlike derplings, who use their proboscis to drain the blood of other creatures, virulings use theirs by using it to inject the plague directly into their victims. Aside from the plaguebringers themselves, no creature is nearly as efficient at contaminating the local wildlife. +Viruling: Unlike derplings, who use their proboscis to drain the blood of other creatures, virulings use theirs to inject the plague directly into their victims. Aside from the plaguebringers themselves, no creature is nearly as efficient at contaminating the local wildlife. //Sulphur Sea Enemies AnthozoanCrab: Though disguised as simple rocks, they are capable of hurling entire boulders at creatures with ease, and will retreat swiftly if approached. Elsewhere, a creature such as this would thrive due to its might; yet in such a hostile environment as this, this much is required merely to survive. AquaticUrchin: Closely related to sea urchins, aquatic urchins have been forced to adapt to the acidic water and radioactive waste. Normally their venomous spikes would normally deter predators, but in the environment it lives in, a painful meal is still a meal. Nothing in this sea can afford to be a picky eater. @@ -141,7 +141,7 @@ DarkEnergy: - DesertNuisance: Though these serpents are of the Desert Scourge’s species, they are notably younger and less developed. Choosing to hunt in a pack with the large scourge due to this weakness, many have seen them tear apart prey not unlike the piranhas that once populated the former sea. CosmicGuardian: Though of the same species as the nameless serpent, their minds and functions are far more basic. They possess very little will of their own and blindly follow the orders of their gluttonous master. HiveTumor: This tumor acts as the brain of the putrid wasteland, being all that is left of the minds of the slain gods that lay there. The creatures of the Corruption exist to protect it, and those who attempt to harm it rarely live to tell the tale. -AquaticAberration: ASpawn of the immense Leviathan, their lifespan can be measured in hours. All they know is how to hunt for their masters. Even non-aquatic life is well within their reach, due to their uncanny ability to fly through air just as easily as swimming through water. +AquaticAberration: A spawn of the immense Leviathan, their lifespan can be measured in hours. All they know is how to hunt for their masters. Even non-aquatic life is well within their reach, due to their uncanny ability to fly through air just as easily as swimming through water. LeviathanStart: A lure created by the Water Elemental, Anahita. It sings so sweetly, its voice full of promise and warmth, but beware: follow the siren’s call at your own peril. PerforatorCyst: This twitching and convulsing pile of gore acts as the heart of the Perforator Hive, harvesting what small amount of diluted Ichor flowing through the Crimson is left and feeding it to the Hive. Little else is known about it, for those who dare to disturb it have become indistinguishable from the landscape. CosmicLantern: These lanterns possess a magical, distorted flame that radiates no heat whatsoever. If one looks closely into their fire, they may see another world entirely. diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 772c052271..c6c7386e63 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: { @@ -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 10%, damage reduction increased by 7% + 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 1ca6891517..e15c05bcc1 100644 --- a/Localization/en-US/Mods.CalamityMod.Configs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Configs.hjson @@ -71,7 +71,6 @@ CalamityConfig: { ''' Gives the player a very weak dash by default that requires no equipment or items to use. This dash will be replaced by any other available dash, including those from other mods. - Calamity is balanced around this setting being enabled. ''' } @@ -231,7 +230,7 @@ CalamityConfig: { Label: "[i:GemLockTopaz] Lock Meter Positions" Tooltip: ''' - Prevents clicking on the Calamity's various Meters on the screen. + Prevents clicking on Calamity's various Meters on the screen. This stops them from being dragged around with the mouse. ''' } 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..085932e823 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson @@ -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' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 5cd7eda970..e6a6ec0227 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -74,7 +74,7 @@ Affliction: { DisplayName: Affliction Tooltip: ''' - Gives you and all other players on your team +1 life regen, + Gives you and all other players on your team +0.5 HP/s life regen, +10% max life, 7% damage reduction, 13 defense and 10% increased damage ''' } @@ -115,9 +115,12 @@ AmbrosialAmpoule: { DisplayName: Ambrosial Ampoule Tooltip: ''' - You emit light - 5% increased damage reduction and increased life regen - Grants immunity to the Frozen, Chilled, Frostburn, Cursed Inferno and Burning Blood debuffs + +70 max life + Grants +2 to +6 HP/s life regen based on missing health + Provides life regeneration equivalent to standing in Honey + Standing still grants extremely powerful regen + Halves how long you are afflicted with fire and sickness debuffs + You emit yellow light if visibility is enabled ''' } @@ -152,7 +155,7 @@ AngelicAlliance: { Call upon the force of heaven to empower your attacks and minions Courage, Enlightenment, Bliss. United in Judgement +2 max minions, 15% increased summon damage, and 8% increased damage to all other classes - Life regeneration is boosted while jumping + +2 HP/s life regen while airborne using wings Press [KEY] to grace yourself in divinity for 15 seconds While under the effects of Divine Bless, for every minion you have, an archangel shall be summoned to aid you in combat Each spawned angel will instantly heal you for two health @@ -218,7 +221,7 @@ AsgardianAegis: { ''' Grants immunity to knockback Immune to most debuffs - +40 max life and increased life regeneration + +40 max life and +0.5 HP/s life regen Grants a cosmic inferno dash which can slam through enemies without taking damage Can be used to ram enemies +20 defense while submerged in liquid @@ -237,17 +240,6 @@ AsgardsValor: { ''' } -AstralArcanum: { - DisplayName: Astral Arcanum - Tooltip: - ''' - Provides immunity to the astral infection debuff - Boosts life regen even while under the effects of a damaging debuff - While under the effects of a damaging debuff you will gain 15 defense - Press [KEY] to toggle teleportation UI while no bosses are alive - ''' -} - BadgeofBravery: { DisplayName: Badge of Bravery Tooltip: @@ -316,8 +308,9 @@ BloomStone: { DisplayName: Bloom Stone Tooltip: ''' - You quickly regenerate life while on the ground - This effect works best during daytime + Grants between +1 HP/s and +3 HP/s life regen depending on time of day + Accelerates life regen based on time of day + 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 @@ -347,16 +340,6 @@ Calamity: { ''' } -CelestialJewel: { - DisplayName: Celestial Jewel - Tooltip: - ''' - Boosts life regen even while under the effects of a damaging debuff - While under the effects of a damaging debuff you will gain 11 defense - Press [KEY] to teleport to a random location while no bosses are alive - ''' -} - ChaosStone: { DisplayName: Chaos Stone Tooltip: @@ -431,7 +414,7 @@ Baroclaw: { Tooltip: ''' 10% increased damage - Enemies that hit you take high damage and are inflicted with Armor Crunch and Crush Depth for a long time + Enemies that hit you take high damage and are inflicted with Armor Crunch and Crush Depth ''' } @@ -448,8 +431,9 @@ CrownJewel: { DisplayName: Crown Jewel Tooltip: ''' - Boosts life regen even while under the effects of a damaging debuff - While under the effects of a damaging debuff you will gain 8 defense + +1 HP/s life regen + You gain an additional +1.5 HP/s life regen while afflicted with any debuff + Massively boosts natural life regen while afflicted with any debuff ''' } @@ -480,8 +464,8 @@ DaawnlightSpiritOrigin: { ''' } -DarkGodsSheath: { - DisplayName: Dark God's Sheath +DarkMatterSheath: { + DisplayName: Dark Matter Sheath Tooltip: ''' +10 maximum stealth @@ -496,11 +480,11 @@ DarkSunRing: { Tooltip: ''' 12% increase to damage - +1 life regen and +2 max minions + +0.5 HP/s life regen and +2 max minions Increased minion knockback - During the day the player has +4 life regen - During the night the player has +20 defense - During an eclipse the player has +2 life regen and +10 defense + During the day, grants +2 HP/s life regen + During the night, grants +20 defense + During an eclipse, grants +1 HP/s life regen and +10 defense 'Contains the power of the dark sun' ''' } @@ -528,7 +512,8 @@ DeificAmulet: { Tooltip: ''' Causes stars to fall and grants increased immune time when damaged - Provides life regeneration and reduces the cooldown of healing potions + +0.5 HP/s life regen + Reduces the cooldown of healing potions ''' } @@ -781,7 +766,7 @@ FungalSymbiote: { Tooltip: ''' You grow mushrooms on the grass beneath you - Consuming mushrooms provides the Mushy buff, increasing defense by 6 and life regen by 2 + 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 ''' } @@ -832,14 +817,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 ''' @@ -861,7 +846,7 @@ GrandGelatin: { 10% 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 provides increased life regen for all players inside for 8 seconds + The aura grants +2.5 HP/s life regen for all players inside for 8 seconds ''' } @@ -934,10 +919,10 @@ HoneyDew: { DisplayName: Honey Dew Tooltip: ''' - 5% increased damage reduction, +9 defense and increased life regen while in the Jungle - Poison and Venom immunity - Honey-like life regen with no speed penalty - Most bee/hornet enemies and projectiles do 75% damage to you + +30 max life + Provides life regeneration equivalent to standing in Honey + Standing still in Honey grants extremely powerful regen + Halves how long you are afflicted with sickness debuffs ''' } @@ -950,6 +935,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: @@ -1001,7 +1000,7 @@ LifeJelly: { Tooltip: ''' Using a healing potion will spawn a lingering aura - The aura provides increased life regen for all players inside for 5 seconds + The aura grants +2 HP/s life regen for all players inside for 5 seconds ''' } @@ -1009,8 +1008,10 @@ LivingDew: { DisplayName: Living Dew Tooltip: ''' - 5% increased damage reduction, +5 defense, and increased life regen while in the Jungle - Immunity to Poison + +50 max life + Provides life regeneration equivalent to standing in Honey + Standing still in Honey grants extremely powerful regen + Halves how long you are afflicted with fire and sickness debuffs ''' } @@ -1019,7 +1020,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 ''' @@ -1048,7 +1049,7 @@ ManaPolarizer: { Tooltip: ''' Increases max mana by 50 and magic damage by 6% - Life regen lowered by 3 if mana is above 50% of its maximum + -1.5 HP/s life regen if mana is above 50% of its maximum Grants spectre healing, the amount healed scales with your mana The healing only works while holding a magic weapon The more mana you have, the more you heal @@ -1220,8 +1221,8 @@ PermafrostsConcoction: { Tooltip: ''' Increases maximum mana by 50 and reduces mana cost by 15% - Increases life regen as life decreases - Increases life regen when afflicted with any fire debuff + +0.5 HP/s life regen below half health, +1 HP/s when below 25% health and +2 HP/s when below 10% health + +3 HP/s life regen while afflicted with any fire debuff You will survive fatal damage and revive with 30% life on a 3 minute cooldown You are encased in an ice barrier for 3 seconds when revived ''' @@ -1264,10 +1265,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 ''' } @@ -1298,20 +1303,43 @@ 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' ''' } RadiantOoze: { DisplayName: Radiant Ooze - Tooltip: You emit light and regen life more quickly + Tooltip: + ''' + Grants +2 to +6 HP/s life regen based on missing health + You emit yellow light if visibility is enabled + ''' } RaidersTalisman: { @@ -1328,7 +1356,7 @@ RampartofDeities: { Tooltip: ''' Causes stars to fall and gives increased immune time when damaged - Provides life regeneration and reduces the cooldown of healing potions + +0.5 HP/s life regen and reduces the cooldown of healing potions Absorbs 15% of damage done to players on your team This effect is only active above 25% life Grants immunity to knockback @@ -1350,7 +1378,7 @@ Regenator: { DisplayName: Regenator Tooltip: ''' - Greatly improves life regeneration + +6 HP/s life regen and massively accelerated natural life regen However, your health cannot exceed 50% of its maximum ''' } @@ -1420,7 +1448,7 @@ SandCloak: { Tooltip: ''' 5% increased movement speed - Press [KEY] to consume 10% of your maximum stealth to create a protective dust veil which provides +6 defense and +2 life regen + Press [KEY] to consume 10% of your maximum stealth to create a protective dust veil which provides +6 defense and +1 HP/s life regen This effect has a 30 second cooldown before it can be used again ''' } @@ -1449,7 +1477,7 @@ ShatteredCommunity: { ''' 'Ruined by unknowable hatred, it still contains (most of) the power of The Community...' Increases damage by 10% and critical strike chance by 5% - Increases max health by 10%, damage reduction by 5%, defense by 10 and life regen by 2 + Increases max health by 10%, damage reduction by 5%, defense by 10, and life regen by 1 HP/s Increases movement speed by 10% and flight time by 20% [RAGEDESC] Taking damage gives rage, this effect is not hindered by your defensive stats @@ -1466,6 +1494,7 @@ ShatteredCommunity: { When Rage is maxed, press {0} for a temporary damage boost ''' RageModified: You generate rage over time and rage does not fade out of combat + LevelUpText: The Community cracks... } ShieldoftheHighRuler: { @@ -1487,7 +1516,7 @@ ShieldoftheOcean: { Tooltip: ''' Increased defense by 5 when submerged in liquid - Increases movement speed and life regen while wearing the Victide armor + 10% increased movement speed and +1 HP/s life regen while wearing Victide armor ''' } @@ -1702,10 +1731,10 @@ TheAbsorber: { Tooltip: ''' 10% increased movement and jump speed - Enemies take immense damage when they touch you and are afflicted with a debuff that reduces damage reduction significantly + 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 - The aura provides greatly increased life regen, damage, and damage reduction for all players inside for 15 seconds + The aura grants +3 HP/s life regen, +8% damage, and +5% damage reduction for all players inside for 10 seconds 5% of the damage from enemy attacks is absorbed and converted into healing ''' } @@ -1760,7 +1789,7 @@ TheCommunity: { ''' Increases damage by {0}% and critical strike chance by {1}% Increases max health by {2}%, damage reduction by {3}%, and defense by {4} - Increases life regen by {5} while under damage over time effects + +{5} HP/s life regen while suffering from damage over time debuffs Increases movement speed by {6}% and flight time by {7}% Become more powerful as you defeat bosses ({8}% Power) ''' @@ -1773,7 +1802,7 @@ TheEvolution: { You reflect projectiles when they hit you Reflected projectiles deal no damage to you This reflect has a 90 second cooldown which is shared with all other dodges and reflects - If this effect triggers you get a health regeneration boost for 5 seconds + After reflecting something, grants +1 HP/s life regen and accelerated life regen for 5 seconds If the same enemy projectile type hits you again you will resist its damage by 15% ''' } @@ -1793,7 +1822,7 @@ TheSponge: { ''' 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 starts recharging 6 seconds after being hit + 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 The barrier's color will change to match your team selection as needed @@ -1826,7 +1855,7 @@ TrinketofChi: { Tooltip: ''' Provides 10% damage reduction after not being hit for 15 seconds, this is removed when you are hit - Provides 2 life regen for you and everyone on your team + +1 HP/s life regen for you and everyone on your team ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson index 5c1780a4f0..7066cfd499 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson @@ -172,7 +172,7 @@ FathomSwarmerBreastplate: { ''' 6% increased damage reduction 6% increased summon damage - Boosted defense and regen increased while submerged in liquid + Increases defense by 10 and grants +2.5 HP/s life regen while submerged in liquid Reduces defense loss within the Abyss ''' } @@ -488,11 +488,11 @@ ReaverHeadTank: { ''' 15% increased damage reduction but 30% decreased damage +50 max life - Passively regenerates one health point every second + Restores 1 HP every second, this applies separately from life regen ''' SetBonus: ''' - +10 defense and +3 life regen + +10 defense and +1.5 HP/s life regen Enemies are more likely to target you Reduces the life regen lost from damage over time debuffs by 20% All attacks have a small chance to steal life and speed up the rate of life regen diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson index 2fb71fc5aa..bbf839d654 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson @@ -82,7 +82,7 @@ BloodflareBodyArmor: { ''' CommonSetBonus: ''' - Greatly increases life regen + Greatly increased life regen, equivalent to Crimson armor Enemies below 50% life drop a heart when struck This effect has a 5 second cooldown ''' @@ -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 @@ -152,7 +152,7 @@ BloodflareHeadSummon: { 50% increased summon damage and +3 max minions Summons polterghast mines to circle you At 90% life and above you gain 10% increased summon damage - At 50% life and below you gain 20 defense and 2 life regen + At 50% life and below you gain 20 defense and +1 HP/s life regen ''' } @@ -163,7 +163,7 @@ DemonshadeBreastplate: { 25% increased melee speed, 15% increased damage and critical strike chance Enemies take ungodly damage when they touch you Increased max life and mana by 200 - Standing still lets you absorb the shadows and boost your life regen + Standing still absorbs shadows to grant exponentially accelerating life regen ''' } @@ -233,7 +233,7 @@ FearmongerGreathelm: { 20% increased summon damage and +2 max minions Minions no longer deal less damage while wielding non-summoner weapons Immunity to all forms of frost and flame - All minion attacks grant colossal life regeneration + Minion attacks grant +3.5 HP/s life regen and massively accelerate life regen 15% increased damage reduction during the Pumpkin and Frost Moons This extra damage reduction ignores the soft cap ''' @@ -288,11 +288,11 @@ GemTechHeadgear: { GreenGemInfo: "[i:Emerald] The green gem provides increased ranged stats and causes flechettes to fly swiftly towards targets when they are damaged by a ranged projectile" BlueGemInfo: "[i:Sapphire] The blue gem grants {0} extra maximum minions, increased summon damage, and negates the summon damage penalty while wielding non-summoner weapons" PurpleGemInfo: "[i:Amethyst] The violet gem grants {0} extra maximum mana, increased magic stats, and makes mana rapidly regenerate when holding a non-magic weapon" - PinkGemInfo: "[i:Diamond] The pink base gem grants {0} extra defense, extra damage reduction, increased movement speed, jump speed, and +{1} life regen" + PinkGemInfo: "[i:Diamond] The pink base gem grants {0} extra defense, extra damage reduction, increased movement speed, jump speed, and +{1} HP/s life regen" GemBonusInfo: ''' - When all gems exist simultaneously, hitting a target with any weapon grants you +{0} life regen for {1} seconds - This is increased to +{2} life regen if a weapon of another class is used during that {1} second period for {3} seconds + When all gems exist simultaneously, hitting a target with any weapon grants you +{0} HP/s life regen for {1} seconds + This is increased to +{2} HP/s life regen if a weapon of another class is used during that {1} second period for {3} seconds ''' } @@ -332,7 +332,6 @@ GodSlayerHeadMelee: { Enemies are more likely to target you Taking over 80 damage in one hit will cause you to release a swarm of high-damage god killer darts Enemies take a lot of damage when they hit you - An attack that would deal 80 damage or less will have its damage reduced to 1 ''' } @@ -492,7 +491,7 @@ TarragonBreastplate: { Tooltip: ''' 10% increased damage and 5% increased critical strike chance - +2 life regen and +40 max life + +1 HP/s life regen and +40 max life ''' CommonSetBonus: ''' @@ -555,8 +554,8 @@ TarragonHeadRogue: { SetBonus: ''' +115 maximum stealth - After every 25 rogue critical hits you will gain 3 seconds of damage immunity - This effect can only occur once every 30 seconds + After every 50 rogue critical hits you will gain 2.5 seconds of damage immunity + This effect has a cooldown of 25 seconds While under the effects of a debuff you gain 10% increased rogue damage ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson index c27cf40941..547aa65183 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson @@ -238,7 +238,7 @@ VictideGreaves: { VictideHeadMagic: { DisplayName: Victide Hermit Helmet Tooltip: 5% increased magic damage - SetBonus: +3 life regen and 10% increased magic damage while submerged in liquid + SetBonus: +1.5 HP/s life regen and 10% increased magic damage while submerged in liquid } VictideHeadMelee: { @@ -247,14 +247,14 @@ VictideHeadMelee: { SetBonus: ''' Enemies are more likely to target you - +3 life regen and 10% increased melee damage while submerged in liquid + +1.5 HP/s life regen and 10% increased melee damage while submerged in liquid ''' } VictideHeadRanged: { DisplayName: Victide Coral Turban Tooltip: 5% increased ranged damage - SetBonus: +3 life regen and 10% increased ranged damage while submerged in liquid + SetBonus: +1.5 HP/s life regen and 10% increased ranged damage while submerged in liquid } VictideHeadRogue: { @@ -263,7 +263,7 @@ VictideHeadRogue: { SetBonus: ''' +60 maximum stealth - +3 life regen and 10% increased rogue damage while submerged in liquid + +1.5 HP/s life regen and 10% increased rogue damage while submerged in liquid ''' } @@ -274,7 +274,7 @@ VictideHeadSummon: { ''' +1 max minion Summons a sea snail to protect you - +3 life regen and 10% increased summon damage while submerged in liquid + +1.5 HP/s life regen and 10% increased summon damage while submerged in liquid ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index d2815713ef..b2d1ae885a 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -932,7 +932,7 @@ BrimstoneElementalRelic: { CalamitasCloneRelic: { DisplayName: Calamitas Clone Relic - Tooltip: A glimpse into what could have been... + Tooltip: "" } CalamitasRelic: { @@ -957,7 +957,7 @@ CragmawMireRelic: { CryogenRelic: { DisplayName: Cryogen Relic - Tooltip: A glimpse into what could have been... + Tooltip: "" } DesertScourgeRelic: { @@ -977,7 +977,7 @@ DraedonRelic: { DragonfollyRelic: { DisplayName: Dragonfolly Relic - Tooltip: A glimpse into what could have been... + Tooltip: "" } GiantClamRelic: { @@ -3930,70 +3930,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 a7d0e850c6..68e9863f99 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson @@ -85,7 +85,7 @@ DeathWhistle: { ''' Summons the Ravager Not consumable - A very old temple whistle + A whistle soaked in blood ''' } @@ -125,7 +125,7 @@ ExoticPheromones: { Summons The Dragonfolly when used in the Jungle Enrages outside the Jungle Not consumable - Specifically formulated to attract draconic hybrids + Specifically formulated to attract draconic offshoots ''' } @@ -137,7 +137,6 @@ EyeofDesolation: { Summons the Calamitas Clone when used during nighttime[GFB] Enrages during the day Not consumable - 'Tonight is going to be a horrific night...' ''' GFBInfo: Creates a square arena of blocks, with you at its center } @@ -235,12 +234,12 @@ RuneofKos: { DisplayName: Rune of Kos Tooltip: ''' - Contains the power hunted relentlessly by the sentinels of the cosmic devourer + An ornate sigil of the Profaned Flame + Hatred yet burns upon its brow [SPAWN] Not consumable - A relic of the profaned flame ''' - SpawnInfo: When used in certain areas of the world, it will unleash them + SpawnInfo: Such power attracts otherworldly beings SpawnVoid: ''' Summons the Ceaseless Void diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson index 879b58bb79..2330fb0490 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson @@ -164,7 +164,9 @@ SnakeEyes: { DisplayName: Snake Eyes Tooltip: ''' - Summons a mechanical surveillance drone that flies around enemies and mercilessly zaps them with electricity + Summons a levitating drone which fires piercing, highly calibrated energy bolts + If a bolt hits, the drone will teleport into its path and reflect the bolt + Reflected bolts home in and explode on impact [c/1FFBFF:'Equipped with high-end sensors, little can evade them. Even less are able to escape their ever watchful eyes.] [c/1FFBFF:An excellent bridge between my experiments with the sight-based soul powered machines and my latest project.'] ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index bec04ebf2d..9b7399e9de 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -733,7 +733,8 @@ SubsumingVortex: { Press to release a barrage of vortices that race towards enemies Press to cast a gigantic vortex in front of you with a bias towards the mouse When enemies are near the vortex, it sends multiple fast-moving smaller vortices towards them - After enough time has passed the vortex stops shooting, and releasing fires the vortex towards the mouse + Releasing fires the vortex towards the mouse if enough time has passed + Damage scales based on how long the vortex was held out ''' } 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 b1ec787467..6df6b23b5e 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -62,7 +62,7 @@ Arbalest: { DisplayName: Arbalest Tooltip: ''' - Fires a volley of 10 high-speed arrows + Fires a volley of 6 high-speed arrows Arrows start off small and grow in size with continuous fire Arrow damage, spread and knockback scale with arrow size ''' @@ -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' ''' } @@ -475,8 +480,8 @@ FlarewingBow: { DisplayName: Flarewing Bow Tooltip: ''' - Shoots a spread of 4 arrows - Wooden arrows are converted into bouncing obsidian bats + Shoots a spread of 3 arrows + Wooden arrows are converted into obsidian bats which home in after piercing once ''' } @@ -518,11 +523,6 @@ Galeforce: { Tooltip: Fires a spread of low-damage feathers } -GodsBellows: { - DisplayName: God's Bellows - Tooltip: 70% chance to save ammo -} - GoldenEagle: { DisplayName: Golden Eagle Tooltip: Fires 5 bullets at once diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index a334f86b58..5410504bb3 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: Deific Thunderbolt - 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 ''' } @@ -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 85e1ad5db0..6b9a868232 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -402,11 +402,6 @@ GlacialEmbrace: { ''' } -GodspawnHelixStaff: { - DisplayName: Godspawn Helix Staff - Tooltip: Summons astral probes to protect you -} - GuidelightofOblivion: { DisplayName: Guidelight of Oblivion Tooltip: @@ -482,6 +477,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 +511,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 +635,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: Sun God 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 +710,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 +792,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 b37414be9f..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 -AstralArcanumUIToggle.DisplayName: Astral Arcanum 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..4ad9c8fda4 100644 --- a/Localization/en-US/Mods.CalamityMod.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Misc.hjson @@ -49,12 +49,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.Projectiles.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson index 0ba4bae953..ca3c5b88d4 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson @@ -45,6 +45,7 @@ UnstableMatter.DisplayName: Unstable Matter VoltageStream.DisplayName: Voltage Stream WavePounderBoom.DisplayName: Explosion WavePounderProjectile.DisplayName: Wave Pounder +SnakeEyesProjectile.DisplayName: Inescapable Bolt // Environmental AcidDrop.DisplayName: Acid BrimstoneGeyser.DisplayName: Smoke diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson index 4a748ebfc7..b308c8119c 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson @@ -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,7 +73,7 @@ DeepSeaDumbbell3.DisplayName: Deep Sea Dumbbell DeepSeaDumbbellWeight.DisplayName: Deep Sea Dumbbell DeepWounderProjectile.DisplayName: Deep Wounder Projectile DeepWounderWater.DisplayName: Water Droplet -DeificThunderboltProj.DisplayName: Deific Thunderbolt +TwistingThunderProj.DisplayName: Deific Thunderbolt DesecratedBubble.DisplayName: Bubble DesecratedWaterProj.DisplayName: Desecrated Water DestructionBolt.DisplayName: Destruction Bolt @@ -91,6 +92,7 @@ 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 ElementalDiskProj.DisplayName: Elemental Disk ElementalDiskSplit.DisplayName: Elemental Disk @@ -170,7 +172,7 @@ LeviathanTooth.DisplayName: Leviathan Tooth LionfishProj.DisplayName: Lionfish LostSoulFriendly.DisplayName: Lost Soul LuminousShard.DisplayName: Stardust Shard -LuminousStrikerProj.DisplayName: Luminous Striker +RealityRuptureLance.DisplayName: Lance of Reality LunarKunaiProj.DisplayName: Kunai LuxorsGiftRogue.DisplayName: Gift MalachiteBolt.DisplayName: Malachite @@ -204,10 +206,8 @@ PanSpark.DisplayName: 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 @@ -323,4 +323,10 @@ WrathwingCinder.DisplayName: Wrathwing Eruption WrathwingFireball.DisplayName: Wrathwing Fireball WrathwingSpear.DisplayName: Wrathwing WulfrumKnifeProj.DisplayName: Knife -WaveSkipperProjectile.DisplayName: Scourge \ No newline at end of file +WaveSkipperProjectile.DisplayName: Scourge +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..9445478803 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson @@ -167,6 +167,7 @@ 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 @@ -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 diff --git a/Localization/en-US/Mods.CalamityMod.Status.Death.hjson b/Localization/en-US/Mods.CalamityMod.Status.Death.hjson index 3add54bf13..00e6c26998 100644 --- a/Localization/en-US/Mods.CalamityMod.Status.Death.hjson +++ b/Localization/en-US/Mods.CalamityMod.Status.Death.hjson @@ -1,5 +1,5 @@ AbyssDrown1: "{0} is food for the Wyrms." -AbyssDrown2: "Oxygen failed to reach {0} from the depths of the Abyss." +AbyssDrown2: Oxygen failed to reach {0} from the depths of the Abyss. AbyssDrown3: "{0} faded away, lost in the dark waters." AlcoholBig1: "{0} downed too many shots." AlcoholBig2: "{0}'s liver failed." @@ -30,7 +30,7 @@ Riptide2: "{0} was ripped apart by the current." Dragonfire1: "{0}'s ashes scatter in the wind." Dragonfire2: "{0}'s embers fade away in a warm glow." Dragonfire3: "{0} can no longer feel the heat of the dragonfire." -Dragonfire4: "This was a fight {0} could not win." +Dragonfire4: This was a fight {0} could not win. GodSlayerInferno1: "{0} imploded into nothingness." GodSlayerInferno2: "{0}'s body slipped into oblivion." GodSlayerInferno3: "{0} ceased being a part of our universe." 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/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index 1f851c1ff2..19302dcd1e 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -7,6 +7,7 @@ using CalamityMod.Events; using CalamityMod.Items; using CalamityMod.Particles; using CalamityMod.Particles.Metaballs; +using CalamityMod.Systems; using CalamityMod.UI; using CalamityMod.UI.CalamitasEnchants; using CalamityMod.UI.DraedonSummoning; @@ -521,6 +522,13 @@ namespace CalamityMod return CalamityWorld.armageddon = enabled; } } + + public static void AddCustomDifficulty(DifficultyMode newMode) + { + //Add the new difficulty and recalculate + DifficultyModeSystem.Difficulties.Add(newMode); + DifficultyModeSystem.CalculateDifficultyData(); + } #endregion #region Rogue Class @@ -849,7 +857,7 @@ namespace CalamityMod case "godslayer_melee": case "godslayer melee": case "god slayer melee": - return mp.godSlayerDamage; // melee helm's unique damage reducing property + return mp.godSlayerDamage; // melee helm case "godslayer_ranged": case "godslayer ranged": case "god slayer ranged": @@ -1264,7 +1272,7 @@ namespace CalamityMod case "godslayer melee": case "god slayer melee": mp.godSlayer = enabled; - mp.godSlayerDamage = enabled; // melee helm's unique damage reducing property + mp.godSlayerDamage = enabled; // melee helm return true; case "godslayer_ranged": case "godslayer ranged": @@ -1702,8 +1710,20 @@ namespace CalamityMod public static bool IsOnPersistentBuffList(int type) => CalamityLists.persistentBuffList.Contains(type); #endregion + #region Venerated Locket Bans + public static bool AddToVeneratedLocketBanlist(int type) + { + if (!CalamityLists.VeneratedLocketBanlist.Contains(type)) + { + CalamityLists.VeneratedLocketBanlist.Add(type); + return true; + } + return false; + } + #endregion + #region Summoner Cross Class Nerf Disabling - public static bool SetSummonerNerfDisabledByMinion(int type, bool disableNerf) + public static bool SetSummonerNerfDisabledByMinion(int type, bool disableNerf) { if (disableNerf && !CalamityLists.DisabledSummonerNerfMinions.Contains(type)) { @@ -1853,6 +1873,16 @@ namespace CalamityMod return new ArgumentException("ERROR: The first argument to \"SetDifficulty\" must be a string."); return SetDifficultyActive(args[1].ToString(), enabled); + + case "AddDifficultyToUI": + if (args.Length < 2) + return new ArgumentException("ERROR: Not enough arguements provided"); + + if (args[1] is not DifficultyMode mode) + return new ArgumentException("ERROR: A class inheriting from 'DifficultyMode' must be provided."); + AddCustomDifficulty(mode); + return null; + case "GetLight": case "GetLightLevel": case "GetLightStrength": @@ -2684,6 +2714,13 @@ namespace CalamityMod DraedonDialogRegistry.DialogOptions.Add(new(inquiry, response, condition)); return null; + case "AddToVeneratedLocketBanlist": + if (args.Length < 2) + return new ArgumentException("ERROR: Not enough arguments!"); + if (args[1] is not int itemType) + return new ArgumentException("ERROR: Must specify a valid item type as an int index of the item."); + return AddToVeneratedLocketBanlist(itemType); + default: return new ArgumentException("ERROR: Invalid method name."); } diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index d366c6ca50..38928fce2a 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -1020,17 +1020,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()); diff --git a/NPCs/Astral/Aries.cs b/NPCs/Astral/Aries.cs index e717aa6412..24b1d3c999 100644 --- a/NPCs/Astral/Aries.cs +++ b/NPCs/Astral/Aries.cs @@ -119,7 +119,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 90, true); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/Astral/AstralProbe.cs b/NPCs/Astral/AstralProbe.cs index 24a1ae49c2..3d86782a3c 100644 --- a/NPCs/Astral/AstralProbe.cs +++ b/NPCs/Astral/AstralProbe.cs @@ -342,7 +342,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 90, true); } } } diff --git a/NPCs/Astral/AstralSlime.cs b/NPCs/Astral/AstralSlime.cs index 68916ddc14..816869d3e4 100644 --- a/NPCs/Astral/AstralSlime.cs +++ b/NPCs/Astral/AstralSlime.cs @@ -86,7 +86,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 90, true); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/Astral/AstralachneaGround.cs b/NPCs/Astral/AstralachneaGround.cs index e4143fb7a5..3cddcb88df 100644 --- a/NPCs/Astral/AstralachneaGround.cs +++ b/NPCs/Astral/AstralachneaGround.cs @@ -178,7 +178,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 90, true); } public static void ModifyAstralachneaLoot(NPCLoot npcLoot) diff --git a/NPCs/Astral/AstralachneaWall.cs b/NPCs/Astral/AstralachneaWall.cs index 467c39ddbb..6d5159ceb8 100644 --- a/NPCs/Astral/AstralachneaWall.cs +++ b/NPCs/Astral/AstralachneaWall.cs @@ -128,7 +128,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 90, true); } public override void ModifyNPCLoot(NPCLoot npcLoot) => AstralachneaGround.ModifyAstralachneaLoot(npcLoot); diff --git a/NPCs/Astral/Atlas.cs b/NPCs/Astral/Atlas.cs index 9eefafa0e5..4024354eed 100644 --- a/NPCs/Astral/Atlas.cs +++ b/NPCs/Astral/Atlas.cs @@ -644,7 +644,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 300, true); + target.AddBuff(ModContent.BuffType(), 180, true); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/Astral/FusionFeeder.cs b/NPCs/Astral/FusionFeeder.cs index b3a7efeaa9..3b67007e74 100644 --- a/NPCs/Astral/FusionFeeder.cs +++ b/NPCs/Astral/FusionFeeder.cs @@ -303,7 +303,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 90, true); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/Astral/Hadarian.cs b/NPCs/Astral/Hadarian.cs index 2cca84a1db..62be4997d1 100644 --- a/NPCs/Astral/Hadarian.cs +++ b/NPCs/Astral/Hadarian.cs @@ -212,7 +212,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 90, true); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/Astral/HiveEnemy.cs b/NPCs/Astral/HiveEnemy.cs index 708edd5708..37b08e38c0 100644 --- a/NPCs/Astral/HiveEnemy.cs +++ b/NPCs/Astral/HiveEnemy.cs @@ -147,7 +147,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 90, true); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/Astral/Hiveling.cs b/NPCs/Astral/Hiveling.cs index 7132d7f064..656c128ac6 100644 --- a/NPCs/Astral/Hiveling.cs +++ b/NPCs/Astral/Hiveling.cs @@ -150,7 +150,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 60, true); + target.AddBuff(ModContent.BuffType(), 30, true); } } } diff --git a/NPCs/Astral/Mantis.cs b/NPCs/Astral/Mantis.cs index 046fe67aca..ded7e0156b 100644 --- a/NPCs/Astral/Mantis.cs +++ b/NPCs/Astral/Mantis.cs @@ -241,7 +241,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 60, true); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/Astral/Nova.cs b/NPCs/Astral/Nova.cs index fbf8eeed46..accc02a682 100644 --- a/NPCs/Astral/Nova.cs +++ b/NPCs/Astral/Nova.cs @@ -310,7 +310,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 60, true); } } } diff --git a/NPCs/Astral/SightseerCollider.cs b/NPCs/Astral/SightseerCollider.cs index b6300acc46..214e809a3c 100644 --- a/NPCs/Astral/SightseerCollider.cs +++ b/NPCs/Astral/SightseerCollider.cs @@ -148,7 +148,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 60, true); + target.AddBuff(ModContent.BuffType(), 30, true); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/Astral/SightseerSpitter.cs b/NPCs/Astral/SightseerSpitter.cs index 9c77cf919c..a5cd3af56c 100644 --- a/NPCs/Astral/SightseerSpitter.cs +++ b/NPCs/Astral/SightseerSpitter.cs @@ -177,7 +177,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 60, true); } public override void ModifyNPCLoot(NPCLoot npcLoot) @@ -273,7 +273,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 60, true); } private void DoKillDust() diff --git a/NPCs/Astral/StellarCulex.cs b/NPCs/Astral/StellarCulex.cs index 8802844f40..2f4a71e5ec 100644 --- a/NPCs/Astral/StellarCulex.cs +++ b/NPCs/Astral/StellarCulex.cs @@ -126,7 +126,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 60, true); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index 9e7f96fa6c..3e9dd36ad8 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -534,7 +534,7 @@ namespace CalamityMod.NPCs.AstrumAureus public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 480, true); + target.AddBuff(ModContent.BuffType(), 240, true); } } } diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index 44aca36db1..81fc716020 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -380,7 +380,7 @@ namespace CalamityMod.NPCs.AstrumAureus public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { int debuffType = Main.zenithWorld ? ModContent.BuffType() : ModContent.BuffType(); - target.AddBuff(debuffType, (int)(180 * NPC.scale), true); + target.AddBuff(debuffType, (int)(90 * NPC.scale), true); } } } diff --git a/NPCs/AstrumDeus/AstrumDeusBody.cs b/NPCs/AstrumDeus/AstrumDeusBody.cs index 8b890edceb..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; @@ -215,7 +176,7 @@ namespace CalamityMod.NPCs.AstrumDeus public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 300, true); + target.AddBuff(ModContent.BuffType(), 120, true); } public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index b986ee086d..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)); @@ -367,7 +331,7 @@ namespace CalamityMod.NPCs.AstrumDeus public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 480, true); + target.AddBuff(ModContent.BuffType(), 240, true); } public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) diff --git a/NPCs/AstrumDeus/AstrumDeusTail.cs b/NPCs/AstrumDeus/AstrumDeusTail.cs index 02d213edaa..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; } @@ -196,7 +164,7 @@ namespace CalamityMod.NPCs.AstrumDeus public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 180, true); + target.AddBuff(ModContent.BuffType(), 90, true); } public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 1781f01de3..8b28c7586b 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 @@ -3793,7 +3791,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 @@ -3907,8 +3905,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 +3922,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 @@ -4018,7 +4013,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; @@ -4195,9 +4190,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 +4231,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 +4253,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 +4286,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 +4300,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 18ad726471..bfee8ae12e 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -1014,7 +1014,7 @@ namespace CalamityMod.NPCs //Absorber Affliction if (absorberAffliction > 0) { - int baseAbsorberDoTValue = (int)(260 * sicknessDamageMult); + int baseAbsorberDoTValue = (int)(400 * sicknessDamageMult); ApplyDPSDebuff(baseAbsorberDoTValue, baseAbsorberDoTValue / 65, ref npc.lifeRegen, ref damage); } @@ -2690,7 +2690,7 @@ namespace CalamityMod.NPCs if (marked > 0) calcDR *= 0.5f; if (absorberAffliction > 0) - calcDR *= 0.7f; + calcDR *= 0.8f; if (npc.betsysCurse) calcDR *= 0.66f; if (npc.Calamity().kamiFlu > 0) @@ -3858,6 +3858,10 @@ namespace CalamityMod.NPCs // Nothing should be immune to Enraged. npc.buffImmune[BuffType()] = false; + + // Town npcs should NOT be immune to shimmer + if (npc.townNPC && NPCID.Sets.ShimmerTownTransform[npc.type]) + npc.buffImmune[BuffID.Shimmer] = false; // Extra Notes: // Shellfish minions set debuff immunity to Shellfish Claps on enemy hits, so most things are technically not immune. @@ -5774,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) diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 6c9ff6a9ec..db0d27fcf0 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -1131,11 +1131,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/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 926898b098..b0f2f01e1a 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -179,7 +179,7 @@ namespace CalamityMod.NPCs.Leviathan { SoundID.Zombie38, SoundID.Zombie39, - SoundID.Zombie49 + SoundID.Zombie40 }); if (soundDelay > 0) 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/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..cdf7df4b71 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 { @@ -2235,7 +2237,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 +2254,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 +2391,8 @@ namespace CalamityMod.NPCs.Providence ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), @@ -2373,7 +2406,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/TownNPCs/AndroombaFriendly.cs b/NPCs/TownNPCs/AndroombaFriendly.cs index 521dabc60e..386817f6b0 100644 --- a/NPCs/TownNPCs/AndroombaFriendly.cs +++ b/NPCs/TownNPCs/AndroombaFriendly.cs @@ -25,6 +25,7 @@ namespace CalamityMod.NPCs.TownNPCs value.Position.Y += 16; value.PortraitPositionYOverride = 36f; NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; + NPCID.Sets.ShimmerTownTransform[Type] = false; } public override void SetDefaults() diff --git a/NPCs/TownNPCs/DILF.cs b/NPCs/TownNPCs/DILF.cs index f44d41bad4..8f117c660f 100644 --- a/NPCs/TownNPCs/DILF.cs +++ b/NPCs/TownNPCs/DILF.cs @@ -33,6 +33,7 @@ namespace CalamityMod.NPCs.TownNPCs NPCID.Sets.AttackType[NPC.type] = 0; NPCID.Sets.AttackTime[NPC.type] = 90; NPCID.Sets.AttackAverageChance[NPC.type] = 30; + NPCID.Sets.ShimmerTownTransform[Type] = false; NPC.Happiness .SetBiomeAffection(AffectionLevel.Like) .SetBiomeAffection(AffectionLevel.Dislike) diff --git a/NPCs/TownNPCs/FAP.cs b/NPCs/TownNPCs/FAP.cs index b6afb97cb6..565dde9f1a 100644 --- a/NPCs/TownNPCs/FAP.cs +++ b/NPCs/TownNPCs/FAP.cs @@ -33,6 +33,7 @@ namespace CalamityMod.NPCs.TownNPCs NPCID.Sets.AttackType[NPC.type] = 0; NPCID.Sets.AttackTime[NPC.type] = 60; NPCID.Sets.AttackAverageChance[NPC.type] = 15; + NPCID.Sets.ShimmerTownTransform[Type] = false; NPC.Happiness .SetBiomeAffection(AffectionLevel.Love) .SetBiomeAffection(AffectionLevel.Like) @@ -109,7 +110,7 @@ namespace CalamityMod.NPCs.TownNPCs Player player = Main.player[Main.myPlayer]; if (Main.zenithWorld) { - player.Hurt(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.CirrusSlap").Format(player.name)), player.statLife / 2, -player.direction, false, false, -1, false); + player.Hurt(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.CirrusSlap" + Main.rand.Next(1, 2 + 1)).Format(player.name)), player.statLife / 2, -player.direction, false, false, -1, false); SoundEngine.PlaySound(CnidarianJellyfishOnTheString.SlapSound, player.Center); } @@ -127,7 +128,7 @@ namespace CalamityMod.NPCs.TownNPCs { if (Main.rand.NextBool(4)) { - player.Hurt(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.CirrusSlap").Format(player.name)), player.statLife / 2, -player.direction, false, false, -1, false); ; + player.Hurt(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.CirrusSlap" + Main.rand.Next(1, 2 + 1)).Format(player.name)), player.statLife / 2, -player.direction, false, false, -1, false); ; SoundEngine.PlaySound(CnidarianJellyfishOnTheString.SlapSound, player.Center); return this.GetLocalizedValue("Chat.BloodMoonSlap"); } diff --git a/NPCs/TownNPCs/SEAHOE.cs b/NPCs/TownNPCs/SEAHOE.cs index 67438e545e..879e554643 100644 --- a/NPCs/TownNPCs/SEAHOE.cs +++ b/NPCs/TownNPCs/SEAHOE.cs @@ -32,6 +32,7 @@ namespace CalamityMod.NPCs.TownNPCs NPCID.Sets.AttackTime[NPC.type] = 90; NPCID.Sets.AttackAverageChance[NPC.type] = 30; NPCID.Sets.HatOffsetY[NPC.type] = 16; + NPCID.Sets.ShimmerTownTransform[Type] = false; NPC.Happiness .SetBiomeAffection(AffectionLevel.Like) .SetBiomeAffection(AffectionLevel.Dislike) diff --git a/NPCs/TownNPCs/THIEF.cs b/NPCs/TownNPCs/THIEF.cs index ca945a7c46..2fe6982cf1 100644 --- a/NPCs/TownNPCs/THIEF.cs +++ b/NPCs/TownNPCs/THIEF.cs @@ -31,6 +31,7 @@ namespace CalamityMod.NPCs.TownNPCs NPCID.Sets.AttackType[NPC.type] = 0; NPCID.Sets.AttackTime[NPC.type] = 60; NPCID.Sets.AttackAverageChance[NPC.type] = 10; + NPCID.Sets.ShimmerTownTransform[Type] = false; NPC.Happiness .SetBiomeAffection(AffectionLevel.Like) .SetBiomeAffection(AffectionLevel.Dislike) diff --git a/NPCs/TownNPCs/WITCH.cs b/NPCs/TownNPCs/WITCH.cs index 9f512e328d..3e360bd064 100644 --- a/NPCs/TownNPCs/WITCH.cs +++ b/NPCs/TownNPCs/WITCH.cs @@ -30,6 +30,7 @@ namespace CalamityMod.NPCs.TownNPCs NPCID.Sets.AttackType[NPC.type] = 1; NPCID.Sets.AttackTime[NPC.type] = 30; NPCID.Sets.AttackAverageChance[NPC.type] = 5; + NPCID.Sets.ShimmerTownTransform[Type] = false; NPC.Happiness .SetBiomeAffection(AffectionLevel.Like) .SetBiomeAffection(AffectionLevel.Dislike) 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/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/Boss/AstralFlame.cs b/Projectiles/Boss/AstralFlame.cs index 8d81045993..6ad20b1cf1 100644 --- a/Projectiles/Boss/AstralFlame.cs +++ b/Projectiles/Boss/AstralFlame.cs @@ -150,7 +150,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 90); } public override void Kill(int timeLeft) diff --git a/Projectiles/Boss/AstralGodRay.cs b/Projectiles/Boss/AstralGodRay.cs index 2c62797d28..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; @@ -108,7 +103,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 90); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Boss/AstralLaser.cs b/Projectiles/Boss/AstralLaser.cs index f5eef46192..b14d6a1167 100644 --- a/Projectiles/Boss/AstralLaser.cs +++ b/Projectiles/Boss/AstralLaser.cs @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Boss return; if (Projectile.timeLeft >= 85) - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 60); } } } diff --git a/Projectiles/Boss/AstralShot2.cs b/Projectiles/Boss/AstralShot2.cs index 066e2e7348..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; @@ -77,7 +78,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 60); } public override Color? GetAlpha(Color lightColor) 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/DeusMine.cs b/Projectiles/Boss/DeusMine.cs index 0e31004150..6075957199 100644 --- a/Projectiles/Boss/DeusMine.cs +++ b/Projectiles/Boss/DeusMine.cs @@ -144,7 +144,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || Projectile.timeLeft > MaxTimeLeft - FadeTime || (Projectile.timeLeft < FadeTime && Projectile.ai[0] == 0f)) return; - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 90); } } } 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/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 1da386d36d..eabbb9cf29 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -74,6 +74,9 @@ namespace CalamityMod.Projectiles // If true, this projectile creates impact sparks upon hitting enemies public bool deepcoreBullet = false; + // If true, causes all projectiles fired by this weapon to have homing. Currently used for Arterial Assault. + public bool allProjectilesHome = false; + // Amount of extra updates that are set in SetDefaults. public int defExtraUpdates = -1; @@ -105,6 +108,7 @@ namespace CalamityMod.Projectiles public bool stealthStrike = false; public int stealthStrikeHitCount = 0; public bool extorterBoost = false; + public bool LocketClone = false; // Note: Although this was intended for fishing line colors, I use this as an AI variable a lot because vanilla only has 4 that sometimes are already in use. ~Ben // TODO -- uses of this variable are undocumented and unstable. Remove it from the API surface. @@ -2122,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()) @@ -2487,6 +2494,11 @@ namespace CalamityMod.Projectiles confetti.velocity.Y += Main.rand.Next(-50, 51) * 0.05f; } } + + if (allProjectilesHome) + { + CalamityUtils.HomeInOnNPC(projectile, !projectile.tileCollide, 300f, 12f, 20f); + } } } #endregion diff --git a/Projectiles/CalamityGlobalProjectileTweaks.cs b/Projectiles/CalamityGlobalProjectileTweaks.cs index bc232b8b76..653e141888 100644 --- a/Projectiles/CalamityGlobalProjectileTweaks.cs +++ b/Projectiles/CalamityGlobalProjectileTweaks.cs @@ -129,7 +129,7 @@ namespace CalamityMod.Projectiles { ProjectileID.EnchantedBoomerang, Do(ExtraUpdatesExact(1)) }, { ProjectileID.ExplosiveBullet, standardBulletTweaks }, { ProjectileID.Flamarang, Do(ExtraUpdatesExact(2)) }, - { ProjectileID.Flames, Do(IDStaticIFrames(6), ExtraUpdatesDelta(+1)) }, // Flamethrower + Elf Melter + { ProjectileID.Flames, Do(IDStaticIFrames(10)) }, // Flamethrower + Elf Melter { ProjectileID.FlamingJack, Do(ExtraUpdatesExact(1)) }, { ProjectileID.FlowerPetal, Do(MaxUpdatesExact(4), LocalIFrames(10)) }, // Orichalcum armor { ProjectileID.FlowerPow, Do(ExtraUpdatesExact(1)) }, @@ -145,6 +145,7 @@ namespace CalamityMod.Projectiles { 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 @@ -161,6 +162,7 @@ namespace CalamityMod.Projectiles { ProjectileID.Shroomerang, Do(ExtraUpdatesExact(1)) }, { ProjectileID.StarWrath, Do(NoPiercing) }, { ProjectileID.Sunfury, Do(ExtraUpdatesExact(1)) }, + { ProjectileID.SwordBeam, Do(ExtraUpdatesExact(1)) }, // Beam Sword projectile { ProjectileID.Trimarang, Do(ExtraUpdatesExact(1)) }, { ProjectileID.VenomBullet, standardBulletTweaks }, { ProjectileID.VenomFang, Do(LocalIFrames(10)) }, diff --git a/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs b/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs index cdff65ad8e..9f24c66d94 100644 --- a/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs +++ b/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs @@ -4,6 +4,7 @@ using Terraria; using Terraria.ModLoader; using Terraria.Audio; using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Particles; namespace CalamityMod.Projectiles.DraedonsArsenal { @@ -13,6 +14,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override string Texture => "CalamityMod/Items/Weapons/DraedonsArsenal/PlasmaGrenade"; private static readonly float Gravity = 0.09f; + private float rotate = Main.rand.Next(360); public float Time { @@ -26,27 +28,28 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile.height = 28; Projectile.friendly = true; Projectile.penetrate = 1; - Projectile.timeLeft = 300; + Projectile.timeLeft = 450; Projectile.MaxUpdates = 2; Projectile.DamageType = RogueDamageClass.Instance; } public override void AI() { - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.ToRadians(rotate); Vector2 projectileTop = Projectile.Center + new Vector2(0f, Projectile.height * -0.5f).RotatedBy(Projectile.rotation); if (Time > 10f) Projectile.velocity.Y += Gravity; - if (!Main.dedServ) + if (!Main.dedServ && Main.rand.NextBool()) // 50% chance to spawn smoke { - Dust dust = Dust.NewDustPerfect(projectileTop, 107); - dust.velocity = Projectile.rotation.ToRotationVector2().RotatedByRandom(0.35f) * Main.rand.NextFloat(2f, 4f); - dust.velocity += Projectile.velocity * 0.25f; - dust.scale = Main.rand.NextFloat(0.95f, 1.3f); + Color plasmaLime = Color.Lerp(Color.Lime, Color.LimeGreen, Main.rand.NextFloat(1f)); + Color fadeColor = Color.Lerp(Color.LightGreen, plasmaLime, Main.rand.NextFloat(0.5f,1f)); + Particle plasma = new SmallSmokeParticle(projectileTop, Projectile.oldVelocity*0.7f, Color.LightGreen, fadeColor, Main.rand.NextFloat(0.4f,0.9f), 100f); + GeneralParticleHandler.SpawnParticle(plasma); } Time++; + rotate += 10; } public override void Kill(int timeLeft) diff --git a/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs b/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs new file mode 100644 index 0000000000..ebc322e266 --- /dev/null +++ b/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs @@ -0,0 +1,194 @@ +using System; +using System.IO; +using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class SnakeEyesProjectile : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public Player Owner => Main.player[Projectile.owner]; + public NPC TargetShot => Main.npc[(int)TargetID]; + public NPC Target => Projectile.Center.MinionHoming(SnakeEyes.EnemyDistanceDetection, Owner); + + public ref float MinionID => ref Projectile.ai[0]; + public ref float TargetID => ref Projectile.ai[1]; + public ref float TimerToRedirect => ref Projectile.ai[2]; + + public bool HasHitEnemy = false; + public bool HasRedirected = false; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.MinionShot[Type] = true; + + // While this projectile doesn't have afterimages, it keeps track of old positions for its primitive drawcode. + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + } + + public override void SetDefaults() + { + Projectile.DamageType = DamageClass.Summon; + Projectile.localNPCHitCooldown = 10; + Projectile.width = Projectile.height = 16; + Projectile.timeLeft = 300; + 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(HasHitEnemy); + writer.Write(HasRedirected); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + HasHitEnemy = reader.ReadBoolean(); + HasRedirected = reader.ReadBoolean(); + } + + #endregion + + public override void AI() + { + if (HasHitEnemy && TimerToRedirect < SnakeEyes.TimeToRedirect) + TimerToRedirect++; + + if (TimerToRedirect >= SnakeEyes.TimeToRedirect && !HasRedirected) + { + if (TargetShot is not null && TargetShot.active) + TargetEnemy(TargetShot); + else if (Target is not null) + TargetEnemy(Target); + } + + if (HasRedirected) + { + if (TargetShot is not null && TargetShot.active) + FollowEnemy(TargetShot); + else if (Target is not null) + FollowEnemy(Target); + } + + for (int i = 0; i < 2; i++) + { + Dust trailDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, HasRedirected ? 261 : 226, Scale: HasRedirected ? 2f : .5f); + trailDust.velocity = Vector2.Zero; + trailDust.noGravity = true; + } + } + + #region AI Methods + + private void TargetEnemy(NPC target) + { + Projectile.velocity = Projectile.SafeDirectionTo(target.Center) * SnakeEyes.ProjectileSpeed; + HasRedirected = true; + + SoundEngine.PlaySound(SoundID.Item92 with { Volume = .8f, Pitch = .5f, PitchVariance = .1f }, Projectile.Center); + + Projectile.netUpdate = true; + } + + private void FollowEnemy(NPC target) + { + Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.SafeDirectionTo(target.Center) * SnakeEyes.ProjectileSpeed, .2f); + } + + #endregion + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + HasHitEnemy = true; + + if (HasRedirected && TargetShot == target) + Projectile.Kill(); + } + + public override void Kill(int timeLeft) + { + if (!HasRedirected) + return; + + Projectile.ExpandHitboxBy(300); + Projectile.Damage(); + + for (int i = 0; i < 20; i++) + { + Dust boomDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, 261, Scale: 2f); + boomDust.noGravity = true; + } + + Particle boom = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.White, Vector2.One, 0f, 0.05f, 1f + Main.rand.NextFloat(0.2f), 20); + GeneralParticleHandler.SpawnParticle(boom); + + SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); + } + + #region Shader Trail Methods + + private float PrimitiveWidthFunction(float completionRatio) + { + float arrowheadCutoff = 0.36f; + float width = 39f; + float minHeadWidth = 0.02f; + float maxHeadWidth = width; + if (completionRatio <= arrowheadCutoff) + width = MathHelper.Lerp(minHeadWidth, maxHeadWidth, Utils.GetLerpValue(0f, arrowheadCutoff, completionRatio, true)); + return width; + } + + private Color PrimitiveColorFunction(float completionRatio) + { + float endFadeRatio = 0.41f; + + float completionRatioFactor = 2.7f; + float globalTimeFactor = 5.3f; + float endFadeFactor = 3.2f; + float endFadeTerm = Utils.GetLerpValue(0f, endFadeRatio * 0.5f, completionRatio, true) * endFadeFactor; + float cosArgument = completionRatio * completionRatioFactor - Main.GlobalTimeWrappedHourly * globalTimeFactor + endFadeTerm; + float startingInterpolant = (float)Math.Cos(cosArgument) * 0.5f + 0.5f; + + float colorLerpFactor = 0.6f; + Color startingColor = Color.Lerp(HasRedirected ? Color.White with { A = 50 } : new Color(0, 0, 0, 0), HasRedirected ? Color.White with { A = 100 } : Color.Cyan with { A = 25 }, startingInterpolant * colorLerpFactor); + + return Color.Lerp(startingColor, HasRedirected ? Color.White : Color.DarkCyan with { A = 50 }, MathHelper.SmoothStep(0f, 1f, Utils.GetLerpValue(0f, endFadeRatio, completionRatio, true))); + } + + #endregion + + 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, 0); + + PrimitiveTrail trail = new PrimitiveTrail(PrimitiveWidthFunction, PrimitiveColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); + GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/FabstaffStreak")); + trail.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 92); + + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs index d210a36699..a789a53b17 100644 --- a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs +++ b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs @@ -1,260 +1,256 @@ -using CalamityMod.Buffs.Summon; +using System; +using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.IO; using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.DraedonsArsenal { public class SnakeEyesSummon : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Misc"; - public bool SufferingFromSeparationAnxiety = false; - public Vector2 OldCenter; - public Vector2 Destination; - public float Time + public Player Owner => Main.player[Projectile.owner]; + public CalamityPlayer ModdedOwner => Owner.Calamity(); + public NPC Target => Owner.Center.MinionHoming(SnakeEyes.EnemyDistanceDetection, Owner); + + public enum AIState { - get => Projectile.ai[0]; - set => Projectile.ai[0] = value; + Idle, + Targetting, + Redirecting } + 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 EyeAngle => ref Projectile.localAI[0]; + public ref float EyeOutwardness => ref Projectile.localAI[1]; - public float EyeOutwardness = 1f; - public float EyeRotation = 0f; + public bool HasShot = false; + public bool HasTeleported = false; + public Vector2 RandomPosition; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() { + Projectile.DamageType = DamageClass.Summon; + Projectile.minionSlots = 1f; Projectile.width = Projectile.height = 22; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.minionSlots = 1; - Projectile.timeLeft = 18000; Projectile.penetrate = -1; - Projectile.timeLeft *= 5; + + Projectile.friendly = true; Projectile.minion = true; Projectile.tileCollide = false; - Projectile.DamageType = DamageClass.Summon; - } - - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(SufferingFromSeparationAnxiety); - writer.Write(EyeOutwardness); - writer.Write(EyeRotation); - writer.WriteVector2(OldCenter); - writer.WriteVector2(Destination); - } - public override void ReceiveExtraAI(BinaryReader reader) - { - SufferingFromSeparationAnxiety = reader.ReadBoolean(); - EyeOutwardness = reader.ReadSingle(); - EyeRotation = reader.ReadSingle(); - OldCenter = reader.ReadVector2(); - Destination = reader.ReadVector2(); + Projectile.netImportant = true; } public override void AI() { - Player player = Main.player[Projectile.owner]; - if (Projectile.localAI[0] == 0f) + // Checks if the minion can still exist given the player's circumstance. + CheckMinionExistence(); + + // The properties of the minion's pupil, it looks around the target if there's one and to the mouse if there isn't any. + EyeAngle = Projectile.SafeDirectionTo((Target is not null) ? Target.Center : Main.MouseWorld).ToRotation(); + EyeOutwardness = Utils.Remap(Projectile.Distance((Target is not null) ? Target.Center : Main.MouseWorld), 0f, 300f, 0f, 5f); + + // Random flavor pulse. + if (Main.rand.NextBool(100)) { - Initialize(player); - Projectile.localAI[0] = 1f; + Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.DarkCyan, Vector2.One, 0f, 0.05f, 0.4f + Main.rand.NextFloat(0.2f), 30); + GeneralParticleHandler.SpawnParticle(pulse); } - GrantBuffs(player); - NPC potentialTarget = Projectile.Center.MinionHoming(820f, player); - if (potentialTarget == null || SufferingFromSeparationAnxiety) + + switch (State) { - Projectile.ai[1] = 0f; - if (Projectile.localAI[1] == 1f) + case AIState.Idle: + IdleState(); + break; + case AIState.Targetting: + TargettingState(); + break; + case AIState.Redirecting: + RedirectingState(); + break; + } + } + + #region AI Methods + + private void IdleState() + { + AITimer += .01f; + + // The projectile oscillates in place. + Projectile.velocity.Y -= MathF.Cos(AITimer) / 350f; + + // If the player's far enough from the minion, he'll teleport somewhere around the player. + if (!Projectile.WithinRange(Owner.Center, 400f)) + { + Projectile.Center = Owner.Center + Main.rand.NextVector2Circular(300f, 300f); + DoVFXPulse(); + } + + if (Target is not null) + SwitchAIState(AIState.Targetting); + } + + private void TargettingState() + { + if (Target is not null) + { + // The minion decides a random position around the target. + if (!HasTeleported) { - Time = 0f; - Projectile.localAI[1] = 0f; + RandomPosition = Target.Center + Main.rand.NextVector2CircularEdge(400f, 400f); + Projectile.Center = RandomPosition; + + DoVFXPulse(); + + HasTeleported = true; + Projectile.netUpdate = true; + } + + else + { + // The projectile will stay on that position. + Projectile.Center = RandomPosition; + + // When the delay is over, shoot at the target. + if (!HasShot && AITimer >= SnakeEyes.TimeToShoot) + ShootProjectile(); + + // When the minion has shot, when the projectile redirects towards the target, + // the minion will teleport on that moment on top of the projectile, + // so it looks like the minion deflected his own projectile. + if (HasShot) + { + for (int i = 0; i < Main.maxProjectiles; i++) + { + Projectile proj = Main.projectile[i]; + if (proj is not null && proj.active && proj.type == ModContent.ProjectileType() && proj.owner == Owner.whoAmI && proj.ModProjectile().MinionID == Projectile.whoAmI && proj.ModProjectile().HasRedirected) + { + Projectile.Center = proj.Center; + SwitchAIState(AIState.Redirecting); + } + } + } + + // If the projectile failed to hit it's enemy and therefore couldn't deflect, + // repeat this process. + if (AITimer >= SnakeEyes.TimeToShoot + 120f) + SwitchAIState(AIState.Targetting); + + AITimer++; } - PlayerMovement(player); } else + SwitchAIState(AIState.Idle); + } + + private void ShootProjectile() + { + if (Main.myPlayer == Projectile.owner) { - if (Projectile.localAI[1] == 0f) - { - Time = 0f; - Projectile.localAI[1] = 1f; - } - NPCMovement(potentialTarget); - } - if (!SufferingFromSeparationAnxiety && Projectile.Distance(player.Center) > (potentialTarget is null ? 360f : 1800f)) - { - SufferingFromSeparationAnxiety = true; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, Target, SnakeEyes.ProjectileSpeed), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Owner.whoAmI, Projectile.whoAmI, Target.whoAmI); + + DoVFXPulse(); + + SoundEngine.PlaySound(SoundID.Item91 with { Volume = .8f, Pitch = .5f, PitchVariance = .1f }, Projectile.Center); + + HasShot = true; Projectile.netUpdate = true; } - else if (SufferingFromSeparationAnxiety && Projectile.Distance(player.Center) < (potentialTarget is null ? 10f : 120f)) - { - SufferingFromSeparationAnxiety = false; - Projectile.netUpdate = true; - } - if (!Main.dedServ) - { - GenerateAfterimageDust(); - } - Time++; } - public void Initialize(Player player) + private void RedirectingState() { - Destination = Projectile.Center - Vector2.UnitY * 180f; - for (int i = 0; i < 45; i++) + if (Target is not null) { - float angle = MathHelper.TwoPi / 45f * i; - Vector2 velocity = angle.ToRotationVector2() * 4f; - Dust dust = Dust.NewDustPerfect(Projectile.Center + velocity * 2.75f, 39, velocity); - dust.noGravity = true; + // The projectile will idle on the spot where he "deflected" the projectile to restart the process. + if (AITimer < SnakeEyes.TimeToRestart) + AITimer++; + else + SwitchAIState(AIState.Targetting); } + else + SwitchAIState(AIState.Idle); } - public void GrantBuffs(Player player) + private void SwitchAIState(AIState state) { - bool isCorrectProjectile = Projectile.type == ModContent.ProjectileType(); - player.AddBuff(ModContent.BuffType(), 3600); - if (isCorrectProjectile) - { - if (player.dead) - { - player.Calamity().snakeEyes = false; - } - if (player.Calamity().snakeEyes) - { - Projectile.timeLeft = 2; - } - } - } + State = state; + AITimer = 0f; + HasTeleported = false; + HasShot = false; + RandomPosition = Vector2.Zero; - public void PlayerMovement(Player player) - { Projectile.velocity = Vector2.Zero; - if (!SufferingFromSeparationAnxiety) - { - Projectile.Center = player.Center - Vector2.UnitY * (80f + (float)Math.Sin(Time / 120f * MathHelper.TwoPi) * 30f); - EyeOutwardness = MathHelper.Lerp(EyeOutwardness, 0f, 0.15f); + + DoVFXPulse(state == AIState.Redirecting); + + Projectile.netUpdate = true; + } + + private void CheckMinionExistence() + { + Owner.AddBuff(ModContent.BuffType(), 2); + if (Type != ModContent.ProjectileType()) return; - } - if (Time % 150f == 0f) - { - OldCenter = Projectile.Center; - } - else if (Time % 150f <= 35f) - { - EyeRotation = Projectile.AngleTo(player.Center); - EyeOutwardness = MathHelper.Lerp(EyeOutwardness, 1f, 0.15f); - Projectile.Center = Vector2.SmoothStep(OldCenter, player.Center - Vector2.UnitY * 80f, Utils.GetLerpValue(0f, 35f, Time % 150f)); - } - else - { - Projectile.Center = player.Center - Vector2.UnitY * (80f + (float)Math.Sin((Time % 150f - 35f) / 115f * MathHelper.TwoPi) * 30f); - } - EyeOutwardness = MathHelper.Lerp(EyeOutwardness, 0f, 0.15f); + + if (Owner.dead) + ModdedOwner.snakeEyes = false; + if (ModdedOwner.snakeEyes) + Projectile.timeLeft = 2; } - public void NPCMovement(NPC npc) + private void DoVFXPulse(bool empowered = false) { - Projectile.velocity = Vector2.Zero; - Vector2 offsetMultiplier = Vector2.UnitX; - switch ((int)Projectile.ai[1] % 4) + int dustAmount = 40; + for (int dustIndex = 0; dustIndex < dustAmount; dustIndex++) { - case 0: - offsetMultiplier = new Vector2(-1f, -1f); - break; - case 1: - offsetMultiplier = new Vector2(-1f, 1f); - break; - case 2: - offsetMultiplier = new Vector2(1f, 1f); - break; - case 3: - offsetMultiplier = new Vector2(1f, -1f); - break; - } - if (Time % 20f == 0f) - { - if (Projectile.ai[1] > 0 && Main.myPlayer == Projectile.owner) - { - Vector2 shootPosition = Projectile.Center + Utils.Vector2FromElipse(EyeRotation.ToRotationVector2(), Projectile.Size * 0.5f * EyeOutwardness); - Vector2 shootVelocity = Projectile.SafeDirectionTo(npc.Center, Main.rand.NextVector2Unit()) * 4f; - int laser = Projectile.NewProjectile(Projectile.GetSource_FromThis(), shootPosition, shootVelocity, ProjectileID.UFOLaser, Projectile.damage, Projectile.knockBack, Projectile.owner); - if (laser.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[laser].timeLeft *= 2; - Main.projectile[laser].originalDamage = Projectile.originalDamage; - Main.projectile[laser].tileCollide = false; - Main.projectile[laser].netUpdate = true; - Main.projectile[laser].DamageType = DamageClass.Summon; - } - } - Projectile.ai[1]++; - OldCenter = Projectile.Center; - } - else - { - EyeOutwardness = MathHelper.Lerp(EyeOutwardness, 1f, 0.15f); - EyeRotation = EyeRotation.AngleTowards(Projectile.AngleTo(npc.Center), MathHelper.TwoPi / 20f); - Projectile.Center = Vector2.SmoothStep(OldCenter, npc.Center + (new Vector2(300f) + Projectile.Size * 0.5f) * offsetMultiplier, Time % 20f / 20f); + float angle = MathHelper.TwoPi / dustAmount * dustIndex; + Vector2 velocity = angle.ToRotationVector2() * 9f; + Dust pulseDust = Dust.NewDustPerfect(Projectile.Center, empowered ? 261 : 226, velocity, Scale: empowered ? 2f : .5f); + pulseDust.noGravity = true; } + + Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, empowered ? Color.White : Color.DarkCyan * 1.2f, Vector2.One, 0f, 0.05f, 0.5f + Main.rand.NextFloat(0.2f), 20); + GeneralParticleHandler.SpawnParticle(pulse); } - public void GenerateAfterimageDust() - { - for (int i = 1; i < Projectile.oldPos.Length; i++) - { - if (i == 1) - { - for (int j = 0; j < 14; j++) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center, 261); - dust.position += (j / 14f * MathHelper.TwoPi).ToRotationVector2() * Projectile.Size * 0.5f * 1.3f; - dust.velocity = Vector2.Zero; - dust.scale = 0.6f; - dust.noGravity = true; - } - } - if (Vector2.Distance(Projectile.oldPos[i - 1], Projectile.oldPos[i]) > 3f) - { - for (int j = 0; j < 7; j++) - { - Dust dust = Dust.NewDustPerfect(Projectile.oldPos[i] + Projectile.Size * 0.5f, 261); - dust.position += (j / 7f * MathHelper.TwoPi).ToRotationVector2() * ((Projectile.oldPos.Length - i) * 1.2f + 3f); - dust.velocity = Vector2.Zero; - dust.scale = 0.6f; - dust.noGravity = true; - } - } - } - } + #endregion + + public override void OnSpawn(IEntitySource source) => DoVFXPulse(); public override bool? CanDamage() => false; public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, 0, Color.White, ProjectileID.Sets.TrailCacheLength[Projectile.type]); + 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, 0); + Texture2D eyeTexture = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/SnakeEye").Value; - Vector2 offsetVector = Utils.Vector2FromElipse(EyeRotation.ToRotationVector2(), Projectile.Size * 0.5f * EyeOutwardness); - Main.EntitySpriteDraw(eyeTexture, - Projectile.Center + offsetVector - Main.screenPosition, - null, - Color.White, - 0f, - eyeTexture.Size() * 0.5f, - 1f, - SpriteEffects.None, - 0); + Vector2 eyeDrawPosition = Projectile.Center - Main.screenPosition + EyeAngle.ToRotationVector2() * EyeOutwardness; + Main.EntitySpriteDraw(eyeTexture, eyeDrawPosition, null, Color.White, 0f, eyeTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); + return false; } } diff --git a/Projectiles/Enemy/AstralMeteorProj.cs b/Projectiles/Enemy/AstralMeteorProj.cs index 69f28a0966..e3338f04bb 100644 --- a/Projectiles/Enemy/AstralMeteorProj.cs +++ b/Projectiles/Enemy/AstralMeteorProj.cs @@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Enemy if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 60); } } } diff --git a/Projectiles/Enemy/MantisRing.cs b/Projectiles/Enemy/MantisRing.cs index 26b19c6c81..156aedf1c2 100644 --- a/Projectiles/Enemy/MantisRing.cs +++ b/Projectiles/Enemy/MantisRing.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Enemy if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 60); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Healing/AbsorberAura.cs b/Projectiles/Healing/AbsorberAura.cs index 252941164e..03c29a479c 100644 --- a/Projectiles/Healing/AbsorberAura.cs +++ b/Projectiles/Healing/AbsorberAura.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Typless //Remove the players debuffs and defense damage, but only once per aura if (targetDist < 232f) { - player.AddBuff(ModContent.BuffType(), 900); + player.AddBuff(ModContent.BuffType(), 600); if (cleanseList[playerIndex] == false) { cleanseList[playerIndex] = true; diff --git a/Projectiles/Magic/CoralSpoutHoldout.cs b/Projectiles/Magic/CoralSpoutHoldout.cs index 2c22646cb4..7ad3a1471c 100644 --- a/Projectiles/Magic/CoralSpoutHoldout.cs +++ b/Projectiles/Magic/CoralSpoutHoldout.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Magic Main.EntitySpriteDraw(texture, Owner.MountedCenter - Main.screenPosition, null, Color.White, angle, new Vector2(texture.Width / 2f, texture.Height/2f), 700f, 0, 0); Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); return false; } diff --git a/Projectiles/Magic/EnormousConsumingVortex.cs b/Projectiles/Magic/EnormousConsumingVortex.cs index 3bc586ca57..942699f649 100644 --- a/Projectiles/Magic/EnormousConsumingVortex.cs +++ b/Projectiles/Magic/EnormousConsumingVortex.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Magic // Emit light. Lighting.AddLight(Projectile.Center, Color.White.ToVector3() * 1.3f); - // If the player is no longer able to channel the vortex and it hasn't been released yet, release it. + // If the player has channeled the vortex for long enough and it hasn't been released yet, release it. if ((!Owner.Calamity().mouseRight || Owner.noItems || Owner.CCed) && !HasBeenReleased) { if (Time >= SubsumingVortex.LargeVortexChargeupTime) @@ -78,6 +78,16 @@ namespace CalamityMod.Projectiles.Magic Projectile.netUpdate = true; } } + else if (Time >= SubsumingVortex.VortexShootDelay) + { + if (Main.myPlayer == Projectile.owner) + { + Projectile.velocity = Projectile.SafeDirectionTo(Main.MouseWorld) * SubsumingVortex.ReleaseSpeed; + Projectile.damage = (int)(Projectile.damage * (1f + Time * 0.0152f)); + HasBeenReleased = true; + Projectile.netUpdate = true; + } + } else Projectile.Kill(); return; @@ -102,9 +112,9 @@ namespace CalamityMod.Projectiles.Magic GeneralParticleHandler.SpawnParticle(exoEnergy); } - // Fire vortices at nearby target if not fully charged yet. + // Fire vortices at nearby target if not fully charged and has not been released yet. NPC potentialTarget = Projectile.Center.ClosestNPCAt(SubsumingVortex.SmallVortexTargetRange - 100f); - if (potentialTarget != null && Time % SubsumingVortex.VortexReleaseRate == SubsumingVortex.VortexReleaseRate - 1 && Time < SubsumingVortex.LargeVortexChargeupTime) + if (potentialTarget != null && Time % SubsumingVortex.VortexReleaseRate == SubsumingVortex.VortexReleaseRate - 1 && Time < SubsumingVortex.LargeVortexChargeupTime && !HasBeenReleased) { // CheckMana returns true if the mana cost can be paid.. bool allowContinuedUse = Owner.CheckMana(Owner.ActiveItem(), -1, true, false); @@ -120,8 +130,6 @@ namespace CalamityMod.Projectiles.Magic } Projectile.netUpdate = true; } - else if (!vortexStillInUse) - Projectile.Kill(); } } 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/PoseidonTyphoon.cs b/Projectiles/Magic/PoseidonTyphoon.cs index ef3a55a3d3..e29fd95186 100644 --- a/Projectiles/Magic/PoseidonTyphoon.cs +++ b/Projectiles/Magic/PoseidonTyphoon.cs @@ -18,10 +18,12 @@ namespace CalamityMod.Projectiles.Magic Projectile.height = 30; Projectile.friendly = true; Projectile.DamageType = DamageClass.Magic; - Projectile.penetrate = 10; //randomized in the item file now, penetrates 4 to 10 times - Projectile.timeLeft = 300; + Projectile.penetrate = 6; + Projectile.timeLeft = 270; Projectile.ignoreWater = true; Projectile.scale = 1.6f; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 40; } public override void AI() @@ -31,7 +33,7 @@ namespace CalamityMod.Projectiles.Magic Lighting.AddLight(Projectile.Center, 0, (255 - Projectile.alpha) * 0.7f / 255f, (255 - Projectile.alpha) / 255f); - CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 6f, 30f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 10f, 30f); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); 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/SpiritCongregation.cs b/Projectiles/Magic/SpiritCongregation.cs index 0831b4b830..ac81c8ca39 100644 --- a/Projectiles/Magic/SpiritCongregation.cs +++ b/Projectiles/Magic/SpiritCongregation.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 6; + Projectile.localNPCHitCooldown = 12; Projectile.timeLeft = 90000; } @@ -125,7 +125,7 @@ namespace CalamityMod.Projectiles.Magic BaseDamage = Projectile.damage; else { - float damageBoostFactor = MathHelper.SmoothStep(1f, 3.3f, CurrentPower); + float damageBoostFactor = MathHelper.SmoothStep(1f, 1.85f, CurrentPower); Projectile.damage = (int)(BaseDamage * damageBoostFactor); } diff --git a/Projectiles/Magic/TerraBeam.cs b/Projectiles/Magic/TerraBeam.cs index 61d3ad9bee..a8cdb69688 100644 --- a/Projectiles/Magic/TerraBeam.cs +++ b/Projectiles/Magic/TerraBeam.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.ignoreWater = true; Projectile.penetrate = 10; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 8; + Projectile.localNPCHitCooldown = 12; Projectile.tileCollide = false; Projectile.timeLeft = (int)Lifetime; } @@ -90,9 +90,9 @@ namespace CalamityMod.Projectiles.Magic // boxes, but that should be negligible. float lengthFromStart = Projectile.Distance(target.Center); - int totalShards = (int)MathHelper.Lerp(1, 4, MathHelper.Clamp(lengthFromStart / MaxLaserLength * 1.4f, 0f, 1f)); + int totalShards = (int)MathHelper.Lerp(1, 3, MathHelper.Clamp(lengthFromStart / MaxLaserLength * 1.5f, 0f, 1f)); int shardType = ModContent.ProjectileType(); - int shardDamage = (int)(Projectile.damage * 0.6); + int shardDamage = (int)(Projectile.damage * 0.5); for (int i = 0; i < totalShards; i++) { int tries = 0; 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/DeathsAscensionProjectile.cs b/Projectiles/Melee/DeathsAscensionProjectile.cs index 81ceaa3911..962f5dcddd 100644 --- a/Projectiles/Melee/DeathsAscensionProjectile.cs +++ b/Projectiles/Melee/DeathsAscensionProjectile.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Melee Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 173, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); } - CalamityUtils.HomeInOnNPC(Projectile, true, 900f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 900f, 18f, 20f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Melee/DivineHatchetBoomerang.cs b/Projectiles/Melee/DivineHatchetBoomerang.cs index dc7bf20165..bb9734bcd1 100644 --- a/Projectiles/Melee/DivineHatchetBoomerang.cs +++ b/Projectiles/Melee/DivineHatchetBoomerang.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.height = 60; Projectile.friendly = true; Projectile.tileCollide = false; - Projectile.penetrate = 4; + Projectile.penetrate = 3; Projectile.timeLeft = Lifetime; Projectile.DamageType = DamageClass.MeleeNoSpeed; Projectile.extraUpdates = 1; diff --git a/Projectiles/Melee/ElementBallShiv.cs b/Projectiles/Melee/ElementBallShiv.cs index 0cb96a955c..44d993767d 100644 --- a/Projectiles/Melee/ElementBallShiv.cs +++ b/Projectiles/Melee/ElementBallShiv.cs @@ -14,10 +14,12 @@ namespace CalamityMod.Projectiles.Melee Projectile.height = 20; Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; - Projectile.penetrate = 1; + Projectile.penetrate = 2; Projectile.tileCollide = false; Projectile.timeLeft = 60; Projectile.aiStyle = ProjAIStyleID.Beam; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; } public override void AI() @@ -59,11 +61,11 @@ namespace CalamityMod.Projectiles.Melee private void OnHitEffects(Vector2 targetPos) { var source = Projectile.GetSource_FromThis(); - for (int x = 0; x < 4; x++) + for (int x = 0; x < 3; x++) { if (Projectile.owner == Main.myPlayer) { - CalamityUtils.ProjectileBarrage(source, Projectile.Center, targetPos, x > 2, 800f, 800f, 0f, 800f, 1f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, false, 50f); + CalamityUtils.ProjectileBarrage(source, Projectile.Center, targetPos, x > 2, 800f, 800f, 0f, 800f, 20f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, false, 50f); } } } diff --git a/Projectiles/Melee/EmpyreanKnife.cs b/Projectiles/Melee/EmpyreanKnife.cs index 2b4b202b8c..a327401b8f 100644 --- a/Projectiles/Melee/EmpyreanKnife.cs +++ b/Projectiles/Melee/EmpyreanKnife.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - float healAmt = hit.Damage * 0.005f; + float healAmt = hit.Damage * 0.0075f; if ((int)healAmt == 0) return; 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/NebulashFlail.cs b/Projectiles/Melee/NebulashFlail.cs index 0ad290be47..f8a50b26ca 100644 --- a/Projectiles/Melee/NebulashFlail.cs +++ b/Projectiles/Melee/NebulashFlail.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.DamageType = DamageClass.MeleeNoSpeed; Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 3; + Projectile.localNPCHitCooldown = 2; } public override Color SpecialDrawColor => new(255, 200, 0); public override int ExudeDustType => ModContent.DustType(); diff --git a/Projectiles/Melee/PrismaticBeam.cs b/Projectiles/Melee/PrismaticBeam.cs index 0ba27991b6..712cd1c434 100644 --- a/Projectiles/Melee/PrismaticBeam.cs +++ b/Projectiles/Melee/PrismaticBeam.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Melee public Player Owner => Main.player[Projectile.owner]; public override Color LaserOverlayColor => CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly / ColorSet.Length % 1f, ColorSet); public override Color LightCastColor => LaserOverlayColor; - public override float Lifetime => 300f; + public override float Lifetime => 900f; public override float MaxScale => 1.5f; public override float MaxLaserLength => 2200f; public override Texture2D LaserBeginTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/UltimaRayStart", AssetRequestMode.ImmediateLoad).Value; @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.hide = true; - Projectile.timeLeft = 300; + Projectile.timeLeft = 900; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; } diff --git a/Projectiles/Melee/PrismaticWave.cs b/Projectiles/Melee/PrismaticWave.cs index afb69ab230..1f13f27b8d 100644 --- a/Projectiles/Melee/PrismaticWave.cs +++ b/Projectiles/Melee/PrismaticWave.cs @@ -52,11 +52,11 @@ namespace CalamityMod.Projectiles.Melee Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.Ranged; Projectile.DamageType = DamageClass.Melee; - Projectile.penetrate = 3; + Projectile.penetrate = 2; Projectile.timeLeft = 360; Projectile.tileCollide = false; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; + Projectile.localNPCHitCooldown = 20; } public override void SendExtraAI(BinaryWriter writer) diff --git a/Projectiles/Melee/SHIV.cs b/Projectiles/Melee/SHIV.cs index 1e5432ee31..d940fd634a 100644 --- a/Projectiles/Melee/SHIV.cs +++ b/Projectiles/Melee/SHIV.cs @@ -27,10 +27,9 @@ namespace CalamityMod.Projectiles.Melee } public override void AI() - { - if (Projectile.velocity.Length() < 25f && Projectile.timeLeft % 2 == 0) - Projectile.velocity *= 2.08f; - + { + CalamityUtils.HomeInOnNPC(Projectile, true, 300f, 12f, 20f); + int rainbow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 66, (float)(Projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.3f); Main.dust[rainbow].noGravity = true; Main.dust[rainbow].velocity = Vector2.Zero; 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/ElementalShivProj.cs b/Projectiles/Melee/Shortswords/ElementalShivProj.cs index 653d59d278..6c9cb5ee50 100644 --- a/Projectiles/Melee/Shortswords/ElementalShivProj.cs +++ b/Projectiles/Melee/Shortswords/ElementalShivProj.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; 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/Melee/StormRulerProj.cs b/Projectiles/Melee/StormRulerProj.cs index a8c261d8bf..ea730da216 100644 --- a/Projectiles/Melee/StormRulerProj.cs +++ b/Projectiles/Melee/StormRulerProj.cs @@ -17,8 +17,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { - Projectile.width = 10; - Projectile.height = 10; + Projectile.width = Projectile.height = 28; Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; Projectile.penetrate = 1; @@ -49,7 +48,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.localAI[0] = 0f; } } - Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X) + 1.57f; + Projectile.rotation = Projectile.velocity.ToRotation(); } public override void Kill(int timeLeft) diff --git a/Projectiles/Melee/StormRulerProj.png b/Projectiles/Melee/StormRulerProj.png index d62ee6f72c..cd5c500f08 100644 Binary files a/Projectiles/Melee/StormRulerProj.png and b/Projectiles/Melee/StormRulerProj.png differ 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/FlareBat.cs b/Projectiles/Ranged/FlareBat.cs index cb08fbbdb3..1b2cf87985 100644 --- a/Projectiles/Ranged/FlareBat.cs +++ b/Projectiles/Ranged/FlareBat.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.height = 24; Projectile.friendly = true; Projectile.DamageType = DamageClass.Ranged; - Projectile.penetrate = 3; + Projectile.penetrate = 2; Projectile.timeLeft = 300; Projectile.light = 0.25f; Projectile.usesLocalNPCImmunity = true; @@ -64,34 +64,20 @@ namespace CalamityMod.Projectiles.Ranged } Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) * Projectile.direction; - } - public override bool OnTileCollide(Vector2 oldVelocity) - { - Projectile.penetrate--; - if (Projectile.penetrate <= 0) - { - Projectile.Kill(); - } - 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; + if (Projectile.localAI[0] > 0f) + Projectile.localAI[0]--; + + // Makes the bat home onto enemies after piercing once + if (Projectile.penetrate == 1 && Projectile.localAI[0] <= 0f) + CalamityUtils.HomeInOnNPC(Projectile, false, 550f, 12f, 20f); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.OnFire3, 480); - - Projectile.Kill(); + Projectile.localAI[0] = 8f; + Projectile.damage /= 2; } public override void OnHitPlayer(Player target, Player.HurtInfo info) 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/PlagueTaintedDrone.cs b/Projectiles/Ranged/PlagueTaintedDrone.cs index 53ef63d162..2b6a03ec21 100644 --- a/Projectiles/Ranged/PlagueTaintedDrone.cs +++ b/Projectiles/Ranged/PlagueTaintedDrone.cs @@ -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/TitaniumRailgunScope.cs b/Projectiles/Ranged/TitaniumRailgunScope.cs index b2bea7ff0a..ca386ce464 100644 --- a/Projectiles/Ranged/TitaniumRailgunScope.cs +++ b/Projectiles/Ranged/TitaniumRailgunScope.cs @@ -215,7 +215,7 @@ namespace CalamityMod.Projectiles.Ranged Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); return false; } 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 new file mode 100644 index 0000000000..d258de5353 --- /dev/null +++ b/Projectiles/Rogue/EclipseStealthBoom.cs @@ -0,0 +1,48 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class EclipseStealthBoom : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Rogue"; + + public const int Lifetime = 35; // 7 animation frames, 12 FPS + + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 7; + } + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 102; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.penetrate = -1; + Projectile.timeLeft = Lifetime; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + + public override void AI() + { + Projectile.frameCounter++; + Projectile.frame = Projectile.frameCounter / 5; + + if (Projectile.frameCounter > Lifetime) + Projectile.Kill(); + } + + public override void PostDraw(Color lightColor) + { + 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() * 0.5f, Projectile.scale, SpriteEffects.None); + } + } +} diff --git a/Projectiles/Rogue/EclipseStealthBoom.png b/Projectiles/Rogue/EclipseStealthBoom.png new file mode 100644 index 0000000000..e8611cd39b Binary files /dev/null and b/Projectiles/Rogue/EclipseStealthBoom.png differ diff --git a/Projectiles/Rogue/EclipseStealthBoomGlow.png b/Projectiles/Rogue/EclipseStealthBoomGlow.png new file mode 100644 index 0000000000..afa3ecf883 Binary files /dev/null and b/Projectiles/Rogue/EclipseStealthBoomGlow.png differ diff --git a/Projectiles/Rogue/EclipsesFallMain.cs b/Projectiles/Rogue/EclipsesFallMain.cs index 4ce8c1b5bd..f311e5090e 100644 --- a/Projectiles/Rogue/EclipsesFallMain.cs +++ b/Projectiles/Rogue/EclipsesFallMain.cs @@ -1,4 +1,6 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,62 +12,67 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/EclipsesFall"; + // these also affect KB + public static float RainDamageMult = 0.4f; + public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() { - Projectile.width = 26; - Projectile.height = 26; + Projectile.width = Projectile.height = 40; Projectile.friendly = true; - Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.extraUpdates = 1; Projectile.ignoreWater = true; Projectile.tileCollide = false; - Projectile.timeLeft = 300; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.MaxUpdates = 2; + Projectile.penetrate = 3; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 6 * Projectile.MaxUpdates; + Projectile.timeLeft = 150 * Projectile.MaxUpdates; } public override void AI() { - if (Main.rand.NextBool(8)) - { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 138, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); - } + Lighting.AddLight(Projectile.Center, 1f, 0.8f, 0.3f); Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; + if (Main.rand.NextBool(5)) + { + Vector2 trailPos = Projectile.Center + Vector2.UnitY.RotatedBy(Projectile.rotation) * Main.rand.NextFloat(-16f, 16f); + float trailScale = Main.rand.NextFloat(0.8f, 1.2f); + Color trailColor = Main.rand.NextBool() ? Color.Indigo : Color.DarkOrange; + Particle eclipseTrail = new SparkParticle(trailPos, Projectile.velocity * 0.2f, false, 60, trailScale, trailColor); + GeneralParticleHandler.SpawnParticle(eclipseTrail); + } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - SpawnSpears(target.Center); - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => SpawnSpears(target.Center); - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - SpawnSpears(target.Center); - } + public override void OnHitPlayer(Player target, Player.HurtInfo info) => SpawnSpears(target.Center); private void SpawnSpears(Vector2 targetPos) { - int spearAmt = Main.rand.Next(3, 6); //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 = 0.08f * Main.rand.NextFloat(4f, 7f); - float kBMult = 0.1f * Main.rand.NextFloat(7f, 10f); - CalamityUtils.ProjectileRain(source, targetPos, 400f, 100f, 500f, 800f, 29f, ModContent.ProjectileType(), (int)(Projectile.damage * dmgMult), Projectile.knockBack * kBMult, Projectile.owner); + {; + CalamityUtils.ProjectileRain(source, targetPos, 400f, 100f, 500f, 800f, 29f, ModContent.ProjectileType(), (int)(Projectile.damage * RainDamageMult), Projectile.knockBack * RainDamageMult, Projectile.owner); } } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); 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() * 0.5f, Projectile.scale, SpriteEffects.None); + } } } diff --git a/Projectiles/Rogue/EclipsesSmol.cs b/Projectiles/Rogue/EclipsesSmol.cs index 7fdd8698c6..0e5261b383 100644 --- a/Projectiles/Rogue/EclipsesSmol.cs +++ b/Projectiles/Rogue/EclipsesSmol.cs @@ -1,9 +1,8 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; + namespace CalamityMod.Projectiles.Rogue { public class EclipsesSmol : ModProjectile, ILocalizedModType @@ -11,50 +10,33 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetDefaults() { - Projectile.width = 20; - Projectile.height = 20; + Projectile.width = Projectile.height = 24; Projectile.friendly = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; - Projectile.timeLeft = 150; - Projectile.extraUpdates = 1; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.MaxUpdates = 2; + Projectile.timeLeft = 75 * Projectile.MaxUpdates; } public override void AI() { + Lighting.AddLight(Projectile.Center, 0.5f, 0.4f, 0.15f); Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; - CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); - } - - public override void Kill(int timeLeft) - { - SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - for (int i = 0; i < 2; i++) - { - int dustInt = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 138, 0f, 0f, 100, default, 1.2f); - Main.dust[dustInt].velocity *= 3f; - if (Main.rand.NextBool(2)) - { - Main.dust[dustInt].scale = 0.5f; - Main.dust[dustInt].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int j = 0; j < 3; j++) - { - int moreDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 138, 0f, 0f, 100, default, 1.7f); - Main.dust[moreDust].noGravity = true; - Main.dust[moreDust].velocity *= 5f; - moreDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 138, 0f, 0f, 100, default, 1f); - Main.dust[moreDust].velocity *= 2f; - } + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 16f, 20f); } 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() * 0.5f, Projectile.scale, SpriteEffects.None); + } } } diff --git a/Projectiles/Rogue/EclipsesSmol.png b/Projectiles/Rogue/EclipsesSmol.png index 6dd2b7914f..854f31bb55 100644 Binary files a/Projectiles/Rogue/EclipsesSmol.png and b/Projectiles/Rogue/EclipsesSmol.png differ diff --git a/Projectiles/Rogue/EclipsesSmolGlow.png b/Projectiles/Rogue/EclipsesSmolGlow.png new file mode 100644 index 0000000000..0539d70e64 Binary files /dev/null and b/Projectiles/Rogue/EclipsesSmolGlow.png differ diff --git a/Projectiles/Rogue/EclipsesStealth.cs b/Projectiles/Rogue/EclipsesStealth.cs index e87f3cd117..e2819ada60 100644 --- a/Projectiles/Rogue/EclipsesStealth.cs +++ b/Projectiles/Rogue/EclipsesStealth.cs @@ -1,5 +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,42 +13,51 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/EclipsesFall"; + // these also affect KB + 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 private bool spawnTwoSpears = true; private bool changedTimeLeft = false; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() { - Projectile.width = 25; - Projectile.height = 25; + Projectile.width = Projectile.height = 40; Projectile.friendly = true; - Projectile.penetrate = -1; - Projectile.timeLeft = 300; Projectile.ignoreWater = true; - Projectile.tileCollide = false; + Projectile.tileCollide = false; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.MaxUpdates = 2; + Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.DamageType = RogueDamageClass.Instance; + Projectile.timeLeft = 150 * Projectile.MaxUpdates; } // Uses localAI[1] to decide how many frames until the next spear drops. public override void AI() { + Lighting.AddLight(Projectile.Center, 1f, 0.8f, 0.3f); // Behavior when not sticking to anything if (Projectile.ai[0] == 0f) { // Keep the spear oriented in the correct direction Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; - - // Spawn dust while flying - if (Main.rand.NextBool(8)) - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 138, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); + if (Main.rand.NextBool(5)) + { + Vector2 trailPos = Projectile.Center + Vector2.UnitY.RotatedBy(Projectile.rotation) * Main.rand.NextFloat(-16f, 16f); + float trailScale = Main.rand.NextFloat(0.8f, 1.2f); + Color trailColor = Main.rand.NextBool() ? Color.Indigo : Color.DarkOrange; + Particle eclipseTrail = new SparkParticle(trailPos, Projectile.velocity * 0.2f, false, 60, trailScale, trailColor); + GeneralParticleHandler.SpawnParticle(eclipseTrail); + } } // Behavior when having impaled a target @@ -54,6 +66,7 @@ namespace CalamityMod.Projectiles.Rogue // Eclipse's Fall is guaranteed to impale for 10 seconds, no more, no less if (!changedTimeLeft) { + Projectile.MaxUpdates = 1; Projectile.timeLeft = 600; changedTimeLeft = true; } @@ -67,16 +80,14 @@ 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, 14); // 8 to 13 frames between each spearfall + Projectile.localAI[1] = Main.rand.Next(10, 13); // 10 to 12 frames between each spearfall int type = ModContent.ProjectileType(); - int smolDamage = (int)(Projectile.damage * 0.22f); - float smolKB = 3f; // Used to be a 50% chance each spearfall for 1 or 2. Now is consistent. int numSpears = spawnTwoSpears ? 2 : 1; spawnTwoSpears = !spawnTwoSpears; for (int i = 0; i < numSpears; ++i) - CalamityUtils.ProjectileRain(source, Projectile.Center, 400f, 100f, 500f, 800f, 29f, type, smolDamage, smolKB, Projectile.owner); + CalamityUtils.ProjectileRain(source, Projectile.Center, 400f, 100f, 500f, 800f, 29f, type, (int)(Projectile.damage * RainDamageMult), Projectile.knockBack * RainDamageMult, Projectile.owner); } } } @@ -98,19 +109,25 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } - public override bool? CanHitNPC(NPC target) + public override void PostDraw(Color lightColor) { - if (Projectile.ai[0] == 1f) - { - return false; - } - return null; + Texture2D glow = ModContent.Request(Texture + "Glow").Value; + 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); + public override bool CanHitPvp(Player target) => Projectile.ai[0] != 1f; + + public override void Kill(int timeLeft) + { + SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); + if (Main.myPlayer == Projectile.owner) + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * ExplosionDamageMult), Projectile.knockBack * ExplosionDamageMult, Projectile.owner); + } } } diff --git a/Projectiles/Rogue/EradicatorProjectile.cs b/Projectiles/Rogue/EradicatorProjectile.cs index 92ef2ca750..7fb2693bb0 100644 --- a/Projectiles/Rogue/EradicatorProjectile.cs +++ b/Projectiles/Rogue/EradicatorProjectile.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Particles; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -14,10 +15,10 @@ namespace CalamityMod.Projectiles.Rogue { public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/Eradicator"; - private const float RotationIncrement = 0.09f; - private const int Lifetime = 350; - public const int StealthExtraLifetime = 240; // 1 extra update means this is double what you'd expect for 2 seconds - private const float ReboundTime = 40f; + private static float RotationIncrement = 0.15f; + private static int Lifetime = 350; + public static int StealthExtraLifetime = 240; // 1 extra update means this is double what you'd expect for 2 seconds + private static int ReboundTime = 60; private float randomLaserCharge = 0f; @@ -29,7 +30,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetDefaults() { - Projectile.width = Projectile.height = 58; + Projectile.width = Projectile.height = 62; Projectile.friendly = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; @@ -116,7 +117,7 @@ namespace CalamityMod.Projectiles.Rogue { // Fire lasers at up to 2 nearby targets every 8 frames for 40% damage. // Stealth strike lasers have an intentionally lower ratio of 12%. - double laserDamageRatio = Projectile.Calamity().stealthStrike ? 0.12D : 0.4D; + double laserDamageRatio = Projectile.Calamity().stealthStrike ? 0.15D : 0.4D; float laserFrames = Projectile.MaxUpdates * 8f; CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, laserFrames, 2, ModContent.ProjectileType(), laserDamageRatio, true); } @@ -167,7 +168,39 @@ namespace CalamityMod.Projectiles.Rogue } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 180); + + // Spawn sparks; taken from Despair stone then adapted to a projectile + Vector2 particleSpawnDisplacement; + Vector2 splatterDirection; + + particleSpawnDisplacement = new Vector2(2f * -Projectile.ai[2], 2f * -Projectile.ai[2]); + splatterDirection = new Vector2(Projectile.velocity.X, Projectile.velocity.Y); + + Vector2 SparkSpawnPosition = target.Center + particleSpawnDisplacement; + + if (Projectile.ai[1] % 4 == 0) + { + for (int i = 0; i < 2; i++) + { + int sparkLifetime = Main.rand.Next(14, 21); + float sparkScale = Main.rand.NextFloat(0.8f, 1f) + 1f * 0.05f; + Color sparkColor = Color.Lerp(Color.Fuchsia, Color.AliceBlue, Main.rand.NextFloat(0.5f)); + sparkColor = Color.Lerp(sparkColor, Color.Cyan, Main.rand.NextFloat()); + + if (Main.rand.NextBool(5)) + sparkScale *= 1.4f; + + Vector2 sparkVelocity = splatterDirection.RotatedByRandom(MathHelper.TwoPi); + sparkVelocity.Y -= 6f; + SparkParticle spark = new SparkParticle(SparkSpawnPosition, sparkVelocity, true, sparkLifetime, sparkScale, sparkColor); + GeneralParticleHandler.SpawnParticle(spark); + } + } + + } public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); @@ -175,7 +208,7 @@ namespace CalamityMod.Projectiles.Rogue private void OnHit() { - // Non-stealth strikes do nothing special on hit. + // Non-stealth strikes do not stick on hit. if (!Projectile.Calamity().stealthStrike) return; diff --git a/Projectiles/Rogue/FinalDawnFireSlash.cs b/Projectiles/Rogue/FinalDawnFireSlash.cs index c676c2ad00..8cee1e8eac 100644 --- a/Projectiles/Rogue/FinalDawnFireSlash.cs +++ b/Projectiles/Rogue/FinalDawnFireSlash.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Rogue { public new string LocalizationCategory => "Projectiles.Rogue"; public bool HasRegeneratedStealth = false; - public const float StealthReturnRatio = 0.25f; + public static float StealthReturnRatio = 0.40f; public override void SetStaticDefaults() { Main.projFrames[Projectile.type] = 11; @@ -93,14 +93,14 @@ namespace CalamityMod.Projectiles.Rogue { CalamityPlayer calamityPlayer = Main.player[Projectile.owner].Calamity(); // Restore stealth - if (!HasRegeneratedStealth) + if (!HasRegeneratedStealth && !Projectile.Calamity().LocketClone) //Locket clones dont create stealth { calamityPlayer.rogueStealth += calamityPlayer.rogueStealthMax * StealthReturnRatio; if (calamityPlayer.rogueStealth > calamityPlayer.rogueStealthMax) calamityPlayer.rogueStealth = calamityPlayer.rogueStealthMax; HasRegeneratedStealth = true; - target.AddBuff(ModContent.BuffType(), 300); } + target.AddBuff(ModContent.BuffType(), 300); } public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Rogue/FinalDawnProjectile.cs b/Projectiles/Rogue/FinalDawnProjectile.cs index cfbc669dd8..e520d9d24c 100644 --- a/Projectiles/Rogue/FinalDawnProjectile.cs +++ b/Projectiles/Rogue/FinalDawnProjectile.cs @@ -138,12 +138,14 @@ namespace CalamityMod.Projectiles.Rogue else { //This one doesn't consume stealth since it replenishes stealth on hits - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, + int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + if (p.WithinBounds(Main.maxProjectiles) && Projectile.Calamity().LocketClone) + Main.projectile[p].Calamity().LocketClone = true; // NO STEALTH GEN OK? } } } 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/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/RadiantStar2.cs b/Projectiles/Rogue/RadiantStar2.cs index 6cc2c03ae1..c7a125d31a 100644 --- a/Projectiles/Rogue/RadiantStar2.cs +++ b/Projectiles/Rogue/RadiantStar2.cs @@ -22,8 +22,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetDefaults() { - Projectile.width = 24; - Projectile.height = 24; + Projectile.width = Projectile.height = 32; Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.penetrate = 1; diff --git a/Projectiles/Rogue/RadiantStarKnife.cs b/Projectiles/Rogue/RadiantStarKnife.cs index c2727d3a69..2b5d9812d3 100644 --- a/Projectiles/Rogue/RadiantStarKnife.cs +++ b/Projectiles/Rogue/RadiantStarKnife.cs @@ -22,8 +22,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetDefaults() { - Projectile.width = 24; - Projectile.height = 24; + Projectile.width = Projectile.height = 32; Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.penetrate = 4; 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..ce6d4397f6 --- /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(12, 15), 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..1d461a3b1e 100644 --- a/Projectiles/Rogue/ReaperProjectile.cs +++ b/Projectiles/Rogue/ReaperProjectile.cs @@ -21,16 +21,16 @@ namespace CalamityMod.Projectiles.Rogue public override void SetDefaults() { - Projectile.width = 70; - Projectile.height = 70; + Projectile.width = 60; + Projectile.height = 60; Projectile.friendly = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.penetrate = -1; - Projectile.extraUpdates = 3; + Projectile.extraUpdates = 2; Projectile.timeLeft = Projectile.MaxUpdates * 90; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 26; // can't hit too fast, but can hit many many times + Projectile.localNPCHitCooldown = 18; // can't hit too fast, but can hit many many times Projectile.DamageType = RogueDamageClass.Instance; } @@ -142,7 +142,7 @@ namespace CalamityMod.Projectiles.Rogue } } } - Projectile.rotation += 0.07f; + Projectile.rotation += 0.3f; } public override bool PreDraw(ref Color lightColor) @@ -154,14 +154,14 @@ namespace CalamityMod.Projectiles.Rogue 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); 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); target.AddBuff(ModContent.BuffType(), 180); } diff --git a/Projectiles/Rogue/SacrificeProjectile.cs b/Projectiles/Rogue/SacrificeProjectile.cs index c28094dd21..61dbf71973 100644 --- a/Projectiles/Rogue/SacrificeProjectile.cs +++ b/Projectiles/Rogue/SacrificeProjectile.cs @@ -40,6 +40,9 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { + if (Projectile.Calamity().LocketClone) + AbleToHealOwner = false; // No healing you too much of your hp + if (ReturningToOwner) { Projectile.timeLeft = 15; diff --git a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs index 883f4410a1..29ca0adbec 100644 --- a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs +++ b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs @@ -69,11 +69,7 @@ namespace CalamityMod.Projectiles.Rogue } } - Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X) + 2.355f; - if (Projectile.spriteDirection == -1) - { - Projectile.rotation -= 1.57f; - } + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; Lighting.AddLight(Projectile.Center, 0.7f, 0.3f, 0f); CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); diff --git a/Projectiles/Rogue/ShatteredSunScorchedBlade.png b/Projectiles/Rogue/ShatteredSunScorchedBlade.png index 63d74c7578..9e351ae4df 100644 Binary files a/Projectiles/Rogue/ShatteredSunScorchedBlade.png and b/Projectiles/Rogue/ShatteredSunScorchedBlade.png differ 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 c75540960e..4bdbbd87e0 100644 --- a/Projectiles/Rogue/UmbraphileBoom.cs +++ b/Projectiles/Rogue/UmbraphileBoom.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -9,36 +10,33 @@ namespace CalamityMod.Projectiles.Rogue public class UmbraphileBoom : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public const int Lifetime = 35; // 7 animation frames, 12 FPS + + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 7; + } public override void SetDefaults() { - Projectile.width = 60; - Projectile.height = 60; + Projectile.width = Projectile.height = 58; Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.tileCollide = false; Projectile.penetrate = -1; - Projectile.timeLeft = 5; + Projectile.timeLeft = Lifetime; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; } - public override void Kill(int timeLeft) + public override void AI() { - for (int s = 0; s < 20; s++) - { - int dustType = Main.rand.NextBool() ? 246 : 176; - float dustSpeed = Main.rand.NextFloat(3f, 9f); - Vector2 dustVel = CalamityUtils.RandomVelocity(10f, dustSpeed, dustSpeed, 1f); - int boom = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 1f); - Dust dust = Main.dust[boom]; - dust.noGravity = true; - dust.position = Projectile.Center; - dust.position.X += (float)Main.rand.Next(-10, 11); - dust.position.Y += (float)Main.rand.Next(-10, 11); - dust.velocity = dustVel; - } + Projectile.frameCounter++; + Projectile.frame = Projectile.frameCounter / 5; + + if (Projectile.frameCounter > Lifetime) + Projectile.Kill(); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) @@ -58,5 +56,12 @@ namespace CalamityMod.Projectiles.Rogue if (!Main.dayTime || Main.rand.NextBool(3)) //100% at night, 33.33% chance during day target.AddBuff(ModContent.BuffType(), 45); } + + public override void PostDraw(Color lightColor) + { + 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() * 0.5f, Projectile.scale, SpriteEffects.None); + } } } diff --git a/Projectiles/Rogue/UmbraphileBoom.png b/Projectiles/Rogue/UmbraphileBoom.png new file mode 100644 index 0000000000..8e6d4ccdf2 Binary files /dev/null and b/Projectiles/Rogue/UmbraphileBoom.png differ diff --git a/Projectiles/Rogue/UmbraphileBoomGlow.png b/Projectiles/Rogue/UmbraphileBoomGlow.png new file mode 100644 index 0000000000..b4c9459bdd Binary files /dev/null and b/Projectiles/Rogue/UmbraphileBoomGlow.png differ 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 index fb58e7187c..5df7b760fa 100644 --- a/Projectiles/Summon/BloodClotMinion.cs +++ b/Projectiles/Summon/BloodClotMinion.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.tileCollide = false; Projectile.MaxUpdates = 3; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = Projectile.MaxUpdates * 24; + Projectile.localNPCHitCooldown = Projectile.MaxUpdates * 30; Projectile.DamageType = DamageClass.Summon; } diff --git a/Projectiles/Summon/DankCreeperMinion.cs b/Projectiles/Summon/DankCreeperMinion.cs index aabd4f4191..666edf8be2 100644 --- a/Projectiles/Summon/DankCreeperMinion.cs +++ b/Projectiles/Summon/DankCreeperMinion.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.tileCollide = false; Projectile.MaxUpdates = 3; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = Projectile.MaxUpdates * 24; + Projectile.localNPCHitCooldown = Projectile.MaxUpdates * 30; Projectile.DamageType = DamageClass.Summon; } 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/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/Summon/StormjawBaby.cs b/Projectiles/Summon/StormjawBaby.cs index 2754293e9f..13700aca1f 100644 --- a/Projectiles/Summon/StormjawBaby.cs +++ b/Projectiles/Summon/StormjawBaby.cs @@ -393,7 +393,7 @@ namespace CalamityMod.Projectiles.Summon if (sparkCounter < 0) sparkCounter = 0; - float sepAnxietyDist = 500f; + float sepAnxietyDist = 1000f; Vector2 playerDist = player.Center - Projectile.Center; // Teleport to the player if too far if (playerDist.Length() > 2000f) @@ -413,14 +413,14 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.ai[0] == 0f) { Projectile.tileCollide = true; - float accelFast = 0.5f; - float maxSpeed = 4f; - float xVel = 4f; - float accelSlow = 0.1f; + float accelFast = 1f; + float maxSpeed = 8f; + float xVel = 8f; + float accelSlow = 0.2f; if (xVel < Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y)) { xVel = Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y); - accelFast = 0.7f; + accelFast = 1.4f; } int direction = 0; bool flag3 = false; diff --git a/Projectiles/Summon/VileFeederSummon.cs b/Projectiles/Summon/VileFeederSummon.cs index e9b2b88884..9e8a586f64 100644 --- a/Projectiles/Summon/VileFeederSummon.cs +++ b/Projectiles/Summon/VileFeederSummon.cs @@ -35,6 +35,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.timeLeft *= 5; Projectile.minion = true; Projectile.DamageType = DamageClass.Summon; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 60; } public override void SendExtraAI(BinaryWriter writer) @@ -267,13 +269,6 @@ namespace CalamityMod.Projectiles.Summon return false; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.immune[Projectile.owner] = 0; - } - - public override bool? CanDamage() => Projectile.ai[0] != 3f; - public override bool OnTileCollide(Vector2 oldVelocity) => false; } } 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..f51b9fb674 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.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/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/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/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/DifficultyModeSystem.cs b/Systems/DifficultyModeSystem.cs index fa1cdd14f6..b91788d864 100644 --- a/Systems/DifficultyModeSystem.cs +++ b/Systems/DifficultyModeSystem.cs @@ -22,23 +22,51 @@ namespace CalamityMod.Systems { internal static bool _hasCheckedItOutYet = false; //Simple variable to add a cool effect to the mode selector - public static DifficultyMode[] Difficulties; //Difficulty modes ordered by ascending difficulty + public static List Difficulties = new List(); //Difficulty modes ordered by ascending difficulty public static List DifficultyTiers; //Difficulty modes grouped together by difficulty public static int MostAlternateDifficulties; //The most alternate difficulties at any tier that exists. Used to know the widest space to take in the ui public override void Load() { MostAlternateDifficulties = 1; - Difficulties = new DifficultyMode[] { new NoDifficulty(), new RevengeanceDifficulty(), new DeathDifficulty()}; + //Initialize base mod difficulties + Difficulties = new List() { new NoDifficulty(), new RevengeanceDifficulty(), new DeathDifficulty()}; - //All of this should happen after a hook happens which lets other mods add their own difficulties - Difficulties = Difficulties.OrderBy(d => d.DifficultyScale).ToArray(); + CalculateDifficultyData(); + } + public override void Unload() + { + Difficulties = null; + } + + public static DifficultyMode GetCurrentDifficulty + { + get + { + DifficultyMode mode = Difficulties[0]; + + for (int i = 1; i < Difficulties.Count; i++) + { + if (Difficulties[i].Enabled) + mode = Difficulties[i]; + } + + return mode; + } + } + + public static void CalculateDifficultyData() + { + MostAlternateDifficulties = 1; + Difficulties.OrderBy(d => d.DifficultyScale); + + //Difficulties are arranged in "tiers". This is done so that multiple mods can add their own alternate difficulties sharing a tier with the base ones DifficultyTiers = new List(); float currentTier = -1; int tierIndex = -1; - for (int i = 0; i < Difficulties.Length; i++) + for (int i = 0; i < Difficulties.Count; i++) { //if we are at a new tier, create a new list of difficulties at that tier. if (currentTier != Difficulties[i].DifficultyScale) @@ -53,7 +81,6 @@ namespace CalamityMod.Systems { //ugly DifficultyTiers[tierIndex] = DifficultyTiers[tierIndex].Append(Difficulties[i]).ToArray(); - MostAlternateDifficulties = Math.Max(DifficultyTiers[tierIndex].Length, MostAlternateDifficulties); } @@ -61,27 +88,6 @@ namespace CalamityMod.Systems } } - public override void Unload() - { - Difficulties = null; - } - - public static DifficultyMode GetCurrentDifficulty - { - get - { - DifficultyMode mode = Difficulties[0]; - - for (int i = 1; i < Difficulties.Length; i++) - { - if (Difficulties[i].Enabled) - mode = Difficulties[i]; - } - - return mode; - } - } - public override void SaveWorldData(TagCompound tag) { //Apparently this is ran after worldgen so it cant always be set to true diff --git a/Systems/MiscWorldStateSystem.cs b/Systems/MiscWorldStateSystem.cs index 1f69bbd246..52fca6e672 100644 --- a/Systems/MiscWorldStateSystem.cs +++ b/Systems/MiscWorldStateSystem.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.IO; using CalamityMod.CustomRecipes; using CalamityMod.Events; using CalamityMod.NPCs; @@ -8,14 +9,15 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.IO; +using static CalamityMod.DownedBossSystem; using static CalamityMod.World.CalamityWorld; namespace CalamityMod { public class MiscWorldStateSystem : ModSystem { - #region Resetting - public static void ResetWorldData() + #region Clear World Data (Reset) + public override void ClearWorld() { CalamityGlobalNPC.holyBoss = -1; CalamityGlobalNPC.doughnutBoss = -1; @@ -69,10 +71,6 @@ namespace CalamityMod AcidRainEvent.AcidRainEventIsOngoing = false; AcidRainEvent.CountdownUntilForcedAcidRain = 0; } - - public override void OnWorldLoad() => ResetWorldData(); - - public override void OnWorldUnload() => ResetWorldData(); #endregion #region Saving/Loading @@ -193,5 +191,300 @@ namespace CalamityMod CavernLabCenter = tag.Get("CavernLabCenter"); } #endregion Saving/Loading + + #region NetSend + public override void NetSend(BinaryWriter writer) + { + BitsByte flags = new BitsByte(); + flags[0] = downedDesertScourge; + flags[1] = downedHiveMind; + flags[2] = downedPerforator; + flags[3] = downedSlimeGod; + flags[4] = downedCryogen; + flags[5] = downedBrimstoneElemental; + flags[6] = downedCalamitasClone; + flags[7] = downedLeviathan; + + BitsByte flags2 = new BitsByte(); + flags2[0] = downedDoG; + flags2[1] = downedPlaguebringer; + flags2[2] = downedGuardians; + flags2[3] = downedProvidence; + flags2[4] = downedCeaselessVoid; + flags2[5] = downedStormWeaver; + flags2[6] = downedSignus; + flags2[7] = downedYharon; + + // Don't write meaningful values for the now-unused vanilla boss booleans + BitsByte flags3 = new BitsByte(); + flags3[0] = downedCalamitas; + flags3[1] = downedDragonfolly; + flags3[2] = downedCrabulon; + flags3[3] = downedBetsy; + flags3[4] = downedRavager; + flags3[5] = false; + flags3[6] = false; + flags3[7] = false; + + BitsByte flags4 = new BitsByte(); + flags4[0] = false; + flags4[1] = false; + flags4[2] = false; + flags4[3] = false; + flags4[4] = false; + flags4[5] = false; + flags4[6] = onionMode; + flags4[7] = revenge; + + BitsByte flags5 = new BitsByte(); + flags5[0] = downedAstrumDeus; + flags5[1] = spawnedBandit; + flags5[2] = spawnedCirrus; + flags5[3] = AcidRainEvent.HasStartedAcidicDownpour; + flags5[4] = false; + flags5[5] = downedPolterghast; + flags5[6] = death; + flags5[7] = downedGSS; + + BitsByte flags6 = new BitsByte(); + flags6[0] = Abyss.AtLeftSideOfWorld; + flags6[1] = downedAquaticScourge; + flags6[2] = downedAstrumAureus; + flags6[3] = false; + flags6[4] = armageddon; + flags6[5] = false; + flags6[6] = false; + flags6[7] = false; + + BitsByte flags7 = new BitsByte(); + flags7[0] = BossRushEvent.BossRushActive; + flags7[1] = downedBoomerDuke; + flags7[2] = downedCLAM; + flags7[3] = false; + flags7[4] = AcidRainEvent.AcidRainEventIsOngoing; + flags7[5] = downedEoCAcidRain; + flags7[6] = downedAquaticScourgeAcidRain; + flags7[7] = AcidRainEvent.HasTriedToSummonOldDuke; + + BitsByte flags8 = new BitsByte(); + flags8[0] = AcidRainEvent.HasBeenForceStartedByEoCDefeat; + flags8[1] = false; + flags8[2] = downedSecondSentinels; + flags8[3] = foundHomePermafrost; + flags8[4] = downedCLAMHardMode; + flags8[5] = catName; + flags8[6] = dogName; + flags8[7] = bunnyName; + + BitsByte flags9 = new BitsByte(); + flags9[0] = false; + flags9[1] = false; + flags9[2] = false; + flags9[3] = false; + flags9[4] = false; + flags9[5] = false; + flags9[6] = false; + flags9[7] = false; + + BitsByte flags10 = new BitsByte(); + flags10[0] = false; + flags10[1] = false; + flags10[2] = AcidRainEvent.OldDukeHasBeenEncountered; + flags10[3] = false; + flags10[4] = false; + flags10[5] = false; + flags10[6] = false; + flags10[7] = false; + + BitsByte flags11 = new BitsByte(); + flags11[0] = false; + flags11[1] = HasGeneratedLuminitePlanetoids; + flags11[2] = downedPrimordialWyrm; + flags11[3] = downedExoMechs; + flags11[4] = downedAres; + flags11[5] = downedThanatos; + flags11[6] = downedArtemisAndApollo; + flags11[7] = TalkedToDraedon; + + BitsByte flags12 = new BitsByte(); + flags12[0] = downedCragmawMire; + flags12[1] = downedMauler; + flags12[2] = downedNuclearTerror; + flags12[3] = downedBossRush; + flags12[4] = DraedonMechdusa; + + writer.Write(flags); + writer.Write(flags2); + writer.Write(flags3); + writer.Write(flags4); + writer.Write(flags5); + writer.Write(flags6); + writer.Write(flags7); + writer.Write(flags8); + writer.Write(flags9); + writer.Write(flags10); + writer.Write(flags11); + writer.Write(flags12); + + RecipeUnlockHandler.SendData(writer); + + writer.Write(Abyss.AbyssChasmBottom); + writer.Write(SulphurousSea.YStart); + writer.Write(AstralBiome.YStart); + writer.Write(AcidRainEvent.AccumulatedKillPoints); + writer.Write(Reforges); + writer.Write(MoneyStolenByBandit); + writer.Write(DraedonSummonCountdown); + writer.Write((int)DraedonMechToSummon); + writer.WriteVector2(DraedonSummonPosition); + writer.WriteVector2(SunkenSeaLabCenter); + writer.WriteVector2(PlanetoidLabCenter); + writer.WriteVector2(JungleLabCenter); + writer.WriteVector2(HellLabCenter); + writer.WriteVector2(IceLabCenter); + writer.WriteVector2(CavernLabCenter); + } + #endregion + + #region NetReceive + public override void NetReceive(BinaryReader reader) + { + BitsByte flags = reader.ReadByte(); + downedDesertScourge = flags[0]; + downedHiveMind = flags[1]; + downedPerforator = flags[2]; + downedSlimeGod = flags[3]; + downedCryogen = flags[4]; + downedBrimstoneElemental = flags[5]; + downedCalamitasClone = flags[6]; + downedLeviathan = flags[7]; + + BitsByte flags2 = reader.ReadByte(); + downedDoG = flags2[0]; + downedPlaguebringer = flags2[1]; + downedGuardians = flags2[2]; + downedProvidence = flags2[3]; + downedCeaselessVoid = flags2[4]; + downedStormWeaver = flags2[5]; + downedSignus = flags2[6]; + downedYharon = flags2[7]; + + // Explicitly discard the now-unused vanilla boss booleans + BitsByte flags3 = reader.ReadByte(); + downedCalamitas = flags3[0]; + downedDragonfolly = flags3[1]; + downedCrabulon = flags3[2]; + downedBetsy = flags3[3]; + downedRavager = flags3[4]; + _ = flags3[5]; + _ = flags3[6]; + _ = flags3[7]; + + BitsByte flags4 = reader.ReadByte(); + _ = flags4[0]; + _ = flags4[1]; + _ = flags4[2]; + _ = flags4[3]; + _ = flags4[4]; + _ = flags4[5]; + onionMode = flags4[6]; + revenge = flags4[7]; + + BitsByte flags5 = reader.ReadByte(); + downedAstrumDeus = flags5[0]; + spawnedBandit = flags5[1]; + spawnedCirrus = flags5[2]; + AcidRainEvent.HasStartedAcidicDownpour = flags5[3]; + _ = flags5[4]; + downedPolterghast = flags5[5]; + death = flags5[6]; + downedGSS = flags5[7]; + + BitsByte flags6 = reader.ReadByte(); + Abyss.AtLeftSideOfWorld = flags6[0]; + downedAquaticScourge = flags6[1]; + downedAstrumAureus = flags6[2]; + _ = flags6[3]; + armageddon = flags6[4]; + _ = flags6[5]; + _ = flags6[6]; + _ = flags6[7]; + + BitsByte flags7 = reader.ReadByte(); + BossRushEvent.BossRushActive = flags7[0]; + downedBoomerDuke = flags7[1]; + downedCLAM = flags7[2]; + _ = flags7[3]; + AcidRainEvent.AcidRainEventIsOngoing = flags7[4]; + downedEoCAcidRain = flags7[5]; + downedAquaticScourgeAcidRain = flags7[6]; + AcidRainEvent.HasTriedToSummonOldDuke = flags7[7]; + + BitsByte flags8 = reader.ReadByte(); + AcidRainEvent.HasBeenForceStartedByEoCDefeat = flags8[0]; + _ = flags8[1]; + downedSecondSentinels = flags8[2]; + foundHomePermafrost = flags8[3]; + downedCLAMHardMode = flags8[4]; + catName = flags8[5]; + dogName = flags8[6]; + bunnyName = flags8[7]; + + BitsByte flags9 = reader.ReadByte(); + _ = flags9[0]; + _ = flags9[1]; + _ = flags9[2]; + _ = flags9[3]; + _ = flags9[4]; + _ = flags9[5]; + _ = flags9[6]; + _ = flags9[7]; + + BitsByte flags10 = reader.ReadByte(); + _ = flags10[0]; + _ = flags10[1]; + AcidRainEvent.OldDukeHasBeenEncountered = flags10[2]; + _ = flags10[3]; + _ = flags10[4]; + _ = flags10[5]; + _ = flags10[6]; + _ = flags10[7]; + + BitsByte flags11 = reader.ReadByte(); + _ = flags11[0]; + HasGeneratedLuminitePlanetoids = flags11[1]; + downedPrimordialWyrm = flags11[2]; + downedExoMechs = flags11[3]; + downedAres = flags11[4]; + downedThanatos = flags11[5]; + downedArtemisAndApollo = flags11[6]; + TalkedToDraedon = flags11[7]; + + BitsByte flags12 = reader.ReadByte(); + downedCragmawMire = flags12[0]; + downedMauler = flags12[1]; + downedNuclearTerror = flags12[2]; + downedBossRush = flags12[3]; + DraedonMechdusa = flags12[4]; + + RecipeUnlockHandler.ReceiveData(reader); + + Abyss.AbyssChasmBottom = reader.ReadInt32(); + SulphurousSea.YStart = reader.ReadInt32(); + AstralBiome.YStart = reader.ReadInt32(); + AcidRainEvent.AccumulatedKillPoints = reader.ReadInt32(); + Reforges = reader.ReadInt32(); + MoneyStolenByBandit = reader.ReadInt32(); + DraedonSummonCountdown = reader.ReadInt32(); + DraedonMechToSummon = (ExoMech)reader.ReadInt32(); + DraedonSummonPosition = reader.ReadVector2(); + SunkenSeaLabCenter = reader.ReadVector2(); + PlanetoidLabCenter = reader.ReadVector2(); + JungleLabCenter = reader.ReadVector2(); + HellLabCenter = reader.ReadVector2(); + IceLabCenter = reader.ReadVector2(); + CavernLabCenter = reader.ReadVector2(); + } + #endregion } } diff --git a/Systems/UIManagementSystem.cs b/Systems/UIManagementSystem.cs index a678d6e40c..e467e32e43 100644 --- a/Systems/UIManagementSystem.cs +++ b/Systems/UIManagementSystem.cs @@ -62,13 +62,6 @@ namespace CalamityMod.Systems return true; }, InterfaceScaleType.UI)); - // Astral Arcanum overlay (if open) - layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Astral Arcanum UI", delegate () - { - AstralArcanumUI.UpdateAndDraw(Main.spriteBatch); - return true; - }, InterfaceScaleType.None)); - // Speedrun Timer layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Speedrun Timer", delegate () { diff --git a/Systems/WorldSyncingSystem.cs b/Systems/WorldSyncingSystem.cs deleted file mode 100644 index 1cabbe8654..0000000000 --- a/Systems/WorldSyncingSystem.cs +++ /dev/null @@ -1,309 +0,0 @@ -using System.IO; -using CalamityMod.CustomRecipes; -using CalamityMod.Events; -using CalamityMod.World; -using Terraria; -using Terraria.ModLoader; -using static CalamityMod.DownedBossSystem; -using static CalamityMod.World.CalamityWorld; - -namespace CalamityMod.Systems -{ - public class WorldSyncingSystem : ModSystem - { - #region NetSend - public override void NetSend(BinaryWriter writer) - { - BitsByte flags = new BitsByte(); - flags[0] = downedDesertScourge; - flags[1] = downedHiveMind; - flags[2] = downedPerforator; - flags[3] = downedSlimeGod; - flags[4] = downedCryogen; - flags[5] = downedBrimstoneElemental; - flags[6] = downedCalamitasClone; - flags[7] = downedLeviathan; - - BitsByte flags2 = new BitsByte(); - flags2[0] = downedDoG; - flags2[1] = downedPlaguebringer; - flags2[2] = downedGuardians; - flags2[3] = downedProvidence; - flags2[4] = downedCeaselessVoid; - flags2[5] = downedStormWeaver; - flags2[6] = downedSignus; - flags2[7] = downedYharon; - - // Don't write meaningful values for the now-unused vanilla boss booleans - BitsByte flags3 = new BitsByte(); - flags3[0] = downedCalamitas; - flags3[1] = downedDragonfolly; - flags3[2] = downedCrabulon; - flags3[3] = downedBetsy; - flags3[4] = downedRavager; - flags3[5] = false; - flags3[6] = false; - flags3[7] = false; - - BitsByte flags4 = new BitsByte(); - flags4[0] = false; - flags4[1] = false; - flags4[2] = false; - flags4[3] = false; - flags4[4] = false; - flags4[5] = false; - flags4[6] = onionMode; - flags4[7] = revenge; - - BitsByte flags5 = new BitsByte(); - flags5[0] = downedAstrumDeus; - flags5[1] = spawnedBandit; - flags5[2] = spawnedCirrus; - flags5[3] = AcidRainEvent.HasStartedAcidicDownpour; - flags5[4] = false; - flags5[5] = downedPolterghast; - flags5[6] = death; - flags5[7] = downedGSS; - - BitsByte flags6 = new BitsByte(); - flags6[0] = Abyss.AtLeftSideOfWorld; - flags6[1] = downedAquaticScourge; - flags6[2] = downedAstrumAureus; - flags6[3] = false; - flags6[4] = armageddon; - flags6[5] = false; - flags6[6] = false; - flags6[7] = false; - - BitsByte flags7 = new BitsByte(); - flags7[0] = BossRushEvent.BossRushActive; - flags7[1] = downedBoomerDuke; - flags7[2] = downedCLAM; - flags7[3] = false; - flags7[4] = AcidRainEvent.AcidRainEventIsOngoing; - flags7[5] = downedEoCAcidRain; - flags7[6] = downedAquaticScourgeAcidRain; - flags7[7] = AcidRainEvent.HasTriedToSummonOldDuke; - - BitsByte flags8 = new BitsByte(); - flags8[0] = AcidRainEvent.HasBeenForceStartedByEoCDefeat; - flags8[1] = false; - flags8[2] = downedSecondSentinels; - flags8[3] = foundHomePermafrost; - flags8[4] = downedCLAMHardMode; - flags8[5] = catName; - flags8[6] = dogName; - flags8[7] = bunnyName; - - BitsByte flags9 = new BitsByte(); - flags9[0] = false; - flags9[1] = false; - flags9[2] = false; - flags9[3] = false; - flags9[4] = false; - flags9[5] = false; - flags9[6] = false; - flags9[7] = false; - - BitsByte flags10 = new BitsByte(); - flags10[0] = false; - flags10[1] = false; - flags10[2] = AcidRainEvent.OldDukeHasBeenEncountered; - flags10[3] = false; - flags10[4] = false; - flags10[5] = false; - flags10[6] = false; - flags10[7] = false; - - BitsByte flags11 = new BitsByte(); - flags11[0] = false; - flags11[1] = HasGeneratedLuminitePlanetoids; - flags11[2] = downedPrimordialWyrm; - flags11[3] = downedExoMechs; - flags11[4] = downedAres; - flags11[5] = downedThanatos; - flags11[6] = downedArtemisAndApollo; - flags11[7] = TalkedToDraedon; - - BitsByte flags12 = new BitsByte(); - flags12[0] = downedCragmawMire; - flags12[1] = downedMauler; - flags12[2] = downedNuclearTerror; - flags12[3] = downedBossRush; - flags12[4] = DraedonMechdusa; - - writer.Write(flags); - writer.Write(flags2); - writer.Write(flags3); - writer.Write(flags4); - writer.Write(flags5); - writer.Write(flags6); - writer.Write(flags7); - writer.Write(flags8); - writer.Write(flags9); - writer.Write(flags10); - writer.Write(flags11); - writer.Write(flags12); - - RecipeUnlockHandler.SendData(writer); - - writer.Write(Abyss.AbyssChasmBottom); - writer.Write(SulphurousSea.YStart); - writer.Write(AstralBiome.YStart); - writer.Write(AcidRainEvent.AccumulatedKillPoints); - writer.Write(Reforges); - writer.Write(MoneyStolenByBandit); - writer.Write(DraedonSummonCountdown); - writer.Write((int)DraedonMechToSummon); - writer.WriteVector2(DraedonSummonPosition); - writer.WriteVector2(SunkenSeaLabCenter); - writer.WriteVector2(PlanetoidLabCenter); - writer.WriteVector2(JungleLabCenter); - writer.WriteVector2(HellLabCenter); - writer.WriteVector2(IceLabCenter); - writer.WriteVector2(CavernLabCenter); - } - #endregion - - #region NetReceive - public override void NetReceive(BinaryReader reader) - { - BitsByte flags = reader.ReadByte(); - downedDesertScourge = flags[0]; - downedHiveMind = flags[1]; - downedPerforator = flags[2]; - downedSlimeGod = flags[3]; - downedCryogen = flags[4]; - downedBrimstoneElemental = flags[5]; - downedCalamitasClone = flags[6]; - downedLeviathan = flags[7]; - - BitsByte flags2 = reader.ReadByte(); - downedDoG = flags2[0]; - downedPlaguebringer = flags2[1]; - downedGuardians = flags2[2]; - downedProvidence = flags2[3]; - downedCeaselessVoid = flags2[4]; - downedStormWeaver = flags2[5]; - downedSignus = flags2[6]; - downedYharon = flags2[7]; - - // Explicitly discard the now-unused vanilla boss booleans - BitsByte flags3 = reader.ReadByte(); - downedCalamitas = flags3[0]; - downedDragonfolly = flags3[1]; - downedCrabulon = flags3[2]; - downedBetsy = flags3[3]; - downedRavager = flags3[4]; - _ = flags3[5]; - _ = flags3[6]; - _ = flags3[7]; - - BitsByte flags4 = reader.ReadByte(); - _ = flags4[0]; - _ = flags4[1]; - _ = flags4[2]; - _ = flags4[3]; - _ = flags4[4]; - _ = flags4[5]; - onionMode = flags4[6]; - revenge = flags4[7]; - - BitsByte flags5 = reader.ReadByte(); - downedAstrumDeus = flags5[0]; - spawnedBandit = flags5[1]; - spawnedCirrus = flags5[2]; - AcidRainEvent.HasStartedAcidicDownpour = flags5[3]; - _ = flags5[4]; - downedPolterghast = flags5[5]; - death = flags5[6]; - downedGSS = flags5[7]; - - BitsByte flags6 = reader.ReadByte(); - Abyss.AtLeftSideOfWorld = flags6[0]; - downedAquaticScourge = flags6[1]; - downedAstrumAureus = flags6[2]; - _ = flags6[3]; - armageddon = flags6[4]; - _ = flags6[5]; - _ = flags6[6]; - _ = flags6[7]; - - BitsByte flags7 = reader.ReadByte(); - BossRushEvent.BossRushActive = flags7[0]; - downedBoomerDuke = flags7[1]; - downedCLAM = flags7[2]; - _ = flags7[3]; - AcidRainEvent.AcidRainEventIsOngoing = flags7[4]; - downedEoCAcidRain = flags7[5]; - downedAquaticScourgeAcidRain = flags7[6]; - AcidRainEvent.HasTriedToSummonOldDuke = flags7[7]; - - BitsByte flags8 = reader.ReadByte(); - AcidRainEvent.HasBeenForceStartedByEoCDefeat = flags8[0]; - _ = flags8[1]; - downedSecondSentinels = flags8[2]; - foundHomePermafrost = flags8[3]; - downedCLAMHardMode = flags8[4]; - catName = flags8[5]; - dogName = flags8[6]; - bunnyName = flags8[7]; - - BitsByte flags9 = reader.ReadByte(); - _ = flags9[0]; - _ = flags9[1]; - _ = flags9[2]; - _ = flags9[3]; - _ = flags9[4]; - _ = flags9[5]; - _ = flags9[6]; - _ = flags9[7]; - - BitsByte flags10 = reader.ReadByte(); - _ = flags10[0]; - _ = flags10[1]; - AcidRainEvent.OldDukeHasBeenEncountered = flags10[2]; - _ = flags10[3]; - _ = flags10[4]; - _ = flags10[5]; - _ = flags10[6]; - _ = flags10[7]; - - BitsByte flags11 = reader.ReadByte(); - _ = flags11[0]; - HasGeneratedLuminitePlanetoids = flags11[1]; - downedPrimordialWyrm = flags11[2]; - downedExoMechs = flags11[3]; - downedAres = flags11[4]; - downedThanatos = flags11[5]; - downedArtemisAndApollo = flags11[6]; - TalkedToDraedon = flags11[7]; - - BitsByte flags12 = reader.ReadByte(); - downedCragmawMire = flags12[0]; - downedMauler = flags12[1]; - downedNuclearTerror = flags12[2]; - downedBossRush = flags12[3]; - DraedonMechdusa = flags12[4]; - - RecipeUnlockHandler.ReceiveData(reader); - - Abyss.AbyssChasmBottom = reader.ReadInt32(); - SulphurousSea.YStart = reader.ReadInt32(); - AstralBiome.YStart = reader.ReadInt32(); - AcidRainEvent.AccumulatedKillPoints = reader.ReadInt32(); - Reforges = reader.ReadInt32(); - MoneyStolenByBandit = reader.ReadInt32(); - DraedonSummonCountdown = reader.ReadInt32(); - DraedonMechToSummon = (ExoMech)reader.ReadInt32(); - DraedonSummonPosition = reader.ReadVector2(); - SunkenSeaLabCenter = reader.ReadVector2(); - PlanetoidLabCenter = reader.ReadVector2(); - JungleLabCenter = reader.ReadVector2(); - HellLabCenter = reader.ReadVector2(); - IceLabCenter = reader.ReadVector2(); - CavernLabCenter = reader.ReadVector2(); - } - #endregion - } -} 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/UI/AstralArcanumUI.cs b/UI/AstralArcanumUI.cs deleted file mode 100644 index ef5cc8cbfb..0000000000 --- a/UI/AstralArcanumUI.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 AstralArcanumUI - { - 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/AstralArcanumCircles", 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/UI/MiscTextures/AstralArcanumCircles.png b/UI/MiscTextures/AstralArcanumCircles.png deleted file mode 100644 index 2368842261..0000000000 Binary files a/UI/MiscTextures/AstralArcanumCircles.png and /dev/null differ diff --git a/UI/ModeIndicator/ModeIndicatorUI.cs b/UI/ModeIndicator/ModeIndicatorUI.cs index 90c6b4b05d..723f75b573 100644 --- a/UI/ModeIndicator/ModeIndicatorUI.cs +++ b/UI/ModeIndicator/ModeIndicatorUI.cs @@ -210,7 +210,7 @@ namespace CalamityMod.UI.ModeIndicator string modeToDisplay = Difficulties[1].Name.ToString(); bool anyActiveMode = false; - for (int i = 1; i < Difficulties.Length; i++) + for (int i = 1; i < Difficulties.Count; i++) { if (GetCurrentDifficulty == Difficulties[i]) { @@ -406,7 +406,7 @@ namespace CalamityMod.UI.ModeIndicator // But would be super useful so other mods can let their own difficulties go there. // Disable difficulties. - for (int i = 0; i < Difficulties.Length; i++) + for (int i = 0; i < Difficulties.Count; i++) { // Disable all difficulties at the same tier / at a tier above itself. if (Difficulties[i]._difficultyTier >= mode._difficultyTier && Difficulties[i] != mode) diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index 8a03f12c5b..9984a20a61 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -813,6 +813,7 @@ namespace CalamityMod // Make various things cheaper (sorted by progression) { Vanilla(ItemID.Leather), ChangeIngredientStack(ItemID.RottenChunk, 2) }, { Vanilla(ItemID.JestersArrow), JesterArrowRecipeEdit }, + { Vanilla(ItemID.TeleportationPotion), TeleportationPotionRecipeEdit }, { Vanilla(ItemID.WormFood), WormFoodRecipeEdit }, { Vanilla(ItemID.BloodySpine), BloodySpineRecipeEdit }, { Vanilla(ItemID.GoblinBattleStandard), ChangeIngredientStack(ItemID.TatteredCloth, 5) }, @@ -826,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) }, @@ -957,6 +959,15 @@ namespace CalamityMod r.ChangeIngredientStack(ItemID.WoodenArrow, intendedStack); } + // Increases Teleportation Potion's recipe to give 5 per craft and use 5 bottled waters + private static void TeleportationPotionRecipeEdit(Recipe r) + { + int intendedStack = 5; + if (r.createItem.stack < intendedStack) + r.createItem.stack = intendedStack; + r.ChangeIngredientStack(ItemID.BottledWater, intendedStack); + } + // Change True Night's Edge recipe to require far less mech boss souls private static void TrueNightsEdgeRecipeEdit(Recipe r) { @@ -1079,7 +1090,8 @@ namespace CalamityMod ItemID.StinkPotion, ItemID.RecallPotion, ItemID.PotionOfReturn, - ItemID.LuckPotionLesser + ItemID.LuckPotionLesser, + ItemID.BiomeSightPotion }; Recipe r; diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index 452c1edf1d..2c835c9d85 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -173,9 +173,9 @@ namespace CalamityMod light += 1; if (mp.aquaticHeart) light += 1; - if (mp.aAmpoule) - light += 1; - else if (mp.rOoze && !Main.dayTime) // radiant ooze and ampoule/higher don't stack + if (mp.purity) // does not stack with downgrades + light += 2; + else if (mp.rOoze || mp.aAmpoule) // the two "yellow lights" do not stack with each other light += 1; if (mp.aquaticEmblem && underwater) light += 1; @@ -245,6 +245,8 @@ namespace CalamityMod return true; } + // See also: Player.IsStandingStillForSpecialEffects (Vanilla shiny stone + standing still mana regen) + // That is more or less equivalent to this with the default value of 0.05 public static bool StandingStill(this Player player, float velocity = 0.05f) => player.velocity.Length() < velocity; /// 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\*