diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index e8f4eb2b9c..5143ee7aa3 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -180,29 +180,12 @@ namespace CalamityMod.Buffs case BuffID.Warmth: tip += ". Immunity to the Chilled, Frozen, and Glacial State debuffs"; - if (CalamityWorld.death) - tip += ". Provides cold protection in Death Mode"; break; case BuffID.Invisibility: tip += ". Grants rogue bonuses while holding certain rogue weapons"; break; - case BuffID.ObsidianSkin: - if (CalamityWorld.death) - tip += ". Provides heat protection in Death Mode"; - break; - - case BuffID.Inferno: - if (CalamityWorld.death) - tip += ". Provides cold protection in Death Mode"; - break; - - case BuffID.Campfire: - if (CalamityWorld.death) - tip += ". Provides cold protection in Death Mode"; - break; - case BuffID.Daybreak: tip = "Incinerated by solar rays"; break; diff --git a/Buffs/StatBuffs/Molten.cs b/Buffs/StatBuffs/Molten.cs index a49e73b451..605be1caf6 100644 --- a/Buffs/StatBuffs/Molten.cs +++ b/Buffs/StatBuffs/Molten.cs @@ -20,11 +20,5 @@ namespace CalamityMod.Buffs.StatBuffs { player.Calamity().molten = true; } - - public override void ModifyBuffTip(ref string tip, ref int rare) - { - if (CalamityWorld.death) - tip += ". Provides cold protection in Death Mode"; - } } } diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index db9eeef744..2320b4538b 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -95,8 +95,6 @@ namespace CalamityMod.CalPlayer public int sCalKillCount = 0; public int deathCount = 0; public int actualMaxLife = 0; - public int deathModeUnderworldTime = 0; - public int deathModeBlizzardTime = 0; public static int chaosStateDuration = 360; public static int chaosStateDurationBoss = 600; public bool killSpikyBalls = false; @@ -1325,8 +1323,6 @@ namespace CalamityMod.CalPlayer { "rogueLevel", rogueLevel }, { "exactRogueLevel", exactRogueLevel }, { "deathCount", deathCount }, - { "deathModeUnderworldTime", deathModeUnderworldTime }, - { "deathModeBlizzardTime", deathModeBlizzardTime }, { "itemTypeLastReforged", itemTypeLastReforged }, { "reforgeTierSafety", reforgeTierSafety }, { "moveSpeedStat", moveSpeedStat }, @@ -1419,9 +1415,6 @@ namespace CalamityMod.CalPlayer _ = tag.GetInt("moneyStolenByBandit"); _ = tag.GetInt("reforges"); - deathModeUnderworldTime = tag.GetInt("deathModeUnderworldTime"); - deathModeBlizzardTime = tag.GetInt("deathModeBlizzardTime"); - itemTypeLastReforged = tag.GetInt("itemTypeLastReforged"); reforgeTierSafety = tag.GetInt("reforgeTierSafety"); @@ -2211,8 +2204,6 @@ namespace CalamityMod.CalPlayer defenseDamageRecoveryFrames = 0; totalDefenseDamageRecoveryFrames = DefenseDamageBaseRecoveryTime; defenseDamageDelayFrames = 0; - deathModeBlizzardTime = 0; - deathModeUnderworldTime = 0; heldGaelsLastFrame = false; gaelRageAttackCooldown = 0; gaelSwipes = 0; @@ -4152,12 +4143,6 @@ namespace CalamityMod.CalPlayer { runAccMult *= 0.6f; } - if (CalamityWorld.death && deathModeBlizzardTime > 0) - { - float speedMult = (3600 - deathModeBlizzardTime) / 3600f; - runAccMult *= speedMult; - runSpeedMult *= speedMult; - } player.runAcceleration *= runAccMult; player.maxRunSpeed *= runSpeedMult; @@ -7638,11 +7623,6 @@ namespace CalamityMod.CalPlayer damageSource = PlayerDeathReason.ByCustomReason("Oxygen failed to reach " + player.name + " from the depths of the Abyss."); } } - else if (CalamityWorld.death && deathModeBlizzardTime > 1980) - { - deathModeBlizzardTime = 0; - damageSource = PlayerDeathReason.ByCustomReason(player.name + " was chilled to the bone by the frigid environment."); - } else if (CalamityWorld.armageddon && areThereAnyDamnBosses) { damageSource = PlayerDeathReason.ByCustomReason(player.name + " failed the challenge at hand."); diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 1efac1c9b6..bec8856b9c 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -1,6 +1,5 @@ using CalamityMod.Buffs.Alcohol; using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.Projectiles.Ranged; using CalamityMod.World; @@ -16,8 +15,6 @@ namespace CalamityMod.CalPlayer #region Update Bad Life Regen public override void UpdateBadLifeRegen() { - Point point = player.Center.ToTileCoordinates(); - if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) noLifeRegen = true; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 18d1af9bdf..b3a39948a1 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -807,247 +807,6 @@ namespace CalamityMod.CalPlayer default: break; } - - // Leech bleed - if (player.ZoneJungle && player.wet && !player.lavaWet && !player.honeyWet) - { - if (player.IsUnderwater()) - player.AddBuff(BuffID.Bleeding, 300, false); - } - - if (!BossRushEvent.BossRushActive && !areThereAnyDamnBosses && !areThereAnyDamnEvents) - { - // Astral effects - if (ZoneAstral) - player.gravity *= 0.75f; - - // Calculate underground darkness here. The effect is applied in CalamityMod.ModifyLightingBrightness. - Point point = player.Center.ToTileCoordinates(); - if (point.Y > Main.worldSurface && !ZoneAbyss && !player.ZoneUnderworldHeight) - { - // Darkness strength scales smoothly with how deep you are. - double totalUndergroundDepth = Main.maxTilesY - 200D - Main.worldSurface; - double playerUndergroundDepth = point.Y - Main.worldSurface; - double depthRatio = playerUndergroundDepth / totalUndergroundDepth; - int lightStrength = GetTotalLightStrength(); - - // In the last 50 blocks before hell, the darkness smoothly fades away. - float FadeAwayStart = (float)(1D - 50D / totalUndergroundDepth); - float darknessStrength = (float)(depthRatio / FadeAwayStart); - if (depthRatio > FadeAwayStart) - { - // Varies from 1.0 to 0.0 as depthRatio varies from FadeAwayStart to 1.0. - darknessStrength = MathHelper.Lerp(0f, 1f, (1f - (float)depthRatio) / (1f - FadeAwayStart)); - } - - // Reduce the power of cave darkness based on your light level. 5+ is enough to totally eliminate it. - switch (lightStrength) - { - case 0: - darknessStrength *= 0.75f; - break; - case 1: - darknessStrength *= 0.5f; - break; - case 2: - darknessStrength *= 0.25f; - break; - case 3: - darknessStrength *= 0.15f; - break; - case 4: - darknessStrength *= 0.05f; - break; - default: - darknessStrength = 0f; - break; - } - caveDarkness = darknessStrength; - } - - // Ice shards, lightning and sharknadoes - bool nearPillar = player.PillarZone(); - if (player.ZoneOverworldHeight && NPC.MoonLordCountdown == 0 && !player.InSpace()) - { - Vector2 sharknadoSpawnPoint = new Vector2(player.Center.X - Main.rand.Next(300, 701), player.Center.Y - Main.rand.Next(700, 801)); - if (point.X > Main.maxTilesX / 2) - sharknadoSpawnPoint.X = player.Center.X + Main.rand.Next(300, 701); - - if (Main.raining) - { - float frequencyMult = (1f - Main.cloudAlpha) * CalamityConfig.Instance.DeathWeatherMultiplier; // 3 to 0.055 - - Vector2 spawnPoint = new Vector2(player.Center.X + Main.rand.Next(-1000, 1001), player.Center.Y - Main.rand.Next(700, 801)); - Tile tileSafely = Framing.GetTileSafely((int)(spawnPoint.X / 16f), (int)(spawnPoint.Y / 16f)); - - if (player.ZoneSnow) - { - if (!tileSafely.active()) - { - int divisor = (int)((Main.hardMode ? 50f : 60f) * frequencyMult); - float windVelocity = (float)Math.Sqrt(Math.Abs(Main.windSpeed)) * Math.Sign(Main.windSpeed) * (Main.cloudAlpha + 0.5f) * 25f + Main.rand.NextFloat() * 0.2f - 0.1f; - Vector2 velocity = new Vector2(windVelocity * 0.2f, 3f * Main.rand.NextFloat()); - - if (player.miscCounter % divisor == 0 && Main.rand.NextBool(3)) - Projectile.NewProjectile(spawnPoint, velocity, ModContent.ProjectileType(), 20, 0f, player.whoAmI, 2f, 0f); - } - } - else - { - if (player.ZoneBeach && !ZoneSulphur) - { - int randomFrequency = (int)(50f * frequencyMult); - if (player.miscCounter == 280 && Main.rand.NextBool(randomFrequency) && player.ownedProjectileCounts[ProjectileID.Cthulunado] < 1) - { - Main.PlaySound(SoundID.NPCDeath19, (int)sharknadoSpawnPoint.X, (int)sharknadoSpawnPoint.Y); - int y = (int)(sharknadoSpawnPoint.Y / 16f); - int x = (int)(sharknadoSpawnPoint.X / 16f); - int yAdjust = 100; - if (x < 10) - x = 10; - if (x > Main.maxTilesX - 10) - x = Main.maxTilesX - 10; - if (y < 10) - y = 10; - if (y > Main.maxTilesY - yAdjust - 10) - y = Main.maxTilesY - yAdjust - 10; - - int spawnAreaY = Main.maxTilesY - y; - for (int j = y; j < y + spawnAreaY; j++) - { - Tile tile = Main.tile[x, j]; - if ((tile.active() && Main.tileSolid[tile.type]) || tile.liquid >= 200) - { - y = j; - break; - } - } - - int tornado = Projectile.NewProjectile(x * 16 + 8, y * 16 - 24, 0f, 0f, ProjectileID.Cthulunado, 50, 4f, player.whoAmI, 16f, 24f); - Main.projectile[tornado].netUpdate = true; - } - } - - // Death Mode random lightning strikes - int randomFrequency2 = (int)(20f * frequencyMult); - if (CalamityWorld.rainingAcid && ZoneSulphur) - randomFrequency2 = (int)(randomFrequency2 * 3.75); - if (player.miscCounter % (Main.hardMode ? 90 : 120) == 0 && Main.rand.NextBool(randomFrequency2)) - { - if (!tileSafely.active()) - { - float randomVelocity = Main.rand.NextFloat() - 0.5f; - Vector2 fireTo = new Vector2(spawnPoint.X + 100f * randomVelocity, spawnPoint.Y + 900f); - Vector2 direction = fireTo - spawnPoint; - Vector2 velocity = Vector2.Normalize(direction) * 12f; - Projectile.NewProjectile(spawnPoint.X, spawnPoint.Y, 0f, velocity.Y, ModContent.ProjectileType(), 0, 0f, player.whoAmI, 0f, 0f); - } - } - } - } - } - - // Immunity bools - bool hasMoltenSet = player.head == ArmorIDs.Head.MoltenHelmet && player.body == ArmorIDs.Body.MoltenBreastplate && player.legs == ArmorIDs.Legs.MoltenGreaves; - - bool immunityToHotAndCold = hasMoltenSet || player.magmaStone || player.frostArmor || fBulwark || fBarrier || - frostFlare || rampartOfDeities || cryogenSoul || snowman || blazingCore || permafrostsConcoction || profanedCrystalBuffs || coldDivinity || eGauntlet; - - bool immunityToCold = player.HasBuff(BuffID.Campfire) || Main.campfire || player.resistCold || eskimoSet || dodgeScarf || player.buffImmune[BuffID.Frozen] || aAmpoule || player.HasBuff(BuffID.Inferno) || immunityToHotAndCold || externalColdImmunity; - - bool immunityToHot = player.lavaImmune || player.lavaRose || player.lavaMax > 0 || immunityToHotAndCold || externalHeatImmunity; - - // Space effects - if (!player.behindBackWall && player.InSpace()) - { - if (Main.dayTime) - { - if (!immunityToHot) - player.AddBuff(BuffID.Burning, 2, false); - } - else - { - if (!immunityToCold) - player.AddBuff(BuffID.Frostburn, 2, false); - } - } - - // Cold timer - if (!player.behindBackWall && Main.raining && player.ZoneSnow && !immunityToCold && player.ZoneOverworldHeight) - { - bool affectedByColdWater = player.wet && !player.lavaWet && !player.honeyWet && !player.arcticDivingGear; - - player.AddBuff(ModContent.BuffType(), 2, false); - - deathModeBlizzardTime++; - if (affectedByColdWater) - deathModeBlizzardTime++; - - if (deathModeUnderworldTime > 0) - { - deathModeUnderworldTime--; - if (affectedByColdWater) - deathModeUnderworldTime--; - if (deathModeUnderworldTime < 0) - deathModeUnderworldTime = 0; - } - } - else if (deathModeBlizzardTime > 0) - { - deathModeBlizzardTime--; - if (immunityToCold) - deathModeBlizzardTime--; - if (deathModeBlizzardTime < 0) - deathModeBlizzardTime = 0; - } - - // Hot timer - if (!player.behindBackWall && player.ZoneUnderworldHeight && !immunityToHot) - { - bool affectedByHotLava = player.lavaWet; - - player.AddBuff(ModContent.BuffType(), 2, false); - - deathModeUnderworldTime++; - if (affectedByHotLava) - deathModeUnderworldTime++; - - if (deathModeBlizzardTime > 0) - { - deathModeBlizzardTime--; - if (affectedByHotLava) - deathModeBlizzardTime--; - if (deathModeBlizzardTime < 0) - deathModeBlizzardTime = 0; - } - } - else if (deathModeUnderworldTime > 0) - { - deathModeUnderworldTime--; - if (immunityToHot) - deathModeUnderworldTime--; - if (deathModeUnderworldTime < 0) - deathModeUnderworldTime = 0; - } - - // Cold effects - if (deathModeBlizzardTime > 1800) - player.AddBuff(BuffID.Frozen, 2, false); - if (deathModeBlizzardTime > 1980) - KillPlayer(); - - // Hot effects - if (deathModeUnderworldTime > 360) - player.AddBuff(BuffID.Weak, 2, false); - if (deathModeUnderworldTime > 720) - player.AddBuff(BuffID.Slow, 2, false); - if (deathModeUnderworldTime > 1080) - player.AddBuff(BuffID.OnFire, 2, false); - if (deathModeUnderworldTime > 1440) - player.AddBuff(BuffID.Confused, 2, false); - if (deathModeUnderworldTime > 1800) - player.AddBuff(BuffID.Burning, 2, false); - } } } @@ -1072,9 +831,6 @@ namespace CalamityMod.CalPlayer player.maxFallSpeed = 80f; player.noFallDmg = true; } - - - } // Omega Blue Armor bonus diff --git a/CalPlayer/CalamityPlayerNetcode.cs b/CalPlayer/CalamityPlayerNetcode.cs index a8b64631f2..a18a72bfdd 100644 --- a/CalPlayer/CalamityPlayerNetcode.cs +++ b/CalPlayer/CalamityPlayerNetcode.cs @@ -14,8 +14,6 @@ namespace CalamityMod.CalPlayer { SyncRage(false); SyncAdrenaline(false); - SyncDeathModeUnderworldTime(false); - SyncDeathModeBlizzardTime(false); SyncMoveSpeed(false); SyncDefenseDamage(false); SyncDodgeCooldown(false); @@ -169,24 +167,6 @@ namespace CalamityMod.CalPlayer player.SendPacket(packet, server); } - public void SyncDeathModeUnderworldTime(bool server) - { - ModPacket packet = mod.GetPacket(256); - packet.Write((byte)CalamityModMessageType.DeathModeUnderworldTimeSync); - packet.Write(player.whoAmI); - packet.Write(deathModeUnderworldTime); - player.SendPacket(packet, server); - } - - public void SyncDeathModeBlizzardTime(bool server) - { - ModPacket packet = mod.GetPacket(256); - packet.Write((byte)CalamityModMessageType.DeathModeBlizzardTimeSync); - packet.Write(player.whoAmI); - packet.Write(deathModeBlizzardTime); - player.SendPacket(packet, server); - } - public void SyncItemTypeLastReforged(bool server) { ModPacket packet = mod.GetPacket(256); @@ -296,20 +276,6 @@ namespace CalamityMod.CalPlayer SyncDeathCount(true); } - internal void HandleDeathModeUnderworldTime(BinaryReader reader) - { - deathModeUnderworldTime = reader.ReadInt32(); - if (Main.netMode == NetmodeID.Server) - SyncDeathModeUnderworldTime(true); - } - - internal void HandleDeathModeBlizzardTime(BinaryReader reader) - { - deathModeBlizzardTime = reader.ReadInt32(); - if (Main.netMode == NetmodeID.Server) - SyncDeathModeBlizzardTime(true); - } - internal void HandleItemTypeLastReforged(BinaryReader reader) { itemTypeLastReforged = reader.ReadInt32(); diff --git a/CalamityMod.cs b/CalamityMod.cs index f3f066e902..0eaec6bb3a 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -1531,7 +1531,6 @@ namespace CalamityMod #endregion #region Lighting - const float MaxCaveDarkness = -0.3f; const float MaxSignusDarkness = -0.4f; const float MaxAbyssDarkness = -0.7f; public override void ModifyLightingBrightness(ref float scale) @@ -1542,8 +1541,6 @@ namespace CalamityMod if (modPlayer.ZoneAbyss) scale += MaxAbyssDarkness * darkRatio; - else if (CalamityWorld.death) - scale += MaxCaveDarkness * darkRatio; if (CalamityWorld.revenge || CalamityWorld.malice) { diff --git a/CalamityNetcode.cs b/CalamityNetcode.cs index 6183c30f20..6fee1cb531 100644 --- a/CalamityNetcode.cs +++ b/CalamityNetcode.cs @@ -257,13 +257,6 @@ namespace CalamityMod // // Death Mode environmental syncs // - - case CalamityModMessageType.DeathModeUnderworldTimeSync: - Main.player[reader.ReadInt32()].Calamity().HandleDeathModeUnderworldTime(reader); - break; - case CalamityModMessageType.DeathModeBlizzardTimeSync: - Main.player[reader.ReadInt32()].Calamity().HandleDeathModeBlizzardTime(reader); - break; case CalamityModMessageType.DeathBossSpawnCountdownSync: int countdown4 = reader.ReadInt32(); CalamityWorld.deathBossSpawnCooldown = countdown4; diff --git a/Items/Accessories/AmbrosialAmpoule.cs b/Items/Accessories/AmbrosialAmpoule.cs index 8d738d4bbb..73012dc233 100644 --- a/Items/Accessories/AmbrosialAmpoule.cs +++ b/Items/Accessories/AmbrosialAmpoule.cs @@ -29,21 +29,6 @@ namespace CalamityMod.Items.Accessories item.accessory = true; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip2") - { - line2.text = "Freeze, chill and frostburn immunity\n" + - "Provides cold protection in Death Mode"; - } - } - } - } - public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/AngelTreads.cs b/Items/Accessories/AngelTreads.cs index 109e396cde..e9dcb7e2ff 100644 --- a/Items/Accessories/AngelTreads.cs +++ b/Items/Accessories/AngelTreads.cs @@ -32,21 +32,6 @@ namespace CalamityMod.Items.Accessories item.accessory = true; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip5") - { - line2.text = "Temporary immunity to lava\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/BlazingCore.cs b/Items/Accessories/BlazingCore.cs index 8b6fe6460b..f40d5f3a3c 100644 --- a/Items/Accessories/BlazingCore.cs +++ b/Items/Accessories/BlazingCore.cs @@ -31,21 +31,6 @@ namespace CalamityMod.Items.Accessories item.value = CalamityGlobalItem.Rarity12BuyPrice; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip5") - { - line2.text = "Provides a moderate amount of light in the Abyss\n" + - "Provides heat and cold protection in Death Mode"; - } - } - } - } - public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/CounterScarf.cs b/Items/Accessories/CounterScarf.cs index 2e15b7e237..3a2ad9e885 100644 --- a/Items/Accessories/CounterScarf.cs +++ b/Items/Accessories/CounterScarf.cs @@ -29,21 +29,6 @@ namespace CalamityMod.Items.Accessories item.accessory = true; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip4") - { - line2.text = "While on cooldown, Chaos State will last twice as long\n" + - "Provides cold protection in Death Mode"; - } - } - } - } - public override bool CanEquipAccessory(Player player, int slot) => !player.Calamity().dodgeScarf; public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/ElementalGauntlet.cs b/Items/Accessories/ElementalGauntlet.cs index d2df2695ee..ae29539e81 100644 --- a/Items/Accessories/ElementalGauntlet.cs +++ b/Items/Accessories/ElementalGauntlet.cs @@ -31,20 +31,6 @@ namespace CalamityMod.Items.Accessories item.Calamity().customRarity = CalamityRarity.DarkBlue; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip4") - { - line2.text += "\nProvides heat and cold protection in Death Mode"; - } - } - } - } - public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/EvasionScarf.cs b/Items/Accessories/EvasionScarf.cs index f015bd41af..442a402dad 100644 --- a/Items/Accessories/EvasionScarf.cs +++ b/Items/Accessories/EvasionScarf.cs @@ -30,21 +30,6 @@ namespace CalamityMod.Items.Accessories item.Calamity().donorItem = true; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip4") - { - line2.text = "While on cooldown, Chaos State will be 50 percent longer\n" + - "Provides cold protection in Death Mode"; - } - } - } - } - public override bool CanEquipAccessory(Player player, int slot) => !player.Calamity().dodgeScarf; public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/FabledTortoiseShell.cs b/Items/Accessories/FabledTortoiseShell.cs index a7b92fd23f..0791cf16b8 100644 --- a/Items/Accessories/FabledTortoiseShell.cs +++ b/Items/Accessories/FabledTortoiseShell.cs @@ -28,21 +28,6 @@ namespace CalamityMod.Items.Accessories item.accessory = true; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip3") - { - line2.text = "Temporary immunity to lava\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/FrigidBulwark.cs b/Items/Accessories/FrigidBulwark.cs index 747ae92122..e45a5f7ff5 100644 --- a/Items/Accessories/FrigidBulwark.cs +++ b/Items/Accessories/FrigidBulwark.cs @@ -30,21 +30,6 @@ namespace CalamityMod.Items.Accessories item.accessory = true; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip4") - { - line2.text = "The shell becomes more powerful when below 15% life and reduces damage even further\n" + - "Provides heat and cold protection in Death Mode"; - } - } - } - } - public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/FrostBarrier.cs b/Items/Accessories/FrostBarrier.cs index 390ebb122a..9af75278e1 100644 --- a/Items/Accessories/FrostBarrier.cs +++ b/Items/Accessories/FrostBarrier.cs @@ -26,21 +26,6 @@ namespace CalamityMod.Items.Accessories item.accessory = true; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip1") - { - line2.text = "You are immune to the chilled debuff\n" + - "Provides heat and cold protection in Death Mode"; - } - } - } - } - public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/FrostFlare.cs b/Items/Accessories/FrostFlare.cs index 4c1a1fccbb..d5e67f12ac 100644 --- a/Items/Accessories/FrostFlare.cs +++ b/Items/Accessories/FrostFlare.cs @@ -30,21 +30,6 @@ namespace CalamityMod.Items.Accessories item.accessory = true; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip4") - { - line2.text = "Provides heat and cold protection in Death Mode\n" + - "Grants resistance against cold attacks"; - } - } - } - } - public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/OccultSkullCrown_Head.png b/Items/Accessories/OccultSkullCrown_Head.png index 210185d183..51b3dc66a6 100644 Binary files a/Items/Accessories/OccultSkullCrown_Head.png and b/Items/Accessories/OccultSkullCrown_Head.png differ diff --git a/Items/Accessories/PermafrostsConcoction.cs b/Items/Accessories/PermafrostsConcoction.cs index 8fec8f18f6..7d49283876 100644 --- a/Items/Accessories/PermafrostsConcoction.cs +++ b/Items/Accessories/PermafrostsConcoction.cs @@ -27,21 +27,6 @@ You are encased in an ice barrier for 3 seconds when revived"); item.rare = ItemRarityID.Pink; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip4") - { - line2.text = "You are encased in an ice barrier for 3 seconds when revived\n" + - "Provides heat and cold protection in Death Mode"; - } - } - } - } - public override void UpdateAccessory(Player player, bool hideVisual) { player.Calamity().permafrostsConcoction = true; diff --git a/Items/Accessories/ProfanedSoulCrystal.cs b/Items/Accessories/ProfanedSoulCrystal.cs index 353a61ae81..6c2653185e 100644 --- a/Items/Accessories/ProfanedSoulCrystal.cs +++ b/Items/Accessories/ProfanedSoulCrystal.cs @@ -40,7 +40,6 @@ namespace CalamityMod.Items.Accessories "Summons and empowers the profaned babs to fight alongside you\n" + "You are no longer affected by burn out when hit\n" + "Provides buffs depending on the time of day\n" + - "Provides heat and cold protection in Death Mode\n" + "Thinking back, it was a boring life\n" + "[c/FFBF49:And so we burn it all in the name of purity]"); Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); @@ -101,19 +100,6 @@ namespace CalamityMod.Items.Accessories } } } - if (scal && draedon) - { - if (!CalamityWorld.death) - { - foreach (TooltipLine line in tooltips) - { - if (line.mod == "Terraria" && line.Name == "Tooltip11") - { - line.text = ""; - } - } - } - } } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/RampartofDeities.cs b/Items/Accessories/RampartofDeities.cs index b9f871c306..47ad7260b1 100644 --- a/Items/Accessories/RampartofDeities.cs +++ b/Items/Accessories/RampartofDeities.cs @@ -20,8 +20,7 @@ namespace CalamityMod.Items.Accessories "This effect is only active above 25% life\n" + "Grants immunity to knockback\n" + "Puts a shell around the owner when below 50% life that reduces damage\n" + - "The shell becomes more powerful when below 15% life and reduces damage even further\n" + - "Provides heat and cold protection in Death Mode"); + "The shell becomes more powerful when below 15% life and reduces damage even further"); } public override void SetDefaults() @@ -34,20 +33,6 @@ namespace CalamityMod.Items.Accessories item.Calamity().customRarity = CalamityRarity.DarkBlue; } - public override void ModifyTooltips(List list) - { - if (!CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip7") - { - line2.text = ""; - } - } - } - } - public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/Sponge.cs b/Items/Accessories/Sponge.cs index c6d7d8f8c2..34a83b5255 100644 --- a/Items/Accessories/Sponge.cs +++ b/Items/Accessories/Sponge.cs @@ -40,20 +40,6 @@ namespace CalamityMod.Items.Accessories item.Calamity().customRarity = CalamityRarity.DarkBlue; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip8") - { - line2.text += "\nProvides cold protection in Death Mode"; - } - } - } - } - public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/StatMeter.cs b/Items/Accessories/StatMeter.cs index 96c0d63579..6e9a0085de 100644 --- a/Items/Accessories/StatMeter.cs +++ b/Items/Accessories/StatMeter.cs @@ -134,7 +134,7 @@ namespace CalamityMod.Items.Accessories sb.Append(" | Wing Flight Time: ").Append(wingFlightTime).Append(" seconds\n"); sb.Append("Jump Speed Boost: ").Append(jumpSpeed).Append("%"); sb.Append(" | Movement Speed Boost: ").Append(moveSpeed).Append("%\n\n"); - sb.Append(CalamityWorld.death ? "Abyss/Cave Light Strength: " : "Abyss Light Strength: ").Append(lightLevel).Append("\n\n"); + sb.Append("Abyss Light Strength: ").Append(lightLevel).Append("\n\n"); // Abyss stats only render if the player is in the Abyss. if (modPlayer.ZoneAbyss) diff --git a/Items/Accessories/TheCamper.cs b/Items/Accessories/TheCamper.cs index 5ad49200a5..79833f4d36 100644 --- a/Items/Accessories/TheCamper.cs +++ b/Items/Accessories/TheCamper.cs @@ -37,21 +37,6 @@ namespace CalamityMod.Items.Accessories item.defense = 10; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip5") - { - line2.text = "Provides a small amount of light in the Abyss\n" + - "Provides cold protection in Death Mode"; - } - } - } - } - public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/Vanity/Popo.cs b/Items/Accessories/Vanity/Popo.cs index 1ae4aff5b9..32961c985a 100644 --- a/Items/Accessories/Vanity/Popo.cs +++ b/Items/Accessories/Vanity/Popo.cs @@ -26,21 +26,6 @@ namespace CalamityMod.Items.Accessories.Vanity item.Calamity().devItem = true; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip1") - { - line2.text = "Transforms the holder into a snowman\n" + - "Provides heat and cold protection in Death Mode"; - } - } - } - } - public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/VoidofExtinction.cs b/Items/Accessories/VoidofExtinction.cs index a26786851e..1b3fd4dc4e 100644 --- a/Items/Accessories/VoidofExtinction.cs +++ b/Items/Accessories/VoidofExtinction.cs @@ -35,21 +35,6 @@ namespace CalamityMod.Items.Accessories item.accessory = true; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip4") - { - line2.text = "Temporary immunity to lava, greatly reduces lava burn damage, and 25% increased damage while in lava\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override bool CanEquipAccessory(Player player, int slot) => !player.Calamity().calamityRing; public override void AddRecipes() diff --git a/Items/Accessories/Wings/CelestialTracers.cs b/Items/Accessories/Wings/CelestialTracers.cs index 8744beaefd..fdbed88525 100644 --- a/Items/Accessories/Wings/CelestialTracers.cs +++ b/Items/Accessories/Wings/CelestialTracers.cs @@ -40,21 +40,6 @@ namespace CalamityMod.Items.Accessories.Wings item.Calamity().customRarity = CalamityRarity.Violet; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip10") - { - line2.text = "Being hit for over 200 damage will make you immune for an extended period of time\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override void UpdateAccessory(Player player, bool hideVisual) { if (player.controlJump && player.wingTime > 0f && !player.jumpAgainCloud && player.jump == 0 && player.velocity.Y != 0f && !hideVisual) diff --git a/Items/Accessories/Wings/ElysianTracers.cs b/Items/Accessories/Wings/ElysianTracers.cs index c6eaf42acd..5b0d7b86be 100644 --- a/Items/Accessories/Wings/ElysianTracers.cs +++ b/Items/Accessories/Wings/ElysianTracers.cs @@ -39,21 +39,6 @@ namespace CalamityMod.Items.Accessories.Wings item.Calamity().customRarity = CalamityRarity.DarkBlue; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip9") - { - line2.text = "Temporary immunity to lava\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override void UpdateAccessory(Player player, bool hideVisual) { if (player.controlJump && player.wingTime > 0f && !player.jumpAgainCloud && player.jump == 0 && player.velocity.Y != 0f && !hideVisual) diff --git a/Items/Accessories/Wings/ElysianWings.cs b/Items/Accessories/Wings/ElysianWings.cs index 587f28a7a9..bd3d31dc53 100644 --- a/Items/Accessories/Wings/ElysianWings.cs +++ b/Items/Accessories/Wings/ElysianWings.cs @@ -31,21 +31,6 @@ namespace CalamityMod.Items.Accessories.Wings item.accessory = true; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip5") - { - line2.text = "Temporary immunity to lava and 15% increased movement speed\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/Wings/InfinityBoots.cs b/Items/Accessories/Wings/InfinityBoots.cs index 8afce14b63..c53f1291e9 100644 --- a/Items/Accessories/Wings/InfinityBoots.cs +++ b/Items/Accessories/Wings/InfinityBoots.cs @@ -38,21 +38,6 @@ namespace CalamityMod.Items.Accessories.Wings item.accessory = true; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip9") - { - line2.text = "Temporary immunity to lava\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override void UpdateAccessory(Player player, bool hideVisual) { if (player.controlJump && player.wingTime > 0f && !player.jumpAgainCloud && player.jump == 0 && player.velocity.Y != 0f && !hideVisual) diff --git a/Items/Accessories/Wings/SoulofCryogen.cs b/Items/Accessories/Wings/SoulofCryogen.cs index 2250d1a8ff..47e9a24e79 100644 --- a/Items/Accessories/Wings/SoulofCryogen.cs +++ b/Items/Accessories/Wings/SoulofCryogen.cs @@ -36,21 +36,6 @@ namespace CalamityMod.Items.Accessories.Wings item.accessory = true; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip8") - { - line2.text = "Icicles rain down as you fly\n" + - "Provides heat and cold protection in Death Mode"; - } - } - } - } - public override void Update(ref float gravity, ref float maxFallSpeed) { float num = (float)Main.rand.Next(90, 111) * 0.01f; diff --git a/Items/Accessories/YharimsInsignia.cs b/Items/Accessories/YharimsInsignia.cs index 52b090ca64..01d346f4a3 100644 --- a/Items/Accessories/YharimsInsignia.cs +++ b/Items/Accessories/YharimsInsignia.cs @@ -31,21 +31,6 @@ namespace CalamityMod.Items.Accessories item.Calamity().customRarity = CalamityRarity.Turquoise; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip6") - { - line2.text = "Increased melee knockback\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Armor/AtaxiaHeadgear.cs b/Items/Armor/AtaxiaHeadgear.cs index 6224eb6baa..72a181a5ea 100644 --- a/Items/Armor/AtaxiaHeadgear.cs +++ b/Items/Armor/AtaxiaHeadgear.cs @@ -27,21 +27,6 @@ namespace CalamityMod.Items.Armor item.defense = 15; //53 } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip1") - { - line2.text = "Reduces ammo usage by 25%, temporary immunity to lava, and immunity to fire damage\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/AtaxiaHelm.cs b/Items/Armor/AtaxiaHelm.cs index d0f2a0775c..f079f68325 100644 --- a/Items/Armor/AtaxiaHelm.cs +++ b/Items/Armor/AtaxiaHelm.cs @@ -29,21 +29,6 @@ namespace CalamityMod.Items.Armor item.defense = 33; //67 } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip3") - { - line2.text = "Temporary immunity to lava and immunity to fire damage\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/AtaxiaHelmet.cs b/Items/Armor/AtaxiaHelmet.cs index 86be4da6af..b6ac9b6df0 100644 --- a/Items/Armor/AtaxiaHelmet.cs +++ b/Items/Armor/AtaxiaHelmet.cs @@ -29,21 +29,6 @@ namespace CalamityMod.Items.Armor item.defense = 6; //40 } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip2") - { - line2.text = "Temporary immunity to lava and immunity to fire damage\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/AtaxiaHood.cs b/Items/Armor/AtaxiaHood.cs index 8045fbda83..921a8bd744 100644 --- a/Items/Armor/AtaxiaHood.cs +++ b/Items/Armor/AtaxiaHood.cs @@ -28,21 +28,6 @@ namespace CalamityMod.Items.Armor item.defense = 12; //49 } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip2") - { - line2.text = "Temporary immunity to lava and immunity to fire damage\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/AtaxiaMask.cs b/Items/Armor/AtaxiaMask.cs index 7d52185eda..b5294c9eb1 100644 --- a/Items/Armor/AtaxiaMask.cs +++ b/Items/Armor/AtaxiaMask.cs @@ -27,21 +27,6 @@ namespace CalamityMod.Items.Armor item.defense = 9; //45 } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip1") - { - line2.text = "Temporary immunity to lava and immunity to fire damage\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/AuricTeslaBodyArmor.cs b/Items/Armor/AuricTeslaBodyArmor.cs index 1544139a86..dd00da786e 100644 --- a/Items/Armor/AuricTeslaBodyArmor.cs +++ b/Items/Armor/AuricTeslaBodyArmor.cs @@ -30,21 +30,6 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.Violet; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip2") - { - line2.text = "You will freeze enemies near you when you are struck\n" + - "Provides heat and cold protection in Death Mode"; - } - } - } - } - public override void UpdateEquip(Player player) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Armor/BloodflareHelm.cs b/Items/Armor/BloodflareHelm.cs index 9b2c799678..8023be45a3 100644 --- a/Items/Armor/BloodflareHelm.cs +++ b/Items/Armor/BloodflareHelm.cs @@ -27,21 +27,6 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.PureGreen; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip1") - { - line2.text = "10% increased rogue damage and critical strike chance, 15% increased movement speed\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/BloodflareHelmet.cs b/Items/Armor/BloodflareHelmet.cs index 9cab98ab33..edbf8a48a7 100644 --- a/Items/Armor/BloodflareHelmet.cs +++ b/Items/Armor/BloodflareHelmet.cs @@ -27,21 +27,6 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.PureGreen; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip1") - { - line2.text = "5% increased minion damage\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/BloodflareHornedHelm.cs b/Items/Armor/BloodflareHornedHelm.cs index 17f6d11404..c4345aa92e 100644 --- a/Items/Armor/BloodflareHornedHelm.cs +++ b/Items/Armor/BloodflareHornedHelm.cs @@ -27,21 +27,6 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.PureGreen; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip1") - { - line2.text = "10% increased ranged damage and critical strike chance\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/BloodflareHornedMask.cs b/Items/Armor/BloodflareHornedMask.cs index fafd8cfc4e..a2f4534c6d 100644 --- a/Items/Armor/BloodflareHornedMask.cs +++ b/Items/Armor/BloodflareHornedMask.cs @@ -27,21 +27,6 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.PureGreen; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip1") - { - line2.text = "10% increased magic damage and critical strike chance, +100 max mana, and 17% reduced mana usage\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/BloodflareMask.cs b/Items/Armor/BloodflareMask.cs index d5c8feb9a9..f4d647bc68 100644 --- a/Items/Armor/BloodflareMask.cs +++ b/Items/Armor/BloodflareMask.cs @@ -27,21 +27,6 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.PureGreen; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip1") - { - line2.text = "10% increased melee damage and critical strike chance\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/FearmongerGreathelm.cs b/Items/Armor/FearmongerGreathelm.cs index 235af6c80a..1f37e87aa1 100644 --- a/Items/Armor/FearmongerGreathelm.cs +++ b/Items/Armor/FearmongerGreathelm.cs @@ -48,25 +48,12 @@ namespace CalamityMod.Items.Armor public override void UpdateArmorSet(Player player) { - if (CalamityWorld.death) - { - player.setBonus = @"20% increased minion damage and +2 max minions -The minion damage nerf while wielding weaponry is reduced -Immunity to all forms of frost and flame -All minion attacks grant colossal life regeneration -15% increased damage reduction during the Pumpkin and Frost Moons -This extra damage reduction ignores the soft cap -Provides cold protection in Death Mode"; - } - else - { - player.setBonus = @"20% increased minion damage and +2 max minions -The minion damage nerf while wielding weaponry is reduced -Immunity to all forms of frost and flame -All minion attacks grant colossal life regeneration -15% increased damage reduction during the Pumpkin and Frost Moons -This extra damage reduction ignores the soft cap"; - } + player.setBonus = @"20% increased minion damage and +2 max minions + The minion damage nerf while wielding weaponry is reduced + Immunity to all forms of frost and flame + All minion attacks grant colossal life regeneration + 15% increased damage reduction during the Pumpkin and Frost Moons + This extra damage reduction ignores the soft cap"; // This bool encompasses cross-class nerf immunity, colossal life regen on minion attack, and the holiday moon DR player.Calamity().fearmongerSet = true; diff --git a/Items/Armor/ReaverHeadgear.cs b/Items/Armor/ReaverHeadgear.cs index 82fa1fac1c..d0abcbc137 100644 --- a/Items/Armor/ReaverHeadgear.cs +++ b/Items/Armor/ReaverHeadgear.cs @@ -20,8 +20,7 @@ namespace CalamityMod.Items.Armor { DisplayName.SetDefault("Reaver Headgear"); Tooltip.SetDefault("10% increased pick speed and 20% increased block/wall placement speed\n" + - "Temporary immunity to lava and can move freely through liquids\n" + - "Provides heat protection in Death Mode"); + "Temporary immunity to lava and can move freely through liquids"); } public override void SetDefaults() @@ -33,20 +32,6 @@ namespace CalamityMod.Items.Armor item.defense = 7; //40 } - public override void ModifyTooltips(List list) - { - if (!CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip2") - { - line2.text = ""; - } - } - } - } - public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/TarragonHelm.cs b/Items/Armor/TarragonHelm.cs index d124b99c40..29cc95f7a9 100644 --- a/Items/Armor/TarragonHelm.cs +++ b/Items/Armor/TarragonHelm.cs @@ -30,21 +30,6 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.Turquoise; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip4") - { - line2.text = "10% increased melee damage and critical strike chance\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/TarragonHelmet.cs b/Items/Armor/TarragonHelmet.cs index d325840ece..2ae25f2aaa 100644 --- a/Items/Armor/TarragonHelmet.cs +++ b/Items/Armor/TarragonHelmet.cs @@ -29,21 +29,6 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.Turquoise; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip3") - { - line2.text = "5% increased damage reduction\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/TarragonHornedHelm.cs b/Items/Armor/TarragonHornedHelm.cs index 4417928680..3d433f1669 100644 --- a/Items/Armor/TarragonHornedHelm.cs +++ b/Items/Armor/TarragonHornedHelm.cs @@ -28,21 +28,6 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.Turquoise; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip2") - { - line2.text = "5% increased damage reduction\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/TarragonMask.cs b/Items/Armor/TarragonMask.cs index 65a33572fe..93cd793291 100644 --- a/Items/Armor/TarragonMask.cs +++ b/Items/Armor/TarragonMask.cs @@ -29,21 +29,6 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.Turquoise; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip3") - { - line2.text = "5% increased damage reduction, +100 max mana, and 15% reduced mana usage\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/TarragonVisage.cs b/Items/Armor/TarragonVisage.cs index f236ffe489..b35a2c004f 100644 --- a/Items/Armor/TarragonVisage.cs +++ b/Items/Armor/TarragonVisage.cs @@ -29,21 +29,6 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.Turquoise; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip3") - { - line2.text = "5% increased damage reduction\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/Vanity/AresMask.png b/Items/Armor/Vanity/AresMask.png index 25dcf27df4..62f680fe19 100644 Binary files a/Items/Armor/Vanity/AresMask.png and b/Items/Armor/Vanity/AresMask.png differ diff --git a/Items/Armor/Vanity/AresMask_Head.png b/Items/Armor/Vanity/AresMask_Head.png index 91263dfa83..a99fe4c5e2 100644 Binary files a/Items/Armor/Vanity/AresMask_Head.png and b/Items/Armor/Vanity/AresMask_Head.png differ diff --git a/Items/Armor/XerocMask.cs b/Items/Armor/XerocMask.cs index c3fbe11d83..bd215b7b58 100644 --- a/Items/Armor/XerocMask.cs +++ b/Items/Armor/XerocMask.cs @@ -28,21 +28,6 @@ namespace CalamityMod.Items.Armor item.defense = 20; //71 } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip2") - { - line2.text = "Temporary immunity to lava\n" + - "Provides heat protection in Death Mode"; - } - } - } - } - public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 48f85a6bb8..c18447e5a3 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -150,6 +150,7 @@ namespace CalamityMod.Items case ItemID.MechanicalBatteryPiece: case ItemID.MechanicalWagonPiece: case ItemID.MechanicalWheelPiece: + case ItemID.MinecartMech: case ItemID.SporeSac: case ItemID.ShinyStone: case ItemID.ShrimpyTruffle: diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 98ff3ef055..5a84f861af 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -212,9 +212,6 @@ namespace CalamityMod.Items #region Vanilla Item Tooltip Modification - public const string HeatProtectionLine = "\nProvides heat protection in Death Mode"; - public const string BothProtectionLine = "\nProvides heat and cold protection in Death Mode"; - // Turns a number into a string of increased mining speed. public static string MiningSpeedString(int percent) => $"\n{percent}% increased mining speed"; @@ -285,8 +282,6 @@ namespace CalamityMod.Items if (item.type == ItemID.WarmthPotion) { string immunityLine = "\nMakes you immune to the Chilled, Frozen, and Glacial State debuffs"; - if (CalamityWorld.death) - immunityLine += "\nProvides cold protection in Death Mode"; EditTooltipByNum(0, (line) => line.text += immunityLine); } @@ -306,8 +301,6 @@ namespace CalamityMod.Items if (item.type == ItemID.HandWarmer) { string extraLine = "\nProvides a regeneration boost while wearing the Eskimo armor"; - if (CalamityWorld.death) - extraLine += "\nProvides cold protection in Death Mode"; EditTooltipByNum(0, (line) => line.text += extraLine); } @@ -615,8 +608,6 @@ namespace CalamityMod.Items if (item.type == ItemID.FireGauntlet) { string extraLine = "\n10% increased true melee damage"; - if (CalamityWorld.death) - extraLine += "\nProvides heat and cold protection in Death Mode"; EditTooltipByNum(1, (line) => line.text = line.text.Replace("10%", "14%") + extraLine); } @@ -659,14 +650,8 @@ namespace CalamityMod.Items + "Provides temporary immunity to lava burn damage\n" + "Greatly increases the speed at which lava immunity recharges\n" + "Reduces lava burn damage"; - if (CalamityWorld.death) - lethalLavaReplacement += HeatProtectionLine; EditTooltipByNum(0, (line) => line.text = lethalLavaReplacement); } - - // Otherwise, changes are only made on Death Mode, where heat immunity is mentioned. - else if (CalamityWorld.death) - EditTooltipByNum(0, (line) => line.text += HeatProtectionLine); } if (item.type == ItemID.ObsidianRose) @@ -675,22 +660,8 @@ namespace CalamityMod.Items // If Lethal Lava is enabled, Obsidian Rose reduces the damage from the debuff. if (CalamityConfig.Instance.LethalLava) sb.Append("\nGreatly reduces lava burn damage"); - if (CalamityWorld.death) - sb.Append(HeatProtectionLine); EditTooltipByNum(0, (line) => line.text += sb.ToString()); } - - if (CalamityWorld.death) - { - if (item.type == ItemID.MagmaStone) - EditTooltipByNum(0, (line) => line.text += BothProtectionLine); - if (item.type == ItemID.LavaCharm) - EditTooltipByNum(0, (line) => line.text += HeatProtectionLine); - if (item.type == ItemID.LavaWaders) - EditTooltipByNum(1, (line) => line.text += HeatProtectionLine); - if (item.type == ItemID.FrostHelmet || item.type == ItemID.FrostBreastplate || item.type == ItemID.FrostLeggings) - EditTooltipByName("SetBonus", (line) => line.text += BothProtectionLine); - } #endregion // Add mentions of what Calamity ores vanilla pickaxes can mine diff --git a/Items/DifficultyItems/Death.cs b/Items/DifficultyItems/Death.cs index 0db80c242f..3a56e448ec 100644 --- a/Items/DifficultyItems/Death.cs +++ b/Items/DifficultyItems/Death.cs @@ -20,7 +20,6 @@ namespace CalamityMod.Items.DifficultyItems // Biome effect lines "Allows certain bosses to spawn naturally depending on what biome you're in.\n" + - "Certain biomes and events have additional weather effects.\n" + "Lethal Lava effects are always enabled.\n" + "Greatly boosts enemy spawn rates during the Blood Moon.\n" + "Makes the Abyss more treacherous to navigate.\n" + diff --git a/Items/Placeables/Banners/PitbullBanner.cs b/Items/Placeables/Banners/PitbullBanner.cs index f9f59dfa86..4496ebca0a 100644 --- a/Items/Placeables/Banners/PitbullBanner.cs +++ b/Items/Placeables/Banners/PitbullBanner.cs @@ -8,7 +8,8 @@ namespace CalamityMod.Items.Placeables.Banners { public override void SetStaticDefaults() { - Tooltip.SetDefault("{$CommonItemTooltip.BannerBonus}Pitbull"); + DisplayName.SetDefault("Rotdog Banner"); + Tooltip.SetDefault("{$CommonItemTooltip.BannerBonus}Rotdog"); } public override void SetDefaults() diff --git a/Items/Placeables/Banners/WulfrumSlimeBanner.cs b/Items/Placeables/Banners/WulfrumSlimeBanner.cs index d5ec672d90..2f6b49575e 100644 --- a/Items/Placeables/Banners/WulfrumSlimeBanner.cs +++ b/Items/Placeables/Banners/WulfrumSlimeBanner.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Items.Placeables.Banners { public override void SetStaticDefaults() { - Tooltip.SetDefault("{$CommonItemTooltip.BannerBonus}Wulfrum Slime"); + Tooltip.SetDefault("A purely decorative banner themed after an extinct slime species"); } public override void SetDefaults() diff --git a/Items/Tools/ClimateChange/TorrentialTear.cs b/Items/Tools/ClimateChange/TorrentialTear.cs index 81f95780e6..d2c747e156 100644 --- a/Items/Tools/ClimateChange/TorrentialTear.cs +++ b/Items/Tools/ClimateChange/TorrentialTear.cs @@ -12,9 +12,7 @@ namespace CalamityMod.Items.Tools.ClimateChange DisplayName.SetDefault("Torrential Tear"); Tooltip.SetDefault("Summons the rain.\n" + "Rain will start some time after this item is used.\n" + - "If used while it's raining, the rain will stop some time afterward.\n" + - "In Death Mode, using this item while it's raining will reduce the amount of time the rain lingers for to one minute.\n" + - "However, this will cause the rain to turn violent for that time."); + "If used while it's raining, the rain will stop some time afterward."); } public override void SetDefaults() @@ -31,7 +29,7 @@ namespace CalamityMod.Items.Tools.ClimateChange public override bool CanUseItem(Player player) { - return !Main.slimeRain && (Main.rainTime > 3600 || !CalamityWorld.death || !Main.raining || CalamityWorld.rainingAcid); + return !Main.slimeRain; } public override bool UseItem(Player player) @@ -40,14 +38,6 @@ namespace CalamityMod.Items.Tools.ClimateChange { CalamityUtils.StartRain(true); } - else if (CalamityWorld.death) - { - if (Main.rainTime > 3600) - { - Main.rainTime = 3600; - AdjustRainSeverity(true); - } - } else { Main.raining = false; diff --git a/Items/VanillaArmorChanges/EskimoArmorSetChange.cs b/Items/VanillaArmorChanges/EskimoArmorSetChange.cs index 3d74cd6765..c55b1b8201 100644 --- a/Items/VanillaArmorChanges/EskimoArmorSetChange.cs +++ b/Items/VanillaArmorChanges/EskimoArmorSetChange.cs @@ -27,10 +27,9 @@ namespace CalamityMod.Items.VanillaArmorChanges public override void UpdateSetBonusText(ref string setBonusText) { - string coldImmunity = CalamityWorld.death ? "\nProvides cold protection in Death Mode" : string.Empty; setBonusText = "All ice-themed damage over time debuffs receive a 50% damage bonus\n" + "Cold enemies will deal reduced contact damage to the player\n" + - "Provides immunity to the Frostburn and Glacial State debuffs" + coldImmunity; + "Provides immunity to the Frostburn and Glacial State debuffs"; } public override void ApplyArmorSetBonus(Player player) diff --git a/Items/VanillaArmorChanges/MoltenArmorSetChange.cs b/Items/VanillaArmorChanges/MoltenArmorSetChange.cs index e882f415c9..ba05211f69 100644 --- a/Items/VanillaArmorChanges/MoltenArmorSetChange.cs +++ b/Items/VanillaArmorChanges/MoltenArmorSetChange.cs @@ -19,8 +19,6 @@ namespace CalamityMod.Items.VanillaArmorChanges public override void UpdateSetBonusText(ref string setBonusText) { string extraLine = "\n20% extra true melee damage\nGrants immunity to fire blocks and temporary immunity to lava"; - if (CalamityWorld.death) - extraLine += CalamityGlobalItem.BothProtectionLine; setBonusText += extraLine; } diff --git a/Items/VanillaArmorChanges/ObsidianArmorSetChange.cs b/Items/VanillaArmorChanges/ObsidianArmorSetChange.cs index 3a73ede2b0..ed50da3d82 100644 --- a/Items/VanillaArmorChanges/ObsidianArmorSetChange.cs +++ b/Items/VanillaArmorChanges/ObsidianArmorSetChange.cs @@ -22,14 +22,13 @@ namespace CalamityMod.Items.VanillaArmorChanges public override void UpdateSetBonusText(ref string setBonusText) { - string heatImmunity = CalamityWorld.death ? "\nProvides heat protection in Death Mode" : string.Empty; setBonusText = "+2 defense\n" + "5% increased rogue damage and critical strike chance\n" + "Grants immunity to fire blocks and temporary immunity to lava\n" + "Rogue stealth builds while not attacking and not moving, up to a max of 80\n" + "Once you have built max stealth, you will be able to perform a Stealth Strike\n" + "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + - "The higher your rogue stealth the higher your rogue damage, crit, and movement speed" + heatImmunity; + "The higher your rogue stealth the higher your rogue damage, crit, and movement speed"; } public override void ApplyHeadPieceEffect(Player player) diff --git a/Items/Weapons/Melee/ArkOfTheAncientsGlow.png b/Items/Weapons/Melee/ArkoftheAncientsGlow.png similarity index 100% rename from Items/Weapons/Melee/ArkOfTheAncientsGlow.png rename to Items/Weapons/Melee/ArkoftheAncientsGlow.png diff --git a/Items/Weapons/Melee/BiomeBlade.cs b/Items/Weapons/Melee/BiomeBlade.cs index ea572df764..d719360201 100644 --- a/Items/Weapons/Melee/BiomeBlade.cs +++ b/Items/Weapons/Melee/BiomeBlade.cs @@ -218,6 +218,7 @@ namespace CalamityMod.Items.Weapons.Melee { player.Calamity().rightClickListener = true; + player.Calamity().mouseWorldListener = true; if (player.velocity.Y == 0) //Reset the lunge ability on ground contact CanLunge = 1; diff --git a/Items/Weapons/Melee/FourSeasonsGalaxia.cs b/Items/Weapons/Melee/FourSeasonsGalaxia.cs index 10070b02b6..b644d1e10f 100644 --- a/Items/Weapons/Melee/FourSeasonsGalaxia.cs +++ b/Items/Weapons/Melee/FourSeasonsGalaxia.cs @@ -264,6 +264,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void HoldItem(Player player) { player.Calamity().rightClickListener = true; + player.Calamity().mouseWorldListener = true; if (CanUseItem(player)) { diff --git a/Items/Weapons/Melee/OmegaBiomeBlade.cs b/Items/Weapons/Melee/OmegaBiomeBlade.cs index c35ee5fe3b..827d108f72 100644 --- a/Items/Weapons/Melee/OmegaBiomeBlade.cs +++ b/Items/Weapons/Melee/OmegaBiomeBlade.cs @@ -286,6 +286,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void HoldItem(Player player) { player.Calamity().rightClickListener = true; + player.Calamity().mouseWorldListener = true; //Reset the strong lunge thing just in case it didnt get caught beofre. diff --git a/Items/Weapons/Melee/TrueBiomeBlade.cs b/Items/Weapons/Melee/TrueBiomeBlade.cs index 365a09faf2..7d21375277 100644 --- a/Items/Weapons/Melee/TrueBiomeBlade.cs +++ b/Items/Weapons/Melee/TrueBiomeBlade.cs @@ -27,7 +27,9 @@ namespace CalamityMod.Items.Weapons.Melee #region stats public static int DefaultAttunement_BaseDamage = 160; - public static int DefaultAttunement_SigilTime = 600; + public static int DefaultAttunement_SigilTime = 1200; + public static int DefaultAttunement_BeamTime = 60; + public static float DefaultAttunement_HomingAngle = MathHelper.PiOver4; public static int EvilAttunement_BaseDamage = 320; public static int EvilAttunement_Lifesteal = 4; @@ -244,6 +246,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void HoldItem(Player player) { player.Calamity().rightClickListener = true; + player.Calamity().mouseWorldListener = true; if (player.velocity.Y == 0) //reset the amount of lunges on ground contact { diff --git a/Items/Weapons/Summon/ColdDivinity.cs b/Items/Weapons/Summon/ColdDivinity.cs index 4238719e4e..776ec9e8ed 100644 --- a/Items/Weapons/Summon/ColdDivinity.cs +++ b/Items/Weapons/Summon/ColdDivinity.cs @@ -41,21 +41,6 @@ namespace CalamityMod.Items.Weapons.Summon item.rare = ItemRarityID.Pink; } - public override void ModifyTooltips(List list) - { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip4") - { - line2.text = "Provides heat and cold protection in Death Mode when in use\n" + - "On right click, summons a duplicate ring around the targeted enemy, which slowly converges before exploding"; - } - } - } - } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { float totalMinionSlots = 0f; diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 431e769339..7f62027d76 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -5,6 +5,7 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Wings; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.DifficultyItems; +using CalamityMod.Items.Dyes; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; using CalamityMod.Items.Mounts; @@ -315,7 +316,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("SlimeGod", out float order); List bosses = new List() { NPCType(), NPCType(), NPCType() }; int summon = ItemType(); - List loot = new List() { ItemType(), ItemID.Gel, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.HealingPotion }; + List loot = new List() { ItemType(), ItemID.Gel, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.HealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}]"; string despawn = CalamityUtils.ColorMessage("The gelatinous monstrosity achieved vengeance for its brethren.", new Color(0xBA, 0x55, 0x33)); @@ -327,7 +328,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("Cryogen", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.FrozenKey, ItemID.GreaterHealingPotion }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.FrozenKey, ItemID.GreaterHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}] in the Snow Biome"; string despawn = CalamityUtils.ColorMessage("Cryogen drifts away, carried on a freezing wind.", new Color(0x00, 0xFF, 0xFF)); @@ -481,7 +482,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("Providence", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType() }; string instructions = $"Use [i:{summon}] in the Hallow or Underworld Biomes"; string despawn = CalamityUtils.ColorMessage("The Profaned Goddess vanishes in a burning blaze.", new Color(0xFF, 0xA5, 0x00)); @@ -601,7 +602,7 @@ namespace CalamityMod int altar = ItemType(); List summons = new List() { summon1, summon2 }; List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use [i:{summon1}] or a [i:{summon2}] as offering at an [i:{altar}]"; string despawn = CalamityUtils.ColorMessage("Please don't waste my time.", new Color(0xFF, 0xA5, 0x00)); string bossHeadTex = "CalamityMod/NPCs/SupremeCalamitas/HoodedHeadIcon"; @@ -629,7 +630,7 @@ namespace CalamityMod InvasionDifficulty.TryGetValue("Acid Rain Initial", out float order); List enemies = AcidRainEvent.PossibleEnemiesPreHM.Select(enemy => enemy.Key).ToList(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType() }; string instructions = $"Use a [i:{summon}] or wait for the invasion to occur naturally after the Eye of Cthulhu is defeated."; string despawn = CalamityUtils.ColorMessage("The mysterious creatures of the sulphuric sea descended back into the ocean.", new Color(146, 183, 116)); @@ -644,7 +645,7 @@ namespace CalamityMod enemies.Add(ModContent.NPCType()); enemies.AddRange(AcidRainEvent.PossibleMinibossesAS.Select(miniboss => miniboss.Key)); List summons = new List() { ItemType() }; - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType() }; string instructions = $"Use a [i:{ItemType()}] or wait for the invasion to occur naturally after the Aquatic Scourge is defeated"; string despawn = CalamityUtils.ColorMessage("The mysterious creatures of the sulphuric sea descended back into the deep ocean.", new Color(146, 183, 116)); @@ -658,7 +659,7 @@ namespace CalamityMod List enemies = AcidRainEvent.PossibleEnemiesPolter.Select(enemy => enemy.Key).ToList(); enemies.AddRange(AcidRainEvent.PossibleMinibossesPolter.Select(miniboss => miniboss.Key)); List summons = new List() { ItemType() }; - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ModContent.ItemType(), ModContent.ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ModContent.ItemType(), ModContent.ItemType() }; List collection = new List() { ItemType() }; string instructions = $"Use a [i:{ItemType()}] or wait for the invasion to occur naturally after the Polterghast is defeated"; string despawn = CalamityUtils.ColorMessage("The mysterious creatures of the sulphuric sea descended back into the deep ocean.", new Color(146, 183, 116)); diff --git a/NPCs/Abyss/LuminousCorvina.cs b/NPCs/Abyss/LuminousCorvina.cs index a1d56dbbd3..1347658e5a 100644 --- a/NPCs/Abyss/LuminousCorvina.cs +++ b/NPCs/Abyss/LuminousCorvina.cs @@ -87,7 +87,7 @@ namespace CalamityMod.NPCs.Abyss { ++screamTimer; - int screamLimit = CalamityWorld.death ? 150 : 300; + int screamLimit = CalamityWorld.death ? 120 : 180; if (screamTimer >= screamLimit) { if (screamTimer == screamLimit) @@ -234,7 +234,7 @@ namespace CalamityMod.NPCs.Abyss npc.frameCounter = 0.0; npc.frame.Y = npc.frame.Y + frameHeight; } - if (screamTimer <= 300) + if (screamTimer <= (CalamityWorld.death ? 120 : 180)) { if (npc.frame.Y > frameHeight * 5) { diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 7435d91ab9..ec38aba6f8 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -909,11 +909,6 @@ namespace CalamityMod.NPCs chat = "I happen to have several Angel Statues at the moment, a truely rare commodity. Want one?"; } - if (Main.rand.NextBool(7) && CalamityWorld.death) - { - chat = "The caverns have become increasingly dark as of late, so I stocked up on some special torches if you have the funds."; - } - break; case NPCID.Mechanic: @@ -1222,7 +1217,6 @@ namespace CalamityMod.NPCs SetShopItem(ref shop, ref nextSlot, WorldGen.crimson ? ItemID.BallOHurt : ItemID.TheRottedFork, WorldGen.shadowOrbSmashed || NPC.downedBoss2); SetShopItem(ref shop, ref nextSlot, ItemID.MasterBait, NPC.downedPlantBoss); SetShopItem(ref shop, ref nextSlot, ItemID.AngelStatue, NPC.FindFirstNPC(NPCType()) != -1, Item.buyPrice(0, 5)); - SetShopItem(ref shop, ref nextSlot, ItemID.UltrabrightTorch, CalamityWorld.death); } if (type == NPCID.DyeTrader) diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 57505549a5..57f48fdb44 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -2061,8 +2061,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (DeathAnimationTimer == 1f) { var soundInstance = Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/DevourerAttack"), npc.Center); - if (soundInstance != null) - soundInstance.Volume = MathHelper.Clamp(soundInstance.Volume * 1.6f, 0f, 1f); + CalamityUtils.SafeVolumeChange(ref soundInstance, 1.6f); } // Close the health bar, fade in, and stop doing contact damage. @@ -2129,8 +2128,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (Main.netMode != NetmodeID.Server) { var soundInstance = Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/DevourerAttack"), npc.Center); - if (soundInstance != null) - soundInstance.Volume = MathHelper.Clamp(soundInstance.Volume * 1.6f, 0f, 1f); + CalamityUtils.SafeVolumeChange(ref soundInstance, 1.6f); for (int i = 0; i < 3; i++) { @@ -2138,7 +2136,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (soundInstance != null) { soundInstance.Pitch = -MathHelper.Lerp(0.1f, 0.4f, i / 3f); - soundInstance.Volume = MathHelper.Clamp(soundInstance.Volume * 1.4f, 0f, 1f); + CalamityUtils.SafeVolumeChange(ref soundInstance, 1.4f); } } } diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index c9eedc455b..02481919a4 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -240,9 +240,7 @@ namespace CalamityMod.NPCs.ExoMechs if (Main.netMode != NetmodeID.Server) { var sound = Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/FlareSound"), PlayerToFollow.Center); - - if (sound != null) - sound.Volume = MathHelper.Clamp(sound.Volume * 1.55f, 0f, 1f); + CalamityUtils.SafeVolumeChange(ref sound, 1.55f); } } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index bd9b76dc6d..bc8a07b1ba 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1756,106 +1756,6 @@ namespace CalamityMod.Projectiles } } - if (CalamityWorld.death && !CalamityPlayer.areThereAnyDamnBosses) - { - if (projectile.type == ProjectileID.Sharknado || projectile.type == ProjectileID.Cthulunado) - { - int num520 = 10; - int num521 = 15; - float num522 = 1f; - int num523 = 150; - int num524 = 42; - if (projectile.type == ProjectileID.Cthulunado) - { - num520 = 16; - num521 = 16; - num522 = 1.5f; - } - if (projectile.velocity.X != 0f) - { - projectile.direction = projectile.spriteDirection = -Math.Sign(projectile.velocity.X); - } - projectile.frameCounter++; - if (projectile.frameCounter > 2) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame >= 6) - { - projectile.frame = 0; - } - if (projectile.localAI[0] == 0f && Main.myPlayer == projectile.owner) - { - projectile.localAI[0] = 1f; - projectile.position.X += projectile.width / 2; - projectile.position.Y += projectile.height / 2; - projectile.scale = (num520 + num521 - projectile.ai[1]) * num522 / (num521 + num520); - projectile.width = (int)(num523 * projectile.scale); - projectile.height = (int)(num524 * projectile.scale); - projectile.position.X -= projectile.width / 2; - projectile.position.Y -= projectile.height / 2; - projectile.netUpdate = true; - } - if (projectile.ai[1] != -1f) - { - projectile.scale = (num520 + num521 - projectile.ai[1]) * num522 / (num521 + num520); - projectile.width = (int)(num523 * projectile.scale); - projectile.height = (int)(num524 * projectile.scale); - } - if (!Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.alpha -= 30; - if (projectile.alpha < 60) - { - projectile.alpha = 60; - } - if (projectile.type == ProjectileID.Cthulunado && projectile.alpha < 100) - { - projectile.alpha = 100; - } - } - else - { - projectile.alpha += 30; - if (projectile.alpha > 150) - { - projectile.alpha = 150; - } - } - if (projectile.ai[0] > 0f) - { - projectile.ai[0] -= 1f; - } - if (projectile.ai[0] == 1f && projectile.ai[1] > 0f && projectile.owner == Main.myPlayer) - { - projectile.netUpdate = true; - Vector2 center2 = projectile.Center; - center2.Y -= num524 * projectile.scale / 2f; - float num525 = (num520 + num521 - projectile.ai[1] + 1f) * num522 / (num521 + num520); - center2.Y -= num524 * num525 / 2f; - center2.Y += 2f; - Projectile.NewProjectile(center2, projectile.velocity, projectile.type, projectile.damage, projectile.knockBack, projectile.owner, 10f, projectile.ai[1] - 1f); - } - if (projectile.ai[0] <= 0f) - { - float num529 = (float)Math.PI / 30f; - float num530 = projectile.width / 5f; - if (projectile.type == ProjectileID.Cthulunado) - { - num530 *= 2f; - } - float num531 = (float)(Math.Cos(num529 * (-projectile.ai[0])) - 0.5) * num530; - projectile.position.X -= num531 * (-projectile.direction); - projectile.ai[0] -= 1f; - num531 = (float)(Math.Cos(num529 * (-projectile.ai[0])) - 0.5) * num530; - projectile.position.X += num531 * (-projectile.direction); - } - - return false; - } - } - return true; } #endregion diff --git a/Projectiles/Magic/AetherfluxCannonHoldout.cs b/Projectiles/Magic/AetherfluxCannonHoldout.cs index 45efe4bcd1..6f2d65e5c4 100644 --- a/Projectiles/Magic/AetherfluxCannonHoldout.cs +++ b/Projectiles/Magic/AetherfluxCannonHoldout.cs @@ -52,8 +52,7 @@ namespace CalamityMod.Projectiles.Magic if (DeployedFrames <= 0f) { var sound = Main.PlaySound(SoundID.DD2_DarkMageCastHeal, projectile.Center); - if (sound != null) - sound.Volume = MathHelper.Clamp(sound.Volume * 1.5f, 0f, 1f); + CalamityUtils.SafeVolumeChange(ref sound, 1.5f); } // Update damage based on curent magic damage stat (so Mana Sickness affects it) diff --git a/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs b/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs index e3a0a1143c..80d017d29f 100644 --- a/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs +++ b/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Melee projectile.timeLeft = (int)MaxTime; var sound = Main.PlaySound(Charge > 0 ? SoundID.DD2_PhantomPhoenixShot : SoundID.DD2_MonkStaffSwing, projectile.Center); if (Charge > 0) - sound.Volume = MathHelper.Clamp(sound.Volume * 2.5f, 0f, 1f); + CalamityUtils.SafeVolumeChange(ref sound, 2.5f); direction = projectile.velocity; direction.Normalize(); projectile.rotation = direction.ToRotation(); diff --git a/Projectiles/Melee/BrokenBiomeBlade_AridGrandeur.cs b/Projectiles/Melee/BrokenBiomeBlade_AridGrandeur.cs index 35d77ce09f..bebaf99992 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_AridGrandeur.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_AridGrandeur.cs @@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Melee Lighting.AddLight(projectile.Center, new Vector3(1f, 0.56f, 0.56f) * ShredRatio); //Manage position and rotation - direction = Owner.DirectionTo(Main.MouseWorld); + direction = Owner.DirectionTo(Owner.Calamity().mouseWorld); direction.Normalize(); projectile.rotation = direction.ToRotation(); projectile.Center = Owner.Center + (direction * 60); diff --git a/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs b/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs index ed786c8f29..7cd9462c7e 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs @@ -133,8 +133,7 @@ namespace CalamityMod.Projectiles.Melee } //Take the direction the sword is swung. FUCK not controlling the swing direction more than just left/right :| - //The direction to mouseworld may need to be turned into the custom synced player mouse variables . not on the branch currently tho - direction = Owner.DirectionTo(Main.MouseWorld); + direction = Owner.DirectionTo(Owner.Calamity().mouseWorld); direction.Normalize(); projectile.rotation = direction.ToRotation(); @@ -184,7 +183,7 @@ namespace CalamityMod.Projectiles.Melee Owner.itemRotation = rotation; if (Owner.direction != 1) { - Owner.itemRotation -= 3.14f; + Owner.itemRotation -= MathHelper.Pi; } Owner.itemRotation = MathHelper.WrapAngle(Owner.itemRotation); } diff --git a/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs b/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs index 8e47b586f5..a19e2edfe2 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Melee { CanBounce = 1f; projectile.timeLeft = (int)MaxTime; - direction = Owner.DirectionTo(Main.MouseWorld); + direction = Owner.DirectionTo(Owner.Calamity().mouseWorld); direction.Normalize(); projectile.rotation = direction.ToRotation(); if (CanLunge == 1f) @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Melee Owner.itemRotation = direction.ToRotation(); if (Owner.direction != 1) { - Owner.itemRotation -= 3.14f; + Owner.itemRotation -= MathHelper.Pi; } Owner.itemRotation = MathHelper.WrapAngle(Owner.itemRotation); } diff --git a/Projectiles/Melee/BrokenBiomeBlade_GrovetendersTouch.cs b/Projectiles/Melee/BrokenBiomeBlade_GrovetendersTouch.cs index 3cce100a21..743e5b75c7 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_GrovetendersTouch.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_GrovetendersTouch.cs @@ -104,8 +104,8 @@ namespace CalamityMod.Projectiles.Melee { if (!initialized) //Initialization. create control points & shit) { - projectile.velocity = Owner.DirectionTo(Main.MouseWorld); - Reach = MathHelper.Clamp((Owner.Center - Main.MouseWorld).Length(), MinReach, MaxReach); + projectile.velocity = Owner.DirectionTo(Owner.Calamity().mouseWorld); + Reach = MathHelper.Clamp((Owner.Center - Owner.Calamity().mouseWorld).Length(), MinReach, MaxReach); Main.PlaySound(SoundID.DD2_OgreSpit, projectile.Center); controlPoint1 = projectile.Center; controlPoint2 = projectile.Center; @@ -136,7 +136,7 @@ namespace CalamityMod.Projectiles.Melee projectile.Center = Owner.MountedCenter + SwingPosition(ratio); projectile.direction = projectile.spriteDirection = -Owner.direction; - Owner.itemRotation = MathHelper.WrapAngle(Owner.AngleTo(Main.MouseWorld) - (Owner.direction < 0 ? MathHelper.Pi : 0)); + Owner.itemRotation = MathHelper.WrapAngle(Owner.AngleTo(Owner.Calamity().mouseWorld) - (Owner.direction < 0 ? MathHelper.Pi : 0)); } public void HookToTile() { diff --git a/Projectiles/Melee/Galaxia_AndromedasStride.cs b/Projectiles/Melee/Galaxia_AndromedasStride.cs index 55798fdf2d..08bc19d94b 100644 --- a/Projectiles/Melee/Galaxia_AndromedasStride.cs +++ b/Projectiles/Melee/Galaxia_AndromedasStride.cs @@ -94,8 +94,7 @@ namespace CalamityMod.Projectiles.Melee { var dashSound = Main.PlaySound(SoundID.Item120, projectile.Center); - if (dashSound != null) - dashSound.Volume *= 0.5f; + CalamityUtils.SafeVolumeChange(ref dashSound, 0.5f); State = 1f; projectile.timeLeft = (7 + (int)((Charge / MaxCharge - 0.25f) * 20)) * 2; //Keep that even, if its an odd number itll fuck off and wont reset the players velocity on death dashDuration = projectile.timeLeft; @@ -108,7 +107,7 @@ namespace CalamityMod.Projectiles.Melee if (State == 0f) { - direction = Owner.DirectionTo(Main.MouseWorld); + direction = Owner.DirectionTo(Owner.Calamity().mouseWorld); direction.Normalize(); projectile.Center = Owner.Center + (direction * 70f * ChargeDisplacement()); @@ -229,8 +228,7 @@ namespace CalamityMod.Projectiles.Melee SideSprouts(-1, 150f, 1f * Charge / MaxCharge); SoundEffectInstance slamSound = Main.PlaySound(SoundID.DD2_MonkStaffGroundImpact, projectile.Center); - if (slamSound != null) - slamSound.Volume *= 1.5f; + CalamityUtils.SafeVolumeChange(ref slamSound, 1.5f); } public bool SideSprouts(float facing, float distance, float projSize) diff --git a/Projectiles/Melee/Galaxia_AriesWrath.cs b/Projectiles/Melee/Galaxia_AriesWrath.cs index 650c30c3c6..906e531875 100644 --- a/Projectiles/Melee/Galaxia_AriesWrath.cs +++ b/Projectiles/Melee/Galaxia_AriesWrath.cs @@ -149,8 +149,7 @@ namespace CalamityMod.Projectiles.Melee { projectile.Center = Owner.Center; var scream = Main.PlaySound(SoundID.Item120, projectile.Center); - if (scream != null) - scream.Volume *= 0.5f; + SafeVolumeChange(ref scream, 0.5f); if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < 3) Main.LocalPlayer.Calamity().GeneralScreenShakePower = 3; @@ -159,8 +158,8 @@ namespace CalamityMod.Projectiles.Melee projectile.scale = 1f + ScaleEquation(); projectile.timeLeft = 2; - projectile.Center = Vector2.Lerp(projectile.Center, Main.MouseWorld, 0.05f * ThrowDisplace()); - projectile.Center = projectile.Center.MoveTowards(Main.MouseWorld, 40f * ThrowDisplace()); + projectile.Center = Vector2.Lerp(projectile.Center, Owner.Calamity().mouseWorld, 0.05f * ThrowDisplace()); + projectile.Center = projectile.Center.MoveTowards(Owner.Calamity().mouseWorld, 40f * ThrowDisplace()); if ((projectile.Center - Owner.Center).Length() > FourSeasonsGalaxia.AriesAttunement_Reach) projectile.Center = Owner.Center + Owner.DirectionTo(projectile.Center) * FourSeasonsGalaxia.AriesAttunement_Reach; diff --git a/Projectiles/Melee/Galaxia_PhoenixsPride.cs b/Projectiles/Melee/Galaxia_PhoenixsPride.cs index a11ccdf0cb..01c93d026b 100644 --- a/Projectiles/Melee/Galaxia_PhoenixsPride.cs +++ b/Projectiles/Melee/Galaxia_PhoenixsPride.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Melee { Main.PlaySound(SoundID.Item90, projectile.Center); projectile.velocity = Vector2.Zero; - direction = Owner.DirectionTo(Main.MouseWorld); + direction = Owner.DirectionTo(Owner.Calamity().mouseWorld); direction.Normalize(); initialized = true; } @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Melee Main.LocalPlayer.Calamity().GeneralScreenShakePower = 3; Main.PlaySound(SoundID.Item80, projectile.Center); - direction = Owner.DirectionTo(Main.MouseWorld); + direction = Owner.DirectionTo(Owner.Calamity().mouseWorld); //PARTICLES LOTS OF PARTICLES LOTS OF SPARKLES YES YES MH YES YES for (int i = 0; i <= 8; i++) { diff --git a/Projectiles/Melee/Galaxia_PolarisGaze.cs b/Projectiles/Melee/Galaxia_PolarisGaze.cs index a832f6af46..28c053ca75 100644 --- a/Projectiles/Melee/Galaxia_PolarisGaze.cs +++ b/Projectiles/Melee/Galaxia_PolarisGaze.cs @@ -156,7 +156,7 @@ namespace CalamityMod.Projectiles.Melee Shred = 0; //Manage position and rotation - direction = Owner.DirectionTo(Main.MouseWorld); + direction = Owner.DirectionTo(Owner.Calamity().mouseWorld); direction.Normalize(); projectile.rotation = direction.ToRotation(); projectile.Center = Owner.Center + (direction * 60); @@ -223,8 +223,7 @@ namespace CalamityMod.Projectiles.Melee if (ChargeSoundCooldown <= 0) { SoundEffectInstance chargeSound = Main.PlaySound(SoundID.DD2_BookStaffCast); - if (chargeSound != null) - chargeSound.Volume *= 2.5f; + CalamityUtils.SafeVolumeChange(ref chargeSound, 2.5f); ChargeSoundCooldown = 20; } } diff --git a/Projectiles/Melee/Galaxia_PolarisGazeStar.cs b/Projectiles/Melee/Galaxia_PolarisGazeStar.cs index f836914db9..9987b19919 100644 --- a/Projectiles/Melee/Galaxia_PolarisGazeStar.cs +++ b/Projectiles/Melee/Galaxia_PolarisGazeStar.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Melee Main.PlaySound(SoundID.Item90, projectile.Center); initialized = true; - direction = Owner.DirectionTo(Main.MouseWorld); + direction = Owner.DirectionTo(Owner.Calamity().mouseWorld); direction.Normalize(); projectile.rotation = direction.ToRotation(); diff --git a/Projectiles/Melee/MendedBiomeBlade_ExtantAbhorrence.cs b/Projectiles/Melee/MendedBiomeBlade_ExtantAbhorrence.cs index 07a7f988c3..68f4dd8bad 100644 --- a/Projectiles/Melee/MendedBiomeBlade_ExtantAbhorrence.cs +++ b/Projectiles/Melee/MendedBiomeBlade_ExtantAbhorrence.cs @@ -95,8 +95,7 @@ namespace CalamityMod.Projectiles.Melee { var dashSound = Main.PlaySound(SoundID.Item120, projectile.Center); - if (dashSound != null) - dashSound.Volume *= 0.5f; + CalamityUtils.SafeVolumeChange(ref dashSound, 0.5f); State = 1f; projectile.timeLeft = (7 + (int)((Charge / MaxCharge - 0.25f) * 20)) * 2; //Keep that even, if its an odd number itll fuck off and wont reset the players velocity on death dashDuration = projectile.timeLeft; @@ -109,7 +108,7 @@ namespace CalamityMod.Projectiles.Melee if (State == 0f) { - direction = Owner.DirectionTo(Main.MouseWorld); + direction = Owner.DirectionTo(Owner.Calamity().mouseWorld); direction.Normalize(); projectile.Center = Owner.Center + (direction * 70f * ChargeDisplacement()); @@ -187,8 +186,7 @@ namespace CalamityMod.Projectiles.Melee public void SlamDown() { var slamSound = Main.PlaySound(SoundID.DD2_MonkStaffGroundImpact, projectile.Center); - if (slamSound != null) - slamSound.Volume *= 1.5f; + CalamityUtils.SafeVolumeChange(ref slamSound, 1.5f); if (Owner.whoAmI != Main.myPlayer || Owner.velocity.Y == 0f) return; diff --git a/Projectiles/Melee/MendedBiomeBlade_GestureForTheDrowned.cs b/Projectiles/Melee/MendedBiomeBlade_GestureForTheDrowned.cs index ce8a75c2dc..85f514c905 100644 --- a/Projectiles/Melee/MendedBiomeBlade_GestureForTheDrowned.cs +++ b/Projectiles/Melee/MendedBiomeBlade_GestureForTheDrowned.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Melee Owner.itemRotation = direction.ToRotation(); if (Owner.direction != 1) { - Owner.itemRotation -= 3.14f; + Owner.itemRotation -= MathHelper.Pi; } projectile.Center = Owner.Center + direction; diff --git a/Projectiles/Melee/MendedBiomeBlade_GestureForTheDrownedOrb.cs b/Projectiles/Melee/MendedBiomeBlade_GestureForTheDrownedOrb.cs index 7fff8f1d70..89c4b074c6 100644 --- a/Projectiles/Melee/MendedBiomeBlade_GestureForTheDrownedOrb.cs +++ b/Projectiles/Melee/MendedBiomeBlade_GestureForTheDrownedOrb.cs @@ -21,7 +21,6 @@ namespace CalamityMod.Projectiles.Melee public class GestureForTheDrownedOrb : ModProjectile { public override string Texture => "CalamityMod/Projectiles/Melee/MendedBiomeBlade_GestureForTheDrowned"; - Vector2 direction = Vector2.Zero; public Player Owner => Main.player[projectile.owner]; public ref float HasLanded => ref projectile.ai[0]; //Is the orb in the air or is it on the ground? public ref float TimeSinceLanding => ref projectile.ai[1]; //How long has it been on the ground for diff --git a/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs b/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs index c615ec8b83..0ae5022b6c 100644 --- a/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs +++ b/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Melee { Main.PlaySound(SoundID.Item90, projectile.Center); projectile.velocity = Vector2.Zero; - direction = Owner.DirectionTo(Main.MouseWorld); + direction = Owner.DirectionTo(Owner.Calamity().mouseWorld); direction.Normalize(); oldDirection = direction; initialized = true; @@ -102,7 +102,7 @@ namespace CalamityMod.Projectiles.Melee { CurrentState = 1f; Main.PlaySound(SoundID.Item80, projectile.Center); - direction = Owner.DirectionTo(Main.MouseWorld); + direction = Owner.DirectionTo(Owner.Calamity().mouseWorld); //PARTICLES LOTS OF PARTICLES LOTS OF SPARKLES YES YES MH YES YES for (int i = 0; i <= 8; i++) { diff --git a/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeur.cs b/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeur.cs index f03ef4d74f..79baa9e483 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeur.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeur.cs @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Melee Lighting.AddLight(projectile.Center, new Vector3(1f, 0.56f, 0.56f) * ShredRatio); //Manage position and rotation - direction = Owner.DirectionTo(Main.MouseWorld); + direction = Owner.DirectionTo(Owner.Calamity().mouseWorld); direction.Normalize(); projectile.rotation = direction.ToRotation(); projectile.Center = Owner.Center + (direction * 60); diff --git a/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeurShot.cs b/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeurShot.cs index 480958b59f..ffc2a1187f 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeurShot.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeurShot.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Melee projectile.timeLeft = (int)(30f + ShredRatio * 30f); initialized = true; - direction = Owner.DirectionTo(Main.MouseWorld); + direction = Owner.DirectionTo(Owner.Calamity().mouseWorld); direction.Normalize(); projectile.rotation = direction.ToRotation(); diff --git a/Projectiles/Melee/MendedBiomeBlade_TrueBitingEmbrace.cs b/Projectiles/Melee/MendedBiomeBlade_TrueBitingEmbrace.cs index 1b1fd2a180..987eec2b16 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TrueBitingEmbrace.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TrueBitingEmbrace.cs @@ -129,9 +129,7 @@ namespace CalamityMod.Projectiles.Melee break; } - //Take the direction the sword is swung. FUCK not controlling the swing direction more than just left/right :| - //The direction to mouseworld may need to be turned into the custom synced player mouse variables . not on the branch currently tho - direction = Owner.DirectionTo(Main.MouseWorld); + direction = Owner.DirectionTo(Owner.Calamity().mouseWorld); direction.Normalize(); projectile.rotation = direction.ToRotation(); diff --git a/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs b/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs index 7ae0b71861..1426434789 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Melee { CanBounce = 1f; projectile.timeLeft = (int)MaxTime; - direction = Owner.DirectionTo(Main.MouseWorld); + direction = Owner.DirectionTo(Owner.Calamity().mouseWorld); direction.Normalize(); projectile.rotation = direction.ToRotation(); if (CanLunge == 1f && !ChargedUp) diff --git a/Projectiles/Melee/MendedBiomeBlade_TrueGrovetendersTouch.cs b/Projectiles/Melee/MendedBiomeBlade_TrueGrovetendersTouch.cs index cb473ae3d5..14461e6d76 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TrueGrovetendersTouch.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TrueGrovetendersTouch.cs @@ -158,8 +158,8 @@ namespace CalamityMod.Projectiles.Melee { if (!initialized) //Initialization. create control points & shit) { - projectile.velocity = Owner.DirectionTo(Main.MouseWorld); - Reach = MathHelper.Clamp((Owner.Center - Main.MouseWorld).Length(), MinReach, MaxReach); + projectile.velocity = Owner.DirectionTo(Owner.Calamity().mouseWorld); + Reach = MathHelper.Clamp((Owner.Center - Owner.Calamity().mouseWorld).Length(), MinReach, MaxReach); Main.PlaySound(SoundID.DD2_OgreSpit, projectile.Center); controlPoint1 = projectile.Center; controlPoint2 = projectile.Center; @@ -192,7 +192,7 @@ namespace CalamityMod.Projectiles.Melee //MessWithTiles(); - Owner.itemRotation = MathHelper.WrapAngle(Owner.AngleTo(Main.MouseWorld) - (Owner.direction < 0 ? MathHelper.Pi : 0)); + Owner.itemRotation = MathHelper.WrapAngle(Owner.AngleTo(Owner.Calamity().mouseWorld) - (Owner.direction < 0 ? MathHelper.Pi : 0)); } public void HookToTile() { diff --git a/Projectiles/Melee/MendedBiomeBlade_TruePurityProjection.cs b/Projectiles/Melee/MendedBiomeBlade_TruePurityProjection.cs index 1c79e63f46..be02bfd8f2 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TruePurityProjection.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TruePurityProjection.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Melee aiType = ProjectileID.LightBeam; projectile.friendly = true; projectile.penetrate = 1; - projectile.timeLeft = 40; + projectile.timeLeft = TrueBiomeBlade.DefaultAttunement_BeamTime; projectile.extraUpdates = 1; projectile.melee = true; projectile.tileCollide = false; @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Melee } } } - else if ((projectile.Center - target.Center).Length() >= (projectile.Center + projectile.velocity - target.Center).Length() && CalamityUtils.AngleBetween(projectile.velocity, target.Center - projectile.Center) < MathHelper.PiOver4 * 0.5f) //Home in + else if ((projectile.Center - target.Center).Length() >= (projectile.Center + projectile.velocity - target.Center).Length() && CalamityUtils.AngleBetween(projectile.velocity, target.Center - projectile.Center) < TrueBiomeBlade.DefaultAttunement_HomingAngle) //Home in { projectile.timeLeft = 30; //Remain alive float angularTurnSpeed = MathHelper.ToRadians(MathHelper.Lerp(12.5f, 2.5f, MathHelper.Clamp(projectile.Distance(target.Center) / 10f, 0f, 1f))); @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Melee projectile.velocity = updatedDirection.ToRotationVector2() * projectile.velocity.Length(); } - if (projectile.timeLeft < 35) + if (projectile.timeLeft < TrueBiomeBlade.DefaultAttunement_BeamTime - 5f) projectile.tileCollide = true; Lighting.AddLight(projectile.Center, 0.75f, 1f, 0.24f); @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - if (projectile.timeLeft > 35) + if (projectile.timeLeft > TrueBiomeBlade.DefaultAttunement_BeamTime - 5f) return false; DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor, 1); diff --git a/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs b/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs index cdcadd82d0..ecc6e9be6a 100644 --- a/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs +++ b/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Melee projectile.timeLeft = (int)MaxTime; var sound = Main.PlaySound(Charge > 0 ? SoundID.DD2_PhantomPhoenixShot : SoundID.DD2_MonkStaffSwing, projectile.Center); if (Charge > 0) - sound.Volume = MathHelper.Clamp(sound.Volume * 2.5f, 0f, 1f); + CalamityUtils.SafeVolumeChange(ref sound, 2.5f); direction = projectile.velocity; direction.Normalize(); projectile.rotation = direction.ToRotation(); diff --git a/Projectiles/Melee/TrueBiomeBlade_ChainedMeatHook.cs b/Projectiles/Melee/TrueBiomeBlade_ChainedMeatHook.cs index 98e096d0ce..f6d97f1081 100644 --- a/Projectiles/Melee/TrueBiomeBlade_ChainedMeatHook.cs +++ b/Projectiles/Melee/TrueBiomeBlade_ChainedMeatHook.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Melee { if (projectile.timeLeft == MaxTwirlTime) { - projectile.velocity = Owner.DirectionTo(Main.MouseWorld); + projectile.velocity = Owner.DirectionTo(Owner.Calamity().mouseWorld); Main.PlaySound(SoundID.Item71, projectile.Center); for (int i = 0; i < 4; i++) { diff --git a/Projectiles/Melee/TrueBiomeBlade_LamentationsOfTheChained.cs b/Projectiles/Melee/TrueBiomeBlade_LamentationsOfTheChained.cs index 850ca14c8b..1b2ced5d6c 100644 --- a/Projectiles/Melee/TrueBiomeBlade_LamentationsOfTheChained.cs +++ b/Projectiles/Melee/TrueBiomeBlade_LamentationsOfTheChained.cs @@ -170,7 +170,7 @@ namespace CalamityMod.Projectiles.Melee return; } - projectile.velocity = Owner.DirectionTo(Main.MouseWorld); + projectile.velocity = Owner.DirectionTo(Owner.Calamity().mouseWorld); projectile.velocity.Normalize(); projectile.rotation = projectile.velocity.ToRotation(); projectile.Center = Owner.Center + (projectile.velocity * 60); diff --git a/Projectiles/Melee/TrueBiomeBlade_MercurialTides.cs b/Projectiles/Melee/TrueBiomeBlade_MercurialTides.cs index 6bc4f145cc..6d639b49bd 100644 --- a/Projectiles/Melee/TrueBiomeBlade_MercurialTides.cs +++ b/Projectiles/Melee/TrueBiomeBlade_MercurialTides.cs @@ -94,8 +94,7 @@ namespace CalamityMod.Projectiles.Melee { var dashSound = Main.PlaySound(SoundID.Item120, projectile.Center); - if (dashSound != null) - dashSound.Volume *= 0.5f; + CalamityUtils.SafeVolumeChange(ref dashSound, 0.5f); State = 1f; projectile.timeLeft = (7 + (int)((Charge / MaxCharge - 0.25f) * 20)) * 2; //Keep that even, if its an odd number itll fuck off and wont reset the players velocity on death dashDuration = projectile.timeLeft; @@ -108,7 +107,7 @@ namespace CalamityMod.Projectiles.Melee if (State == 0f) { - direction = Owner.DirectionTo(Main.MouseWorld); + direction = Owner.DirectionTo(Owner.Calamity().mouseWorld); direction.Normalize(); projectile.Center = Owner.Center + (direction * 70f * ChargeDisplacement()); @@ -187,8 +186,7 @@ namespace CalamityMod.Projectiles.Melee public void SlamDown() { var slamSound = Main.PlaySound(SoundID.DD2_MonkStaffGroundImpact, projectile.Center); - if (slamSound != null) - slamSound.Volume *= 1.5f; + CalamityUtils.SafeVolumeChange(ref slamSound, 1.5f); if (Owner.whoAmI != Main.myPlayer || Owner.velocity.Y == 0f) return; diff --git a/Projectiles/Melee/TrueBiomeBlade_SanguineFury.cs b/Projectiles/Melee/TrueBiomeBlade_SanguineFury.cs index 5d3c267c45..5321a2e6d2 100644 --- a/Projectiles/Melee/TrueBiomeBlade_SanguineFury.cs +++ b/Projectiles/Melee/TrueBiomeBlade_SanguineFury.cs @@ -113,7 +113,7 @@ namespace CalamityMod.Projectiles.Melee { if (proj.active && proj.type == ProjectileType() && proj.owner == Owner.whoAmI) { - if (CalamityUtils.AngleBetween(Owner.Center - Main.MouseWorld, Owner.Center - proj.Center) > MathHelper.PiOver4) + if (CalamityUtils.AngleBetween(Owner.Center - Owner.Calamity().mouseWorld, Owner.Center - proj.Center) > MathHelper.PiOver4) { proj.Kill(); break; @@ -143,7 +143,7 @@ namespace CalamityMod.Projectiles.Melee Lighting.AddLight(projectile.Center, new Vector3(1f, 0.56f, 0.56f) * ShredRatio); //Manage position and rotation - direction = Owner.DirectionTo(Main.MouseWorld); + direction = Owner.DirectionTo(Owner.Calamity().mouseWorld); direction.Normalize(); projectile.rotation = direction.ToRotation(); projectile.Center = Owner.Center + (direction * 60); @@ -208,7 +208,7 @@ namespace CalamityMod.Projectiles.Melee if (ChargeSoundCooldown <= 0) { var chargeSound = Main.PlaySound(SoundID.DD2_SonicBoomBladeSlash); - chargeSound.Volume *= 2.5f; + CalamityUtils.SafeVolumeChange(ref chargeSound, 2.5f); ChargeSoundCooldown = 20; } } diff --git a/Projectiles/Melee/TrueBiomeBlade_SanguineFuryWheel.cs b/Projectiles/Melee/TrueBiomeBlade_SanguineFuryWheel.cs index 7385a11c0e..ef90d89c5e 100644 --- a/Projectiles/Melee/TrueBiomeBlade_SanguineFuryWheel.cs +++ b/Projectiles/Melee/TrueBiomeBlade_SanguineFuryWheel.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Melee Main.PlaySound(SoundID.Item90, projectile.Center); initialized = true; - direction = Owner.DirectionTo(Main.MouseWorld); + direction = Owner.DirectionTo(Owner.Calamity().mouseWorld); direction.Normalize(); projectile.rotation = direction.ToRotation(); diff --git a/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs b/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs index 82cf2456ad..a0f8867dad 100644 --- a/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs +++ b/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Melee { Main.PlaySound(SoundID.Item90, projectile.Center); projectile.velocity = Vector2.Zero; - direction = Owner.DirectionTo(Main.MouseWorld); + direction = Owner.DirectionTo(Owner.Calamity().mouseWorld); direction.Normalize(); initialized = true; } @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Melee { CurrentState = 1f; Main.PlaySound(SoundID.Item80, projectile.Center); - direction = Owner.DirectionTo(Main.MouseWorld); + direction = Owner.DirectionTo(Owner.Calamity().mouseWorld); //PARTICLES LOTS OF PARTICLES LOTS OF SPARKLES YES YES MH YES YES for (int i = 0; i <= 8; i++) { @@ -179,13 +179,13 @@ namespace CalamityMod.Projectiles.Melee if (sightLine == null) { - sightLine = new LineVFX(Owner.Center, Owner.DirectionTo(Main.MouseWorld), 0.2f, Color.HotPink, false); + sightLine = new LineVFX(Owner.Center, Owner.DirectionTo(Owner.Calamity().mouseWorld), 0.2f, Color.HotPink, false); GeneralParticleHandler.SpawnParticle(sightLine); } else { - sightLine.Position = Owner.Center + Owner.DirectionTo(Main.MouseWorld) * projectile.scale * 1.88f * 40; - (sightLine as LineVFX).LineVector = Owner.DirectionTo(Main.MouseWorld) * projectile.scale * 1.88f * 38f; + sightLine.Position = Owner.Center + Owner.DirectionTo(Owner.Calamity().mouseWorld) * projectile.scale * 1.88f * 40; + (sightLine as LineVFX).LineVector = Owner.DirectionTo(Owner.Calamity().mouseWorld) * projectile.scale * 1.88f * 38f; sightLine.Scale = 0.2f; sightLine.Time = 0; sightLine.Color = currentColor * 0.7f; diff --git a/Projectiles/Summon/SquirrelSquireMinion.cs b/Projectiles/Summon/SquirrelSquireMinion.cs index efb1d978a6..7bdf3777d6 100644 --- a/Projectiles/Summon/SquirrelSquireMinion.cs +++ b/Projectiles/Summon/SquirrelSquireMinion.cs @@ -17,6 +17,21 @@ namespace CalamityMod.Projectiles.Summon get => projectile.localAI[1] == 1f; set => projectile.localAI[1] = value.ToInt(); } + public bool OnSolidGround + { + get + { + bool groundSolid = false; + for (int i = (int)projectile.Left.X / 16 - 1; i < (int)projectile.Right.X / 16 + 1; i++) + { + bool bottomTileSolid = CalamityUtils.ParanoidTileRetrieval(i, (int)projectile.Bottom.Y / 16).IsTileSolidGround(); + bool firstTileDownSolid = CalamityUtils.ParanoidTileRetrieval(i, (int)projectile.Bottom.Y / 16 + 1).IsTileSolidGround(); + bool secondTileDownSolid = CalamityUtils.ParanoidTileRetrieval(i, (int)projectile.Bottom.Y / 16 + 2).IsTileSolidGround(); + groundSolid |= bottomTileSolid || firstTileDownSolid || secondTileDownSolid; + } + return groundSolid; + } + } public Player Owner => Main.player[projectile.owner]; public override void SetStaticDefaults() @@ -24,7 +39,7 @@ namespace CalamityMod.Projectiles.Summon DisplayName.SetDefault("Squirrel Squire"); ProjectileID.Sets.MinionSacrificable[projectile.type] = true; ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; - Main.projFrames[projectile.type] = 17; //About half of these frames are now unused, but I'll still keep them here incase + Main.projFrames[projectile.type] = 16; } public override void SetDefaults() @@ -56,21 +71,36 @@ namespace CalamityMod.Projectiles.Summon projectile.damage = trueDamage; } - projectile.velocity.Y = MathHelper.Clamp(projectile.velocity.Y + 0.4f, -12f, 12f); + projectile.velocity.Y = MathHelper.Clamp(projectile.velocity.Y + 0.004f, -12f, 12f); projectile.frameCounter++; Attacking = false; NPC potentialTarget = projectile.Center.MinionHoming(800f, Owner, false); if (potentialTarget is null) { - if (projectile.frameCounter > 3) + if (OnSolidGround) { - projectile.frame++; - projectile.frameCounter = 0; + if (projectile.frameCounter > 3) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } } - if (projectile.frame > 3) + else { - projectile.frame = 0; + if (projectile.frameCounter > 5) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame < 8 || projectile.frame > 11) + { + projectile.frame = 9; + } } } else @@ -106,7 +136,13 @@ namespace CalamityMod.Projectiles.Summon AttackTimer++; // Pelt the target with acorns. - projectile.frame = 8 + (int)(AttackTimer / 6.4) % 4; + if (!OnSolidGround) + projectile.frame = 12 + (int)(AttackTimer / 6.4) % 4; + else + { + projectile.velocity.Y = MathHelper.Clamp(projectile.velocity.Y + 0.2f, -12f, 12f); + projectile.frame = 4 + (int)(AttackTimer / 6.4) % 4; + } if (Main.myPlayer == projectile.owner && AttackTimer % 30f == 27f) { projectile.spriteDirection = (target.Center.X > projectile.Center.X).ToDirectionInt(); @@ -119,7 +155,6 @@ namespace CalamityMod.Projectiles.Summon Projectile.NewProjectile(acornSpawnPosition, acornShootVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); } - projectile.velocity.Y = MathHelper.Clamp(projectile.velocity.Y + 0.4f, -12f, 12f); } public override bool CanDamage() => false; diff --git a/Projectiles/Summon/SquirrelSquireMinion.png b/Projectiles/Summon/SquirrelSquireMinion.png index ee371261a3..57814576d0 100644 Binary files a/Projectiles/Summon/SquirrelSquireMinion.png and b/Projectiles/Summon/SquirrelSquireMinion.png differ diff --git a/Skies/AstralScreenShaderData.cs b/Skies/AstralScreenShaderData.cs index 886e7040ca..9cd11f6938 100644 --- a/Skies/AstralScreenShaderData.cs +++ b/Skies/AstralScreenShaderData.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Skies public override void Apply() { Vector3 vec = Main.bgColor.ToVector3(); - vec *= CalamityWorld.death ? 0.55f : 0.4f; + vec *= 0.4f; base.UseOpacity(Math.Max(vec.X, Math.Max(vec.Y, vec.Z))); base.Apply(); } diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index b1a2f22308..1b04c84e92 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -503,77 +503,6 @@ namespace CalamityMod.Tiles return true; } - public override void NearbyEffects(int i, int j, int type, bool closer) - { - if (i > 20 && i < Main.maxTilesX - 20 && j > Main.maxTilesY - 160 && j < Main.maxTilesY - 40) - { - if (type == TileID.Ash || type == TileID.Hellstone || type == ModContent.TileType() || type == ModContent.TileType()) - { - if (Main.gamePaused || !CalamityWorld.death || CalamityPlayer.areThereAnyDamnBosses || !closer || Main.tile[i, j] == null || Main.tile[i, j - 1] == null) - return; - - Tile tileAbove = Main.tile[i, j - 1]; - if (tileAbove.liquidType() == 1 && !tileAbove.active()) - { - bool shootFlames = Main.rand.NextBool(750); - if (shootFlames) - { - int lavaTilesAbove = 0; - int lavaTopY = 0; - for (int k = j - 1; k > Main.maxTilesY - 180; k--) - { - if (Main.tile[i, k] == null) - { - shootFlames = false; - break; - } - - if (!Main.tile[i, k].active() && Main.tile[i, k].liquidType() == 1) - { - if (lavaTilesAbove < 5) - lavaTilesAbove++; - } - else - { - if (lavaTilesAbove == 5) - lavaTopY = k - 1; - else - shootFlames = false; - - break; - } - } - if (shootFlames) - { - for (int l = lavaTopY; l > lavaTopY - 5; l--) - { - if (Main.tile[i, l] == null) - { - shootFlames = false; - break; - } - if (Main.tile[i, l].active()) - { - shootFlames = false; - break; - } - } - } - } - if (shootFlames) - { - float ai0 = 0f; - if (type == ModContent.TileType() || type == ModContent.TileType()) - ai0 = 1f; - int projectileType = ModContent.ProjectileType(); - int proj = Projectile.NewProjectile(i * 16, j * 16, 0f, 0f, projectileType, 0, 0f, Main.myPlayer, ai0, 0f); - Main.projectile[proj].netUpdate = true; - } - } - } - } - } - public override int[] AdjTiles (int type) { // Ashen, Ancient and Profaned Sinks all count as a lava source instead of a water source diff --git a/Tiles/DraedonSummoner/CodebreakerDecryptionComputer.png b/Tiles/DraedonSummoner/CodebreakerDecryptionComputer.png index a5a0642811..c19a1d2c15 100644 Binary files a/Tiles/DraedonSummoner/CodebreakerDecryptionComputer.png and b/Tiles/DraedonSummoner/CodebreakerDecryptionComputer.png differ diff --git a/UI/RipperUI.cs b/UI/RipperUI.cs index bb92e8aaf3..4990423d49 100644 --- a/UI/RipperUI.cs +++ b/UI/RipperUI.cs @@ -165,7 +165,7 @@ namespace CalamityMod.UI // Draw pearls at appropriate positions. for (int i = 0; i < pearls.Count; ++i) - spriteBatch.Draw(pearls[i], rageDrawPos + shakeOffset + offsets[i], null, Color.White, 0f, rageBorderTex.Size() * 0.5f, uiScale, SpriteEffects.None, 0); + spriteBatch.Draw(pearls[i], rageDrawPos + shakeOffset + offsets[i] * uiScale, null, Color.White, 0f, rageBorderTex.Size() * 0.5f, uiScale, SpriteEffects.None, 0); // If the animation is active, draw the animation on top of both the border and the bar. if (animationActive) @@ -231,7 +231,7 @@ namespace CalamityMod.UI // Draw pearls at appropriate positions. for (int i = 0; i < pearls.Count; ++i) - spriteBatch.Draw(pearls[i], adrenDrawPos + shakeOffset + offsets[i], null, Color.White, 0f, adrenBorderTex.Size() * 0.5f, uiScale, SpriteEffects.None, 0); + spriteBatch.Draw(pearls[i], adrenDrawPos + shakeOffset + offsets[i] * uiScale, null, Color.White, 0f, adrenBorderTex.Size() * 0.5f, uiScale, SpriteEffects.None, 0); // If the animation is active, draw the animation on top of both the border and the bar. if (animationActive) diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs index 6165a3bed8..4b0019a6aa 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -187,7 +187,19 @@ namespace CalamityMod (sfx.Volume, sfx.Pan) = CalculateSoundStats(soundPos, ambient); } - public static void StartRain(bool torrentialTear = false, bool maxSeverity = false) + /// + /// Method to change the volume of a sound without having to manually do a nullcheck or having to clamp it down to between 0 and 1 + /// + /// The SoundEffectInstance which is having its values updated. + /// How much the sound's volume should get changed + public static void SafeVolumeChange(ref SoundEffectInstance sfx, float volumeMultiplier) + { + if (sfx is null || sfx.IsDisposed) + return; + sfx.Volume = MathHelper.Clamp(sfx.Volume * volumeMultiplier, 0f, 1f); + } + + public static void StartRain(bool torrentialTear = false, bool maxSeverity = false) { int num = 86400; int num2 = num / 24;