diff --git a/BiomeManagers/SulphurousSeaBiome.cs b/BiomeManagers/SulphurousSeaBiome.cs index f0f6fa7eba..0ca4be3feb 100644 --- a/BiomeManagers/SulphurousSeaBiome.cs +++ b/BiomeManagers/SulphurousSeaBiome.cs @@ -31,6 +31,7 @@ namespace CalamityMod.BiomeManagers if (!CalamityPlayer.areThereAnyDamnBosses) { bool acidRain = AcidRainEvent.AcidRainEventIsOngoing; + bool normalRain = Main.cloudAlpha > 0f; // Acid Rain themes if (acidRain) @@ -42,9 +43,18 @@ namespace CalamityMod.BiomeManagers // Regular Sulphur Sea themes, when Acid Rain is not occurring else - music = !Main.dayTime - ? CalamityMod.Instance.GetMusicFromMusicMod("SulphurousSeaNight") ?? MusicID.Desert // Nighttime - : CalamityMod.Instance.GetMusicFromMusicMod("SulphurousSeaDay") ?? MusicID.Desert; // Daytime + { + if (normalRain) + { + music = CalamityMod.Instance.GetMusicFromMusicMod("SulphurousSeaRain") ?? MusicID.Desert; // Normal Rain + } + else + { + music = !Main.dayTime + ? CalamityMod.Instance.GetMusicFromMusicMod("SulphurousSeaNight") ?? MusicID.Desert // Nighttime + : CalamityMod.Instance.GetMusicFromMusicMod("SulphurousSeaDay") ?? MusicID.Desert; // Daytime + } + } } return music; diff --git a/Buffs/StatBuffs/AbyssalDivingSuitPlates.cs b/Buffs/StatBuffs/AbyssalDivingSuitPlates.cs index 41164d0898..23137c86dd 100644 --- a/Buffs/StatBuffs/AbyssalDivingSuitPlates.cs +++ b/Buffs/StatBuffs/AbyssalDivingSuitPlates.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.Items.Accessories; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs @@ -13,6 +14,11 @@ namespace CalamityMod.Buffs.StatBuffs Main.buffNoSave[Type] = true; } + public override void ModifyBuffText(ref string buffName, ref string tip, ref int rare) + { + tip = base.Description.Format((AbyssalDivingSuit.PlatesAllDamageReduction - Main.player[Main.myPlayer].Calamity().abyssalDivingSuitPlateHits * AbyssalDivingSuit.PlatesHitDecay).ToPercent()); + } + public override void Update(Player player, ref int buffIndex) { player.Calamity().abyssalDivingSuitPlates = true; diff --git a/Buffs/StatBuffs/AquaticHeartWaterSpeed.cs b/Buffs/StatBuffs/AquaticHeartWaterSpeed.cs index 280f8f2f62..2a8341dc4a 100644 --- a/Buffs/StatBuffs/AquaticHeartWaterSpeed.cs +++ b/Buffs/StatBuffs/AquaticHeartWaterSpeed.cs @@ -1,10 +1,14 @@ -using Terraria; +using CalamityMod.Items.Accessories; +using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs { public class AquaticHeartWaterSpeed : ModBuff { + public override LocalizedText Description => base.Description.WithFormatArgs(AquaticHeart.WaterSpeedBoost.ToPercent()); + public override void SetStaticDefaults() { Main.debuff[Type] = false; diff --git a/Buffs/StatBuffs/CoralSymbiosis.cs b/Buffs/StatBuffs/CoralSymbiosis.cs index 0a3e8851bf..f6292a4461 100644 --- a/Buffs/StatBuffs/CoralSymbiosis.cs +++ b/Buffs/StatBuffs/CoralSymbiosis.cs @@ -1,11 +1,14 @@ using CalamityMod.Items.Weapons.Magic; using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs { public class CoralSymbiosis : ModBuff { + public override LocalizedText Description => base.Description.WithFormatArgs(CoralSpout.SymbiosisDamageBuff); + public override void SetStaticDefaults() { Main.debuff[Type] = false; diff --git a/Buffs/StatBuffs/Encased.cs b/Buffs/StatBuffs/Encased.cs index 251d0489a8..34013fef8b 100644 --- a/Buffs/StatBuffs/Encased.cs +++ b/Buffs/StatBuffs/Encased.cs @@ -3,12 +3,15 @@ using CalamityMod.Items.Accessories; using Terraria; using Terraria.Audio; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs { public class Encased : ModBuff { + public override LocalizedText Description => base.Description.WithFormatArgs(PermafrostsConcoction.EncasedDefenseBoost, PermafrostsConcoction.EncasedAllDamageReduction.ToPercent()); + public override void SetStaticDefaults() { Main.debuff[Type] = true; diff --git a/Buffs/StatBuffs/HallowedRuneDefense.cs b/Buffs/StatBuffs/HallowedRuneDefense.cs index 769359d05e..f307c99e49 100644 --- a/Buffs/StatBuffs/HallowedRuneDefense.cs +++ b/Buffs/StatBuffs/HallowedRuneDefense.cs @@ -1,10 +1,14 @@ -using Terraria; +using CalamityMod.Items.Accessories; +using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs { public class HallowedRuneDefense : ModBuff { + public override LocalizedText Description => base.Description.WithFormatArgs(HallowedRune.DefenseBoost, HallowedRune.DamageReductionBoost.ToPercent()); + public override void SetStaticDefaults() { Main.debuff[Type] = false; @@ -15,8 +19,8 @@ namespace CalamityMod.Buffs.StatBuffs public override void Update(Player player, ref int buffIndex) { - player.statDefense += 8; - player.endurance += 0.04f; // TODO -- is this applied too late to be affected by the DR softcap? + player.statDefense += HallowedRune.DefenseBoost; + player.endurance += HallowedRune.DamageReductionBoost; // TODO -- is this applied too late to be affected by the DR softcap? } } } diff --git a/Buffs/StatBuffs/HallowedRunePower.cs b/Buffs/StatBuffs/HallowedRunePower.cs index 227723e448..f99ddd9cc2 100644 --- a/Buffs/StatBuffs/HallowedRunePower.cs +++ b/Buffs/StatBuffs/HallowedRunePower.cs @@ -1,10 +1,14 @@ -using Terraria; +using CalamityMod.Items.Accessories; +using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs { public class HallowedRunePower : ModBuff { + public override LocalizedText Description => base.Description.WithFormatArgs(HallowedRune.SummonDamageBoost.ToPercent()); + public override void SetStaticDefaults() { Main.debuff[Type] = false; @@ -16,7 +20,7 @@ namespace CalamityMod.Buffs.StatBuffs public override void Update(Player player, ref int buffIndex) { player.Calamity().hallowedPower = true; - player.GetDamage() += 0.1f; + player.GetDamage() += HallowedRune.SummonDamageBoost; } } } diff --git a/Buffs/StatBuffs/IceShieldBuff.cs b/Buffs/StatBuffs/IceShieldBuff.cs index 3678d17394..b652f9f936 100644 --- a/Buffs/StatBuffs/IceShieldBuff.cs +++ b/Buffs/StatBuffs/IceShieldBuff.cs @@ -1,10 +1,14 @@ -using Terraria; +using CalamityMod.Items.Accessories; +using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs { public class IceShieldBuff : ModBuff { + public override LocalizedText Description => base.Description.WithFormatArgs(AquaticHeart.IceShieldAllDamageReduction.ToPercent()); + public override void SetStaticDefaults() { Main.buffNoTimeDisplay[Type] = true; diff --git a/Buffs/StatBuffs/PhantomicEmpowerment.cs b/Buffs/StatBuffs/PhantomicEmpowerment.cs index 73fb24895c..4599d4e18f 100644 --- a/Buffs/StatBuffs/PhantomicEmpowerment.cs +++ b/Buffs/StatBuffs/PhantomicEmpowerment.cs @@ -1,10 +1,14 @@ -using Terraria; +using CalamityMod.Items.Accessories; +using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs { public class PhantomicEmpowerment : ModBuff { + public override LocalizedText Description => base.Description.WithFormatArgs(PhantomicArtifact.SummonDamageBoost.ToPercent()); + public override void SetStaticDefaults() { Main.debuff[Type] = false; @@ -15,7 +19,7 @@ namespace CalamityMod.Buffs.StatBuffs public override void Update(Player player, ref int buffIndex) { - player.GetDamage() += 0.1f; + player.GetDamage() += PhantomicArtifact.SummonDamageBoost; } } } diff --git a/Buffs/StatBuffs/PhantomicShield.cs b/Buffs/StatBuffs/PhantomicShield.cs index 9a502b69dd..dc8d920fad 100644 --- a/Buffs/StatBuffs/PhantomicShield.cs +++ b/Buffs/StatBuffs/PhantomicShield.cs @@ -1,10 +1,14 @@ -using Terraria; +using CalamityMod.Items.Accessories; +using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs { public class PhantomicShield : ModBuff { + public override LocalizedText Description => base.Description.WithFormatArgs(PhantomicArtifact.DefenseBoost, PhantomicArtifact.DamageReductionBoost.ToPercent()); + public override void SetStaticDefaults() { Main.debuff[Type] = false; @@ -15,8 +19,8 @@ namespace CalamityMod.Buffs.StatBuffs public override void Update(Player player, ref int buffIndex) { - player.endurance += 0.05f; // TODO -- is this applied too late to be affected by the DR softcap? - player.statDefense += 10; + player.endurance += PhantomicArtifact.DamageReductionBoost; // TODO -- is this applied too late to be affected by the DR softcap? + player.statDefense += PhantomicArtifact.DefenseBoost; } } } diff --git a/Buffs/StatBuffs/ReaverRage.cs b/Buffs/StatBuffs/ReaverRage.cs index 5406617ea4..11e38a84f4 100644 --- a/Buffs/StatBuffs/ReaverRage.cs +++ b/Buffs/StatBuffs/ReaverRage.cs @@ -1,10 +1,14 @@ -using Terraria; +using CalamityMod.Items.Armor.Reaver; +using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs { public class ReaverRage : ModBuff { + public override LocalizedText Description => base.Description.WithFormatArgs(ReaverHeadTank.ReaverRageDefenseBoost, ReaverHeadTank.ReaverRageDamageBoost.ToPercent()); + public override void SetStaticDefaults() { Main.debuff[Type] = false; diff --git a/Buffs/StatBuffs/SpiritDefense.cs b/Buffs/StatBuffs/SpiritDefense.cs index 86933e4e2b..664de50b2b 100644 --- a/Buffs/StatBuffs/SpiritDefense.cs +++ b/Buffs/StatBuffs/SpiritDefense.cs @@ -1,10 +1,14 @@ -using Terraria; +using CalamityMod.Items.Accessories; +using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs { public class SpiritDefense : ModBuff { + public override LocalizedText Description => base.Description.WithFormatArgs(SpiritGlyph.DefenseBoost, SpiritGlyph.DamageReductionBoost.ToPercent()); + public override void SetStaticDefaults() { Main.debuff[Type] = false; @@ -15,8 +19,8 @@ namespace CalamityMod.Buffs.StatBuffs public override void Update(Player player, ref int buffIndex) { - player.statDefense += 6; - player.endurance += 0.03f; // TODO -- is this applied too late to be affected by the DR softcap? + player.statDefense += SpiritGlyph.DefenseBoost; + player.endurance += SpiritGlyph.DamageReductionBoost; // TODO -- is this applied too late to be affected by the DR softcap? } } } diff --git a/Buffs/StatBuffs/SpiritPower.cs b/Buffs/StatBuffs/SpiritPower.cs index abc18fed2b..2233f93857 100644 --- a/Buffs/StatBuffs/SpiritPower.cs +++ b/Buffs/StatBuffs/SpiritPower.cs @@ -1,10 +1,14 @@ -using Terraria; +using CalamityMod.Items.Accessories; +using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs { public class SpiritPower : ModBuff { + public override LocalizedText Description => base.Description.WithFormatArgs(SpiritGlyph.SummonDamageBoost.ToPercent()); + public override void SetStaticDefaults() { Main.debuff[Type] = false; @@ -15,7 +19,7 @@ namespace CalamityMod.Buffs.StatBuffs public override void Update(Player player, ref int buffIndex) { - player.GetDamage() += 0.1f; + player.GetDamage() += SpiritGlyph.SummonDamageBoost; } } } diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index ad9415740b..ad7fd47ec1 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -16,14 +16,20 @@ using CalamityMod.Events; using CalamityMod.FluidSimulation; using CalamityMod.Items; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Armor; +using CalamityMod.Items.Armor.Auric; using CalamityMod.Items.Armor.Bloodflare; using CalamityMod.Items.Armor.Brimflame; +using CalamityMod.Items.Armor.Daedalus; using CalamityMod.Items.Armor.Demonshade; +using CalamityMod.Items.Armor.Empyrean; using CalamityMod.Items.Armor.LunicCorps; using CalamityMod.Items.Armor.OmegaBlue; using CalamityMod.Items.Armor.PlagueReaper; using CalamityMod.Items.Armor.Silva; +using CalamityMod.Items.Armor.SnowRuffian; +using CalamityMod.Items.Armor.Victide; using CalamityMod.Items.Dyes; using CalamityMod.Items.Mounts; using CalamityMod.Items.Mounts.Minecarts; @@ -603,6 +609,7 @@ namespace CalamityMod.CalPlayer public bool holyMinions = false; public bool alchFlask = false; public bool toxicHeart = false; + public bool toxicHeartVisuals = false; public bool abaddon = false; public bool aeroStone = false; @@ -1815,6 +1822,7 @@ namespace CalamityMod.CalPlayer holyMinions = false; alchFlask = false; toxicHeart = false; + toxicHeartVisuals = false; abaddon = false; aeroStone = false; lifejelly = false; @@ -3878,7 +3886,7 @@ namespace CalamityMod.CalPlayer (shadowSpeed ? 0.5f : 0f) + (stressPills ? 0.05f : 0f) + ((abyssalDivingSuit && Player.IsUnderwater()) ? 0.05f : 0f) + - (aquaticHeartWaterBuff ? 0.15f : 0f) + + (aquaticHeartWaterBuff ? AquaticHeart.WaterSpeedBoost : 0f) + ((frostFlare && Player.statLife <= (int)(Player.statLifeMax2 * 0.5)) ? 0.15f : 0f) + (dragonScales ? 0.1f : 0f) + (kamiBoost ? YanmeisKnife.RunAccelerationBoost : 0f) + @@ -3895,7 +3903,7 @@ namespace CalamityMod.CalPlayer (shadowSpeed ? 0.5f : 0f) + (stressPills ? 0.05f : 0f) + ((abyssalDivingSuit && Player.IsUnderwater()) ? 0.05f : 0f) + - (aquaticHeartWaterBuff ? 0.15f : 0f) + + (aquaticHeartWaterBuff ? AquaticHeart.WaterSpeedBoost : 0f) + ((frostFlare && Player.statLife <= (int)(Player.statLifeMax2 * 0.5)) ? 0.15f : 0f) + (dragonScales ? 0.1f : 0f) + (kamiBoost ? YanmeisKnife.RunSpeedBoost : 0f) + @@ -4299,6 +4307,66 @@ namespace CalamityMod.CalPlayer #region Frame Effects public override void FrameEffects() { + // Mannequin frame effects + // These "players" never load Calamity's equippable bools so they need to be manually loaded + if (Player.isDisplayDollOrInanimate) + { + // Body + if (Player.armor[1].type == ModContent.ItemType()) + Player.body = EquipLoader.GetEquipSlot(Mod, "AuricTeslaBodyArmor", EquipType.Body); + else if (Player.armor[1].type == ModContent.ItemType()) + Player.body = EquipLoader.GetEquipSlot(Mod, "DaedalusBreastplate", EquipType.Body); + else if (Player.armor[1].type == ModContent.ItemType()) + Player.body = EquipLoader.GetEquipSlot(Mod, "EmpyreanCloak", EquipType.Body); + else if (Player.armor[1].type == ModContent.ItemType()) + Player.body = EquipLoader.GetEquipSlot(Mod, "SnowRuffianChestplate", EquipType.Body); + else if (Player.armor[1].type == ModContent.ItemType()) + Player.body = EquipLoader.GetEquipSlot(Mod, "VictideBreastplate", EquipType.Body); + + // Legs + if (Player.armor[2].type == ModContent.ItemType()) + Player.legs = EquipLoader.GetEquipSlot(Mod, "VictideGreaves", EquipType.Legs); + + // Set Bonus + if (Player.armor[0].type == ModContent.ItemType() + && Player.armor[1].type == ModContent.ItemType() + && Player.armor[2].type == ModContent.ItemType()) + snowRuffianSet = true; + + // Accessories + for (int i = 3; i < 8; i++) + { + Item vanity = Player.armor[i]; + + if (vanity.type == ModContent.ItemType()) + Player.GetModPlayer().transformationActive = true; + if (vanity.type == ModContent.ItemType()) + abyssalDivingSuitForce = true; + if (vanity.type == ModContent.ItemType()) + aquaticHeartForce = true; + if (vanity.type == ModContent.ItemType()) + Player.GetModPlayer().vanityEquipped = true; + if (vanity.type == ModContent.ItemType()) + ghostBracelet = true; + if (vanity.type == ModContent.ItemType()) + Player.GetModPlayer().vanityEquipped = true; + if (vanity.type == ModContent.ItemType()) + Player.GetModPlayer().vanityEquipped = true; + if (vanity.type == ModContent.ItemType()) + snowmanForce = true; + if (vanity.type == ModContent.ItemType()) + profanedCrystalForce = true; + if (vanity.type == ModContent.ItemType()) + punchCard = true; + if (vanity.type == ModContent.ItemType()) + Player.GetModPlayer().vanityEquipped = true; + if (vanity.type == ModContent.ItemType()) + Player.GetModPlayer().vanityEquipped = true; + if (vanity.type == ModContent.ItemType()) + Player.GetModPlayer().vanityEquipped = true; + } + } + if (Player.Calamity().andromedaState == AndromedaPlayerState.LargeRobot || Player.Calamity().andromedaState == AndromedaPlayerState.SpecialAttack) { diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 18051976c0..f8f80246ef 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -810,13 +810,13 @@ namespace CalamityMod.CalPlayer contactDamageReduction += 0.15; if (abyssalDivingSuitPlates) - contactDamageReduction += 0.15 - abyssalDivingSuitPlateHits * 0.03; + contactDamageReduction += AbyssalDivingSuit.PlatesAllDamageReduction - abyssalDivingSuitPlateHits * AbyssalDivingSuit.PlatesHitDecay; if (aquaticHeartIce) - contactDamageReduction += 0.2; + contactDamageReduction += AquaticHeart.IceShieldAllDamageReduction; if (encased) - contactDamageReduction += 0.3; + contactDamageReduction += PermafrostsConcoction.EncasedAllDamageReduction; if (Player.ownedProjectileCounts[ModContent.ProjectileType()] > 0 && Player.ActiveItem().type == ModContent.ItemType()) contactDamageReduction += 0.5; @@ -1047,13 +1047,13 @@ namespace CalamityMod.CalPlayer projectileDamageReduction += 0.15; if (abyssalDivingSuitPlates) - projectileDamageReduction += 0.15 - abyssalDivingSuitPlateHits * 0.03; + projectileDamageReduction += AbyssalDivingSuit.PlatesAllDamageReduction - abyssalDivingSuitPlateHits * AbyssalDivingSuit.PlatesHitDecay; if (aquaticHeartIce) - projectileDamageReduction += 0.2; + projectileDamageReduction += AquaticHeart.IceShieldAllDamageReduction; if (encased) - projectileDamageReduction += 0.3; + projectileDamageReduction += PermafrostsConcoction.EncasedAllDamageReduction; if (Player.ownedProjectileCounts[ModContent.ProjectileType()] > 0 && Player.ActiveItem().type == ModContent.ItemType()) projectileDamageReduction += 0.5; diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 49dd58e354..cf8aca672f 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -644,7 +644,7 @@ namespace CalamityMod.CalPlayer Player.lifeRegen += 3; if (sRegen) - Player.lifeRegen += 2; + Player.lifeRegen += SpiritGlyph.RegenBoost; if (PinkJellyRegen) Player.lifeRegen += LifeJelly.AuraRegenBoost; @@ -656,7 +656,7 @@ namespace CalamityMod.CalPlayer Player.lifeRegen += TheAbsorber.AuraRegenBoost; if (hallowedRegen) - Player.lifeRegen += 3; + Player.lifeRegen += HallowedRune.RegenBoost; if (affliction || afflicted) Player.lifeRegen += 1; @@ -680,7 +680,7 @@ namespace CalamityMod.CalPlayer if (phantomicHeartRegen <= 720 && phantomicHeartRegen >= 600) { - Player.lifeRegen += 2; + Player.lifeRegen += PhantomicArtifact.RegenBoost; if (Main.rand.NextBool()) { Dust regen = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.Blood, 0f, 0f, 200, new Color(99, 54, 84), 2f); @@ -900,16 +900,27 @@ namespace CalamityMod.CalPlayer if (toxicHeart) // Since it needs to know your life regen, it must be placed here { + float minLifeRegen = -20; // Fastest rate + float maxLifeRegen = 15; // Slowest rate int auraDamage = (int)Player.GetBestClassDamage().ApplyTo(200); var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); - pulseRate = Utils.Remap(Player.lifeRegen, -30, 10, 20, 1, true); + float lifeRegenRate = Utils.Remap(Player.lifeRegen, minLifeRegen, maxLifeRegen, 20, 1, true); + + if (pulseRate < lifeRegenRate) // Jump to fastest pulse rate and slowly slow down if life regen increases + pulseRate = lifeRegenRate; + else + pulseRate = MathHelper.Lerp(pulseRate, lifeRegenRate, 0.002f); + if (pulseCounter >= 420) { Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), auraDamage, 0f, Player.whoAmI, 0, 0, 0); pulseCounter = 0; - float soundVolume = Utils.Remap(Player.lifeRegen, -30, 10, 1f, 0.3f, true); - SoundStyle heartbeat = new("CalamityMod/Sounds/Item/Heartbeat"); - SoundEngine.PlaySound(heartbeat with { Volume = soundVolume, PitchVariance = 0.2f }, Player.Center); + if (toxicHeartVisuals) + { + float soundVolume = Utils.Remap(Player.lifeRegen, minLifeRegen, maxLifeRegen, 1f, 0.3f, true); + SoundStyle heartbeat = new("CalamityMod/Sounds/Item/Heartbeat"); + SoundEngine.PlaySound(heartbeat with { Volume = soundVolume, PitchVariance = 0.2f }, Player.Center); + } } else { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 3de198a285..05314f7dcd 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -24,6 +24,7 @@ using CalamityMod.Items.Armor.Hydrothermic; using CalamityMod.Items.Armor.LunicCorps; using CalamityMod.Items.Armor.OmegaBlue; using CalamityMod.Items.Armor.Prismatic; +using CalamityMod.Items.Armor.Reaver; using CalamityMod.Items.Armor.Silva; using CalamityMod.Items.Armor.Tarragon; using CalamityMod.Items.Armor.Wulfrum; @@ -2146,7 +2147,7 @@ namespace CalamityMod.CalPlayer if (encased) { - Player.statDefense += 30; + Player.statDefense += PermafrostsConcoction.EncasedDefenseBoost; Player.frozen = true; Player.velocity.X = 0f; Player.velocity.Y = -0.4f; // Should negate gravity @@ -2902,14 +2903,14 @@ namespace CalamityMod.CalPlayer if (rRage) { - Player.GetDamage() += 0.1f; - Player.statDefense += 5; + Player.GetDamage() += ReaverHeadTank.ReaverRageDamageBoost; + Player.statDefense += ReaverHeadTank.ReaverRageDefenseBoost; } if (xWrath) { - Player.GetDamage() += 0.1f; - Player.GetCritChance() += 5; + Player.GetDamage() += 0.1f; + Player.GetCritChance() += 5; } if (graxDefense) diff --git a/Items/Accessories/AbyssalDivingSuit.cs b/Items/Accessories/AbyssalDivingSuit.cs index fd672d8313..29f496a0b1 100644 --- a/Items/Accessories/AbyssalDivingSuit.cs +++ b/Items/Accessories/AbyssalDivingSuit.cs @@ -10,6 +10,10 @@ namespace CalamityMod.Items.Accessories public class AbyssalDivingSuit : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static double PlatesAllDamageReduction = 0.15D; + public static double PlatesHitDecay = 0.03D; + public override void Load() { // All code below runs only if we're not loading on a server diff --git a/Items/Accessories/AquaticHeart.cs b/Items/Accessories/AquaticHeart.cs index 8eaf86ad86..0187c48cfc 100644 --- a/Items/Accessories/AquaticHeart.cs +++ b/Items/Accessories/AquaticHeart.cs @@ -11,6 +11,10 @@ namespace CalamityMod.Items.Accessories public class AquaticHeart : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static float WaterSpeedBoost = 0.15f; + public static double IceShieldAllDamageReduction = 0.2D; + public override void Load() { // All code below runs only if we're not loading on a server diff --git a/Items/Accessories/HallowedRune.cs b/Items/Accessories/HallowedRune.cs index f6bf010380..360aa5df98 100644 --- a/Items/Accessories/HallowedRune.cs +++ b/Items/Accessories/HallowedRune.cs @@ -7,6 +7,12 @@ namespace CalamityMod.Items.Accessories public class HallowedRune : ModItem, ILocalizedModType, IHoldShiftTooltipItem { public new string LocalizationCategory => "Items.Accessories"; + + public static int RegenBoost = 3; + public static int DefenseBoost = 8; + public static float DamageReductionBoost = 0.04f; + public static float SummonDamageBoost = 0.1f; + public override void SetDefaults() { Item.width = 26; diff --git a/Items/Accessories/PermafrostsConcoction.cs b/Items/Accessories/PermafrostsConcoction.cs index e52819bd0c..7b849b028e 100644 --- a/Items/Accessories/PermafrostsConcoction.cs +++ b/Items/Accessories/PermafrostsConcoction.cs @@ -8,7 +8,10 @@ namespace CalamityMod.Items.Accessories { // Boosted by Cross Necklace. internal static readonly int EncasedIFrames = 90; - + + public static int EncasedDefenseBoost = 30; + public static double EncasedAllDamageReduction = 0.3D; + public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { diff --git a/Items/Accessories/PhantomicArtifact.cs b/Items/Accessories/PhantomicArtifact.cs index a45bdf9c9c..15ea7c2134 100644 --- a/Items/Accessories/PhantomicArtifact.cs +++ b/Items/Accessories/PhantomicArtifact.cs @@ -15,6 +15,12 @@ namespace CalamityMod.Items.Accessories public class PhantomicArtifact : ModItem, ILocalizedModType, IHoldShiftTooltipItem { public new string LocalizationCategory => "Items.Accessories"; + + public static int RegenBoost = 2; + public static int DefenseBoost = 10; + public static float DamageReductionBoost = 0.05f; + public static float SummonDamageBoost = 0.1f; + public override void SetStaticDefaults() { Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 7)); diff --git a/Items/Accessories/SpiritGlyph.cs b/Items/Accessories/SpiritGlyph.cs index 2f7f12d2cb..2d1d84ad2f 100644 --- a/Items/Accessories/SpiritGlyph.cs +++ b/Items/Accessories/SpiritGlyph.cs @@ -9,6 +9,12 @@ namespace CalamityMod.Items.Accessories public class SpiritGlyph : ModItem, ILocalizedModType, IHoldShiftTooltipItem { public new string LocalizationCategory => "Items.Accessories"; + + public static int RegenBoost = 2; + public static int DefenseBoost = 6; + public static float DamageReductionBoost = 0.03f; + public static float SummonDamageBoost = 0.1f; + public override void SetDefaults() { Item.width = 24; diff --git a/Items/Accessories/ToxicHeart.cs b/Items/Accessories/ToxicHeart.cs index ca3e9c0e5a..97daa1e8cb 100644 --- a/Items/Accessories/ToxicHeart.cs +++ b/Items/Accessories/ToxicHeart.cs @@ -27,6 +27,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.toxicHeart = true; + modPlayer.toxicHeartVisuals = !hideVisual; } } } diff --git a/Items/Armor/Reaver/ReaverHeadTank.cs b/Items/Armor/Reaver/ReaverHeadTank.cs index 4daabc64d8..0aff26f2c8 100644 --- a/Items/Armor/Reaver/ReaverHeadTank.cs +++ b/Items/Armor/Reaver/ReaverHeadTank.cs @@ -13,6 +13,9 @@ namespace CalamityMod.Items.Armor.Reaver public new string LocalizationCategory => "Items.Armor.Hardmode"; internal static string HealOrbEntitySourceContext => "SetBonus_Calamity_ReaverTank"; + public static int ReaverRageDefenseBoost = 5; + public static float ReaverRageDamageBoost = 0.1f; + //Defense and DR Helm public override void SetDefaults() { @@ -45,7 +48,6 @@ namespace CalamityMod.Items.Armor.Reaver modPlayer.reaverDefense = true; modPlayer.wearingRogueArmor = true; player.setBonus = this.GetLocalizedValue("SetBonus"); - // Reaver Rage provides 10% damage, 5 def, and 5% melee speed. } public override void UpdateEquip(Player player) diff --git a/Items/Mounts/ExoTank.cs b/Items/Mounts/ExoTank.cs index 8219d43355..59b2dad384 100644 --- a/Items/Mounts/ExoTank.cs +++ b/Items/Mounts/ExoTank.cs @@ -151,14 +151,16 @@ namespace CalamityMod.Items.Mounts if (angle > MathHelper.ToRadians(60f)) continue; - canFireLasers = angle <= MathHelper.ToRadians(18f); + if (canFireLasers && angle > MathHelper.ToRadians(18f)) + continue; } else { if (angle < MathHelper.ToRadians(120f)) continue; - canFireLasers = angle >= MathHelper.ToRadians(162f); + if (canFireLasers && angle < MathHelper.ToRadians(162f)) + continue; } float distance = targetDif.Length(); @@ -166,6 +168,7 @@ namespace CalamityMod.Items.Mounts { range = distance; targetNPC = target.whoAmI; + canFireLasers = (player.direction == 1 ? angle <= MathHelper.ToRadians(18f) : angle >= MathHelper.ToRadians(162f)); } } diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 12a7432de8..d2f2267717 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -651,7 +651,7 @@ AbyssalDivingSuitBuff: { AbyssalDivingSuitPlates: { DisplayName: Abyssal Diving Suit Plates - Description: 15% increased damage reduction + Description: "{0}% increased damage reduction" } AbyssalMadness: { @@ -695,7 +695,7 @@ AquaticHeartBuff: { AquaticHeartWaterSpeed: { DisplayName: Ocean's Blessing - Description: 15% increased max speed and acceleration + Description: "{0}% increased max speed and acceleration" } AvertorBonus: { @@ -741,7 +741,7 @@ ChiRegenBuff: { CoralSymbiosis: { DisplayName: Coral Symbiosis - Description: Coral Spout charges up faster and deals 2 extra damage + Description: Coral Spout charges up faster and deals {0} extra damage } CosmicFreeze: { @@ -766,7 +766,7 @@ EmpyreanWrath: { Encased: { DisplayName: Encased - Description: Increased defense by 30 and damage reduction by 30%, but... + Description: Increased defense by {0} and damage reduction by {1}%, but... } GraxBoost: { @@ -781,12 +781,12 @@ GreenJellyRegen: { HallowedRuneDefense: { DisplayName: Hallowed Defense - Description: Increased defense by 8 and damage reduction by 4% + Description: Increased defense by {0} and damage reduction by {1}% } HallowedRunePower: { DisplayName: Hallowed Power - Description: 10% increased summon damage + Description: "{0}% increased summon damage" } HallowedRuneRegeneration: { @@ -801,7 +801,7 @@ Haste: { IceShieldBuff: { DisplayName: Ice Shield - Description: Absorbs 20% damage from the next hit you take, then shatters + Description: Absorbs {0}% damage from the next hit you take, then shatters } KamiBuff: { @@ -816,7 +816,7 @@ Mushy: { PhantomicEmpowerment: { DisplayName: Phantomic Empowerment - Description: 10% increased summon damage + Description: "{0}% increased summon damage" } PhantomicRegen: { @@ -828,7 +828,7 @@ PhantomicShield: { DisplayName: Phantomic Shield Description: ''' - Defense increased by 10 and damage reduction increased by 5% + Defense increased by {0} and damage reduction increased by {1}% An ephemeral bulwark protects you ''' } @@ -880,7 +880,7 @@ ReaverRage: { Description: ''' Rage of the earth - Defense increased by 5 and damage increased by 10% + Defense increased by {0} and damage increased by {1}% ''' } @@ -900,12 +900,12 @@ SilvaRevival: { SpiritDefense: { DisplayName: Spirit Defense - Description: Defense increased by 6 and damage reduction increased by 3% + Description: Defense increased by {0} and damage reduction increased by {1}% } SpiritPower: { DisplayName: Spirit Power - Description: 10% increased summon damage + Description: "{0}% increased summon damage" } SpiritRegen: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index f5db1a82eb..b91cd402a8 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -237,7 +237,7 @@ AscendantInsignia: { Tooltip: ''' Increases wing flight time by 50%, movement and jump speed by 10%, and acceleration by 1.5x - Pressing [KEY] will give you the power of ascension, providing infinite flight time for 4 seconds + Pressing [KEY] grants you the power of ascension, providing infinite flight time for 4 seconds Ascension has a 40 second cooldown ''' } @@ -1905,6 +1905,7 @@ ToxicHeart: { Your heart beats with the plague, pulsing outside of your body Pulse frequency scale with regen, and pulses that kill enemies pulse again to heal you Multiplies all sickness debuff damage by 1.5x + Effects are transparent and silent if visibility is disabled ''' } diff --git a/MainMenu/CalamityMainMenu.cs b/MainMenu/CalamityMainMenu.cs index 5e83ed1a39..88c1b1737f 100644 --- a/MainMenu/CalamityMainMenu.cs +++ b/MainMenu/CalamityMainMenu.cs @@ -39,6 +39,7 @@ namespace CalamityMod.MainMenu internal set; } = new(); + public float remixLogoRotation = 0f; public override string DisplayName => "Calamity Style"; public override Asset Logo => ModContent.Request("CalamityMod/MainMenu/Logo"); @@ -135,11 +136,24 @@ namespace CalamityMod.MainMenu Main.time = 27000; Main.dayTime = true; + // Adjust rotation based on secret seeds; only Drunk world and Remix touch this, with GFB leeching off those two + // Standard rotation is none; Drunk world makes it spin out, so it can use the vanilla rotation due to disappearing + // Remix makes it flip upside down, and in GFB it will spin forever + if (WorldGen.remixWorldGen) + { + remixLogoRotation += MathHelper.Pi / 50f; + if (remixLogoRotation >= MathHelper.Pi && !WorldGen.everythingWorldGen) + remixLogoRotation = MathHelper.Pi; + } + else + remixLogoRotation = 0f; + float rotationSecretSeedAdjusted = WorldGen.remixWorldGen ? remixLogoRotation : WorldGen.drunkWorldGen ? logoRotation : 0f; + // Draw the logo using a different spritebatch blending setting so it doesn't have a horrible yellow glow Vector2 drawPos = new Vector2(Main.screenWidth / 2f, 100f); spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.LinearClamp, DepthStencilState.None, Main.Rasterizer, null, Main.UIScaleMatrix); - spriteBatch.Draw(Logo.Value, drawPos, null, drawColor, logoRotation, Logo.Value.Size() * 0.5f, logoScale, SpriteEffects.None, 0f); + spriteBatch.Draw(Logo.Value, drawPos, null, drawColor, rotationSecretSeedAdjusted, Logo.Value.Size() * 0.5f, WorldGen.drunkWorldGen ? logoScale : 1f, SpriteEffects.None, 0f); spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, Main.Rasterizer, null, Main.UIScaleMatrix); return false; diff --git a/Particles/BloomLineFade.png b/Particles/BloomLineFade.png new file mode 100644 index 0000000000..31ed1cf6e7 Binary files /dev/null and b/Particles/BloomLineFade.png differ diff --git a/Particles/BloomLineSkinny.png b/Particles/BloomLineSkinny.png new file mode 100644 index 0000000000..d7bf41c6e0 Binary files /dev/null and b/Particles/BloomLineSkinny.png differ diff --git a/Projectiles/Ranged/NullShot.cs b/Projectiles/Ranged/NullShot.cs index cfe9b11904..5b96d86e7f 100644 --- a/Projectiles/Ranged/NullShot.cs +++ b/Projectiles/Ranged/NullShot.cs @@ -86,14 +86,14 @@ namespace CalamityMod.Projectiles.Ranged float scale = Main.rand.NextFloat(0.8f, 1.1f); if (Main.rand.NextBool(2)) { - Dust dust2 = Dust.NewDustPerfect(Projectile.Center + offset * sineDir, Projectile.ai[1] == 5 ? ModContent.DustType() : ModContent.DustType(), -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.8f)); + Dust dust2 = Dust.NewDustPerfect(Projectile.Center + offset * sineDir, ModContent.DustType(), -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.8f)); dust2.noGravity = true; dust2.scale = scale; dust2.color = baseColor; } if (Main.rand.NextBool(2)) { - Dust dust3 = Dust.NewDustPerfect(Projectile.Center - offset * sineDir, /*Projectile.ai[1] == 5 ? ModContent.DustType() : */ModContent.DustType(), -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.8f)); + Dust dust3 = Dust.NewDustPerfect(Projectile.Center - offset * sineDir, ModContent.DustType(), -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.8f)); dust3.noGravity = true; dust3.scale = scale; dust3.color = baseColor; @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Ranged } else if (Main.rand.NextBool(13)) { - Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(10, 10), Projectile.ai[1] == 5 ? ModContent.DustType() : ModContent.DustType(), -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.8f)); + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(10, 10), Projectile.ai[1] == 5 ? (Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType()) : ModContent.DustType(), -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.8f)); dust.noGravity = true; dust.scale = Main.rand.NextFloat(1.05f, 1.65f); dust.color = baseColor; @@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles.Ranged { for (int i = 0; i < 8; i++) { - Dust dust = Dust.NewDustPerfect(Projectile.Center, Projectile.ai[1] == 5 ? ModContent.DustType() : ModContent.DustType(), (Projectile.velocity * 3).RotatedByRandom(0.7f) * Main.rand.NextFloat(0.2f, 1f)); + Dust dust = Dust.NewDustPerfect(Projectile.Center, Projectile.ai[1] == 5 ? (Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType()) : ModContent.DustType(), (Projectile.velocity * 3).RotatedByRandom(0.7f) * Main.rand.NextFloat(0.2f, 1f)); dust.noGravity = true; dust.scale = Main.rand.NextFloat(1.15f, 1.45f); dust.color = baseColor; diff --git a/Projectiles/Ranged/OntologicalDespoilerBeam.cs b/Projectiles/Ranged/OntologicalDespoilerBeam.cs index c4ac0b212a..5aecd11315 100644 --- a/Projectiles/Ranged/OntologicalDespoilerBeam.cs +++ b/Projectiles/Ranged/OntologicalDespoilerBeam.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Ranged { if (Main.rand.NextBool(4) && !fading) { - Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20, 20), ModContent.DustType(), Projectile.velocity.RotatedByRandom(0.1f) * Main.rand.NextFloat(2.3f, 5.8f)); + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20, 20), (Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType()), Projectile.velocity.RotatedByRandom(0.1f) * Main.rand.NextFloat(2.3f, 5.8f)); dust.noGravity = true; dust.scale = Main.rand.NextFloat(1.3f, 2.15f); dust.color = baseColor; @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Ranged for (int i = 0; i < 30; i++) { float dustPower = Main.rand.NextFloat(0.2f, 1f); - Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), (Projectile.velocity * 15 * (dustPower * dustPower)).RotatedByRandom(1f - dustPower * dustPower) * Main.rand.NextFloat(0.9f, 1f)); + Dust dust = Dust.NewDustPerfect(Projectile.Center, (Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType()), (Projectile.velocity * 15 * (dustPower * dustPower)).RotatedByRandom(1f - dustPower * dustPower) * Main.rand.NextFloat(0.9f, 1f)); dust.noGravity = true; dust.scale = Main.rand.NextFloat(2.15f, 3.45f) * dustPower; dust.color = baseColor; diff --git a/Projectiles/Ranged/OntologicalDespoilerGrenade.cs b/Projectiles/Ranged/OntologicalDespoilerGrenade.cs index 975405f5ca..e757f9f71b 100644 --- a/Projectiles/Ranged/OntologicalDespoilerGrenade.cs +++ b/Projectiles/Ranged/OntologicalDespoilerGrenade.cs @@ -102,7 +102,7 @@ namespace CalamityMod.Projectiles.Ranged } if (Main.rand.NextBool(3)) { - Dust dust3 = Dust.NewDustPerfect(Projectile.Center - offset, ModContent.DustType(), -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.8f)); + Dust dust3 = Dust.NewDustPerfect(Projectile.Center - offset, ModContent.DustType(), -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.8f)); dust3.noGravity = true; dust3.scale = scale; dust3.color = baseColor; @@ -130,12 +130,12 @@ namespace CalamityMod.Projectiles.Ranged Owner.Calamity().GeneralScreenShakePower = 8.5f; float power = 1.5f; - for (int i = 0; i < 40; i++) + for (int i = 0; i < 55; i++) { Color useColor = GetRandomColor(); - Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), (Projectile.velocity * 6 * power).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f)); + Dust dust = Dust.NewDustPerfect(Projectile.Center, (Main.rand.NextBool(6) ? ModContent.DustType() : ModContent.DustType()), (Projectile.velocity * 6 * power).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f)); dust.noGravity = true; - dust.scale = Main.rand.NextFloat(1.85f, 2.45f) * power; + dust.scale = Main.rand.NextFloat(1.75f, 2.25f) * power; dust.color = useColor; if (Owner.shirtColor == Color.White) useColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Main.DiscoR); @@ -180,7 +180,7 @@ namespace CalamityMod.Projectiles.Ranged for (int i = 0; i < 20; i++) { Color useColor = GetRandomColor(); - Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), (Projectile.velocity * 3).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f)); + Dust dust = Dust.NewDustPerfect(Projectile.Center, (Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType()), (Projectile.velocity * 3).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f)); dust.noGravity = true; dust.scale = Main.rand.NextFloat(1.85f, 2.45f); dust.color = useColor; diff --git a/Projectiles/Ranged/OntologicalDespoilerHoldout.cs b/Projectiles/Ranged/OntologicalDespoilerHoldout.cs index 85bdd7b9ff..5488e232a8 100644 --- a/Projectiles/Ranged/OntologicalDespoilerHoldout.cs +++ b/Projectiles/Ranged/OntologicalDespoilerHoldout.cs @@ -161,7 +161,7 @@ namespace CalamityMod.Projectiles.Ranged { Color useColor = GetRandomColor(); - Dust dust = Dust.NewDustPerfect(Owner.Center, !Positive ? ModContent.DustType() : ModContent.DustType(), new Vector2(12, 12).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 1f)); + Dust dust = Dust.NewDustPerfect(Owner.Center, !Positive ? (Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType()) : ModContent.DustType(), new Vector2(12, 12).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 1f)); dust.noGravity = true; dust.scale = Main.rand.NextFloat(0.9f, 1.25f); dust.color = Projectile.ai[2] == 15 ? baseColor : useColor; @@ -172,7 +172,7 @@ namespace CalamityMod.Projectiles.Ranged } if (Main.rand.NextBool() && Time > 1) { - Dust dust = Dust.NewDustPerfect(GunTipPosition - (Projectile.velocity * 60).RotatedBy(0.15f * Projectile.direction), Projectile.ai[2] == 15 ? ModContent.DustType() : ModContent.DustType(), (Projectile.velocity * 14).RotatedBy(MathHelper.ToRadians(-135f) * Projectile.direction).RotatedByRandom(0.3f) * Main.rand.NextFloat(0.6f, 1f)); + Dust dust = Dust.NewDustPerfect(GunTipPosition - (Projectile.velocity * 60).RotatedBy(0.15f * Projectile.direction), Projectile.ai[2] == 15 ? (Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType()) : ModContent.DustType(), (Projectile.velocity * 14).RotatedBy(MathHelper.ToRadians(-135f) * Projectile.direction).RotatedByRandom(0.3f) * Main.rand.NextFloat(0.6f, 1f)); dust.noGravity = true; dust.scale = Main.rand.NextFloat(0.8f, 0.9f) * Utils.GetLerpValue(-10, 15, Projectile.timeLeft); dust.color = baseColor; @@ -226,7 +226,7 @@ namespace CalamityMod.Projectiles.Ranged Color useColor = GetRandomColor(); float rand = Main.rand.NextFloat(0, 2.5f); - Dust dust = Dust.NewDustPerfect(GunTipPosition - Projectile.velocity * 15, ModContent.DustType(), shootVelocity.RotatedByRandom(0.12f + rand * 0.2f) * (Main.rand.NextFloat(2.5f, 6.3f) - rand)); + Dust dust = Dust.NewDustPerfect(GunTipPosition - Projectile.velocity * 15, (i % 2 == 0 ? ModContent.DustType() : ModContent.DustType()), shootVelocity.RotatedByRandom(0.12f + rand * 0.2f) * (Main.rand.NextFloat(2.5f, 6.3f) - rand)); dust.noGravity = true; dust.scale = Main.rand.NextFloat(1.55f, 1.85f); dust.color = Positive ? useColor : baseColor; @@ -274,7 +274,7 @@ namespace CalamityMod.Projectiles.Ranged SoundEngine.PlaySound(OntologicalDespoiler.SmallShot, Projectile.position); for (int i = 0; i < 3; i++) { - Dust dust = Dust.NewDustPerfect(GunTipPosition - Projectile.velocity * 15, !Positive ? ModContent.DustType() : ModContent.DustType(), shootVelocity.RotatedByRandom(0.5f) * Main.rand.NextFloat(0.3f, 2.3f)); + Dust dust = Dust.NewDustPerfect(GunTipPosition - Projectile.velocity * 15, !Positive ? (Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType()) : ModContent.DustType(), shootVelocity.RotatedByRandom(0.5f) * Main.rand.NextFloat(0.3f, 2.3f)); dust.noGravity = true; dust.scale = Main.rand.NextFloat(1.15f, 1.35f); dust.color = baseColor; @@ -319,7 +319,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 dustVel = -Projectile.velocity.RotatedByRandom(100) * Main.rand.NextFloat(1.1f, 15.8f); Vector2 addedPlace = Positive ? Vector2.Zero : dustVel * 3; bool dustChance = Main.rand.NextBool((int)(30 * Utils.GetLerpValue(Charge2Frames, Charge1Frames, CurrentChargingFrames, true) + 1)); - int dustType = !Positive ? ModContent.DustType() : ChargeLV1 ? (dustChance ? ModContent.DustType() : ModContent.DustType()) : ModContent.DustType(); + int dustType = !Positive ? (Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType()) : ChargeLV1 ? (dustChance ? ModContent.DustType() : ModContent.DustType()) : ModContent.DustType(); Dust dust = Dust.NewDustPerfect(GunTipPosition + (Positive ? Vector2.Zero : (dustVel * 15 * Utils.GetLerpValue(Charge1Frames, Charge2Frames, CurrentChargingFrames, true))), dustType, dustVel - addedPlace * Utils.GetLerpValue(Charge1Frames, Charge2Frames, CurrentChargingFrames, true)); dust.noGravity = true; @@ -341,9 +341,9 @@ namespace CalamityMod.Projectiles.Ranged GeneralParticleHandler.SpawnParticle(orb); bool color = Main.rand.NextBool(4); Vector2 dustVel = -Projectile.velocity.RotatedByRandom(100) * Main.rand.NextFloat(1.1f, 15.8f); - Dust dust = Dust.NewDustPerfect(GunTipPosition, ModContent.DustType(), dustVel); + Dust dust = Dust.NewDustPerfect(GunTipPosition, (color ? ModContent.DustType() : ModContent.DustType()), dustVel); dust.noGravity = true; - dust.scale = Main.rand.NextFloat(0.5f, 1.25f) * (color ? 1.8f : 1); + dust.scale = Main.rand.NextFloat(0.5f, 1.25f); dust.color = color ? Color.Black : baseColor; } } @@ -356,7 +356,7 @@ namespace CalamityMod.Projectiles.Ranged { Color useColor = GetRandomColor(); - Dust chargefull = Dust.NewDustPerfect(GunTipPosition, ModContent.DustType()); + Dust chargefull = Dust.NewDustPerfect(GunTipPosition, !Positive ? (i % 2 == 0 ? ModContent.DustType() : ModContent.DustType()) : ModContent.DustType()); chargefull.velocity = (MathHelper.TwoPi * i / 16f).ToRotationVector2() * 16f * (i % 2 == 0 ? 0.7f : 1); chargefull.scale = Main.rand.NextFloat(1.1f, 1.3f); chargefull.noGravity = true; @@ -369,11 +369,11 @@ namespace CalamityMod.Projectiles.Ranged if (ChargeLV2 && !hasReachedLV2) { SoundEngine.PlaySound(OntologicalDespoiler.ChargeLV2, Projectile.Center); - for (int i = 0; i < 25; i++) + for (int i = 0; i < 24; i++) { Color useColor = GetRandomColor(); - Dust chargefull = Dust.NewDustPerfect(GunTipPosition, ModContent.DustType()); + Dust chargefull = Dust.NewDustPerfect(GunTipPosition, !Positive ? (i % 2 == 0 ? ModContent.DustType() : ModContent.DustType()) : ModContent.DustType()); chargefull.velocity = (MathHelper.TwoPi * i / 25f).ToRotationVector2() * 22f * (i % 2 == 0 ? 0.7f : 1); chargefull.scale = Main.rand.NextFloat(1.45f, 1.55f); chargefull.noGravity = true; diff --git a/Projectiles/Ranged/OntologicalDespoilerShot.cs b/Projectiles/Ranged/OntologicalDespoilerShot.cs index 501f4290c2..d863b74048 100644 --- a/Projectiles/Ranged/OntologicalDespoilerShot.cs +++ b/Projectiles/Ranged/OntologicalDespoilerShot.cs @@ -110,13 +110,10 @@ namespace CalamityMod.Projectiles.Ranged Vector2 offset = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.PiOver2) * sine * 13f; float scale = Main.rand.NextFloat(0.45f, 0.55f); - if (true) - { - Dust dust2 = Dust.NewDustPerfect(Projectile.Center + offset * sineDir, ModContent.DustType(), -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.8f)); - dust2.noGravity = true; - dust2.scale = scale; - dust2.color = baseColor; - } + Dust dust2 = Dust.NewDustPerfect(Projectile.Center + offset * sineDir, (time % 2 == 0 ? ModContent.DustType() : ModContent.DustType()), -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.8f)); + dust2.noGravity = true; + dust2.scale = scale; + dust2.color = baseColor; } else { @@ -172,7 +169,7 @@ namespace CalamityMod.Projectiles.Ranged { for (int i = 0; i < 3; i++) { - Dust dust = Dust.NewDustPerfect(Projectile.Center, !Positive ? ModContent.DustType() : ModContent.DustType(), (Projectile.velocity * 3).RotatedByRandom(0.7f) * Main.rand.NextFloat(0.2f, 1f)); + Dust dust = Dust.NewDustPerfect(Projectile.Center, !Positive ? (Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType()) : ModContent.DustType(), (Projectile.velocity * 3).RotatedByRandom(0.7f) * Main.rand.NextFloat(0.2f, 1f)); dust.noGravity = true; dust.scale = Main.rand.NextFloat(1.15f, 1.45f); dust.color = baseColor; diff --git a/Projectiles/Typeless/PlaguePulse.cs b/Projectiles/Typeless/PlaguePulse.cs index 482dde104f..64e4a8f6d3 100644 --- a/Projectiles/Typeless/PlaguePulse.cs +++ b/Projectiles/Typeless/PlaguePulse.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Typeless public ref float time => ref Projectile.ai[0]; public ref float radius => ref Projectile.ai[1]; public float maxRadius = 300; - public int startDamage; + public bool visible; public override void SetDefaults() { Projectile.width = 96; @@ -36,23 +36,22 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { - if (time == 0) - startDamage = Projectile.damage; - Player player = Main.player[Projectile.owner]; + visible = player.Calamity().toxicHeartVisuals; if (Projectile.ai[2] == 0) Projectile.Center = player.MountedCenter; if (Projectile.ai[2] == 1) { - maxRadius = 200; + maxRadius = Main.rand.Next(150, 250 + 1); + Projectile.extraUpdates = 2; } - if (Main.rand.NextBool(5)) + if (Main.rand.NextBool(5) && visible) { DirectionalPulseRing pulse = new DirectionalPulseRing(Projectile.Center + Main.rand.NextVector2Circular(radius, radius), Vector2.Zero, (Main.rand.NextBool(3) ? Color.LimeGreen : Color.Green) * 0.6f, new Vector2(1, 1), 0, Main.rand.NextFloat(0.07f, 0.23f), 0f, 20); GeneralParticleHandler.SpawnParticle(pulse); } - if (Main.rand.NextBool(3)) + if (Main.rand.NextBool(3) && visible) { for (int i = 0; i < 2; i++) { @@ -70,10 +69,10 @@ namespace CalamityMod.Projectiles.Typeless } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - if (Projectile.numHits > 0) - Projectile.damage = (int)(Projectile.damage * 0.85f); - if (Projectile.damage < 1) - Projectile.damage = 1; + float minMult = 0.4f; + int hitsToMinMult = 6; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + modifiers.SourceDamage *= damageMult; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { @@ -83,15 +82,33 @@ namespace CalamityMod.Projectiles.Typeless if ((target.life <= 0 && target.realLife == -1)) { player.Heal(10); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(startDamage * 0.8f), 0f, Projectile.owner, 0, 0, 1); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.9f), 0f, Projectile.owner, 0, Projectile.ai[1] + 1, 1); + } + if (target.CanBeMoved()) // Always push targets away from the player + { + Vector2 pushVelocity = Utils.DirectionTo(player.Center, target.Center) * 5; + target.velocity = pushVelocity; } } public override bool PreDraw(ref Color lightColor) { Player player = Main.player[Projectile.owner]; - Texture2D rexture = ModContent.Request("CalamityMod/Particles/HighResHollowCircleHardEdge").Value; - Main.EntitySpriteDraw(rexture, Projectile.Center - Main.screenPosition, null, (Color.Green * Utils.Remap(time, 30, 60, 0.35f, 0, true)) with { A = 0 }, Projectile.rotation, rexture.Size() * 0.5f, (Utils.Remap(time, 0, 60, 1, 6, true) / 21) * (maxRadius == 300 ? 1 : 0.7f), SpriteEffects.None, 0); + Texture2D rexture = ModContent.Request("CalamityMod/Particles/SoftRoundExplosion").Value; + Texture2D fexture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + Color color = (Color.Green * Utils.Remap(time, 30, 60, 0.35f, 0, true)) with { A = 0 } * (visible ? 1f : 0.25f); + float scale = (Utils.Remap(time, 0, 60, 1, 6, true) / 21) * (maxRadius == 300 ? 1 : 0.7f); + Vector2 pos = Projectile.Center - Main.screenPosition; + Main.EntitySpriteDraw(rexture, pos, null, color, Projectile.rotation - Main.GlobalTimeWrappedHourly * 1.5f, rexture.Size() * 0.5f, scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(rexture, pos, null, color, Projectile.rotation + Main.GlobalTimeWrappedHourly * 3, rexture.Size() * 0.5f, scale * 0.95f, SpriteEffects.None, 0); + if (Projectile.ai[2] == 1) + { + for (int i = 0; i < 4; i++) + { + float pulseScale = (scale * 6 + 0.11f) - i * 0.022f; + Main.EntitySpriteDraw(fexture, pos, null, color, Projectile.rotation, fexture.Size() * 0.5f, pulseScale, SpriteEffects.None, 0); + } + } return false; } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, radius, targetHitbox); diff --git a/Systems/Collections/PierceResistExceptionList.cs b/Systems/Collections/PierceResistExceptionList.cs index d42001f90d..1d5e366f57 100644 --- a/Systems/Collections/PierceResistExceptionList.cs +++ b/Systems/Collections/PierceResistExceptionList.cs @@ -6,6 +6,7 @@ using CalamityMod.Projectiles.Melee.MaceFlails; using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; +using CalamityMod.Projectiles.Typeless; using Terraria.ID; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; @@ -32,6 +33,7 @@ namespace CalamityMod.Systems.Collections ProjectileID.Terragrim, ProjectileType(), ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), @@ -54,6 +56,7 @@ namespace CalamityMod.Systems.Collections ProjectileType(), ProjectileType(), ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), @@ -72,8 +75,10 @@ namespace CalamityMod.Systems.Collections ProjectileType(), ProjectileType(), ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(),