diff --git a/Backgrounds/FloralParadiseBGStyle.cs b/Backgrounds/FloralParadiseBGStyle.cs deleted file mode 100644 index 9f987956f8..0000000000 --- a/Backgrounds/FloralParadiseBGStyle.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Terraria.ModLoader; - -namespace CalamityMod.Backgrounds -{ - public class FloralParadiseBGStyle : ModUndergroundBackgroundStyle - { - public override void FillTextureArray(int[] textureSlots) - { - // Corresponds to underground jungle backgrounds. Something custom could probably be made, but for what it is it works sufficiently for the minibiome. - for (int i = 0; i <= 3; i++) - textureSlots[i] = i + 153; - } - } -} diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index 27c954566f..0c450ba4f3 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -95,8 +95,8 @@ namespace CalamityMod.Balancing #endregion #region Wall of Flesh - // 40% resist to Corro/Crimslime Staff. - NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.WallofFleshEye, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType(), ProjectileType())))); + // 50% resist to Staff of Necrosteocytes. + NPCSpecificBalancingChanges.AddRange(Bundle(new List { NPCID.WallofFlesh, NPCID.WallofFleshEye }, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); #endregion #region Aquatic Scourge @@ -153,6 +153,10 @@ namespace CalamityMod.Balancing // 25% resist to The Ballista's greatarrows. NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); + + // 15% resist to Dryad's Tears. + NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), Do(new ProjectileResistBalancingRule(0.85f, ProjectileType(), ProjectileType())))); + #endregion #region Duke Fishron @@ -206,6 +210,9 @@ namespace CalamityMod.Balancing // 75% resist to Plaguenades. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.25f, ProjectileType(), ProjectileType())))); + // 70% resist to Stardust Dragon Staff. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.StardustDragon1, ProjectileID.StardustDragon2, ProjectileID.StardustDragon3, ProjectileID.StardustDragon4)))); + // 50% resist to true melee. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(ResistTrueMelee(0.5f)))); @@ -215,12 +222,9 @@ namespace CalamityMod.Balancing // 50% resist to Charged Blaster Cannon. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.ChargedBlasterLaser)))); - //45% resist to Duststorm in a Bottle + // 45% resist to Duststorm in a Bottle. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType(), ProjectileType(), ProjectileType())))); - // 40% resist to Stardust Dragon Staff. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.6f, ProjectileID.StardustDragon1, ProjectileID.StardustDragon2, ProjectileID.StardustDragon3, ProjectileID.StardustDragon4)))); - // 35% resist to Aerial Bane. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2BetsyArrow)))); @@ -270,9 +274,6 @@ namespace CalamityMod.Balancing // 50% resist to true melee. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(ResistTrueMelee(0.5f)))); - // 50% resist to Dazzling Stabber Staff. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); - // 50% resist to Last Prism. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.LastPrismLaser)))); @@ -287,11 +288,12 @@ namespace CalamityMod.Balancing // 35% resist to Event Horizon. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType(), ProjectileType())))); - #endregion - #region Old Duke - // 20% resist to Time Bolt. - NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.8f, ProjectileType()))); + // 35% resist to King of Constellations, Tenryu. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType())))); + + // 20% resist to Dazzling Stabber Staff. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); #endregion #region The Devourer of Gods @@ -300,23 +302,18 @@ namespace CalamityMod.Balancing // 60% resist to Corinth Prime's grenades. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.4f, ProjectileType())))); - + + // 50% resist to Stratus Sphere + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + // 35% resist to Sulphuric Acid Cannon's explosions. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); // 20% resist to Valediction's typhoons; will catch Nuclear Fury as well but that doesn't matter. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); - // 15% vulnerability to Time Bolt stealth strikes. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new StealthStrikeBalancingRule(1.15f, ProjectileType())))); #endregion The Devourer of Gods - #region Yharon - - // 15% resist to Time Bolt. - NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), Do(new ProjectileResistBalancingRule(0.85f, ProjectileType())))); - #endregion - #region Exo Mechs: Ares // 35% resist to Devil's Devastation's slash. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); diff --git a/Buffs/Alcohol/BaconOilBuff.cs b/Buffs/Alcohol/BaconOilBuff.cs index c2903d95b5..5d8408f271 100644 --- a/Buffs/Alcohol/BaconOilBuff.cs +++ b/Buffs/Alcohol/BaconOilBuff.cs @@ -18,7 +18,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; CalamityBuffSets.DebuffDataset[Type] = debuffData; } diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index a5a4cd48d5..4ae1be4f13 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -40,11 +40,6 @@ namespace CalamityMod.Buffs { player.GetDamage() -= 0.1f; } - else if (type == BuffID.Clairvoyance) - { - player.GetDamage() -= 0.02f; - player.GetCritChance() -= 2; - } else if (type == BuffID.SugarRush) { player.moveSpeed -= 0.1f; diff --git a/Buffs/DamageOverTime/SagePoison.cs b/Buffs/DamageOverTime/SagePoison.cs index ba20aefe40..66f26cdea1 100644 --- a/Buffs/DamageOverTime/SagePoison.cs +++ b/Buffs/DamageOverTime/SagePoison.cs @@ -3,7 +3,6 @@ using CalamityMod.Projectiles.Summon; using CalamityMod.Systems.Collections; using Terraria; using Terraria.ModLoader; -using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { diff --git a/Buffs/DamageOverTime/ShellfishClaps.cs b/Buffs/DamageOverTime/ShellfishClaps.cs index 32c4224576..960f716168 100644 --- a/Buffs/DamageOverTime/ShellfishClaps.cs +++ b/Buffs/DamageOverTime/ShellfishClaps.cs @@ -30,11 +30,6 @@ namespace CalamityMod.Buffs.DamageOverTime { owner = p.owner; projectileCount++; - if (projectileCount >= 5) - { - projectileCount = 5; - break; - } } } diff --git a/Buffs/DamageOverTime/Shred.cs b/Buffs/DamageOverTime/Shred.cs index 6b893d8bc9..885ef41cf5 100644 --- a/Buffs/DamageOverTime/Shred.cs +++ b/Buffs/DamageOverTime/Shred.cs @@ -72,6 +72,7 @@ namespace CalamityMod.Buffs.DamageOverTime Projectile tick = Projectile.NewProjectileDirect(target.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), bleedTickDamage, 0f, applicator.whoAmI, target.whoAmI); tick.DamageType = DamageClass.Ranged; // Uncommon for DirectStrikes, but it needs to be able to crit. + tick.CritChance = (int)applicator.GetTotalCritChance(DamageClass.Ranged); // All ticks of Shred have a 3x base crit multiplier and have supercrits enabled. CalamityGlobalProjectile cgp = tick.Calamity(); diff --git a/Buffs/DamageOverTime/TrueVulnerabilityHex.cs b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs index 2145aba8db..62fe6749ab 100644 --- a/Buffs/DamageOverTime/TrueVulnerabilityHex.cs +++ b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs @@ -8,7 +8,6 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { diff --git a/Buffs/DamageOverTime/Vaporfied.cs b/Buffs/DamageOverTime/Vaporfied.cs index 47068b9b71..ebc6f14169 100644 --- a/Buffs/DamageOverTime/Vaporfied.cs +++ b/Buffs/DamageOverTime/Vaporfied.cs @@ -1,12 +1,10 @@ using CalamityMod.DataStructures; -using CalamityMod.NPCs; using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { diff --git a/Buffs/DamageOverTime/VulnerabilityHex.cs b/Buffs/DamageOverTime/VulnerabilityHex.cs index 2ce9745729..a0b2a92520 100644 --- a/Buffs/DamageOverTime/VulnerabilityHex.cs +++ b/Buffs/DamageOverTime/VulnerabilityHex.cs @@ -8,7 +8,6 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { diff --git a/Buffs/Cooldowns/Withered.cs b/Buffs/DamageOverTime/Withered.cs similarity index 91% rename from Buffs/Cooldowns/Withered.cs rename to Buffs/DamageOverTime/Withered.cs index 8bcf884976..603ed198cb 100644 --- a/Buffs/Cooldowns/Withered.cs +++ b/Buffs/DamageOverTime/Withered.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Buffs.Cooldowns +namespace CalamityMod.Buffs.DamageOverTime { public class Withered : ModBuff { diff --git a/Buffs/Cooldowns/Withered.png b/Buffs/DamageOverTime/Withered.png similarity index 100% rename from Buffs/Cooldowns/Withered.png rename to Buffs/DamageOverTime/Withered.png diff --git a/Buffs/Placeables/CorruptionEffigyBuff.png b/Buffs/Placeables/CorruptionEffigyBuff.png index c4e47d8cc1..d33ee8eb12 100644 Binary files a/Buffs/Placeables/CorruptionEffigyBuff.png and b/Buffs/Placeables/CorruptionEffigyBuff.png differ diff --git a/Buffs/Placeables/CrimsonEffigyBuff.png b/Buffs/Placeables/CrimsonEffigyBuff.png index 0fdde912e0..fe4f8b1fbf 100644 Binary files a/Buffs/Placeables/CrimsonEffigyBuff.png and b/Buffs/Placeables/CrimsonEffigyBuff.png differ diff --git a/Buffs/Potions/Soaring.cs b/Buffs/Potions/Soaring.cs index a9a75af3c5..f3b261e533 100644 --- a/Buffs/Potions/Soaring.cs +++ b/Buffs/Potions/Soaring.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Buffs.Potions { public class Soaring : ModBuff { - public override LocalizedText Description => base.Description.WithFormatArgs(SoaringPotion.FlightBoost.ToPercent()); + public override LocalizedText Description => base.Description.WithFormatArgs(SoaringPotion.FlightTimeBoost.ToPercent()); public override void SetStaticDefaults() { diff --git a/Buffs/StatBuffs/FulfilledContract.cs b/Buffs/StatBuffs/FulfilledContract.cs new file mode 100644 index 0000000000..1134aa059e --- /dev/null +++ b/Buffs/StatBuffs/FulfilledContract.cs @@ -0,0 +1,21 @@ +using CalamityMod.Items.Accessories; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.StatBuffs +{ + public class FulfilledContract : ModBuff + { + public override void SetStaticDefaults() + { + Main.debuff[Type] = false; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + Main.buffNoTimeDisplay[Type] = false; + } + } +} diff --git a/Buffs/StatBuffs/FulfilledContract.png b/Buffs/StatBuffs/FulfilledContract.png new file mode 100644 index 0000000000..e365757d90 Binary files /dev/null and b/Buffs/StatBuffs/FulfilledContract.png differ diff --git a/Buffs/StatBuffs/SmashedEvil.cs b/Buffs/StatBuffs/SmashedEvil.cs index 57f5c2ac60..2a67a162d9 100644 --- a/Buffs/StatBuffs/SmashedEvil.cs +++ b/Buffs/StatBuffs/SmashedEvil.cs @@ -1,10 +1,8 @@ using System; using CalamityMod.DataStructures; -using CalamityMod.Items.Accessories; -using Terraria; -using Terraria.Localization; -using Terraria.ModLoader; using CalamityMod.Systems.Collections; +using Terraria; +using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs { @@ -12,7 +10,7 @@ namespace CalamityMod.Buffs.StatBuffs { public static DebuffData debuffData = new DebuffData() { - EnemyLostRegen = 40, + EnemyLostRegen = 160, SicknessDebuffScaling = 1, HeatDebuffScaling = 1, ColdDebuffScaling = 1, @@ -39,7 +37,14 @@ namespace CalamityMod.Buffs.StatBuffs .CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveWaterDebuffMultiplier, debuffData.WaterDebuffScaling) .CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveElectricDebuffMultiplier, debuffData.ElectricDebuffScaling) )))); - totalDPS = totalScaling.ApplyTo(totalDPS); + + //Smashed Evil ignores Mult boosters for now to ignore weakness/resist. Once those systems are changed, return to using totalScaling instead of this mess. + StatModifier finalScaling = new(); + finalScaling += totalScaling.Additive - 1; + finalScaling.Base = totalScaling.Base; + finalScaling.Flat = totalScaling.Flat; + + totalDPS = finalScaling.ApplyTo(totalDPS); var totalDPSAdjusted = totalDPS - debuffData.EnemyVanillaRegenToCancelOut; npc.Calamity().ApplyDPSDebuff((int)(totalDPSAdjusted), (int)Math.Max(totalDPS * debuffData.MultiplierDamageTickSize, debuffData.MinimumDamageTickSize), ref npc.lifeRegen, ref damage); } @@ -53,9 +58,8 @@ namespace CalamityMod.Buffs.StatBuffs public override void Update(Player player, ref int buffIndex) { - player.lifeRegenTime += 2; - player.GetDamage() += 0.1f; - player.moveSpeed += 0.2f; + player.lifeRegenTime += 4; + player.GetDamage() += 0.20f; } public override void Update(NPC npc, ref int buffIndex) diff --git a/Buffs/StatDebuffs/GalvanicCorrosion.cs b/Buffs/StatDebuffs/GalvanicCorrosion.cs index 7cafbbd2d4..7229f2502f 100644 --- a/Buffs/StatDebuffs/GalvanicCorrosion.cs +++ b/Buffs/StatDebuffs/GalvanicCorrosion.cs @@ -1,10 +1,8 @@ using CalamityMod.DataStructures; -using CalamityMod.NPCs; using CalamityMod.Systems.Collections; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.StatDebuffs { diff --git a/Buffs/StatDebuffs/MarkedforDeath.cs b/Buffs/StatDebuffs/MarkedforDeath.cs index e7b836d7ee..0ddfe27068 100644 --- a/Buffs/StatDebuffs/MarkedforDeath.cs +++ b/Buffs/StatDebuffs/MarkedforDeath.cs @@ -5,8 +5,6 @@ namespace CalamityMod.Buffs.StatDebuffs { public class MarkedforDeath : ModBuff { - public static int DefenseReduction = 5; - public override void SetStaticDefaults() { Main.debuff[Type] = true; diff --git a/Buffs/Summon/BabySlimeGodBuff.cs b/Buffs/Summon/BabyPaladinBuff.cs similarity index 62% rename from Buffs/Summon/BabySlimeGodBuff.cs rename to Buffs/Summon/BabyPaladinBuff.cs index c596e06060..41a9ed1b88 100644 --- a/Buffs/Summon/BabySlimeGodBuff.cs +++ b/Buffs/Summon/BabyPaladinBuff.cs @@ -1,11 +1,11 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Projectiles.Summon; using Terraria.ModLoader; namespace CalamityMod.Buffs.Summon { - public class BabySlimeGodBuff : BaseSummonBuff + public class BabyPaladinBuff : BaseSummonBuff { - protected override int MinionProjectileType => ModContent.ProjectileType(); + protected override int MinionProjectileType => ModContent.ProjectileType(); protected override ref bool MinionBool => ref BuffModdedOwner.sGod; } diff --git a/Buffs/Summon/BabySlimeGodBuff.png b/Buffs/Summon/BabyPaladinBuff.png similarity index 100% rename from Buffs/Summon/BabySlimeGodBuff.png rename to Buffs/Summon/BabyPaladinBuff.png diff --git a/Buffs/Summon/Corroslime.cs b/Buffs/Summon/BlightedSlime.cs similarity index 57% rename from Buffs/Summon/Corroslime.cs rename to Buffs/Summon/BlightedSlime.cs index ca5b6d02ee..1455f3f3b1 100644 --- a/Buffs/Summon/Corroslime.cs +++ b/Buffs/Summon/BlightedSlime.cs @@ -1,12 +1,12 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Projectiles.Summon; using Terraria.ModLoader; namespace CalamityMod.Buffs.Summon { - public class Corroslime : BaseSummonBuff + public class BlightedSlime : BaseSummonBuff { - protected override int MinionProjectileType => ModContent.ProjectileType(); + protected override int MinionProjectileType => ModContent.ProjectileType(); - protected override ref bool MinionBool => ref BuffModdedOwner.cSlime; + protected override ref bool MinionBool => ref BuffModdedOwner.blightedSlime; } } diff --git a/Buffs/Summon/Corroslime.png b/Buffs/Summon/BlightedSlime.png similarity index 100% rename from Buffs/Summon/Corroslime.png rename to Buffs/Summon/BlightedSlime.png diff --git a/Buffs/Summon/Crimslime.png b/Buffs/Summon/BlightedSlimeCrimson.png similarity index 100% rename from Buffs/Summon/Crimslime.png rename to Buffs/Summon/BlightedSlimeCrimson.png diff --git a/Buffs/Summon/Crimslime.cs b/Buffs/Summon/Crimslime.cs deleted file mode 100644 index dc08297928..0000000000 --- a/Buffs/Summon/Crimslime.cs +++ /dev/null @@ -1,12 +0,0 @@ -using CalamityMod.Projectiles.Summon; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs.Summon -{ - public class Crimslime : BaseSummonBuff - { - protected override int MinionProjectileType => ModContent.ProjectileType(); - - protected override ref bool MinionBool => ref BuffModdedOwner.cSlime2; - } -} diff --git a/Buffs/Summon/HotE.cs b/Buffs/Summon/HotE.cs index 3e8eae1f10..18f70d5b7a 100644 --- a/Buffs/Summon/HotE.cs +++ b/Buffs/Summon/HotE.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Buffs.Summon { CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.allElementals) + if (!modPlayer.allElementals.HasValue) { player.DelBuff(buffIndex); buffIndex--; diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 88ab437d84..c0ded3f947 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -327,6 +327,7 @@ namespace CalamityMod.CalPlayer public int arsenalCooldown = 0; public int killModeCooldown = 0; public bool demonSwordKillMode = false; + public int oblivionCooldown = 0; public bool exaltedKillMode => (demonSwordKillMode && Player.HeldItem.type == ItemType()); public bool devilsDevastationKillMode => (demonSwordKillMode && Player.HeldItem.type == ItemType()); /// @@ -402,19 +403,15 @@ namespace CalamityMod.CalPlayer /// public int hInfernoBoost = 0; public int packetTimer = 0; - public int navyRodAuraTimer = 0; /// Timer variable used to time when Hydrothermic armor's set bonus inferno ring deals damage to targets. public int hydrothermicInfernoTimer = 0; /// Timer variable used to time when Tarragon armor's set bonus life aura deals damage to targets. public int tarraLifeAuraTimer = 0; public int bloodflareHeartTimer = 300; - /// Counter variable used to determine when to spawn Dragon Rage's fireballs. Fireballs are spawned after 10 hits. - public int dragonRageHits = 0; /// Cooldown variable for Dragon Rage's fireball spawning to prevent spamming projectiles when hitting multiple enemies simultaneously. public int dragonRageCooldown = 0; /// Counter variable which controls Aquatic Emblem's stat boosts while underwater. public float aquaticBoost = 0; - public int galileoCooldown = 0; /// Used to track Prideful Hunter's Planar Ripper's movement speed boost, along with its visual effects. public int planarSpeedBoost = 0; public int profanedSoulWeaponUsage = 0; @@ -844,15 +841,11 @@ namespace CalamityMod.CalPlayer public bool shouldTriggerBeeCooldown = false; public int theBeeCooldown = 0; public bool aFossil = false; - public bool aPowder = false; public bool fallingBlockProtection = false; - public bool trapProtection = false; + public bool archaicPowder = false; public bool alluringBait = false; public bool enchantedPearl = false; - public bool fishingStation = false; public bool rBrain = false; - public bool bloodyWormTooth = false; - public bool ivDrip = false; /// NOT the primary Affliction variable, used instead for the Afflicted buff which is given to teammates. public bool afflicted = false; public bool chiRegen = false; @@ -866,13 +859,11 @@ namespace CalamityMod.CalPlayer public bool vexation = false; public bool dodgeScarf = false; public bool evasionScarf = false; - public bool badgeOfBravery = false; public bool WarbanneroftheRighteous = false; public bool warbannerGlow = false; public float warbannerDamageMult = 0; public bool tesla = false; public bool teslaVisuals = true; - public bool cryogenSoul = false; public bool ascendantInsignia = false; public int ascendantInsigniaBuffTime = 0; public int ascendantInsigniaCooldown = 0; @@ -886,13 +877,12 @@ namespace CalamityMod.CalPlayer public bool eGauntlet = false; /// public bool eGauntletVisuals = true; + public bool volatileGelatinVisuals = true; /// /// Used to prevent melee speed stacking with Feral Claws and its upgrades.
/// Feral Claws = 1, Power Glove = 2, Mechanical Glove = 3, Fire Gauntlet = 4, Elemental Gauntlet = 5 ///
public int gloveLevel = 0; - public bool alreadyHasFrogLeg = false; // Unused, intended to prevent Frog Leg tinker stacking - public bool eTalisman = false; public bool lastDashWasTabi = false; public bool statisNinjaBelt = false; public bool voidSashVisuals = true; @@ -930,12 +920,8 @@ namespace CalamityMod.CalPlayer /// bool _hasNoNaturalRegen = false; public bool hadLifeRegenHinderingDebuff = false; - public bool alwaysHoneyRegen = false; - public float alwaysHoneyRegenAmount = 0; - public bool honeyTurboRegen = false; public bool honeyDew = false; public bool livingDew = false; - public int jewelBonusDefense = 0; /// /// Counter variable for spawning Toxic Heart's pulses.
/// Incremented on every frame by , and when it reaches 420, it is reset and a pulse is spawned. @@ -963,8 +949,6 @@ namespace CalamityMod.CalPlayer public bool sGlyph = false; public bool sRegen = false; public bool tracersDust = false; - public bool moonWalkers = false; - public bool voidStriders = false; public bool seraphTracers = false; public bool frostFlare = false; public bool evolution = false; @@ -974,9 +958,9 @@ namespace CalamityMod.CalPlayer public bool procDodgeEffects = false; public bool nanotech = false; public int nanotechHitCooldown = 0; - public bool deadshotBrooch = false; + public Item ammoCycleItem = null; public bool shadowMinions = false; - public bool holyMinions = false; + public bool statisMinions = false; public bool alchFlask = false; public bool toxicHeart = false; public bool toxicHeartVisuals = false; @@ -998,6 +982,7 @@ namespace CalamityMod.CalPlayer public bool fleshTotemVisual = false; public int fleshTotemManaStorage = 0; public bool bloodPact = false; + public bool CanBeCritByThePact = false; public bool bloodflareCore = false; public int bloodflareCoreRemainingHealOverTime = 0; @@ -1008,12 +993,9 @@ namespace CalamityMod.CalPlayer public int chaliceHitOriginalDamage = 0; public bool chaliceHeartStyle = false; - public bool elementalHeart = false; public bool crownJewel = false; public bool infectedJewel = false; public bool purity = false; - /// If true, reduces the damage of electricity debuffs by 50%. - public bool eleResist = false; public bool harpyRing = false; public bool angelTreads = false; /// Makes Flesh Knuckles and its upgrades increase the player's max health. @@ -1061,9 +1043,7 @@ namespace CalamityMod.CalPlayer public bool baroclaw = false; public bool IsFirstDashFrame = true; public int fallingBootVelCheckTimer = 0; - public bool voidOfCalamity = false; public bool apollyon = false; - public bool fragmentsOfAnotherWorld = false; public bool crushingEgo = false; public bool fadedIdolatry = false; public bool pSoulArtifact = false; @@ -1087,27 +1067,27 @@ namespace CalamityMod.CalPlayer public bool ursaSergeant = false; public bool ursaSergeantVisual = false; public bool scuttlersJewel = false; - public int scuttlerCooldown = 0; public bool thiefsDime = false; public bool dynamoStemCells = false; public bool etherealExtorter = false; - public bool blazingCore = false; - public int blazingCoreParry = 0; - public int blazingCoreSuccessfulParry = 0; - public bool blazingCoreEmpoweredParry = false; + public Item AccessoryParryItem = null; + public bool divineProvidence = false; + public int divineProvParry = 0; + public int divineProvSuccessfulParry = 0; + public bool divineProvEmpoweredParry = false; public bool voltaicJelly = false; public bool jellyChargedBattery = false; /// General cooldown for accessories which spawn projectiles on minion hits. public float summonProjCooldown; - public bool sandElemental = false; + public bool? sandElemental = null; public bool sandElementalVanity = false; - public bool oasisElemental = false; + public bool? oasisElemental = null; public bool oasisElementalVanity = false; - public bool cloudElemental = false; + public bool? cloudElemental = null; public bool cloudElementalVanity = false; - public bool brimElemental = false; + public bool? brimElemental = null; public bool brimElementalVanity = false; - public bool waterElemental = false; + public bool? waterElemental = null; public bool waterElementalVanity = false; public bool fungalClump = false; public bool fungalClumpVanity = false; @@ -1123,7 +1103,6 @@ namespace CalamityMod.CalPlayer public int mageCrownTimer = 0; public int mageCrownCount = 0; public bool dragonScales = false; - public bool gloveOfPrecision = false; public bool gloveOfRecklessness = false; public bool vampiricTalisman = false; public bool electricianGlove = false; @@ -1135,7 +1114,7 @@ namespace CalamityMod.CalPlayer public bool spectralVeil = false; public int spectralVeilImmunity = 0; /// Check for if the player has Plagued Fuel Pack OR Blunder Booster equipped. - public bool hasJetpack = false; + public Item rogueDashItem = null; public bool hasEngineDash = false; public bool plaguedFuelPack = false; public bool blunderBooster = false; @@ -1155,8 +1134,6 @@ namespace CalamityMod.CalPlayer public float frozenCubeDebuffBoost = 0; public float frozenCubeElumphantBoost = 0; public int frozenCubeUsedDefense = 0; - public bool miniOldDuke = false; - public bool miniOldDukeVanity = false; public bool starbusterCore = false; public bool starTaintedGenerator = false; public bool hallowedRune = false; @@ -1176,6 +1153,7 @@ namespace CalamityMod.CalPlayer public int voidFrameCounter = 0; /// public int voidFrame = 0; + public int volatileGelHits = 0; public bool rottenDogTooth = false; public bool angelicAlliance = false; public int angelicActivate = -1; @@ -1228,15 +1206,13 @@ namespace CalamityMod.CalPlayer public bool meteorSet = false; /// Calamity's Necro armor set bonus; gives a temporary 10 second revive when the player is killed before actually dying. public bool necroSet = false; - /// Calamity's Frost armor set bonus; gives a combined 20% damage boost split between melee and ranged based on distance from the closest enemy. + /// Calamity's Frost armor set bonus; gives a combined damage boost split between melee and ranged based on distance from the closest enemy. public bool frostSet = false; public bool victideSet = false; public bool victideSummoner = false; public bool sulphurSet = false; - public bool sulphurJump = false; public int sulphurBubbleCooldown = 0; public bool aeroSet = false; - public bool statigelSet = false; public bool tarraSet = false; public bool tarraMelee = false; public bool tarragonCloak = false; @@ -1254,13 +1230,12 @@ namespace CalamityMod.CalPlayer public bool bloodflareFrenzy = false; public int bloodflareMeleeHits = 0; public bool bloodflareRanged = false; - public bool bloodflareThrowing = false; public bool bloodflareMage = false; public int bloodflareMageCooldown = 0; public bool bloodflareSummon = false; public int bloodflareSummonTimer = 0; public bool godSlayer = false; - public bool godSlayerDamage = false; + public bool godSlayerMelee = false; public bool godSlayerRanged = false; public bool godSlayerThrowing = false; public bool godSlayerDashHotKeyPressed = false; @@ -1279,8 +1254,7 @@ namespace CalamityMod.CalPlayer public bool shadeRegen = false; /// Demonshade Greaves' movement speed boost. public bool shadowSpeed = false; - public bool dsSetBonus = false; - public bool auricSetMelee = false; + public bool demonshadeSet = false; public bool daedalusReflect = false; public bool daedalusSplit = false; public bool titanHeartSet = false; @@ -1291,7 +1265,6 @@ namespace CalamityMod.CalPlayer public bool reaverSpeed = false; public bool reaverDefense = false; public bool reaverExplore = false; - public bool fathomSwarmer = false; public bool fathomSwarmerVisage = false; public bool fathomSwarmerBreastplate = false; public bool fathomSwarmerTail = false; @@ -1301,7 +1274,6 @@ namespace CalamityMod.CalPlayer public int tailFrame = 0; public bool astralStarRain = false; public int astralStarRainCooldown = 0; - public int VoidCooldown = 0; public int ursaSergeantCooldown = 0; public int AlchFlaskCooldown = 0; public bool plagueReaper = false; @@ -1349,7 +1321,6 @@ namespace CalamityMod.CalPlayer /// Calamity's Adamantite armor set bonus; adds half of DR to crit chance, and makes landing hits give a stacking defense boost. public bool AdamantiteSet = false; public int AdamantiteSetDecayDelay = 0; - public int ChlorophyteHealDelay = 0; /// /// If true, the player is wearing a post-Moon Lord summoner armor set.
/// Currently unused. @@ -1547,10 +1518,8 @@ namespace CalamityMod.CalPlayer public bool CalamarisLament = false; /// Entropy's Vigil. public bool cEyes = false; - /// Corroslime Staff. - public bool cSlime = false; - /// Crimslime Staff. - public bool cSlime2 = false; + /// Blighted Slime Staff. + public bool blightedSlime = false; /// Abandoned Slime Staff. public bool aSlime = false; public bool brittleStar = false; @@ -1581,14 +1550,14 @@ namespace CalamityMod.CalPlayer /// Enchanted Conch. public bool hCrab = false; /// Heart of the Elements. - public bool allElementals = false; + public bool? allElementals = null; /// Heart of the Elements; however, the minions will not attack. public bool allElementalsVanity = false; /// Silva armor's Silva Crystal. public bool sCrystal = false; /// Elemental in a Bottle. public bool sandEleBuff = false; - /// Rare Elemental in a Bottle. + /// Oasis Elemental in a Bottle. public bool oasisEleBuff = false; /// Eye of the Storm. public bool cloudEleBuff = false; @@ -1705,7 +1674,6 @@ namespace CalamityMod.CalPlayer public bool abyssDeath = false; public int abyssBreathCD; - public float caveDarkness = 0f; #endregion #region Transformation @@ -1722,11 +1690,9 @@ namespace CalamityMod.CalPlayer public bool aquaticHeartPrevious; public bool aquaticHeart; public bool snowmanNoseless; - public bool meldTransformationPrevious; public bool meldTransformation; public bool meldTransformationForce; public bool meldTransformationPower; - public bool omegaBlueTransformationPrevious; public bool omegaBlueTransformation; public bool omegaBlueTransformationForce; public bool omegaBlueTransformationPower; @@ -2159,6 +2125,9 @@ namespace CalamityMod.CalPlayer if (crimEffigy) Player.statLifeMax2 = (int)(Player.statLifeMax2 * (1f - CrimsonEffigy.MaxHealthLossPercent)); + if (CanBeCritByThePact) + Player.statLifeMax2 = (int)(Player.statLifeMax2 * ThePact.MaxLifeMult); + ResetRogueStealth(); calamityBonusLuck = 0f; @@ -2318,8 +2287,6 @@ namespace CalamityMod.CalPlayer rimehound = false; crysthamyr = false; ExoChair = false; - miniOldDuke = false; - miniOldDukeVanity = false; aquaticHeartWaterBuff = false; aquaticHeartIce = false; @@ -2336,7 +2303,7 @@ namespace CalamityMod.CalPlayer nebulousCore = false; godSlayer = false; - godSlayerDamage = false; + godSlayerMelee = false; godSlayerRanged = false; godSlayerThrowing = false; @@ -2345,8 +2312,6 @@ namespace CalamityMod.CalPlayer silvaSummon = false; auricSet = false; - auricSetMelee = false; - GemTechSet = false; CobaltSet = false; @@ -2373,7 +2338,7 @@ namespace CalamityMod.CalPlayer shadeRegen = false; shadowSpeed = false; - dsSetBonus = false; + demonshadeSet = false; wearingRogueArmor = false; blockAllDashes = false; @@ -2399,17 +2364,12 @@ namespace CalamityMod.CalPlayer protolithBangle = false; // Marble band protolithBangleVisual = false; aFossil = false; - aPowder = false; fallingBlockProtection = false; - trapProtection = false; + archaicPowder = false; alluringBait = false; enchantedPearl = false; - fishingStation = false; rBrain = false; - bloodyWormTooth = false; - ivDrip = false; vexation = false; - badgeOfBravery = false; // Clear the Warbanner "cooldown" if not wearing Warbanner. This has absolutely zero effect for a casual player, but is useful for resetting the cooldown's duration. if (!WarbanneroftheRighteous) cooldowns.Remove(WarbanneroftheRighteousBuff.ID); @@ -2440,13 +2400,13 @@ namespace CalamityMod.CalPlayer v8000Engine = false; nanotech = false; nanotechHitCooldown = 0; - deadshotBrooch = false; + ammoCycleItem = null; tesla = false; teslaVisuals = true; - cryogenSoul = false; ascendantInsignia = false; fishStocks = false; magmaStoneVisuals = true; + volatileGelatinVisuals = true; eGauntlet = false; eGauntletVisuals = true; gloveLevel = 0; @@ -2454,14 +2414,12 @@ namespace CalamityMod.CalPlayer statisNinjaBelt = false; if (Player.dashDelay != -1) statisVoidSash = false; - alreadyHasFrogLeg = false; - eTalisman = false; nucleogenesis = false; nuclearFuelRod = false; heartOfDarkness = false; profanedSoulRelicBuff = false; shadowMinions = false; - holyMinions = false; + statisMinions = false; alchFlask = false; toxicHeart = false; toxicHeartVisuals = false; @@ -2479,11 +2437,11 @@ namespace CalamityMod.CalPlayer fleshTotemVisual = false; fleshTotemMinion = false; bloodPact = false; + CanBeCritByThePact = false; bloodflareCore = false; chaliceOfTheBloodGod = false; chaliceHeartStyle = false; chaliceBleedoutToApplyOnHurt = 0; // Resets every frame so it doesn't improperly carry over between hits - elementalHeart = false; crownJewel = false; infectedJewel = false; purity = false; @@ -2493,9 +2451,7 @@ namespace CalamityMod.CalPlayer darkSunRing = false; crawCarapace = false; baroclaw = false; - voidOfCalamity = false; apollyon = false; - fragmentsOfAnotherWorld = false; crushingEgo = false; fadedIdolatry = false; pSoulArtifact = false; @@ -2517,8 +2473,6 @@ namespace CalamityMod.CalPlayer hallowedRegen = false; hallowedPower = false; tracersDust = false; - moonWalkers = false; - voidStriders = false; seraphTracers = false; ursaSergeant = false; ursaSergeantVisual = false; @@ -2526,7 +2480,8 @@ namespace CalamityMod.CalPlayer thiefsDime = false; dynamoStemCells = false; etherealExtorter = false; - blazingCore = false; + AccessoryParryItem = null; + divineProvidence = false; voltaicJelly = false; jellyChargedBattery = false; starbusterCore = false; @@ -2614,9 +2569,6 @@ namespace CalamityMod.CalPlayer sulphurSet = false; aeroSet = false; - - statigelSet = false; - titanHeartSet = false; titanHeartMask = false; titanHeartMantle = false; @@ -2624,7 +2576,6 @@ namespace CalamityMod.CalPlayer plagueReaper = false; plaguebringerPatronSet = false; plaguebringerCarapace = false; - fathomSwarmer = false; fathomSwarmerVisage = false; fathomSwarmerBreastplate = false; fathomSwarmerTail = false; @@ -2646,7 +2597,6 @@ namespace CalamityMod.CalPlayer bloodflareMelee = false; bloodflareFrenzy = false; bloodflareRanged = false; - bloodflareThrowing = false; bloodflareMage = false; bloodflareSummon = false; @@ -2662,7 +2612,6 @@ namespace CalamityMod.CalPlayer moonCrown = false; mageCrownVisibility = false; dragonScales = false; - gloveOfPrecision = false; gloveOfRecklessness = false; vampiricTalisman = false; electricianGlove = false; @@ -2670,7 +2619,7 @@ namespace CalamityMod.CalPlayer filthyGlove = false; sandCloak = false; spectralVeil = false; - hasJetpack = false; + rogueDashItem = null; hasEngineDash = false; plaguedFuelPack = false; blunderBooster = false; @@ -2830,8 +2779,7 @@ namespace CalamityMod.CalPlayer cosmicViper = false; CalamarisLament = false; cEyes = false; - cSlime = false; - cSlime2 = false; + blightedSlime = false; aSlime = false; brittleStar = false; aquaticStar = false; @@ -2866,17 +2814,17 @@ namespace CalamityMod.CalPlayer cSpirit = false; dCrystal = false; MutatedTruffleBool = false; - sandElemental = false; + sandElemental = null; sandElementalVanity = false; - oasisElemental = false; + oasisElemental = null; oasisElementalVanity = false; - cloudElemental = false; + cloudElemental = null; cloudElementalVanity = false; - brimElemental = false; + brimElemental = null; brimElementalVanity = false; - waterElemental = false; + waterElemental = null; waterElementalVanity = false; - allElementals = false; + allElementals = null; allElementalsVanity = false; fungalClump = false; fungalClumpVanity = false; @@ -2971,10 +2919,8 @@ namespace CalamityMod.CalPlayer pscState = 0; pscLerpColor = Color.White; - meldTransformationPrevious = meldTransformation; meldTransformation = meldTransformationForce = meldTransformationPower = false; - omegaBlueTransformationPrevious = omegaBlueTransformation; omegaBlueTransformation = omegaBlueTransformationForce = omegaBlueTransformationPower = false; rageModeActive = false; @@ -3036,6 +2982,9 @@ namespace CalamityMod.CalPlayer #endregion #region Screen Position Movements + + float HalleyScopeLerp = 0; + bool HalleyToggle = false; public override void ModifyScreenPosition() { // CIT 08FEB2025: Photosensitivity config also disables screenshake @@ -3045,6 +2994,19 @@ namespace CalamityMod.CalPlayer Main.screenPosition += Main.rand.NextVector2Circular(GeneralScreenShakePower * CalamityClientConfig.Instance.ScreenshakePower, GeneralScreenShakePower * CalamityClientConfig.Instance.ScreenshakePower); GeneralScreenShakePower = MathHelper.Clamp(GeneralScreenShakePower - 0.185f, 0f, 20f * CalamityClientConfig.Instance.ScreenshakePower); + + if (Player.HeldItem.type != ModContent.ItemType()) + HalleyToggle = false; + else if (Player.HeldItem.JustPressedKeybind()) + HalleyToggle = !HalleyToggle; + + HalleyScopeLerp = MathHelper.Clamp(HalleyScopeLerp + (HalleyToggle ? 0.05f : -0.05f), 0, 1); + if (HalleyScopeLerp > 0) + { + var screenSize = new Vector2(Main.screenWidth, Main.screenHeight); + Vector2 center = Main.screenPosition + screenSize * 0.5f; + Main.screenPosition -= (Vector2.Clamp((center - Main.MouseWorld) / screenSize, new(-0.5f), new(0.5f)) / Main.GameZoomTarget * MathHelper.SmoothStep(0, 1, HalleyScopeLerp)) * new Vector2(1920, 1200) * 0.9f; + } } #endregion @@ -3102,7 +3064,6 @@ namespace CalamityMod.CalPlayer arsenalCooldown = 0; andromedaState = AndromedaPlayerState.Inactive; planarSpeedBoost = 0; - galileoCooldown = 0; soundCooldown = 0; dogTextCooldown = 0; auralisStealthCounter = 0f; @@ -3131,7 +3092,6 @@ namespace CalamityMod.CalPlayer gSabatonTempJumpSpeed = 0; rOfDelivarenceRam = false; astralStarRainCooldown = 0; - VoidCooldown = 0; AlchFlaskCooldown = 0; ascendantInsigniaCooldown = 0; transformerCooldown = 0; @@ -3150,14 +3110,12 @@ namespace CalamityMod.CalPlayer externalColdImmunity = externalHeatImmunity = false; externalDefenseDamageImmunity = false; - dragonRageHits = 0; dragonRageCooldown = 0; spectralVeilImmunity = 0; jetPackDash = 0; jetPackDirection = 0; andromedaCripple = 0; theBeeCooldown = 0; - scuttlerCooldown = 0; mageCrownTimer = 0; wingProjectileCooldown = 0; hallowedRuneCooldown = 0; @@ -3349,12 +3307,11 @@ namespace CalamityMod.CalPlayer miningSetCooldown = 0; shadowSpeed = false; godSlayer = false; - godSlayerDamage = false; + godSlayerMelee = false; godSlayerRanged = false; godSlayerThrowing = false; godSlayerDashHotKeyPressed = false; SpeedBlasterDashStarted = false; - auricSetMelee = false; silvaSet = false; silvaMage = false; silvaSummon = false; @@ -3368,7 +3325,6 @@ namespace CalamityMod.CalPlayer AdamantiteSet = false; WearingPostMLSummonerSet = false; AdamantiteSetDecayDelay = 0; - ChlorophyteHealDelay = 0; omegaBlueChestplate = false; omegaBlueSet = false; molluskHelmet = false; @@ -3387,13 +3343,12 @@ namespace CalamityMod.CalPlayer reaverDefense = false; reaverExplore = false; shadeRegen = false; - dsSetBonus = false; + demonshadeSet = false; titanHeartSet = false; titanHeartMask = false; titanHeartMantle = false; titanCooldown = 0; umbraphileSet = false; - fathomSwarmer = false; fathomSwarmerVisage = false; fathomSwarmerBreastplate = false; fathomSwarmerTail = false; @@ -3424,7 +3379,6 @@ namespace CalamityMod.CalPlayer victideSet = false; aeroSet = false; sulphurSet = false; - statigelSet = false; tarraSet = false; tarraMelee = false; tarragonCloak = false; @@ -3440,7 +3394,6 @@ namespace CalamityMod.CalPlayer bloodflareFrenzy = false; bloodflareMeleeHits = 0; bloodflareRanged = false; - bloodflareThrowing = false; bloodflareMage = false; bloodflareSummon = false; bloodflareSummonTimer = 0; @@ -3449,9 +3402,9 @@ namespace CalamityMod.CalPlayer xerocSet = false; tracersDust = false; GemTechState.OnDeathEffects(); - blazingCoreParry = 0; - blazingCoreEmpoweredParry = false; - blazingCoreSuccessfulParry = 0; + divineProvParry = 0; + divineProvEmpoweredParry = false; + divineProvSuccessfulParry = 0; flameLickedShellParry = 0; flameLickedShellEmpoweredParry = false; profanedCrystalAnim = -1; @@ -3535,7 +3488,7 @@ namespace CalamityMod.CalPlayer if (Player.dead) return; - if (ascendantInsignia && Main.myPlayer == Player.whoAmI && CalamityKeybinds.AscendantInsigniaHotKey.JustPressed && ascendantInsigniaCooldown <= 0) + if (ascendantInsignia && Main.myPlayer == Player.whoAmI && FindAccessory().JustPressedKeybind() && ascendantInsigniaCooldown <= 0) { var source = Player.GetSource_Accessory(FindAccessory()); Projectile.NewProjectile(source, Player.Center - Vector2.UnitY * 45f, Vector2.Zero, ProjectileType(), 0, 0f); @@ -3545,7 +3498,7 @@ namespace CalamityMod.CalPlayer } int numOfBlobs = Player.ownedProjectileCounts[ProjectileType()]; - if (transformer && numOfBlobs > 0 && Main.myPlayer == Player.whoAmI && CalamityKeybinds.TransformerHotKey.JustPressed && transformerCooldown <= 0 && true) // Add check if projectiles are active + if (transformer && numOfBlobs > 0 && Main.myPlayer == Player.whoAmI && FindAccessory().JustPressedKeybind() && transformerCooldown <= 0 && true) // Add check if projectiles are active { // Go fire all the blobs int cooldownTime = 300; @@ -3572,7 +3525,8 @@ namespace CalamityMod.CalPlayer } //Only increment the slam if not on ground, not mounted, not on rope, not hooked, not tongued, otherwise reset slam time to zero - if (CalamityKeybinds.GravistarSabatonHotkey.JustPressed && gSabatonHotkeyFallWindup < 0) + + if (gSabaton && FindAccessory().JustPressedKeybind() && gSabatonHotkeyFallWindup < 0) gSabatonHotkeyFallWindup = 0; if (gSabaton && gSabatonHotkeyFallWindup >= 0 && Main.myPlayer == Player.whoAmI && (Player.velocity.Y != 0) && !Player.pulley && !Player.mount.Active && Player.grappling[0] == -1 && !Player.tongued) { @@ -3618,7 +3572,7 @@ namespace CalamityMod.CalPlayer } } } - if (CalamityKeybinds.AngelicAllianceHotKey.JustPressed && angelicAlliance && Main.myPlayer == Player.whoAmI && !divineBless && !Player.HasCooldown(Cooldowns.DivineBless.ID)) + if (angelicAlliance && Main.myPlayer == Player.whoAmI && FindAccessory().JustPressedKeybind() && !divineBless && !Player.HasCooldown(Cooldowns.DivineBless.ID)) { Player.AddBuff(BuffType(), AngelicAlliance.DivineBlessDuration, false); SoundEngine.PlaySound(AngelicAlliance.ActivationSound, Player.Center); @@ -3628,7 +3582,7 @@ namespace CalamityMod.CalPlayer for (int projIndex = 0; projIndex < Main.maxProjectiles; projIndex++) { Projectile proj = Main.projectile[projIndex]; - if (proj.minionSlots <= 0f || !proj.CountsAsClass()) + if ((proj.minionSlots <= 0f && proj.type != ModContent.ProjectileType()) || !proj.CountsAsClass()) continue; if (proj.active && proj.owner == Player.whoAmI) @@ -3645,7 +3599,7 @@ namespace CalamityMod.CalPlayer Player.HealPlayer(AngelicAlliance.HealPerAngelSpawned); } } - if (CalamityKeybinds.SpectralVeilHotKey.JustPressed && spectralVeil && Main.myPlayer == Player.whoAmI && rogueStealth >= rogueStealthMax * 0.25f && + if (spectralVeil && Main.myPlayer == Player.whoAmI && FindAccessory().JustPressedKeybind() && rogueStealth >= rogueStealthMax * 0.25f && wearingRogueArmor && rogueStealthMax > 0) { if (!Player.chaosState) @@ -3691,7 +3645,7 @@ namespace CalamityMod.CalPlayer } } } - if (CalamityKeybinds.BoosterDashHotKey.JustPressed && hasJetpack && Main.myPlayer == Player.whoAmI && rogueStealth >= rogueStealthMax * 0.25f && + if (rogueDashItem != null && Main.myPlayer == Player.whoAmI && rogueDashItem.JustPressedKeybind() && rogueStealth >= rogueStealthMax * 0.25f && wearingRogueArmor && rogueStealthMax > 0 && !Player.HasCooldown(RogueBooster.ID) && !Player.mount.Active) { jetPackDash = blunderBooster ? 15 : 10; @@ -3702,7 +3656,7 @@ namespace CalamityMod.CalPlayer SoundEngine.PlaySound(SoundID.Item34, Player.Center); } - if (CalamityKeybinds.AmmoCycleHotkey.JustPressed && deadshotBrooch) + if (ammoCycleItem != null && ammoCycleItem.JustPressedKeybind()) { SoundEngine.PlaySound(SoundID.Item149, Player.Center); @@ -3801,9 +3755,9 @@ namespace CalamityMod.CalPlayer else ArmorSetBonusKeyHeldTimer = 0; - if (CalamityKeybinds.AccessoryParryHotKey.JustPressed) + if (AccessoryParryItem != null && AccessoryParryItem.JustPressedKeybind()) { - if (blazingCore && blazingCoreParry == 0 && blazingCoreSuccessfulParry == 0) + if (divineProvidence && divineProvParry == 0 && divineProvSuccessfulParry == 0) { //minor cheese prevention with standing on a spike with later game gear spamming parry :skull: //because of ordering, if they do not have the cooldown, it will not check the projectile array. Likewise if there are no bosses alive. @@ -3811,8 +3765,8 @@ namespace CalamityMod.CalPlayer if (!Player.HasCooldown(ParryCooldown.ID) || Player.ownedProjectileCounts[ProjectileType()] == 0) { Player.SetScreenshake(3.5f); - blazingCoreParry = 30; - SoundEngine.PlaySound(BlazingCore.ParryActivateSound, Player.Center); + divineProvParry = 30; + SoundEngine.PlaySound(DivineProvidence.ParryActivateSound, Player.Center); var mySourceIsIMadeItUp = Player.GetSource_FromThis(); int blazingSun = Projectile.NewProjectile(mySourceIsIMadeItUp, Player.Center, Vector2.Zero, ProjectileType(), 0, 0f, Player.whoAmI, 0f, 0f); Main.projectile[blazingSun].Center = Player.Center; @@ -4099,7 +4053,7 @@ namespace CalamityMod.CalPlayer dust.velocity *= 6.6f; } } - if (dsSetBonus) + if (demonshadeSet) { SoundEngine.PlaySound(DemonshadeHelm.ActivationSound, Player.Center); for (int i = 0; i < 36; i++) @@ -4882,7 +4836,7 @@ namespace CalamityMod.CalPlayer Player.velocity.Y = 0.5f; } else - Player.velocity.Y = 0f; + Player.velocity.Y = 1E-05f; if (CalamityKeybinds.ExoChairSlowdownHotkey.Current) Player.velocity *= 0.5f; @@ -5268,6 +5222,15 @@ namespace CalamityMod.CalPlayer if (Player.chiselSpeed) Player.pickSpeed += 0.1f; + // Prevent Archaic Powder mining speed from stacking with Ancient Chisel or Ancient Fossil + if (archaicPowder) + { + if (Player.chiselSpeed) + Player.pickSpeed += 0.15f; + if (aFossil) + Player.pickSpeed += AncientFossil.MiningSpeedBoost; + } + if (oceanCrest) { bool surface = Player.Center.Y < Main.worldSurface * 16.0; @@ -5391,7 +5354,7 @@ namespace CalamityMod.CalPlayer EnhancedDarknessSystem.lights.Add(new(lastDeerclopsPosition.Value, scale: DeerclopsAI.borderScale, texture: DeerclopsAI.ArenaTex.Value)); //we draw light around the player when far away so they have some visibility, although very small. This is especially nice in multiplayer. we scale opacity with distance bc it looks better - EnhancedDarknessSystem.lights.Add(new EnhancedDarknessSystem.LightSource(scale: 0.75f, opacity: MathHelper.Clamp(Main.LocalPlayer.DistanceSQ(lastDeerclopsPosition.Value) / (409600 /*640^2*/), 0, 1))); + EnhancedDarknessSystem.lights.Add(new EnhancedDarknessSystem.LightSource(scale: 0.75f, opacity: MathHelper.Clamp(Main.LocalPlayer.DistanceSQ(lastDeerclopsPosition.Value) / 409600, 0, 1))); if (darknessIntensity == 0) { @@ -5495,7 +5458,6 @@ namespace CalamityMod.CalPlayer (statisVoidSash ? 0.85f : 0f) + (blueCandle ? WeightlessCandle.AccelerationBoost : 0f) + (planarSpeedBoost > 0 ? (0.01f * planarSpeedBoost) : 0f) + - //(exaltedKillMode ? 7f : devilsDevastationKillMode ? 11f : 0) + (hasteLevel * 0.05f); float runSpeedMult = 1f + @@ -5509,7 +5471,6 @@ namespace CalamityMod.CalPlayer (CobaltSet ? CobaltArmorSetChange.SpeedBoostSetBonusPercentage * 0.01f : 0f) + (silvaSet ? SilvaArmor.AccelerationBoost : 0f) + (planarSpeedBoost > 0 ? (0.01f * planarSpeedBoost) : 0f) + - //(exaltedKillMode ? 0.4f : devilsDevastationKillMode ? 0.7f : 0) + (hasteLevel * 0.05f); if ((Player.slippy || Player.slippy2) && Player.iceSkate) @@ -5528,6 +5489,17 @@ namespace CalamityMod.CalPlayer else momentumCapacitorBoost = 0f; + if (Player.HasBuff()) + { + runAccMult += 0.25f; + Player.runSlowdown *= 1.5f; + if (Player.accRunSpeed > 3) + Player.accRunSpeed += 1.1f; + if (Player.wingAccRunSpeed > 3) + Player.wingAccRunSpeed += 1.1f; + Player.maxRunSpeed += 1.1f; + } + Player.runAcceleration *= runAccMult; Player.maxRunSpeed *= runSpeedMult; } @@ -5838,7 +5810,7 @@ namespace CalamityMod.CalPlayer rainbow.noGravity = true; } } - if (dsSetBonus) + if (demonshadeSet) { if (Main.rand.NextBool(3)) { @@ -6114,7 +6086,10 @@ namespace CalamityMod.CalPlayer float scale = MathHelper.Max(Main.screenWidth, Main.screenHeight) / size * 0.4f; if (ProfanedMoonlightAuroraDrawer is null || ProfanedMoonlightAuroraDrawer.Size != size) + { + ProfanedMoonlightAuroraDrawer?.Dispose(); ProfanedMoonlightAuroraDrawer = FluidFieldManager.CreateField(size, scale, 0.1f, 50f, 0.992f); + } int sourceArea = (int)Math.Ceiling(6f / ProfanedMoonlightAuroraDrawer.Scale) + 1; ProfanedMoonlightAuroraDrawer.ShouldUpdate = Player.miscCounter % 2 == 0; diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index 76b0224e0f..a3d0628a15 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -431,7 +431,7 @@ namespace CalamityMod.CalPlayer #region Armor Visuals // Demonshade Armor - if (calamityPlayer.dsSetBonus && drawInfo.shadow == 0f) + if (calamityPlayer.demonshadeSet && drawInfo.shadow == 0f) { if (Player != null && !Player.dead) { diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 4bfc5a2325..ca3464efec 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -1,14 +1,12 @@ using System; using System.Linq; using CalamityMod.Balancing; -using CalamityMod.Buffs.Cooldowns; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.Placeables; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer.Dashes; using CalamityMod.Cooldowns; -using CalamityMod.DataStructures; using CalamityMod.Dusts; using CalamityMod.Enums; using CalamityMod.Events; @@ -25,7 +23,6 @@ using CalamityMod.Items.Armor.Reaver; using CalamityMod.Items.Armor.Silva; using CalamityMod.Items.Armor.Sulphurous; using CalamityMod.Items.Armor.Tarragon; -using CalamityMod.Items.Armor.Victide; using CalamityMod.Items.Armor.Wulfrum; using CalamityMod.Items.Potions; using CalamityMod.Items.Tools; @@ -43,7 +40,6 @@ using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses; using CalamityMod.Particles; using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Melee; -using CalamityMod.Projectiles.Pets; using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Typeless; @@ -147,7 +143,7 @@ namespace CalamityMod.CalPlayer NetMessage.SendData(MessageID.Dodge, -1, -1, null, Player.whoAmI, 1f, 0f, 0f, 0, 0, 0); } - + #endregion #region Pre Kill @@ -210,9 +206,9 @@ namespace CalamityMod.CalPlayer chaliceBleedoutBuffer = 0D; chaliceDamagePointPartialProgress = 0D; } - Player.HealPlayer(100); + Player.HealPlayer(Items.Accessories.NebulousCore.HealLifeOnRevive); - Player.AddCooldown(Cooldowns.NebulousCore.ID, CalamityUtils.SecondsToFrames(90)); + Player.AddCooldown(Cooldowns.NebulousCore.ID, Items.Accessories.NebulousCore.ReviveCooldown); return false; } @@ -394,7 +390,7 @@ namespace CalamityMod.CalPlayer var npc = Main.npc[damageSource.SourceNPCIndex]; if (npc.ai[3] < 2) //Divinity Devourer { - damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.DivinityDevourer"+Main.rand.Next(1,4)).ToNetworkText(Player.name)); + damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.DivinityDevourer" + Main.rand.Next(1, 4)).ToNetworkText(Player.name)); } else if (npc.ai[3] >= 3) { @@ -428,9 +424,13 @@ namespace CalamityMod.CalPlayer public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { if (Player.Calamity().yharimsGift) - target.AddBuff(ModContent.BuffType(),120); + target.AddBuff(ModContent.BuffType(), 120); - int debuffSpreadProj = ModContent.ProjectileType(); + + if (Player.HasBuff()) + target.AddBuff(ModContent.BuffType(), ThePact.DebuffInflictionDuration); + + int debuffSpreadProj = ModContent.ProjectileType(); if ((Player.Calamity().abaddon || Player.Calamity().apollyon) && (target.Calamity().abaddonEffected || target.Calamity().apollyonEffected) && hit.Crit && abaddonCooldown == 0 && Player.ownedProjectileCounts[debuffSpreadProj] == 0) { int maxTargetNum = target.Calamity().apollyonEffected ? 10 : 6; @@ -498,7 +498,7 @@ namespace CalamityMod.CalPlayer // // FinalDamage cannot be used for the intended effect because there is no way to access the actual damage of the hit CalamityGlobalNPC cgn = target.Calamity(); - if (yellowCandle && cgn.DR < 0.99f && target.takenDamageMultiplier > 0.05f) + if (yellowCandle && cgn.DR < 0.9f && target.takenDamageMultiplier > 0.05f) modifiers.ModifyHitInfo += YellowCandleBuff.ModifyHitInfo_Spite; if (Player.Calamity().scionsCurio && item.CountsAsClass()) @@ -557,7 +557,7 @@ namespace CalamityMod.CalPlayer } } - public override void ModifyHitNPCWithProj(Projectile proj, NPC target, ref NPC.HitModifiers modifiers)/* tModPorter If you don't need the Projectile, consider using ModifyHitNPC instead */ + public override void ModifyHitNPCWithProj(Projectile proj, NPC target, ref NPC.HitModifiers modifiers) { if (proj.npcProj || proj.trap) return; @@ -896,11 +896,11 @@ namespace CalamityMod.CalPlayer modifiers.Cancel(); bool isIgnoredTrap = (proj.type == ProjectileID.PoisonDartTrap) || (proj.type == ProjectileID.VenomDartTrap) || (proj.type == ProjectileID.PoisonDart); - if (Player.Calamity().trapProtection && isIgnoredTrap) + if (Player.Calamity().archaicPowder && isIgnoredTrap) modifiers.Cancel(); bool isReducedTrap = (proj.trap || proj.type == ProjectileID.RollingCactusSpike || proj.type == ProjectileID.Landmine) && !isIgnoredTrap; - if (Player.Calamity().trapProtection && isReducedTrap) + if (Player.Calamity().archaicPowder && isReducedTrap) modifiers.SourceDamage *= (1f - ArchaicPowder.TrapDamageReduction); // Reduce damage dealt by rainbow trails @@ -1121,7 +1121,7 @@ namespace CalamityMod.CalPlayer { if (sulphurSet) Main.npc[proj.Calamity().ParentNPCIndex].AddBuff(BuffID.Poisoned, SulphurousHelmet.SetBonusPoisonDuration); - } + } } if (proj.hostile && hurtInfo.Damage > 0) @@ -1406,7 +1406,8 @@ namespace CalamityMod.CalPlayer bool sufficientDamageForDodging = actualDamageTaken >= dodgeDamageGateValue; //This is in a method here so the logic below can call it in multiple places - void GenericDodgeEffects() { + void GenericDodgeEffects() + { double maxCooldownDurationDamagePercent = 0.5; int maxCooldownDurationDamageValue = (int)Math.Round(Player.statLifeMax2 * (maxCooldownDurationDamagePercent - dodgeDamageGateValuePercent)); @@ -1466,7 +1467,7 @@ namespace CalamityMod.CalPlayer storedShadowDodge = false; return true; } - + if (!Player.HasCooldown(GlobalDodge.ID) && sufficientDamageForDodging && DodgeEffects.Count > 0) { GenericDodgeEffects(); @@ -1489,6 +1490,14 @@ namespace CalamityMod.CalPlayer #region Modify Hurt public override void ModifyHurt(ref Player.HurtModifiers modifiers) { + if (CanBeCritByThePact && Main.rand.NextFloat() < ThePact.ChanceToBeCrit) + { + modifiers.SourceDamage *= ThePact.CritDmgTaken; + Player.AddBuff(ModContent.BuffType(), ThePact.BoostDuration); + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/BloodPactCrit")); + } + + // Calcium Potion knockback reduction if (calcium) modifiers.Knockback *= (1f - CalciumPotion.KnockbackResistance); @@ -1499,7 +1508,7 @@ namespace CalamityMod.CalPlayer #region Custom Hurt Sounds if (hurtSoundTimer == 0) { - if(Player.Transformation().Type != -1 && Player.Transformation().currentTransformation.HurtSound(Player) != null) + if (Player.Transformation().Type != -1 && Player.Transformation().currentTransformation.HurtSound(Player) != null) { var hurtSound = Player.Transformation().currentTransformation.HurtSound(Player).Value; modifiers.DisableSound(); @@ -1554,23 +1563,23 @@ namespace CalamityMod.CalPlayer // It has not yet been mitigated by any means. // - if (blazingCoreParry > 0) //check for active parry + if (divineProvParry > 0) //check for active parry { - if (blazingCoreParry >= 12) //only the first 18 frames (0.3 seconds) counts for a valid parry + if (divineProvParry >= 12) //only the first 18 frames (0.3 seconds) counts for a valid parry { if (!Player.HasCooldown(ParryCooldown.ID)) { - // 17APR2024: Ozzatron: Blazing Core is a parry. It uses vanilla parry iframes and benefits from Cross Necklace. - int blazingCoreParryIFrames = Player.ComputeParryIFrames(); - Player.GiveUniversalIFrames(blazingCoreParryIFrames, true); + // 17APR2024: Ozzatron: Divine Providence is a parry. It uses vanilla parry iframes and benefits from Cross Necklace. + int divineProvParryIFrames = Player.ComputeParryIFrames(); + Player.GiveUniversalIFrames(divineProvParryIFrames, true); - blazingCoreEmpoweredParry = true; + divineProvEmpoweredParry = true; modifiers.Cancel(); modifiers.DisableSound(); //prevents hurt sound from playing, had no idea this was a thing } - SoundEngine.PlaySound(BlazingCore.ParrySuccessSound, Player.Center); + SoundEngine.PlaySound(DivineProvidence.ParrySuccessSound, Player.Center); float power = 2; for (int i = 0; i < (int)(20 * power); i++) @@ -1600,12 +1609,12 @@ namespace CalamityMod.CalPlayer Particle orb2 = new CustomPulse(Player.Center, Vector2.Zero, Color.Khaki, "CalamityMod/Particles/BloomRing", new Vector2(1f, 0.5f), 0, 0, 2.1f * power, 25); GeneralParticleHandler.SpawnParticle(orb2); - blazingCoreSuccessfulParry = 60; + divineProvSuccessfulParry = 60; Player.AddCooldown(ParryCooldown.ID, 60 * 30, false, "blazingcore"); //cooldown is frames in seconds multiplied by the desired amount of seconds } - if (blazingCoreParry > 1) - blazingCoreParry = 1; //schedule parry to end next frame + if (divineProvParry > 1) + divineProvParry = 1; //schedule parry to end next frame } else if (flameLickedShellParry > 0) { @@ -2221,12 +2230,13 @@ namespace CalamityMod.CalPlayer } } - if (fleshTotem && hurtInfo.Damage > 0) + if (fleshTotem && hurtInfo.Damage > 0 && fleshTotemManaStorage > 0) { SoundStyle Counter = new SoundStyle("CalamityMod/Sounds/Custom/BrainOfCthulhu/BoC_Rev_Shield_Down"); if (fleshTotemManaStorage >= 100 && fleshTotemVisual) - SoundEngine.PlaySound(Counter with { Volume = 0.75f}, Player.Center); - int lostSoulAmount = fleshTotemManaStorage / 25; + SoundEngine.PlaySound(Counter with { Volume = 0.75f }, Player.Center); + int lostSoulAmount = (fleshTotemManaStorage / 2) / 25; + int lostSoulDamage = (int)Player.GetTotalDamage().ApplyTo(FleshTotem.lostSoulDamage); if (Player.ownedProjectileCounts[ModContent.ProjectileType()] != 0) { for (int i = 0; i < Main.maxProjectiles; i++) @@ -2236,13 +2246,13 @@ namespace CalamityMod.CalPlayer { for (int k = 0; k < lostSoulAmount; k++) { - Projectile.NewProjectile(Player.GetSource_Accessory_OnHurt(FindAccessory(), hurtInfo.DamageSource), proj.Center, new Vector2(10, 10).RotatedByRandom(100) * Main.rand.NextFloat(0.4f, 0.55f), ModContent.ProjectileType(), FleshTotem.lostSoulDamage, 0f, Main.myPlayer, 0f, 0f, 3f); + Projectile.NewProjectile(Player.GetSource_Accessory_OnHurt(FindAccessory(), hurtInfo.DamageSource), proj.Center, new Vector2(10, 10).RotatedByRandom(100) * Main.rand.NextFloat(0.4f, 0.55f), ModContent.ProjectileType(), lostSoulDamage, 0f, Main.myPlayer, 0f, 0f, 3f); } break; } } } - fleshTotemManaStorage = 0; + fleshTotemManaStorage = fleshTotemManaStorage / 2; } // By setting brainOfConfusionItem, these accessories have this code already, @@ -2370,7 +2380,7 @@ namespace CalamityMod.CalPlayer { int deificProjDamage = (int)(Player.GetBestClassDamage().ApplyTo(DeificAmulet.StarDamage)); - Projectile onHitProj = Main.projectile[Projectile.NewProjectile(source, Player.Center, new Vector2(0,-15 * (rampartOfDeities && n % 2 == 0 ? 0.75f: 1.25f)).RotatedBy(MathHelper.TwoPi/projAmount*n), ModContent.ProjectileType(), deificProjDamage, 4f, Player.whoAmI)]; + Projectile onHitProj = Main.projectile[Projectile.NewProjectile(source, Player.Center, new Vector2(0, -15 * (rampartOfDeities && n % 2 == 0 ? 0.75f : 1.25f)).RotatedBy(MathHelper.TwoPi / projAmount * n), ModContent.ProjectileType(), deificProjDamage, 4f, Player.whoAmI)]; if (onHitProj.whoAmI.WithinBounds(Main.maxProjectiles)) { onHitProj.DamageType = DamageClass.Generic; @@ -2485,7 +2495,7 @@ namespace CalamityMod.CalPlayer } } } - else if (godSlayerDamage) //god slayer melee helm + else if (godSlayerMelee) //god slayer melee helm { var source = Player.GetSource_OnHurt(hurtInfo.DamageSource); if (hurtInfo.Damage > GodSlayerHeadMelee.SetBonusHurtDamageThreshold) @@ -2507,7 +2517,7 @@ namespace CalamityMod.CalPlayer } } } - else if (dsSetBonus) + else if (demonshadeSet) { if (Player.whoAmI == Main.myPlayer) { diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 53083cfb9e..774f52511e 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -73,9 +73,9 @@ namespace CalamityMod.CalPlayer if (Player.electrified) { - totalVanillaDoT += eleResist ? 4 : 8; + totalVanillaDoT += 8; if (Player.controlLeft || Player.controlRight) - totalVanillaDoT += eleResist ? 16 : 32; + totalVanillaDoT += 32; } // Tally up total current vanilla DoT so it can be added as extra DoT from Death Mode @@ -109,7 +109,7 @@ namespace CalamityMod.CalPlayer ApplyDoTDebuff(burningBlood, 8); ApplyDoTDebuff(brainRot, 8); ApplyDoTDebuff(vaporfied, 8); - int staticDoT = ((Player.controlLeft || Player.controlRight) ? 12 : 3) / (eleResist ? 2 : 1); + int staticDoT = ((Player.controlLeft || Player.controlRight) ? 12 : 3); ApplyDoTDebuff(staticDischarge, staticDoT); ApplyDoTDebuff(heavybleeding, 16); ApplyDoTDebuff(crushDepth, 18); @@ -130,7 +130,7 @@ namespace CalamityMod.CalPlayer // Profaned Soul Crystal turns you into Providence, a God, and you take more damage from God Slayer Inferno ApplyDoTDebuff(godSlayerInferno, profanedCrystalBuffs ? 50 : 40); - int fluxDoT = ((Player.controlLeft || Player.controlRight) ? 50 : 10) / (eleResist ? 2 : 1); + int fluxDoT = ((Player.controlLeft || Player.controlRight) ? 50 : 10); ApplyDoTDebuff(vermillionFlux, fluxDoT); ApplyDoTDebuff(elementalMix, 50); // Never inflicted on the player ApplyDoTDebuff(trueVHex, 50); @@ -138,7 +138,7 @@ namespace CalamityMod.CalPlayer ApplyDoTDebuff(dragonFire, dragonfireDoT); ApplyDoTDebuff(miracleBlight, 60); ApplyDoTDebuff(banishingFire, 60); // Never inflicted on the player - int rebukeDoT = ((Player.controlLeft || Player.controlRight) ? 80 : 16) / (eleResist ? 2 : 1); + int rebukeDoT = ((Player.controlLeft || Player.controlRight) ? 80 : 16); ApplyDoTDebuff(auricRebuke, rebukeDoT); // Slowly increase the sulphuric water poisoning effect. Once it's high enough, the player takes damage and the meter resets. @@ -275,7 +275,7 @@ namespace CalamityMod.CalPlayer if (Player.statMana < 0 && Player.Calamity().ChaosStone) { - totalNegativeLifeRegen -= Player.statMana/100f * Items.Accessories.ChaosStone.LostRegenPer100Mana; + totalNegativeLifeRegen -= (Player.statMana/100f * Items.Accessories.ChaosStone.LostRegenPer100Mana) + Items.Accessories.ChaosStone.BaseLostRegen; } // @@ -677,7 +677,7 @@ namespace CalamityMod.CalPlayer { Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), auraDamage, 0f, Player.whoAmI, 0, 0, 0); pulseCounter = 0; - if (toxicHeartVisuals) + if (toxicHeartVisuals && !CalamityClientConfig.Instance.MisophoniaSupport) { float soundVolume = Utils.Remap(Player.lifeRegen, minLifeRegen, maxLifeRegen, 1f, 0.3f, true); SoundStyle heartbeat = new("CalamityMod/Sounds/Item/Heartbeat"); @@ -694,6 +694,10 @@ namespace CalamityMod.CalPlayer public override void NaturalLifeRegen(ref float regen) { + + if (Player.HasBuff()) + regen *= 1.5f; + // Honey Dew and its upgrades make natural regen more powerful if (purity) regen *= Radiance.NaturalRegenPower; @@ -704,6 +708,8 @@ namespace CalamityMod.CalPlayer else if (honeyDew) regen *= HoneyDew.NaturalRegenPower; + if (Player.HasBuff()) + regen *= ThePact.NaturalRegenBoost; // The Camper counteracts the regen loss while moving horizontally if (camper && (Player.velocity.X != 0 && Player.grappling[0] <= 0)) { @@ -735,7 +741,6 @@ namespace CalamityMod.CalPlayer finalRegen += 4f; regeneratorDamage = finalRegen * Regenerator.RegenToDamageRatio; - Player.GetDamage() += regeneratorDamage; if (Player.lifeRegen > 0) Player.lifeRegen = 0; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 0bfd55fb4a..769e535903 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1060,9 +1060,9 @@ namespace CalamityMod.CalPlayer // Create a direct strike to hit this specific NPC. var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); Projectile sigilStrike = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), sigilDamage, 0f, Player.whoAmI, target.whoAmI, 255f); - - // Enable crits by setting the sigil's damage class to be whatever the player's strongest damage class is. - sigilStrike.DamageType = Player.GetBestClass(); + //Set crit chance so Calamity can crit with the proper chance, but don't make it count as those classes. + sigilStrike.CritChance = (int)Player.GetTotalCritChance(Player.GetBestClass()); + sigilStrike.DamageType = AverageDamageClass.Instance; // Incinerate the target with either Vulnerability Hex or True Vulnerability Hex, depending on current cursor focus. // This adds 8 to the buff duration, which results in a net increase of 3 frames every time damage is dealt, due to damage occurring every 5 frames. @@ -1138,6 +1138,7 @@ namespace CalamityMod.CalPlayer Asset carpetAuric = ExtraTextureRefs.FlyingCarpetAuric; Asset carpetOriginal = ExtraTextureRefs.FlyingCarpetVanilla; TextureAssets.FlyingCarpet = (auricSet ? carpetAuric : carpetOriginal); + TextureAssets.Buff[ModContent.BuffType()] = WorldGen.crimson ? ExtraTextureRefs.BlightedSlimeCrimIcon : ExtraTextureRefs.BlightedSlimeCorroIcon; for (int l = 0; l < Player.MaxBuffs; l++) { @@ -1457,7 +1458,6 @@ namespace CalamityMod.CalPlayer } // Death Mode effects - caveDarkness = 0f; if (CalamityWorld.death || Main.getGoodWorld) { if (Player.whoAmI == Main.myPlayer) @@ -1850,7 +1850,7 @@ namespace CalamityMod.CalPlayer int numOfPigs = Player.ownedProjectileCounts[ModContent.ProjectileType()]; if (numOfPigs < Player.Calamity().friendlyMinions) { - int pigDamage = 7; + int pigDamage = 12; Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, new Vector2(0, -16).RotatedByRandom(MathHelper.Pi), ModContent.ProjectileType(), pigDamage, 0f, Player.whoAmI, 0, numOfPigs + 1); } } @@ -2026,8 +2026,8 @@ namespace CalamityMod.CalPlayer if (Player.velocity.Y == 0 && fallingBootVelCheckTimer > 10) { float power = Utils.Remap(fallingBootVelCheckTimer, 10, 40, 0.1f, 1); - float scaledPower = (float)Math.Pow(power, 3); - int damage = (int)Player.GetBestClassDamage().ApplyTo(1500 * scaledPower); // Damage scales down thrice + float scaledPower = (float)Math.Pow(power, 2); + int damage = (int)Player.GetBestClassDamage().ApplyTo(300 * scaledPower); // Damage scales down thrice Vector2 playerFeet = Player.Center + Vector2.UnitY * 26 * Player.gravDir; float blastSize = 120 * power; @@ -2241,7 +2241,7 @@ namespace CalamityMod.CalPlayer // First Shadowflame is +1, Statis' Blessing is +2, Statis' Curse inherits both for +3 if (shadowMinions) Player.maxMinions++; - if (holyMinions) + if (statisMinions) Player.maxMinions += 2; if (starTaintedGenerator) @@ -2334,6 +2334,8 @@ namespace CalamityMod.CalPlayer arsenalCooldown--; if (killModeCooldown > 0) killModeCooldown--; + if (oblivionCooldown > 0) + oblivionCooldown--; if (ascendantInsigniaCooldown > 0 && ascendantInsigniaBuffTime <= 0) ascendantInsigniaCooldown--; if (transformerCooldown > 0) @@ -2358,8 +2360,6 @@ namespace CalamityMod.CalPlayer phantomicHeartRegen--; if (phantomicBulwarkCooldown > 0) phantomicBulwarkCooldown--; - if (galileoCooldown > 0) - galileoCooldown--; if (gladiatorTimer > 0) gladiatorTimer--; if (dragonRageCooldown > 0) @@ -2372,8 +2372,6 @@ namespace CalamityMod.CalPlayer raiderSoundCooldown--; if (astralStarRainCooldown > 0) astralStarRainCooldown--; - if (VoidCooldown > 0) - VoidCooldown--; if (ursaSergeantCooldown > 0) ursaSergeantCooldown--; if (generalBandCooldown > 0) @@ -2445,8 +2443,6 @@ namespace CalamityMod.CalPlayer ataxiaDmg = 0f; if (hydroHealTimer > 0f) hydroHealTimer -= 0.05f; - if (ataxiaDmg < 0f) - ataxiaDmg = 0f; if (xerocDmg > 0f) xerocDmg -= 2f; if (xerocDmg < 0f) @@ -2539,15 +2535,15 @@ namespace CalamityMod.CalPlayer if (auralisAuroraCooldown > 0) auralisAuroraCooldown--; - if (blazingCore) + if (divineProvidence) { - if (blazingCoreSuccessfulParry > 0) - BlazingCore.HandleStars(Player); - else if (blazingCoreParry > 0) - BlazingCore.HandleParryCountdown(Player); + if (divineProvSuccessfulParry > 0) + DivineProvidence.HandleStars(Player); + else if (divineProvParry > 0) + DivineProvidence.HandleParryCountdown(Player); } - else if (blazingCoreParry > 0) - blazingCoreParry--; + else if (divineProvParry > 0) + divineProvParry--; else if (flameLickedShellParry > 0) { if (flameLickedShell) @@ -2582,8 +2578,6 @@ namespace CalamityMod.CalPlayer } else adamantiteSetDefenseBoostInterpolant = 0f; - if (ChlorophyteHealDelay > 0) - ChlorophyteHealDelay--; if (monolithAccursedShader > 0) monolithAccursedShader--; if (monolithBossRushShader > 0) @@ -2771,9 +2765,6 @@ namespace CalamityMod.CalPlayer if (Player.buffTime[l] <= 2 && buffID == ModContent.BuffType()) if (Player.whoAmI == Main.myPlayer) Player.AddCooldown(Cooldowns.TarragonImmunity.ID, TarragonHeadRogue.ImmunityCooldown); - - if (CalamityBuffSets.IsDebuff[buffID]) - Player.GetDamage() += TarragonHeadRogue.RogueDamageBoostWhileDebuffed; } } @@ -2839,6 +2830,10 @@ namespace CalamityMod.CalPlayer if (Player.ichor) Player.statDefense += 5; + // Holding Walking Cane increases movement speed + if (Player.HeldItem.type == ModContent.ItemType()) + Player.moveSpeed += WalkingCane.MoveSpeedBoost; + // Fairy Boots bonus if (fairyBoots) { @@ -2946,6 +2941,29 @@ namespace CalamityMod.CalPlayer } } + if (Player.volatileGelatin) + { + Player.volatileGelatinCounter++; + + int npcCount = 0; + int npcType = ModContent.NPCType(); + for (int x = 0; x < Main.maxNPCs; x++) + { + NPC npc = Main.npc[x]; + if (npc.active && npc.type == npcType && npc.ai[1] == Player.whoAmI && npc.ai[3] == 0) + npcCount++; + } + int wingFlatBoost = 15; // 0.3 seconds of flight + float jumpSpeedBoost = 0.25f; // 5% jump speed + + if (Player.wingTimeMax > 0) + Player.wingTimeMax += (wingFlatBoost * npcCount); + Player.jumpSpeedBoost += (jumpSpeedBoost * npcCount); + } + else + volatileGelHits = 0; + + // Vortex Armor nerf if (Player.vortexStealthActive && Player.HeldItem.type != ItemID.PsychoKnife) { @@ -3179,11 +3197,7 @@ namespace CalamityMod.CalPlayer // Nebula Headcrab darkness effect if (!Player.headcovered) - { - float screenObstructionAmt = MathHelper.Clamp(caveDarkness, 0f, 0.95f); - float targetValue = MathHelper.Clamp(screenObstructionAmt * 0.7f, 0.1f, 0.3f); - ScreenObstruction.screenObstruction = MathHelper.Lerp(ScreenObstruction.screenObstruction, screenObstructionAmt, targetValue); - } + ScreenObstruction.screenObstruction = MathHelper.Lerp(ScreenObstruction.screenObstruction, 0f, 0.1f); // Breath lost while at zero breath double breathLoss = Main.remixWorld ? (point.Y < abyssLevel1 ? 1D : 0D) : (point.Y > abyssLevel1 ? 1D : 0D); @@ -3310,14 +3324,10 @@ namespace CalamityMod.CalPlayer { if (Vector2.Distance(Main.LocalPlayer.Center, Main.npc[CalamityGlobalNPC.signus].Center) <= 5200f) { - float darkRatio = MathHelper.Clamp(caveDarkness, 0f, 1f); float signusLifeRatio = 1f - (Main.npc[CalamityGlobalNPC.signus].life / Main.npc[CalamityGlobalNPC.signus].lifeMax); // Reduce the power of Signus darkness based on your light level. - float multiplier = 1f; - - float signusDarkness = signusLifeRatio * multiplier; - darkRatio = MathHelper.Clamp(signusDarkness, 0f, 1f); + float darkRatio = MathHelper.Clamp(signusLifeRatio, 0f, 1f); ScreenObstruction.screenObstruction = MathHelper.Lerp(ScreenObstruction.screenObstruction, LightingEffectsSystem.MaxGFBSignusDarkness * -darkRatio, 0.3f); } } @@ -3652,8 +3662,7 @@ namespace CalamityMod.CalPlayer --bloodflareCoreRemainingHealOverTime; } - - // Reduce how slow Chilled makes the player, because it's cancerous right now + // Reduce how slow Chilled makes the player // The moveSpeed multiplier for Chilled in vanilla is 0.75, so we just multiply by 1.166667 here to make it 0.875, effectively cutting the reduction in half if (Player.chilled) Player.moveSpeed *= 1f + (1f / 6f); @@ -3661,7 +3670,7 @@ namespace CalamityMod.CalPlayer if (purpleHazeStealthTimer > 0) { //this is so janky looking but it's the only way I could get it to work properly - if (!(StealthStrikeAvailable() && Player.HeldItem.DamageType == RogueDamageClass.Instance)) + if (!(StealthStrikeAvailable() && Player.HeldItem.DamageType.CountsAsClass(RogueDamageClass.Instance))) Player.GetDamage(DamageClass.Generic) += PurpleHaze.DamageBoost + ((dripPlayer.HasAlcohol(AlcoholType.PurpleHaze) && purpleHaze) ? PurpleHaze.DamageBoost : 0); else stealthDamage -= PurpleHaze.StealthDamageLoss + ((dripPlayer.HasAlcohol(AlcoholType.PurpleHaze) && purpleHaze) ? PurpleHaze.StealthDamageLoss : 0); @@ -3766,10 +3775,9 @@ namespace CalamityMod.CalPlayer (reaverSpeed ? ReaverHeadMobility.SetBonusFlightBoost : 0D) + (angelTreads ? AngelTreads.FlightTimeBoost : 0D) + (blueCandle ? WeightlessCandle.WingTimeBoost : 0D) + - (soaring ? SoaringPotion.FlightBoost : 0D) + + (soaring ? SoaringPotion.FlightTimeBoost : 0D) + (prismaticGreaves ? PrismaticGreaves.FlightTimeBoost : 0D) + (plagueReaper ? PlagueReaperMask.SetBonusFlightTimeBoost : 0D) + - (ascendantInsignia ? AscendantInsignia.FlightTimeBoost : Player.empressBrooch ? 0.33D : 0D) + externalFlightTimeMultBoost; if (community) @@ -3902,11 +3910,6 @@ namespace CalamityMod.CalPlayer Player.GetDamage() += MathHelper.Lerp(0.05f, 0.15f, manaRatio); } - if (bloodyWormTooth) - { - Player.GetDamage() += 0.1f; - } - // While making the rogue update verify if we should allow these to stack again - Shade if (filthyGlove) { @@ -3957,12 +3960,6 @@ namespace CalamityMod.CalPlayer Player.AddBuff(BuffID.Inferno, 2); } - if (bloodflareThrowing) - { - if (Player.statLife > (int)(Player.statLifeMax2 * BloodflareHeadRogue.DefenseBoostHealthThreshold)) - Player.statDefense += BloodflareHeadRogue.DefenseBoostAboveHealthThreshold; - } - if (bloodflareSummon) { if (Player.statLife <= (int)(Player.statLifeMax2 * BloodflareHeadSummon.DefenseBoostHealthThreshold)) @@ -4164,9 +4161,9 @@ namespace CalamityMod.CalPlayer Player.lavaImmune = true; Player.fireWalk = true; Player.buffImmune[ModContent.BuffType()] = true; + Player.buffImmune[ModContent.BuffType()] = true; Player.buffImmune[BuffID.OnFire] = true; Player.buffImmune[BuffID.Burning] = true; - Player.buffImmune[BuffID.Daybreak] = true; if (Player.wingTimeMax > 0) Player.wingTimeMax = (int)(Player.wingTimeMax * 1.1D); @@ -4391,12 +4388,6 @@ namespace CalamityMod.CalPlayer Player.GetDamage() += beeBoost; } - if (badgeOfBravery) - { - Player.GetDamage() += 0.1f; - Player.GetCritChance() += 10; - } - // Amalgam boosts if (Main.myPlayer == Player.whoAmI) { diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 979cee740d..4183e55bc9 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -62,7 +62,7 @@ namespace CalamityMod.CalPlayer #endregion #region On Hit NPC - public override void OnHitNPCWithItem(Item item, NPC target, NPC.HitInfo hit, int damageDone)/* tModPorter If you don't need the Item, consider using OnHitNPC instead */ + public override void OnHitNPCWithItem(Item item, NPC target, NPC.HitInfo hit, int damageDone) { if (Player.whoAmI != Main.myPlayer) return; @@ -153,7 +153,7 @@ namespace CalamityMod.CalPlayer if (cooldown < BlackGlassBand.cooldown) cooldown = BlackGlassBand.cooldown; } - if (protolithBangle && item.DamageType == DamageClass.Ranged) + if (protolithBangle && item.DamageType.CountsAsClass(DamageClass.Ranged)) { int damage = (int)Player.GetBestClassDamage().ApplyTo(ProtolithBangle.damage); Projectile band = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType(), damage, -1, Player.whoAmI, target.whoAmI); @@ -161,7 +161,7 @@ namespace CalamityMod.CalPlayer if (cooldown < ProtolithBangle.cooldown) cooldown = ProtolithBangle.cooldown; } - if (batholithBangle && item.DamageType == DamageClass.Magic) + if (batholithBangle && item.DamageType.CountsAsClass(DamageClass.Magic)) { int damage = (int)Player.GetBestClassDamage().ApplyTo(BatholithBangle.damage); Projectile band = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType(), damage, -1, Player.whoAmI, target.whoAmI); @@ -207,7 +207,7 @@ namespace CalamityMod.CalPlayer #endregion #region On Hit NPC With Proj - public override void OnHitNPCWithProj(Projectile proj, NPC target, NPC.HitInfo hit, int damageDone)/* tModPorter If you don't need the Projectile, consider using OnHitNPC instead */ + public override void OnHitNPCWithProj(Projectile proj, NPC target, NPC.HitInfo hit, int damageDone) { if (Player.whoAmI != Main.myPlayer) return; @@ -358,8 +358,6 @@ namespace CalamityMod.CalPlayer if (generalBandCooldown == 0) { int cooldown = 0; - // NOTE: Apparently Pulse Pistol/Pulse Rifle projectiles will set spawned projectiles here to inherit the proj ID??? - // No clue why this happens or how to fix it, but it just breaks using multiple band types together on these two weapons if (bGlassBand) { int damage = (int)Player.GetBestClassDamage().ApplyTo(BlackGlassBand.damage); @@ -368,7 +366,7 @@ namespace CalamityMod.CalPlayer if (cooldown < BlackGlassBand.cooldown) cooldown = BlackGlassBand.cooldown; } - if (protolithBangle && proj.DamageType == DamageClass.Ranged) + if (protolithBangle && proj.DamageType.CountsAsClass(DamageClass.Ranged)) { int damage = (int)Player.GetBestClassDamage().ApplyTo(ProtolithBangle.damage); Projectile band = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType(), damage, -1, Player.whoAmI, target.whoAmI); @@ -376,7 +374,7 @@ namespace CalamityMod.CalPlayer if (cooldown < ProtolithBangle.cooldown) cooldown = ProtolithBangle.cooldown; } - if (batholithBangle && proj.DamageType == DamageClass.Magic) + if (batholithBangle && proj.DamageType.CountsAsClass(DamageClass.Magic)) { int damage = (int)Player.GetBestClassDamage().ApplyTo(BatholithBangle.damage); Projectile band = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType(), damage, -1, Player.whoAmI, target.whoAmI); @@ -618,7 +616,7 @@ namespace CalamityMod.CalPlayer ProjLifesteal(target, proj, damageDone, hit.Crit); ProjOnHit(proj, target, hit.Crit, target.IsAnEnemy(false), targetIsDummy); - NPCDebuffs(target, proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), hit.Crit, true, proj.noEnchantments); + NPCDebuffs(target, proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass() && /*This is for Pigion to not count as a whip*/!(proj.type == ModContent.ProjectileType() && proj.minion), hit.Crit, true, proj.noEnchantments); // Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies). if (targetIsDummy) diff --git a/CalPlayer/DrawLayers/EncasementParryLayer.cs b/CalPlayer/DrawLayers/EncasementParryLayer.cs index 4e3deb92bc..12e96039d4 100644 --- a/CalPlayer/DrawLayers/EncasementParryLayer.cs +++ b/CalPlayer/DrawLayers/EncasementParryLayer.cs @@ -15,7 +15,7 @@ namespace CalamityMod.CalPlayer.DrawLayers } public override Position GetDefaultPosition() => new BeforeParent(PlayerDrawLayers.FrontAccFront); //me when the player layer is called front acc front :skull: - public EncasementType GetEncasementTypeFor(CalamityPlayer modPlayer) => modPlayer.blazingCore ? EncasementType.BlazingCore : EncasementType.FlameLickedShell; + public EncasementType GetEncasementTypeFor(CalamityPlayer modPlayer) => modPlayer.divineProvidence ? EncasementType.BlazingCore : EncasementType.FlameLickedShell; public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) { @@ -25,7 +25,7 @@ namespace CalamityMod.CalPlayer.DrawLayers bool visible = drawInfo.shadow == 0f && !drawPlayer.dead; visible = encasement switch { - EncasementType.BlazingCore => visible && modPlayer.blazingCoreParry > 0, + EncasementType.BlazingCore => visible && modPlayer.divineProvParry > 0, EncasementType.FlameLickedShell => visible && modPlayer.flameLickedShellParry > 0, _ => false }; @@ -45,7 +45,7 @@ namespace CalamityMod.CalPlayer.DrawLayers { case EncasementType.BlazingCore: tex += "BlazingCoreCrystal"; - currentParry = calPlayer.blazingCoreParry; + currentParry = calPlayer.divineProvParry; defaultOpacity = 0.725f; scale = 1.15f; break; diff --git a/CalamityConditions.cs b/CalamityConditions.cs index 84cd4b16b3..fa6d25e049 100644 --- a/CalamityConditions.cs +++ b/CalamityConditions.cs @@ -71,7 +71,7 @@ namespace CalamityMod // Vanilla public static readonly Condition DownedBetsy = Create("Drops.DownedBetsy", () => DownedBossSystem.downedBetsy); - + public static readonly Condition DownedDreadnautilus = Create("Drops.DownedDreadnautilus", () => DownedBossSystem.downedDreadnautilus); // // Calamity Biome conditions // diff --git a/CalamityConfig.cs b/CalamityConfig.cs index 7c72d2f83d..6501b1a176 100644 --- a/CalamityConfig.cs +++ b/CalamityConfig.cs @@ -50,10 +50,6 @@ namespace CalamityMod [DefaultValue(false)] public bool BoCSpriteChange { get; set; } - [BackgroundColor(192, 54, 64, 192)] - [DefaultValue(true)] - public bool EnableVanillaTextureEdits { get; set; } - [BackgroundColor(192, 54, 64, 192)] [DefaultValue(true)] public bool SunkenSeaBackgroundDistortion { get; set; } @@ -244,8 +240,8 @@ namespace CalamityMod public float FlightBarPosY { get; set; } #endregion - #region Music Toggles - [Header("MusicToggles")] + #region Audio Toggles + [Header("AudioToggles")] [BackgroundColor(192, 54, 64, 192)] [DefaultValue(true)] @@ -259,6 +255,9 @@ namespace CalamityMod [DefaultValue(false)] public bool AbyssLayer3Alt { get; set; } + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(false)] + public bool MisophoniaSupport { get; set; } #endregion #region General Gameplay Changes diff --git a/CalamityKeybinds.cs b/CalamityKeybinds.cs index 62b5f44039..8ed529182e 100644 --- a/CalamityKeybinds.cs +++ b/CalamityKeybinds.cs @@ -1,72 +1,231 @@ -using Terraria.ModLoader; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using CalamityMod.Systems.Collections; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameInput; +using Terraria.ModLoader; namespace CalamityMod { public class CalamityKeybinds : ModSystem { - public static ModKeybind AccessoryParryHotKey { get; private set; } public static ModKeybind AdrenalineHotKey { get; private set; } - public static ModKeybind AmmoCycleHotkey { get; private set; } - public static ModKeybind AngelicAllianceHotKey { get; private set; } public static ModKeybind ArmorSetBonusHotKey { get; private set; } - public static ModKeybind AscendantInsigniaHotKey { get; private set; } - public static ModKeybind BoosterDashHotKey { get; private set; } public static ModKeybind DashHotkey { get; private set; } public static ModKeybind ExoChairSlowdownHotkey { get; private set; } public static ModKeybind GodSlayerDashHotKey { get; private set; } - public static ModKeybind GravistarSabatonHotkey { get; private set; } public static ModKeybind NormalityRelocatorHotKey { get; private set; } public static ModKeybind RageHotKey { get; private set; } - public static ModKeybind SpectralVeilHotKey { get; private set; } - public static ModKeybind SpringStoolJumpHotKey { get; private set; } - public static ModKeybind TransformerHotKey { get; private set; } - public static ModKeybind SwitchGravityHotkey {get; private set;} + public static ModKeybind SwitchGravityHotkey { get; private set; } public static ModKeybind ExpandDebuffInfo { get; private set; } - public static ModKeybind ThePointerLock {get; private set;} + + + public static ModKeybind HeldItem { get; private set; } + public static ModKeybind Accessory1 { get; private set; } + public static ModKeybind Accessory2 { get; private set; } + public static ModKeybind Accessory3 { get; private set; } + public static ModKeybind Accessory4 { get; private set; } + public static ModKeybind Accessory5 { get; private set; } + public static ModKeybind Accessory6 { get; private set; } + public static ModKeybind Accessory7 { get; private set; } + + public static ModKeybind[] AccessoryKeybinds = []; + + public static List RentedKeybinds = []; + /// + /// We store the keybind then move it to the main list at the end of the frame + /// This ensures that between frames has keybinds in the values needed for drawing + /// This does means there's a 1 frame delay when switching slots for item tooltips to update, but that's never important + /// + public static List KeybindRentalQueue = []; public override void Load() { // Register keybinds - AccessoryParryHotKey = KeybindLoader.RegisterKeybind(Mod, "ActivateAccessoryParry", "N"); AdrenalineHotKey = KeybindLoader.RegisterKeybind(Mod, "AdrenalineMode", "B"); - AmmoCycleHotkey = KeybindLoader.RegisterKeybind(Mod, "AmmoCycle", "Mouse3"); - AngelicAllianceHotKey = KeybindLoader.RegisterKeybind(Mod, "AngelicAllianceBlessing", "G"); ArmorSetBonusHotKey = KeybindLoader.RegisterKeybind(Mod, "ArmorSetBonus", "Y"); - AscendantInsigniaHotKey = KeybindLoader.RegisterKeybind(Mod, "AscendantInsigniaHotKey", "K"); - BoosterDashHotKey = KeybindLoader.RegisterKeybind(Mod, "BoosterDash", "Q"); DashHotkey = KeybindLoader.RegisterKeybind(Mod, "DashDoubleTapOverride", "F"); ExoChairSlowdownHotkey = KeybindLoader.RegisterKeybind(Mod, "ExoChairSlowDown", "RightShift"); GodSlayerDashHotKey = KeybindLoader.RegisterKeybind(Mod, "GodSlayerDash", "H"); - GravistarSabatonHotkey = KeybindLoader.RegisterKeybind(Mod, "GravistarSabatonHotkey", "X"); NormalityRelocatorHotKey = KeybindLoader.RegisterKeybind(Mod, "NormalityRelocator", "Z"); RageHotKey = KeybindLoader.RegisterKeybind(Mod, "RageMode", "V"); - SpectralVeilHotKey = KeybindLoader.RegisterKeybind(Mod, "SpectralVeilTeleport", "Z"); - SpringStoolJumpHotKey = KeybindLoader.RegisterKeybind(Mod, "SpringStoolJumpHotKey", "U"); - TransformerHotKey = KeybindLoader.RegisterKeybind(Mod, "TransformerHotKey", "K"); SwitchGravityHotkey = KeybindLoader.RegisterKeybind(Mod, "GravitySwapOverride", "T"); ExpandDebuffInfo = KeybindLoader.RegisterKeybind(Mod, "ExpandDebuffInfo", "LeftControl"); - ThePointerLock = KeybindLoader.RegisterKeybind(Mod, "ThePointerLock", "N"); + + HeldItem = KeybindLoader.RegisterKeybind(Mod, "HeldItem", "NumPad0"); + Accessory1 = KeybindLoader.RegisterKeybind(Mod, "Accessory1", "NumPad1"); + Accessory2 = KeybindLoader.RegisterKeybind(Mod, "Accessory2", "NumPad2"); + Accessory3 = KeybindLoader.RegisterKeybind(Mod, "Accessory3", "NumPad3"); + Accessory4 = KeybindLoader.RegisterKeybind(Mod, "Accessory4", "NumPad4"); + Accessory5 = KeybindLoader.RegisterKeybind(Mod, "Accessory5", "NumPad5"); + Accessory6 = KeybindLoader.RegisterKeybind(Mod, "Accessory6", "NumPad6"); + Accessory7 = KeybindLoader.RegisterKeybind(Mod, "Accessory7", "NumPad7"); + + AccessoryKeybinds = [ + Accessory1, + Accessory2, + Accessory3, + Accessory4, + Accessory5, + Accessory6, + Accessory7 + ]; } public override void Unload() { - AccessoryParryHotKey = null; AdrenalineHotKey = null; - AmmoCycleHotkey = null; - AngelicAllianceHotKey = null; ArmorSetBonusHotKey = null; - AscendantInsigniaHotKey = null; - BoosterDashHotKey = null; DashHotkey = null; ExoChairSlowdownHotkey = null; GodSlayerDashHotKey = null; - GravistarSabatonHotkey = null; NormalityRelocatorHotKey = null; RageHotKey = null; - SpectralVeilHotKey = null; - SpringStoolJumpHotKey = null; - TransformerHotKey = null; ExpandDebuffInfo = null; + + Accessory1 = null; + Accessory2 = null; + Accessory3 = null; + Accessory4 = null; + Accessory5 = null; + Accessory6 = null; + Accessory1 = null; + Accessory7 = null; + + AccessoryKeybinds = null; + } + public override void PostUpdateEverything() + { + RentedKeybinds = KeybindRentalQueue.ToList(); + KeybindRentalQueue.Clear(); + } + } + + public class AccessoryKeybindManager : GlobalItem + { + public override bool InstancePerEntity => true; + + internal int KeybindId { get; set; } + + public override void UpdateEquip(Item item, Player player) + { + if (CalamityItemSets.HasAccessoryKeybind[item.type]) + CalamityKeybinds.KeybindRentalQueue.Add(item.type); + } + } + + public static class CalamityKeybindsExtensions + { + /// + /// Gets if the Calamity keybind for the given item was just pressed.
+ /// Automatically adjusts between Held Item and Accessory Ability keybinds based on if the item is held and equip order of accessories + ///
+ /// + /// + /// + public static bool JustPressedKeybind(this Item item) + { + if (item == Main.LocalPlayer.HeldItem) + return CalamityKeybinds.HeldItem.JustPressed; + + if (!CalamityItemSets.HasAccessoryKeybind[item.type]) + Debug.Assert(false, "Item is not marked as having a Calamity keybind in the HasAccessoryKeybind item set, but is requesting an accessory keybind"); + + if (CalamityKeybinds.RentedKeybinds.Contains(item.type)) + { + int index = CalamityKeybinds.RentedKeybinds.IndexOf(item.type); + if (CalamityKeybinds.AccessoryKeybinds.IndexInRange(index)) + return CalamityKeybinds.AccessoryKeybinds[index].JustPressed; + } + + return false; + } + + /// + /// Gets if the Calamity keybind for the given item was just released.
+ /// Automatically adjusts between Held Item and Accessory Ability keybinds based on if the item is held and equip order of accessories + ///
+ /// + /// + /// + public static bool JustReleasedKeybind(this Item item) + { + + if (item == Main.LocalPlayer.HeldItem) + return CalamityKeybinds.HeldItem.JustReleased; + + if (!CalamityItemSets.HasAccessoryKeybind[item.type]) + Debug.Assert(false, "Item is not marked as having a Calamity keybind in the HasAccessoryKeybind item set, but is requesting an accessory keybind"); + + if (CalamityKeybinds.RentedKeybinds.Contains(item.type)) + { + int index = CalamityKeybinds.RentedKeybinds.IndexOf(item.type); + if (CalamityKeybinds.AccessoryKeybinds.IndexInRange(index)) + return CalamityKeybinds.AccessoryKeybinds[index].JustReleased; + } + + return false; + } + + + /// + /// Gets if the Calamity keybind for the given item is currently held down.
+ /// Automatically adjusts between Held Item and Accessory Ability keybinds based on if the item is held and equip order of accessories + ///
+ /// + /// + /// + public static bool CurrentlyPressingKeybind(this Item item) + { + if (item == Main.LocalPlayer.HeldItem) + return CalamityKeybinds.HeldItem.Current; + + if (!CalamityItemSets.HasAccessoryKeybind[item.type]) + Debug.Assert(false, "Item is not marked as having a Calamity keybind in the HasAccessoryKeybind item set, but is requesting an accessory keybind"); + + if (CalamityKeybinds.RentedKeybinds.Contains(item.type)) + { + int index = CalamityKeybinds.RentedKeybinds.IndexOf(item.type); + if (CalamityKeybinds.AccessoryKeybinds.IndexInRange(index)) + return CalamityKeybinds.AccessoryKeybinds[index].Current; + } + + return false; + } + + + /// + /// Gets the Calamity keybind for the given item.
+ /// Automatically adjusts between Held Item and Accessory Ability keybinds based on if the item is held and equip order of accessories + ///
+ /// + /// + /// + public static ModKeybind? GetDynamicModHotkey(this Item item) + { + + if (!CalamityItemSets.HasAccessoryKeybind[item.type]) + return CalamityKeybinds.HeldItem; + + if (CalamityKeybinds.RentedKeybinds.Contains(item.type)) + { + int index = CalamityKeybinds.RentedKeybinds.IndexOf(item.type); + if (CalamityKeybinds.AccessoryKeybinds.IndexInRange(index)) + return CalamityKeybinds.AccessoryKeybinds[index]; + } + return null; + } + + public static bool HasBoundDynamicHotkey(this Item item) + { + var h = item.GetDynamicModHotkey(); + if (h == null) return false; + if (h?.GetAssignedKeysOrEmpty(PlayerInput.CurrentInputMode).Count == 0) + return false; + return true; } } } diff --git a/ChatTags/CustomColorEffectHandler.cs b/ChatTags/CustomColorEffectHandler.cs index b99db87773..03cda39a56 100644 --- a/ChatTags/CustomColorEffectHandler.cs +++ b/ChatTags/CustomColorEffectHandler.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Items.Accessories.Wings; using CalamityMod.NPCs.DevourerofGods; using CalamityMod.Rarities; using CalamityMod.Utilities.Daybreak; @@ -35,6 +36,8 @@ namespace CalamityMod.ChatTags return new CalamityRed.CustomTextSnippet(text); if (options.Equals("exo", StringComparison.OrdinalIgnoreCase)) return new ExoticRainbow.CustomTextSnippet(text); + if (options.Equals("doze", StringComparison.OrdinalIgnoreCase)) + return new TiredTailTextEffects(text); return new TextSnippet(text); } } diff --git a/Cooldowns/OblivionCooldown.cs b/Cooldowns/OblivionCooldown.cs new file mode 100644 index 0000000000..2e87ddcbb4 --- /dev/null +++ b/Cooldowns/OblivionCooldown.cs @@ -0,0 +1,17 @@ +using Microsoft.Xna.Framework; +using Terraria.Localization; + +namespace CalamityMod.Cooldowns +{ + public class OblivionCooldown : CooldownHandler + { + public static new string ID => "OblivionCooldown"; + public override bool ShouldDisplay => true; + public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}"); + public override string Texture => "CalamityMod/Projectiles/Melee/Yoyos/OblivionYoyo"; + public override string OutlineTexture => "CalamityMod/Cooldowns/OblivionCooldownOutline"; + public override Color OutlineColor => Color.MediumVioletRed; + public override Color CooldownStartColor => Color.DarkRed; + public override Color CooldownEndColor => Color.Red; + } +} diff --git a/Cooldowns/OblivionCooldownOutline.png b/Cooldowns/OblivionCooldownOutline.png new file mode 100644 index 0000000000..edc4369894 Binary files /dev/null and b/Cooldowns/OblivionCooldownOutline.png differ diff --git a/DamageClasses/AllClassDamageClass.cs b/DamageClasses/AllClassDamageClass.cs new file mode 100644 index 0000000000..04cfc318c7 --- /dev/null +++ b/DamageClasses/AllClassDamageClass.cs @@ -0,0 +1,18 @@ +using Terraria.ModLoader; + +namespace CalamityMod +{ + public class AllClassDamageClass : DamageClass + { + internal static AllClassDamageClass Instance; + + public override void Load() => Instance = this; + public override void Unload() => Instance = null; + + public override StatInheritanceData GetModifierInheritance(DamageClass damageClass) + { + return StatInheritanceData.Full; + } + public override bool GetEffectInheritance(DamageClass damageClass) => true; + } +} diff --git a/DataStructures/Attunement.cs b/DataStructures/Attunement.cs index 9599aea147..cf54c1512f 100644 --- a/DataStructures/Attunement.cs +++ b/DataStructures/Attunement.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Melee; +using System; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; @@ -72,7 +73,12 @@ namespace CalamityMod.DataStructures /// >Used by evil attunements to check if a regular dash is avaialble /// Used by evil attunements to check if a strong dash is avaialble /// - public virtual bool Shoot(Player player, IEntitySource source, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack, ref int Combo, ref int CanLunge, ref int PowerLungeCounter) => true; + public virtual bool Shoot(Player player, IEntitySource source, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack, ref int Combo, ref int CanLunge, ref int PowerLungeCounter) + { + Projectile blade = Projectile.NewProjectileDirect(source, position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + blade.originalDamage = (int)MathF.Round(blade.originalDamage * DamageMultiplier); + return false; + } public virtual void PassiveEffect(Player player, IEntitySource source, ref int UseTimer, ref bool Procced, Projectile projectile = null) { @@ -155,20 +161,14 @@ namespace CalamityMod.DataStructures public override bool Shoot(Player player, IEntitySource source, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack, ref int Combo, ref int CanLunge, ref int PowerLungeCounter) { - switch (Combo) + Projectile blade = Projectile.NewProjectileDirect(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 0, 15); + blade.originalDamage = (int)MathF.Round(blade.originalDamage * DamageMultiplier); + if (Combo > 0) { - case 0: - Projectile.NewProjectile(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 0, 15); - break; - - case 1: - Projectile.NewProjectile(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 1, 20); - break; - - case 2: - Projectile.NewProjectile(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 2, 50); - break; + blade.ai[0] = Combo; + blade.ai[1] = (Combo == 2 ? 50 : 20); } + Combo++; if (Combo > 2) Combo = 0; @@ -202,7 +202,8 @@ namespace CalamityMod.DataStructures public override bool Shoot(Player player, IEntitySource source, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack, ref int Combo, ref int CanLunge, ref int PowerLungeCounter) { - Projectile.NewProjectile(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 26, (float)CanLunge); + Projectile blade = Projectile.NewProjectileDirect(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 26, (float)CanLunge); + blade.originalDamage = (int)MathF.Round(blade.originalDamage * DamageMultiplier); CanLunge = 0; return false; } @@ -283,20 +284,14 @@ namespace CalamityMod.DataStructures public override bool Shoot(Player player, IEntitySource source, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack, ref int Combo, ref int CanLunge, ref int PowerLungeCounter) { - switch (Combo) + Projectile blade = Projectile.NewProjectileDirect(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 0, 15); + blade.originalDamage = (int)MathF.Round(blade.originalDamage * DamageMultiplier); + if (Combo > 0) { - case 0: - Projectile.NewProjectile(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 0, 15); - break; - - case 1: - Projectile.NewProjectile(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 1, 20); - break; - - case 2: - Projectile.NewProjectile(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 2, 50); - break; + blade.ai[0] = Combo; + blade.ai[1] = (Combo == 2 ? 50 : 20); } + Combo++; if (Combo > 2) Combo = 0; @@ -331,6 +326,7 @@ namespace CalamityMod.DataStructures public override bool Shoot(Player player, IEntitySource source, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack, ref int Combo, ref int CanLunge, ref int PowerLungeCounter) { Projectile whipProj = Projectile.NewProjectileDirect(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 0, 0); + whipProj.originalDamage = (int)MathF.Round(whipProj.originalDamage * DamageMultiplier); if (whipProj.ModProjectile is TrueGrovetendersTouch whip) whip.flipped = Combo == 0 ? 1 : -1; Combo++; @@ -373,6 +369,7 @@ namespace CalamityMod.DataStructures PowerLungeCounter = 0; } Projectile proj = Projectile.NewProjectileDirect(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 26f, CanLunge > 0 ? 1f : 0f); + proj.originalDamage = (int)MathF.Round(proj.originalDamage * DamageMultiplier); if (proj.ModProjectile is TrueDecaysRetort rapier) rapier.ChargedUp = powerLungeAvailable; CanLunge--; diff --git a/DataStructures/DebuffData.cs b/DataStructures/DebuffData.cs index f90196804d..44ebe15fbc 100644 --- a/DataStructures/DebuffData.cs +++ b/DataStructures/DebuffData.cs @@ -289,6 +289,24 @@ namespace CalamityMod.DataStructures ///
public static void OiledNPCMethod(NPC npc, int buffType, ref int buffIndex, ref int damage) { + // Exclude Oiled itself from counting as an applicable debuff + bool valid = false; + for (int i = 0; i < npc.buffType.Length; i++) + { + int activeBuff = npc.buffType[i]; + if (activeBuff > 0 && activeBuff != BuffID.Oiled) + { + var data = CalamityBuffSets.DebuffDataset[activeBuff]; + if (data != null && data.HeatDebuffScaling > 0) + { + valid = true; + break; + } + } + } + if (!valid && !(npc.onFrostBurn || npc.onFrostBurn2 || npc.onFire || npc.onFire2 || npc.onFire3 || npc.shadowFlame)) + return; + var cnpc = npc.Calamity(); double totalDPS = ApplyScalingToStatModifer(cnpc.ActiveHeatDebuffMultiplier, Oiled.HeatDebuffScaling).ApplyTo(Oiled.EnemyLostRegen); if (totalDPS <= 0) diff --git a/Effects/BasicTint.fx b/Effects/BasicTint.fx index 8b3b2268c2..ca360c3e68 100644 --- a/Effects/BasicTint.fx +++ b/Effects/BasicTint.fx @@ -3,7 +3,7 @@ sampler uImage1 : register(s1); float3 uColor; float3 uSecondaryColor; float uOpacity; -float uSaturation; +float uSaturation; // Saturation gets used as a "true" opacity float uRotation; float uTime; float4 uSourceRect; @@ -20,7 +20,7 @@ float4 Recolor(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 float4 color = tex2D(uImage0, coords); float originalAlpha = color.a; color.rbg = lerp(color.rbg, uColor, uOpacity); - return color * originalAlpha; + return color * originalAlpha * uSaturation; } diff --git a/Effects/BasicTint.xnb b/Effects/BasicTint.xnb index 4b02bc2bdc..3fe8964653 100644 Binary files a/Effects/BasicTint.xnb and b/Effects/BasicTint.xnb differ diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index 7bda59d4a4..6626872f28 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -129,10 +129,10 @@ namespace CalamityMod.Effects // Used by Devourer of Gods. Renders the portal that he escapes through at the end of phase 1. internal static Asset DoGPortalShader; - // Used to render all-encompassing fog in the Floral Paradise biome. + // Unused, renders all-encompassing fog. internal static Asset FogShader; - // Used to render background water features in the Floral Paradise biome. + // Unused, renders background water features. internal static Asset WaterfallShader; // Metaballs. See the MetaballManager class for comments on how this system works. @@ -219,10 +219,6 @@ namespace CalamityMod.Effects ///
internal static Asset DozeLightingShader; /// - /// Flips the screen. Used for Gravity Globe. - /// - internal static Asset FlipScreenShader; - /// /// Distorts a texture towards the center based on a provided noisemap. Meant to emulate the Terraria Otherworld barrier effects. /// Opacity is the intensity of this distortion, and Saturation is the speed the noisemap moves at. /// @@ -266,6 +262,9 @@ namespace CalamityMod.Effects // The swirling aura effect seen around Horrible Hog while its idling. internal static Asset HorribleHogAuraShader; + + // The shader effect for the primitive trails drawn for Providence's HolyBurnOrb/HolyLight projectiles. + internal static Asset ProvidenceHolyOrbTrailShader; #endregion #region Big E's Shaders @@ -273,6 +272,7 @@ namespace CalamityMod.Effects internal static Asset SeaPrismColorBlendingShader; internal static Asset Dissolve; + internal static Asset PaletteSwap; internal static Asset BrainOfCthulhuForcefield; #endregion @@ -497,9 +497,6 @@ namespace CalamityMod.Effects DozeLightingShader = LoadShader("DozeLightingShader"); RegisterMiscShader(DozeLightingShader, "ShadowPass", "DozeLightingShader"); - FlipScreenShader = LoadShader("ScreenShaders/FlipScreen"); - RegisterScreenShader(FlipScreenShader, "FlipTheScreen", "FlipScreen",EffectPriority.VeryHigh); - OtherworldBarrierDistortionShader = LoadShader("OtherworldBarrierDistortion"); RegisterMiscShader(OtherworldBarrierDistortionShader, "DistortionPass", "OtherworldBarrierDistortion"); #endregion @@ -537,6 +534,9 @@ namespace CalamityMod.Effects HorribleHogAuraShader = LoadShader("HorribleHogAuraShader"); RegisterMiscShader(HorribleHogAuraShader, "ScaryAuraPass", "HorribleHogAura"); + + ProvidenceHolyOrbTrailShader = LoadShader("ProvidenceHolyOrbTrailShader"); + RegisterMiscShader(ProvidenceHolyOrbTrailShader, "TrailPass", "ProvidenceHolyOrbTrail"); #endregion #region Loading Big E's Shaders @@ -549,6 +549,9 @@ namespace CalamityMod.Effects Dissolve = LoadShader("Dissolve"); RegisterMiscShader(Dissolve, "DissolvePass", "Dissolve"); + PaletteSwap = LoadShader("PaletteSwap"); + RegisterMiscShader(PaletteSwap, "PaletteSwapPass", "PaletteSwap"); + BrainOfCthulhuForcefield = LoadShader("ScreenShaders/BrainOfCthulhuForcefield"); RegisterScreenShader(BrainOfCthulhuForcefield, "BoCShieldPass", "BrainOfCthulhuForcefield"); #endregion diff --git a/Effects/PaletteSwap.fx b/Effects/PaletteSwap.fx new file mode 100644 index 0000000000..2de436b8cd --- /dev/null +++ b/Effects/PaletteSwap.fx @@ -0,0 +1,35 @@ +sampler baseTexture : register(s0); + +float4 sourcePalette[16]; +float4 targetPalette[16]; +float matchThreshold = 0.01; +int paletteSize; + +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR +{ + float4 color = tex2D(baseTexture, coords) * sampleColor; + + // Check each color in the source palette + for (int i = 0; i < paletteSize; i++) + { + float3 diff = color.rgb - sourcePalette[i].rgb; + float distance = sqrt(dot(diff, diff)); + + // If color is close enough to this palette color, swap it + if (distance <= matchThreshold) + { + color.rgb = targetPalette[i].rgb; + break; // Stop checking once we find a match + } + } + + return color; +} + +technique Technique1 +{ + pass PaletteSwapPass + { + PixelShader = compile ps_3_0 PixelShaderFunction(); + } +} \ No newline at end of file diff --git a/Effects/PaletteSwap.xnb b/Effects/PaletteSwap.xnb new file mode 100644 index 0000000000..742449fa6d Binary files /dev/null and b/Effects/PaletteSwap.xnb differ diff --git a/Effects/ProvidenceHolyOrbTrailShader.fx b/Effects/ProvidenceHolyOrbTrailShader.fx new file mode 100644 index 0000000000..9f5c67d241 --- /dev/null +++ b/Effects/ProvidenceHolyOrbTrailShader.fx @@ -0,0 +1,68 @@ +// 29JUN2026: fryzahh +// Programmed to work under the use of SanePrimitiveRenderer. +// Never use this shader with PrimitveRenderer. + +sampler baseStreakTexture : register(s0); +sampler distortionTexture : register(s1); + +matrix uTransformMatrix; +float time; +float glowPower; +float pixelationFactor; + +struct VertexShaderInput +{ + float4 Position : POSITION0; + float4 Color : COLOR0; + float2 TextureCoordinates : TEXCOORD0; +}; + +struct VertexShaderOutput +{ + float4 Position : SV_POSITION; + float4 Color : COLOR0; + float2 TextureCoordinates : TEXCOORD0; +}; + +VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) +{ + VertexShaderOutput output; + output.Position = mul(input.Position, uTransformMatrix); + output.Color = input.Color; + output.TextureCoordinates = input.TextureCoordinates; + return output; +} + +float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 +{ + float4 color = input.Color; + float2 coords = input.TextureCoordinates; + + // Fade out at the horizontal and vertical ends of the streak. + float horizonatalDistanceFromCenter = distance(0.5, coords.y); + float opacity = smoothstep(0.5, 0.5 - 0.486, horizonatalDistanceFromCenter); + + // Glow from the center go out. + float glow = pow(0.1 / horizonatalDistanceFromCenter, glowPower); + + float2 distortionCoords = coords + float2(time * -3.12, 0); + distortionCoords *= float2(0.25, 1); + float distortion = tex2D(distortionTexture, distortionCoords).r * 0.43; + + float2 streakCoords = coords + float2(time * -2.34, 0); + streakCoords *= float2(1.25, 1); + float4 streakMapColor = tex2D(baseStreakTexture, streakCoords + distortion); + + float4 returnColor = (streakMapColor * color * glow) * opacity; + returnColor = round(returnColor * 7) / 7; + return returnColor; +} + +technique Technique1 +{ + pass TrailPass + { + VertexShader = compile vs_2_0 VertexShaderFunction(); + PixelShader = compile ps_2_0 PixelShaderFunction(); + } +} \ No newline at end of file diff --git a/Effects/ProvidenceHolyOrbTrailShader.xnb b/Effects/ProvidenceHolyOrbTrailShader.xnb new file mode 100644 index 0000000000..dda2ab7acc Binary files /dev/null and b/Effects/ProvidenceHolyOrbTrailShader.xnb differ diff --git a/Effects/ScreenShaders/FlipScreen.fx b/Effects/ScreenShaders/FlipScreen.fx deleted file mode 100644 index 39ad44126c..0000000000 --- a/Effects/ScreenShaders/FlipScreen.fx +++ /dev/null @@ -1,38 +0,0 @@ -sampler uImage0 : register(s0); -sampler uImage1 : register(s1); -sampler uImage2 : register(s2); -sampler uImage3 : register(s3); -float3 uColor; -float3 uSecondaryColor; -float2 uScreenResolution; -float2 uScreenPosition; -float2 uTargetPosition; -float2 uDirection; -float uOpacity; -float uTime; -float uIntensity; -float uProgress; -float2 uImageSize1; -float2 uImageSize2; -float2 uImageSize3; -float2 uImageOffset; -float uSaturation; -float4 uSourceRect; -float2 uZoom; - -float4 FilterMyShader(float2 coords : TEXCOORD0) : COLOR0 -{ - float2 newCoords; - newCoords.x = coords.x; - newCoords.y = 1 - coords.y; - float4 color = tex2D(uImage0, newCoords); - return color; -} - -technique Technique1 -{ - pass FlipTheScreen - { - PixelShader = compile ps_2_0 FilterMyShader(); - } -} \ No newline at end of file diff --git a/Effects/ScreenShaders/FlipScreen.xnb b/Effects/ScreenShaders/FlipScreen.xnb deleted file mode 100644 index 842a5d7873..0000000000 Binary files a/Effects/ScreenShaders/FlipScreen.xnb and /dev/null differ diff --git a/Events/BossRushEvent.cs b/Events/BossRushEvent.cs index ce412a01e9..48cbda15d3 100644 --- a/Events/BossRushEvent.cs +++ b/Events/BossRushEvent.cs @@ -586,12 +586,14 @@ namespace CalamityMod.Events // Cooldown and boss spawn. if (BossRushSpawnCountdown <= 0 && BossRushStage < Bosses.Count) { - // Cooldown before next boss spawns. + // Cooldown before next boss spawns. Defaults to 1 second. BossRushSpawnCountdown = 60; - // Increase cooldown post-Moon Lord. + // Cooldown increases to 3 seconds in tier 4 and 4 seconds in tier 5. if (BossRushStage >= Bosses.FindIndex(boss => boss.EntityID == NPCID.MoonLordCore)) - BossRushSpawnCountdown += 180; + BossRushSpawnCountdown += 120; + if (BossRushStage >= Bosses.FindIndex(boss => boss.EntityID == ModContent.NPCType())) + BossRushSpawnCountdown += 60; // Override the spawn countdown if specified. if (BossRushStage < Bosses.Count - 1 && Bosses[BossRushStage + 1].SpecialSpawnCountdown != -1) @@ -691,6 +693,18 @@ namespace CalamityMod.Events } } + // Both Twins must be killed to progress. + else if (npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer) + { + int bossType = npc.type == NPCID.Spazmatism ? NPCID.Retinazer : NPCID.Spazmatism; + if (!NPC.AnyNPCs(bossType)) + { + BossRushStage++; + CalamityUtils.KillAllHostileProjectiles(); + HostileProjectileKillCounter = 3; + } + } + // Anahita and Leviathan manually check for each other (this probably isn't necessary). else if (npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType()) { diff --git a/ExtraTextures/ExtraTextureRefs.cs b/ExtraTextures/ExtraTextureRefs.cs index 7eaf854a40..7e19975be1 100644 --- a/ExtraTextures/ExtraTextureRefs.cs +++ b/ExtraTextures/ExtraTextureRefs.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework.Graphics; +using CalamityMod.Buffs.Summon; +using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; using Terraria.GameContent; @@ -10,13 +11,7 @@ namespace CalamityMod.ExtraTextures [Autoload(Side = ModSide.Client)] public class ExtraTextureRefs : ModSystem { - // Destroyer glowmasks - public static Asset DestroyerHeadGlowmask; - public static Asset DestroyerBodyGlowmask; - public static Asset DestroyerTailGlowmask; - - // WoF, These are not "exactly" the ExtraTextures. But - public static Asset WallOfFleshEyeGlowmask; + // WoF, These are not "exactly" the ExtraTextures public static Asset WallOfFleshDemonSickleTexture; // Flying Carpet Replacements @@ -28,6 +23,10 @@ namespace CalamityMod.ExtraTextures public static Asset LuckIconVanilla; public static Asset LuckIconLesser; + // Blighted Slime Buff icons + public static Asset BlightedSlimeCorroIcon; + public static Asset BlightedSlimeCrimIcon; + // Particles public static Asset CircularSmear; public static Asset CircularSmearFire1; @@ -38,11 +37,6 @@ namespace CalamityMod.ExtraTextures // TODO: - Every other ExtraTextures Reference could be move in here public override void OnModLoad() { - DestroyerHeadGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerHeadGlow", AssetRequestMode.AsyncLoad); - DestroyerBodyGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerBodyGlow", AssetRequestMode.AsyncLoad); - DestroyerTailGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerTailGlow", AssetRequestMode.AsyncLoad); - - WallOfFleshEyeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/WallOfFleshEyeTelegraphGlow", AssetRequestMode.AsyncLoad); WallOfFleshDemonSickleTexture = ModContent.Request("CalamityMod/Projectiles/Melee/ForbiddenOathbladeProjectile", AssetRequestMode.AsyncLoad); FlyingCarpetVanilla = TextureAssets.FlyingCarpet; @@ -52,6 +46,9 @@ namespace CalamityMod.ExtraTextures LuckIconVanilla = TextureAssets.Buff[BuffID.Lucky]; LuckIconLesser = ModContent.Request("CalamityMod/ExtraTextures/VanillaBuffs/LuckyLesser", AssetRequestMode.AsyncLoad); + BlightedSlimeCorroIcon = ModContent.Request("CalamityMod/Buffs/Summon/BlightedSlime"); + BlightedSlimeCrimIcon = ModContent.Request("CalamityMod/Buffs/Summon/BlightedSlimeCrimson"); + CircularSmear = ModContent.Request("CalamityMod/Particles/CircularSmear", AssetRequestMode.AsyncLoad); CircularSmearFire1 = ModContent.Request("CalamityMod/Particles/CircularSmearFire1", AssetRequestMode.AsyncLoad); CircularSmearFire2 = ModContent.Request("CalamityMod/Particles/CircularSmearFire2", AssetRequestMode.AsyncLoad); diff --git a/ExtraTextures/VanillaBossGlowmasks/DestroyerBodyGlow.png b/ExtraTextures/VanillaBossGlowmasks/DestroyerBodyGlow.png deleted file mode 100644 index 3e2235cd1d..0000000000 Binary files a/ExtraTextures/VanillaBossGlowmasks/DestroyerBodyGlow.png and /dev/null differ diff --git a/ExtraTextures/VanillaBossGlowmasks/DestroyerHeadGlow.png b/ExtraTextures/VanillaBossGlowmasks/DestroyerHeadGlow.png deleted file mode 100644 index 4530739af2..0000000000 Binary files a/ExtraTextures/VanillaBossGlowmasks/DestroyerHeadGlow.png and /dev/null differ diff --git a/ExtraTextures/VanillaBossGlowmasks/DestroyerTailGlow.png b/ExtraTextures/VanillaBossGlowmasks/DestroyerTailGlow.png deleted file mode 100644 index 2fcbcceb81..0000000000 Binary files a/ExtraTextures/VanillaBossGlowmasks/DestroyerTailGlow.png and /dev/null differ diff --git a/ExtraTextures/VanillaBossGlowmasks/SkeletronPrimeHeadGlow.png b/ExtraTextures/VanillaBossGlowmasks/SkeletronPrimeHeadGlow.png deleted file mode 100644 index a988d2bbdc..0000000000 Binary files a/ExtraTextures/VanillaBossGlowmasks/SkeletronPrimeHeadGlow.png and /dev/null differ diff --git a/ExtraTextures/VanillaBossGlowmasks/WallOfFleshEyeTelegraphGlow.png b/ExtraTextures/VanillaBossGlowmasks/WallOfFleshEyeTelegraphGlow.png deleted file mode 100644 index 2f52bdb33a..0000000000 Binary files a/ExtraTextures/VanillaBossGlowmasks/WallOfFleshEyeTelegraphGlow.png and /dev/null differ diff --git a/Gores/AquaticScourgeGores/AquaticParasite1.png b/Gores/AquaticScourgeGores/AquaticParasite1.png deleted file mode 100644 index f652388f71..0000000000 Binary files a/Gores/AquaticScourgeGores/AquaticParasite1.png and /dev/null differ diff --git a/Gores/AquaticScourgeGores/AquaticParasite2.png b/Gores/AquaticScourgeGores/AquaticParasite2.png deleted file mode 100644 index 82a0aa1720..0000000000 Binary files a/Gores/AquaticScourgeGores/AquaticParasite2.png and /dev/null differ diff --git a/Gores/AquaticScourgeGores/AquaticSeekerBody.png b/Gores/AquaticScourgeGores/AquaticSeekerBody.png deleted file mode 100644 index fb1978fced..0000000000 Binary files a/Gores/AquaticScourgeGores/AquaticSeekerBody.png and /dev/null differ diff --git a/Gores/AquaticScourgeGores/AquaticSeekerHead.png b/Gores/AquaticScourgeGores/AquaticSeekerHead.png deleted file mode 100644 index ab7b02b78b..0000000000 Binary files a/Gores/AquaticScourgeGores/AquaticSeekerHead.png and /dev/null differ diff --git a/Gores/AquaticScourgeGores/AquaticSeekerTail.png b/Gores/AquaticScourgeGores/AquaticSeekerTail.png deleted file mode 100644 index f4da7fb3a7..0000000000 Binary files a/Gores/AquaticScourgeGores/AquaticSeekerTail.png and /dev/null differ diff --git a/Gores/CalamitasGores/LifeSeeker.png b/Gores/CalamitasGores/LifeSeeker.png deleted file mode 100644 index 398861be36..0000000000 Binary files a/Gores/CalamitasGores/LifeSeeker.png and /dev/null differ diff --git a/Gores/CalamitasGores/LifeSeeker2.png b/Gores/CalamitasGores/LifeSeeker2.png deleted file mode 100644 index d51c94f12d..0000000000 Binary files a/Gores/CalamitasGores/LifeSeeker2.png and /dev/null differ diff --git a/Gores/CalamitasGores/LifeSeeker3.png b/Gores/CalamitasGores/LifeSeeker3.png deleted file mode 100644 index dd3f95427d..0000000000 Binary files a/Gores/CalamitasGores/LifeSeeker3.png and /dev/null differ diff --git a/Gores/CalamitasGores/SoulSlurper.png b/Gores/CalamitasGores/SoulSlurper.png deleted file mode 100644 index 63911dc0f4..0000000000 Binary files a/Gores/CalamitasGores/SoulSlurper.png and /dev/null differ diff --git a/Gores/CalamitasGores/SoulSlurper2.png b/Gores/CalamitasGores/SoulSlurper2.png deleted file mode 100644 index 9f7519fd46..0000000000 Binary files a/Gores/CalamitasGores/SoulSlurper2.png and /dev/null differ diff --git a/Gores/CalamitasGores/SoulSlurper3.png b/Gores/CalamitasGores/SoulSlurper3.png deleted file mode 100644 index d752cbe4e8..0000000000 Binary files a/Gores/CalamitasGores/SoulSlurper3.png and /dev/null differ diff --git a/Gores/CalamitasGores/SoulSlurper4.png b/Gores/CalamitasGores/SoulSlurper4.png deleted file mode 100644 index 2d6924f39f..0000000000 Binary files a/Gores/CalamitasGores/SoulSlurper4.png and /dev/null differ diff --git a/Gores/Cryocore.png b/Gores/Cryocore.png deleted file mode 100644 index cbf2143aa0..0000000000 Binary files a/Gores/Cryocore.png and /dev/null differ diff --git a/Gores/Cryocore2.png b/Gores/Cryocore2.png deleted file mode 100644 index e63a1f27e0..0000000000 Binary files a/Gores/Cryocore2.png and /dev/null differ diff --git a/Gores/DoGBody.png b/Gores/DoGBody.png deleted file mode 100644 index 3bd4321383..0000000000 Binary files a/Gores/DoGBody.png and /dev/null differ diff --git a/Gores/DoGBody2.png b/Gores/DoGBody2.png deleted file mode 100644 index ce1193d555..0000000000 Binary files a/Gores/DoGBody2.png and /dev/null differ diff --git a/Gores/DoGBody3.png b/Gores/DoGBody3.png deleted file mode 100644 index 2e2616f6a3..0000000000 Binary files a/Gores/DoGBody3.png and /dev/null differ diff --git a/Gores/DoGHead.png b/Gores/DoGHead.png deleted file mode 100644 index f33c23b97e..0000000000 Binary files a/Gores/DoGHead.png and /dev/null differ diff --git a/Gores/DoGTail.png b/Gores/DoGTail.png deleted file mode 100644 index 65f911efda..0000000000 Binary files a/Gores/DoGTail.png and /dev/null differ diff --git a/Gores/DoT.png b/Gores/DoT.png deleted file mode 100644 index 2522740775..0000000000 Binary files a/Gores/DoT.png and /dev/null differ diff --git a/Gores/DoT2.png b/Gores/DoT2.png deleted file mode 100644 index 7d83341fd1..0000000000 Binary files a/Gores/DoT2.png and /dev/null differ diff --git a/Gores/DoT3.png b/Gores/DoT3.png deleted file mode 100644 index 872927462a..0000000000 Binary files a/Gores/DoT3.png and /dev/null differ diff --git a/Gores/DoT4.png b/Gores/DoT4.png deleted file mode 100644 index 8865c715ba..0000000000 Binary files a/Gores/DoT4.png and /dev/null differ diff --git a/Gores/DoT5.png b/Gores/DoT5.png deleted file mode 100644 index 19ccf524a2..0000000000 Binary files a/Gores/DoT5.png and /dev/null differ diff --git a/Gores/PrismShurikenBlade.png b/Gores/PrismShurikenBlade.png deleted file mode 100644 index 650f27e8c1..0000000000 Binary files a/Gores/PrismShurikenBlade.png and /dev/null differ diff --git a/Gores/ScourgePestBody.png b/Gores/ScourgePestBody.png deleted file mode 100644 index e120f5edc7..0000000000 Binary files a/Gores/ScourgePestBody.png and /dev/null differ diff --git a/Gores/ScourgePestBody2.png b/Gores/ScourgePestBody2.png deleted file mode 100644 index 8e07accb80..0000000000 Binary files a/Gores/ScourgePestBody2.png and /dev/null differ diff --git a/Gores/ScourgePestBody3.png b/Gores/ScourgePestBody3.png deleted file mode 100644 index adedc10e2f..0000000000 Binary files a/Gores/ScourgePestBody3.png and /dev/null differ diff --git a/Gores/ScourgePestBody4.png b/Gores/ScourgePestBody4.png deleted file mode 100644 index 7b3f75ea31..0000000000 Binary files a/Gores/ScourgePestBody4.png and /dev/null differ diff --git a/Gores/ScourgePestHead.png b/Gores/ScourgePestHead.png deleted file mode 100644 index b0be38f842..0000000000 Binary files a/Gores/ScourgePestHead.png and /dev/null differ diff --git a/Gores/ScourgePestTail.png b/Gores/ScourgePestTail.png deleted file mode 100644 index 39e6906844..0000000000 Binary files a/Gores/ScourgePestTail.png and /dev/null differ diff --git a/Gores/StasisProbe1.png b/Gores/StasisProbe1.png deleted file mode 100644 index 5ea916d95b..0000000000 Binary files a/Gores/StasisProbe1.png and /dev/null differ diff --git a/Gores/StasisProbeNaked1.png b/Gores/StasisProbeNaked1.png deleted file mode 100644 index c60d12338b..0000000000 Binary files a/Gores/StasisProbeNaked1.png and /dev/null differ diff --git a/Gores/TarraHeart.png b/Gores/TarraHeart.png deleted file mode 100644 index dc382d7695..0000000000 Binary files a/Gores/TarraHeart.png and /dev/null differ diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 67b5ec5794..41e3ff9dc0 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -63,6 +63,7 @@ namespace CalamityMod.ILEditing // Mechanics / features On_NPC.ApplyTileCollision += AllowFusionFeederToDigThroughSand; + On_NPC.RerollVariation += AllowPatronNameRerollsOnLicenseUse; IL_Player.ApplyEquipFunctional += ScopesRequireVisibilityToZoom; IL_Player.Hurt_PlayerDeathReason_int_int_refHurtInfo_bool_bool_int_bool_float_float_float += DodgeMechanicAdjustments; On_Player.PutHallowedArmorSetBonusOnCooldown += AddHolyProtectionCooldown; @@ -141,6 +142,8 @@ namespace CalamityMod.ILEditing IL_UIWorldCreation.AddWorldSizeOptions += SwapSmallDescriptionKey; On_WorldGen.MakeDungeon += LimitDungeonEntranceXPosition; IL_WorldGen.DungeonHalls += LimitDungeonHallsXPosition; + IL_WorldGen.IslandHouse += MakeFledgingWingsMoreCommon; + IL_WorldGen.AddBuriedChest_int_int_int_bool_int_bool_ushort += DisableFledglingWingsSecondary; // Removal of vanilla stupidity IL_Player.StatusFromNPC += RemoveExpertBrainRandomDebuffs; @@ -170,11 +173,6 @@ namespace CalamityMod.ILEditing IL_Main.DrawInfoAccs += RemoveDamageConditionFromRadar; //On_ShopHelper.ApplyNpcRelationshipEffect += AllowMultipleLikedNPCs; - On_Player.UpdateControlHolds += DelayGravity; - On_PlayerInput.SetZoom_MouseInWorld += GravityMouse; - On_Main.DrawPlayerChatBubbles += UI_Unflip_Start; - On_Main.DrawInterface += UI_Unflip_End; - // Fix vanilla not accounting for spritebatch modification in held projectile drawing On_PlayerDrawLayers.DrawHeldProj += FixHeldProjectileBlendState; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index f7466891f6..34e8809ea7 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -30,6 +30,7 @@ using CalamityMod.Tiles; using CalamityMod.Utilities.Daybreak; using CalamityMod.Walls; using CalamityMod.Walls.UnsafeWalls; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Mono.Cecil.Cil; @@ -236,14 +237,6 @@ namespace CalamityMod.ILEditing dir = self.direction; dashing = true; - // CIT 16OCT2024: Commented this code out, as there's no reason for custom dash hotkey to use Player.dashTime - // and was causing the return of Celestial Starboard's dash bug from early 1.4 versions - /*if ((self.dashTime <= 0 && self.direction == -1) || (self.dashTime >= 0 && self.direction == 1)) - { - self.dashTime = 15; - return; - }*/ - dashing = true; self.dashTime = 0; self.timeSinceLastDashStarted = 0; @@ -251,7 +244,7 @@ namespace CalamityMod.ILEditing return; } - if (CalamityKeybinds.DashHotkey.GetAssignedKeysOrEmpty().Count == 0) + if (CalamityKeybinds.DashHotkey.GetAssignedKeysOrEmpty(PlayerInput.CurrentInputMode).Count == 0) orig(self, out dir, out dashing, dashStartAction); else { @@ -326,6 +319,27 @@ namespace CalamityMod.ILEditing } #endregion + #region Allow Patron Name Rerolls on License Use + private static bool AllowPatronNameRerollsOnLicenseUse(On_NPC.orig_RerollVariation orig, NPC self) + { + bool success = orig(self); + if (success) + { + if (self.type == NPCID.TownBunny) + CalamityWorld.bunnyName = false; + if (self.type == NPCID.TownCat) + CalamityWorld.catName = false; + if (self.type == NPCID.TownDog) + CalamityWorld.dogName = false; + + if (!self.TryGetGlobalNPC(out var calGlobalTownNPC)) + return success; + calGlobalTownNPC.setNewName = true; + } + return success; + } + #endregion + #region Prevent Diabolists from Dropping Stuff in GFB Before Plantera private static void PreventDiabolistLootLogic(On_NPC.orig_NPCLoot orig, NPC self) { @@ -639,8 +653,14 @@ namespace CalamityMod.ILEditing { if (self.Calamity().ChaosStone) { + if (amount <= -1) + amount = self.GetManaCost(item); + if (pay) + { self.statMana -= item.mana; + CombinedHooks.OnConsumeMana(self, item, amount); + } if (self.statMana < -self.statManaMax2) self.statMana = -self.statManaMax2; return true; @@ -695,7 +715,10 @@ namespace CalamityMod.ILEditing ref FluidField calamityFireDrawer = ref player.Calamity().CalamityFireDrawer; ref Vector2 firePosition = ref player.Calamity().FireDrawerPosition; if (calamityFireDrawer is null || calamityFireDrawer.Size != size) + { + calamityFireDrawer?.Dispose(); calamityFireDrawer = FluidFieldManager.CreateField(size, scale, 0.1f, 50f, 0.992f); + } // Update the fire draw position. firePosition = new Vector2(Main.screenWidth, Main.screenHeight) * 0.5f; @@ -1118,19 +1141,92 @@ namespace CalamityMod.ILEditing { // If an Abyss wall is detected, try to find another teleportation location bool canSpawn = false; - int teleportStartX = 100; + int halfWorldWidth = Main.maxTilesX / 2; + + int teleportStartX = Abyss.AtLeftSideOfWorld ? halfWorldWidth - (halfWorldWidth - 175) + 35 : halfWorldWidth + (halfWorldWidth - 175) - 35; int teleportRangeX = Main.maxTilesX - 200; int teleportStartY = 100; - int underworldLayer = Main.UnderworldLayer; - Vector2 newerPos = self.CheckForGoodTeleportationSpot(ref canSpawn, teleportStartX, teleportRangeX, teleportStartY, underworldLayer, new Player.RandomTeleportationAttemptSettings + int teleportRangeY = Main.UnderworldLayer; + + int attempts = 0; + int maxAttempts = 1000; + int teleportPositionX = 0; + int teleportPositionY = 0; + Vector2 teleportPosition = new Vector2(teleportPositionX, teleportPositionY) * 16f - new Vector2(self.width * 0.5f + 8, self.height); + while (!canSpawn && attempts < maxAttempts) { - avoidLava = true, - avoidHurtTiles = true, - maximumFallDistanceFromOrignalPoint = 100, - attemptsBeforeGivingUp = 1000 - }); + attempts++; + + if (Abyss.AtLeftSideOfWorld) + teleportPositionX = teleportStartX + Main.rand.Next(teleportRangeX); + else + teleportPositionX = teleportStartX - Main.rand.Next(teleportRangeX); + teleportPositionY = teleportStartY + Main.rand.Next(teleportRangeY); + + teleportPositionX = MathHelper.Clamp(teleportPositionX, 5, Main.maxTilesX - 5); + teleportPositionY = MathHelper.Clamp(teleportPositionY, 5, Main.maxTilesY - 5); + teleportPosition = new Vector2(teleportPositionX, teleportPositionY) * 16f - new Vector2(self.width * 0.5f + 8, self.height); + + if (Collision.SolidCollision(teleportPosition, self.width, self.height)) + continue; + + Tile tile = Framing.GetTileSafely(new Point(teleportPositionX, teleportPositionY)); + bool behindTempleWalls = tile.WallType == WallID.LihzahrdBrickUnsafe && teleportPositionY > Main.worldSurface && !NPC.downedPlantBoss; + bool behindDungeonWalls = Main.wallDungeon[tile.WallType] && teleportPositionY > Main.worldSurface && !NPC.downedBoss3; + if (behindTempleWalls || behindDungeonWalls) + continue; + + int distanceToGround = 0; + int maxFallDistance = 100; + while (distanceToGround < maxFallDistance) + { + Tile groundTile = Framing.GetTileSafely(new Point(teleportPositionX, teleportPositionY + distanceToGround)); + teleportPosition = new Vector2(teleportPositionX, teleportPositionY + distanceToGround) * 16f - new Vector2(self.width * 0.5f + 8, self.height); + Collision.SlopeCollision(teleportPosition, self.velocity, self.width, self.height, self.gravDir); + if (!Collision.SolidCollision(teleportPosition, self.width, self.height)) + { + distanceToGround++; + continue; + } + + if (groundTile.HasUnactuatedTile && Main.tileSolid[groundTile.TileType]) + break; + + distanceToGround++; + } + + teleportPosition.Y -= 16f; + bool inLava = Collision.LavaCollision(teleportPosition, self.width, self.height); + bool onHurtingTile = Collision.AnyHurtingTiles(teleportPosition, self.width, self.height); + bool insideBlocks = Collision.SolidCollision(teleportPosition, self.width, self.height); + bool reachedMaxFallDistance = distanceToGround >= maxFallDistance; + if (inLava || onHurtingTile || insideBlocks || reachedMaxFallDistance) + continue; + + Vector2 checkDirection = Vector2.UnitX * 16f; + if (Collision.TileCollision(teleportPosition - checkDirection, checkDirection, self.width, self.height, false, false, (int)self.gravDir) != checkDirection) + continue; + + checkDirection = Vector2.UnitX * -16f; + if (Collision.TileCollision(teleportPosition - checkDirection, checkDirection, self.width, self.height, false, false, (int)self.gravDir) != checkDirection) + continue; + + checkDirection = Vector2.UnitY * 16f; + if (Collision.TileCollision(teleportPosition - checkDirection, checkDirection, self.width, self.height, false, false, (int)self.gravDir) == checkDirection) + { + checkDirection = Vector2.UnitY * -16f; + if (Collision.TileCollision(teleportPosition - checkDirection, checkDirection, self.width, self.height, false, false, (int)self.gravDir) == checkDirection) + { + canSpawn = true; + teleportPositionY += distanceToGround; + teleportPosition = new Vector2(teleportPositionX, teleportPositionY) * 16f - new Vector2(self.width * 0.5f + 8, self.height); + break; + } + } + } + // Attempt teleporting again with the new location - orig(self, newerPos, Style, extraInfo); + orig(self, teleportPosition, Style, extraInfo); } else { diff --git a/ILEditing/VanillaStupidityFixingILChanges.cs b/ILEditing/VanillaStupidityFixingILChanges.cs index c2674dcadc..d38654671b 100644 --- a/ILEditing/VanillaStupidityFixingILChanges.cs +++ b/ILEditing/VanillaStupidityFixingILChanges.cs @@ -18,7 +18,9 @@ using Terraria.DataStructures; using Terraria.GameContent.Drawing; using Terraria.GameContent.ItemDropRules; using Terraria.GameInput; +using Terraria.Graphics; using Terraria.Graphics.Effects; +using Terraria.Graphics.Renderers; using Terraria.ID; using Terraria.ModLoader; @@ -713,95 +715,6 @@ namespace CalamityMod.ILEditing }*/ #endregion - #region Allow Disabling Gravity Swap Visual and Allow Gravity Keybind - private static void DelayGravity(On_Player.orig_UpdateControlHolds orig, Player Player) - { - var cplay = Player.Calamity(); - if (CalamityKeybinds.SwitchGravityHotkey.GetAssignedKeysOrEmpty().Count != 0 && (Player.gravControl || Player.gravControl2) && !Player.mount.Active) - { - if (Player.controlUp && Player.releaseUp) - { - Player.gravDir *= -1; - } - if (CalamityKeybinds.SwitchGravityHotkey.JustPressed) - { - Player.gravDir *= -1; - Player.fallStart = (int)(Player.position.Y / 16f); - Player.jump = 0; - SoundEngine.PlaySound(SoundID.Item8, Player.position); - } - - if (Player.forcedGravity > 0) - { - Player.gravDir = -1f; - } - } - - if (cplay.justChangedGravity) - { - Player.gravDir = cplay.oldGravDir; - } - cplay.justChangedGravity = cplay.oldGravDir != Player.gravDir; - - cplay.oldGravDir = Player.gravDir; - if (Main.netMode != NetmodeID.Server && !Main.gameMenu && CalamityClientConfig.Instance.DisableGravityScreenSwap) - { - if (Player.gravDir == -1) - { - if (!Filters.Scene["CalamityMod:FlipScreen"].IsActive()) - { - Filters.Scene.Activate("CalamityMod:FlipScreen"); - Filters.Scene["CalamityMod:FlipScreen"].Opacity = 1f; - - } - } - else - { - if (Filters.Scene["CalamityMod:FlipScreen"].IsActive()) - { - Filters.Scene["CalamityMod:FlipScreen"].Opacity = 0f; - Filters.Scene.Deactivate("CalamityMod:FlipScreen"); - - } - } - } - if (cplay.justChangedGravity) - { - Player.gravDir *= -1; - } - orig(Player); - } - - private static void GravityMouse(On_PlayerInput.orig_SetZoom_MouseInWorld orig) - { - orig(); - if (!Main.gameMenu && Filters.Scene["CalamityMod:FlipScreen"].IsActive())//((Main.LocalPlayer.gravDir == -1 && !Main.LocalPlayer.Calamity().justChangedGravity) || (Main.LocalPlayer.Calamity().oldGravDir == -1 && Main.LocalPlayer.Calamity().justChangedGravity)) - { - var center = Main.screenHeight / 2; - Main.mouseY = center - (Main.mouseY - center); - } - ; - } - private static void UI_Unflip_Start(On_Main.orig_DrawPlayerChatBubbles orig, Main self) - { - if (!Main.gameMenu && (Filters.Scene["CalamityMod:FlipScreen"].IsActive() || Main.LocalPlayer.Calamity().justChangedGravity)) - { - Main.LocalPlayer.Calamity().tempGravDir = Main.LocalPlayer.gravDir; - Main.LocalPlayer.gravDir = 1; - } - orig(self); - } - - private static void UI_Unflip_End(On_Main.orig_DrawInterface orig, Main self, GameTime gameTime) - { - orig(self, gameTime); - if (!Main.gameMenu && Filters.Scene["CalamityMod:FlipScreen"].IsActive()) - { - Main.LocalPlayer.gravDir = Main.LocalPlayer.Calamity().tempGravDir; - } - } - #endregion - // 02JUN2024: Ozzatron: The below code is being kept in its initial state for historic value. #region Store The Stupid Fucking Private Wind Map In Public Property [/*TotallyNot*/Obsolete("This function serves no purpose and is included in the Calamity source code for historic value.", error: true)] diff --git a/ILEditing/WorldgenILChanges.cs b/ILEditing/WorldgenILChanges.cs index 6a11c74bec..63e1681843 100644 --- a/ILEditing/WorldgenILChanges.cs +++ b/ILEditing/WorldgenILChanges.cs @@ -208,5 +208,72 @@ namespace CalamityMod.ILEditing } #endregion Prevent Abyss/Dungeon Interactions + + #region Fledgling Wings Loot Changes + /// + /// Changes the primary loot of Floating Island chests to include Fledging Wings + /// + private static void MakeFledgingWingsMoreCommon(ILContext il) + { + var cursor = new ILCursor(il); + + // How the code we are moving to works: + // Set num13 equal to the number of islands generated. If greater than 3, set to a random number between 0-3 inclusive. Then use that value in a 4-branch switch statement. + // This makes num13 always be a value between 0-3, for the 4 primary items in island loot. + // To accomodate for Fledgling Wings, we must change this to check for being greater than 4, then to set to a random number between 0-4 inclusive, then make the switch have 5 branches. + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchStloc(13))) + { + LogFailure("Fledgling Wings", "Could not move to the location of determining Floating Island primary loot 1."); + return; + } + + // Emit a delegate which reimplements the logic for choosing the primary loot of floating islands with Fledgling Wings, then return the ID of the item. + var label = il.DefineLabel(); + cursor.EmitDelegate>(() => + { + int island = GenVars.skyIslandHouseCount; + if (island > 4) + island = Main.rand.Next(5); + + return island switch + { + 1 => 65, // Starfury + 2 => 158, // Lucky Horseshoe + 3 => 2219, // Celestial Magnet + 4 => 4978, // Fledgling Wings + _ => 159, // Shiny Red Balloon + }; + }); + + // Store this value in the variable which holds the ID of the item, then branch past the original logic. + cursor.Emit(OpCodes.Stloc, 13); + cursor.Emit(OpCodes.Br, label); + + if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdsfld("getGoodWorldGen"))) + { + LogFailure("Fledgling Wings", "Could not move after the switch statement."); + return; + } + cursor.MarkLabel(label); + } + + /// + /// Disables Fledgling Wings being added as secondary loot in floating island chests + /// + private static void DisableFledglingWingsSecondary(ILContext il) + { + var cursor = new ILCursor(il); + + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdloc(9))) + { + LogFailure("Fledgling Wings", "Could not move to the code adding Fledgling Wings as secondary loot."); + return; + } + + // AND with 0 (false) so that the code to add Fledgling Wings as secondary loot never runs. + cursor.Emit(OpCodes.Ldc_I4_0); + cursor.Emit(OpCodes.And); + } + #endregion } } diff --git a/Items/Accessories/AbyssalDivingGear.cs b/Items/Accessories/AbyssalDivingGear.cs index b2129bd402..79d47e65cf 100644 --- a/Items/Accessories/AbyssalDivingGear.cs +++ b/Items/Accessories/AbyssalDivingGear.cs @@ -49,8 +49,8 @@ namespace CalamityMod.Items.Accessories CreateRecipe(). AddIngredient(ItemID.ArcticDivingGear). AddIngredient(). - AddIngredient(10). - AddIngredient(10). + AddIngredient(20). + AddIngredient(15). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/AbyssalMirror.cs b/Items/Accessories/AbyssalMirror.cs index 0a71cbd439..5ef95b91af 100644 --- a/Items/Accessories/AbyssalMirror.cs +++ b/Items/Accessories/AbyssalMirror.cs @@ -73,8 +73,8 @@ namespace CalamityMod.Items.Accessories CreateRecipe(). AddIngredient(). AddIngredient(). - AddIngredient(5). - AddIngredient(5). + AddIngredient(20). + AddIngredient(15). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/AcrobaticBobber.cs b/Items/Accessories/AcrobaticBobber.cs index ffd5b98001..135efdb3a1 100644 --- a/Items/Accessories/AcrobaticBobber.cs +++ b/Items/Accessories/AcrobaticBobber.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Items.Fishing CreateRecipe(). AddIngredient(ItemID.FishingBobber). AddIngredient(5). - AddIngredient(ItemID.Feather). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Accessories/AmbrosialAmpoule.cs b/Items/Accessories/AmbrosialAmpoule.cs index 7804ef5748..b5497cd0a3 100644 --- a/Items/Accessories/AmbrosialAmpoule.cs +++ b/Items/Accessories/AmbrosialAmpoule.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories public static int MinRegenBoost => 2; public static int MaxRegenBoost => 6; public static float RegenTimeBoost => 1; - public static float NaturalRegenPower => 1.5f; + public static float NaturalRegenPower => 1.75f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinRegenBoost.ToRegenPerSecond(), MaxRegenBoost.ToRegenPerSecond(), (NaturalRegenPower - 1f).ToPercent(), RegenTimeBoost.ToPercent()); public override void SetDefaults() diff --git a/Items/Accessories/AngelicAlliance.cs b/Items/Accessories/AngelicAlliance.cs index aca8d30b28..054a6893af 100644 --- a/Items/Accessories/AngelicAlliance.cs +++ b/Items/Accessories/AngelicAlliance.cs @@ -2,7 +2,9 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Rarities; +using CalamityMod.Systems.Collections; using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -39,7 +41,7 @@ namespace CalamityMod.Items.Accessories Item.Calamity().devItem = true; } - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.AngelicAllianceHotKey); + public override void ModifyTooltips(List list) => list.IntegrateDynamicHotkey(Item); public override void UpdateAccessory(Player player, bool hideVisual) { @@ -63,5 +65,7 @@ namespace CalamityMod.Items.Accessories AddTile(). Register(); } + + public static Color RarityColor() => CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly / 2f % 1f, [ new Color(255, 196, 55), new Color(255, 231, 107), new Color(255, 254, 243) ]); } } diff --git a/Items/Accessories/Apollyon.cs b/Items/Accessories/Apollyon.cs index 6a886f3eff..574d9f7dc8 100644 --- a/Items/Accessories/Apollyon.cs +++ b/Items/Accessories/Apollyon.cs @@ -28,8 +28,9 @@ namespace CalamityMod.Items.Accessories { CreateRecipe(). AddIngredient(). - AddIngredient(3). - AddIngredient(). + AddIngredient(ItemID.EyeoftheGolem). + AddIngredient(4). + AddIngredient(2). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/ArchaicPowder.cs b/Items/Accessories/ArchaicPowder.cs index bb6f6d5597..f9fa031628 100644 --- a/Items/Accessories/ArchaicPowder.cs +++ b/Items/Accessories/ArchaicPowder.cs @@ -27,15 +27,8 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { player.pickSpeed -= MiningSpeedBoost; - player.Calamity().aPowder = true; player.Calamity().fallingBlockProtection = true; - player.Calamity().trapProtection = true; - - // Doesn't stack with downgrades - if (player.chiselSpeed) - player.pickSpeed += 0.15f; - if (player.Calamity().aFossil) - player.pickSpeed += AncientFossil.MiningSpeedBoost; + player.Calamity().archaicPowder = true; } public override void AddRecipes() diff --git a/Items/Accessories/AscendantInsignia.cs b/Items/Accessories/AscendantInsignia.cs index cd3b024632..70e2f6a4ea 100644 --- a/Items/Accessories/AscendantInsignia.cs +++ b/Items/Accessories/AscendantInsignia.cs @@ -15,15 +15,15 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; // These values override Soaring Insignia's - public static double FlightTimeBoost = 0.5D; + public static int FlightTimeBoostFlat = CalamityUtils.SecondsToFrames(4); public static float MoveSpeedBoost = 0.15f; - public static float JumpSpeedBoost = 0.75f; // NOTE: Tooltip shares this number with move speed % as they're equal + public static float JumpSpeedBoost = 1f; public static float AccelerationBoost = 0.5f; public static int AbilityDuration = CalamityUtils.SecondsToFrames(4); public static int AbilityCooldown = CalamityUtils.SecondsToFrames(40); - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(FlightTimeBoost.ToPercent(), MoveSpeedBoost.ToPercent(), (1f + AccelerationBoost).Round(), AbilityDuration.FramesToSeconds(), AbilityCooldown.FramesToSeconds()); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(FlightTimeBoostFlat.FramesToSeconds(), MoveSpeedBoost.ToPercent(), JumpSpeedBoost.ToJumpSpeedPercent(), (1f + AccelerationBoost).Round(), AbilityDuration.FramesToSeconds(), AbilityCooldown.FramesToSeconds()); - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.AscendantInsigniaHotKey); + public override void ModifyTooltips(List list) => list.IntegrateDynamicHotkey(Item); public override void SetDefaults() { Item.width = 46; @@ -41,6 +41,7 @@ namespace CalamityMod.Items.Accessories player.empressBrooch = true; player.moveSpeed += MoveSpeedBoost; player.jumpSpeedBoost += JumpSpeedBoost - 0.5f; + player.wingTimeMax += FlightTimeBoostFlat; } public override void AddRecipes() diff --git a/Items/Accessories/AsgardsValor.cs b/Items/Accessories/AsgardsValor.cs index 9e450205d1..f09a272bda 100644 --- a/Items/Accessories/AsgardsValor.cs +++ b/Items/Accessories/AsgardsValor.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Accessories { Item.width = 50; Item.height = 48; - Item.value = CalamityGlobalItem.RarityLimeBuyPrice; - Item.rare = ItemRarityID.Lime; + Item.value = CalamityGlobalItem.RarityYellowBuyPrice; + Item.rare = ItemRarityID.Yellow; Item.defense = 4; Item.accessory = true; } @@ -41,8 +41,8 @@ namespace CalamityMod.Items.Accessories { CreateRecipe(). AddIngredient(). - AddIngredient(). AddIngredient(ItemID.HallowedBar, 5). + AddIngredient(). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/BadgeofBravery.cs b/Items/Accessories/BadgeofBravery.cs index 14d252e5f0..e1c1798956 100644 --- a/Items/Accessories/BadgeofBravery.cs +++ b/Items/Accessories/BadgeofBravery.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.badgeOfBravery = true; + player.GetDamage() += 0.1f; + player.GetCritChance() += 10; player.GetArmorPenetration() += 5; } @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Accessories { CreateRecipe(). AddIngredient(ItemID.WarriorEmblem). - AddIngredient(2). + AddIngredient(12). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/Baroclaw.cs b/Items/Accessories/Baroclaw.cs index 579a0c61c4..a18cbbe9e4 100644 --- a/Items/Accessories/Baroclaw.cs +++ b/Items/Accessories/Baroclaw.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Accessories { CreateRecipe(). AddIngredient(). - AddIngredient(12). + AddIngredient(20). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/BloodyWormScarf.cs b/Items/Accessories/BloodyWormScarf.cs index 846392ae1d..a16a16e50d 100644 --- a/Items/Accessories/BloodyWormScarf.cs +++ b/Items/Accessories/BloodyWormScarf.cs @@ -22,8 +22,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.bloodyWormTooth = true; + player.GetDamage() += 0.1f; player.endurance += 0.1f; } diff --git a/Items/Accessories/BloodyWormTooth.cs b/Items/Accessories/BloodyWormTooth.cs index a57a2e73d0..3cb14f971f 100644 --- a/Items/Accessories/BloodyWormTooth.cs +++ b/Items/Accessories/BloodyWormTooth.cs @@ -21,8 +21,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.bloodyWormTooth = true; + player.GetDamage() += 0.1f; } public override void AddRecipes() diff --git a/Items/Accessories/BlunderBooster.cs b/Items/Accessories/BlunderBooster.cs index 1a1b2bac13..19e94e34f6 100644 --- a/Items/Accessories/BlunderBooster.cs +++ b/Items/Accessories/BlunderBooster.cs @@ -18,12 +18,9 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - // TODO -- Check if its trying to replace the other rogue jetpack. If its the case, return true. - public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().hasJetpack; - public override void UpdateAccessory(Player player, bool hideVisual) { - player.Calamity().hasJetpack = true; + player.Calamity().rogueDashItem = Item; player.GetDamage() += 0.12f; player.Calamity().rogueVelocity += 0.15f; player.Calamity().blunderBooster = true; @@ -32,7 +29,7 @@ namespace CalamityMod.Items.Accessories player.Calamity().stealthGenMoving += 0.1f; } - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.BoosterDashHotKey); + public override void ModifyTooltips(List list) => list.IntegrateDynamicHotkey(Item); public override void AddRecipes() { diff --git a/Items/Accessories/ChaliceOfTheBloodGod.cs b/Items/Accessories/ChaliceOfTheBloodGod.cs index 53a8a5026d..99494921a8 100644 --- a/Items/Accessories/ChaliceOfTheBloodGod.cs +++ b/Items/Accessories/ChaliceOfTheBloodGod.cs @@ -71,7 +71,8 @@ namespace CalamityMod.Items.Accessories CreateRecipe(). AddIngredient(). AddIngredient(ItemID.CharmofMyths). - AddIngredient(5). + AddIngredient(12). + AddIngredient(5). AddIngredient(4). AddTile(). Register(); diff --git a/Items/Accessories/ChaosStone.cs b/Items/Accessories/ChaosStone.cs index ed7d14d158..dca6821906 100644 --- a/Items/Accessories/ChaosStone.cs +++ b/Items/Accessories/ChaosStone.cs @@ -10,12 +10,13 @@ namespace CalamityMod.Items.Accessories public class ChaosStone : ModItem, ILocalizedModType { public static float LostRegenPer100Mana => 8; - public static float DamageMultPer100Mana => 0.05f; + public static int BaseLostRegen => 12; + public static float DamageMultPer100Mana => 0.055f; public new string LocalizationCategory => "Items.Accessories"; public override void ModifyTooltips(List tooltips) { - var regenAmount = Main.LocalPlayer.statManaMax2 == 0 ? 0 : (int)((Main.LocalPlayer.statManaMax2 / 100f) * LostRegenPer100Mana) * 0.5f; + var regenAmount = Main.LocalPlayer.statManaMax2 == 0 ? 0 : (int)((Main.LocalPlayer.statManaMax2 / 100f) * LostRegenPer100Mana + BaseLostRegen) * 0.5f; var dmgAmount = Main.LocalPlayer.statManaMax2 == 0 ? 0 : ((Main.LocalPlayer.statManaMax2 / 100f) * DamageMultPer100Mana * 100); tooltips.FindAndReplaceAll("[REGEN]", regenAmount.ToString("0.#")); tooltips.FindAndReplaceAll("[DAMAGE]", dmgAmount.ToString("0.#")); diff --git a/Items/Accessories/CorrosiveSpine.cs b/Items/Accessories/CorrosiveSpine.cs index cf72391472..873027e96e 100644 --- a/Items/Accessories/CorrosiveSpine.cs +++ b/Items/Accessories/CorrosiveSpine.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.corrosiveSpine = true; player.moveSpeed += 0.05f; - modPlayer.WaterDebuffMultiplier += 0.25f; - modPlayer.SicknessDebuffMultiplier += 0.25f; + modPlayer.WaterDebuffMultiplier += 0.5f; + modPlayer.SicknessDebuffMultiplier += 0.5f; } } } diff --git a/Items/Accessories/CrushingEgo.cs b/Items/Accessories/CrushingEgo.cs index 13c92cc9fb..59bf0db7f5 100644 --- a/Items/Accessories/CrushingEgo.cs +++ b/Items/Accessories/CrushingEgo.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Accessories public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(10). AddIngredient(25). AddIngredient(25). AddTile(). diff --git a/Items/Accessories/DeadshotBrooch.cs b/Items/Accessories/DeadshotBrooch.cs index 16e3459913..5c3497351d 100644 --- a/Items/Accessories/DeadshotBrooch.cs +++ b/Items/Accessories/DeadshotBrooch.cs @@ -21,13 +21,13 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.Calamity().deadshotBrooch = true; + player.Calamity().ammoCycleItem = Item; player.Calamity().ammoCost *= 0.8f; player.GetDamage() += 0.12f; player.GetCritChance() += 7; } - public override void ModifyTooltips(List tooltips) => tooltips.IntegrateHotkey(CalamityKeybinds.AmmoCycleHotkey); + public override void ModifyTooltips(List tooltips) => tooltips.IntegrateDynamicHotkey(Item); public override void AddRecipes() { diff --git a/Items/Accessories/DiamondOfTheDeep.cs b/Items/Accessories/DiamondOfTheDeep.cs index 316af2422c..f0ceeea175 100644 --- a/Items/Accessories/DiamondOfTheDeep.cs +++ b/Items/Accessories/DiamondOfTheDeep.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Items.Accessories { Item.width = 26; Item.height = 26; - Item.value = CalamityGlobalItem.RarityLimeBuyPrice; - Item.rare = ItemRarityID.Lime; + Item.value = CalamityGlobalItem.RarityYellowBuyPrice; + Item.rare = ItemRarityID.Yellow; Item.accessory = true; } @@ -33,12 +33,12 @@ namespace CalamityMod.Items.Accessories { CreateRecipe(). AddIngredient(). - AddIngredient(10). - AddIngredient(5). - AddIngredient(10). AddIngredient(5). - AddIngredient(10). - AddIngredient(5). + AddIngredient(20). + AddIngredient(20). + AddIngredient(20). + AddIngredient(20). + AddIngredient(15). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/BlazingCore.cs b/Items/Accessories/DivineProvidence.cs similarity index 83% rename from Items/Accessories/BlazingCore.cs rename to Items/Accessories/DivineProvidence.cs index 87edf334c1..e6771ab241 100644 --- a/Items/Accessories/BlazingCore.cs +++ b/Items/Accessories/DivineProvidence.cs @@ -13,7 +13,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class BlazingCore : ModItem, ILocalizedModType + [LegacyName("BlazingCore")] + public class DivineProvidence : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; @@ -29,7 +30,7 @@ namespace CalamityMod.Items.Accessories ItemID.Sets.AnimatesAsSoul[Type] = true; } - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.AccessoryParryHotKey); + public override void ModifyTooltips(List list) => list.IntegrateDynamicHotkey(Main.LocalPlayer.Calamity().AccessoryParryItem != null ? Main.LocalPlayer.Calamity().AccessoryParryItem : Item); public override void SetDefaults() { Item.width = 42; @@ -42,21 +43,22 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.Calamity().blazingCore = true; + player.Calamity().divineProvidence = true; + player.Calamity().AccessoryParryItem = Item; player.noKnockback = true; } public static void HandleStars(Player player) { - bool empowered = player.Calamity().blazingCoreEmpoweredParry; + bool empowered = player.Calamity().divineProvEmpoweredParry; float divisor = 3f; int totalFlameProjectiles = 45; int chains = 3; float interval = totalFlameProjectiles / chains * divisor; - double patternInterval = Math.Floor(player.Calamity().blazingCoreSuccessfulParry / interval); + double patternInterval = Math.Floor(player.Calamity().divineProvSuccessfulParry / interval); - if (player.Calamity().blazingCoreSuccessfulParry % 4 == 0) //play sound every 4 frames + if (player.Calamity().divineProvSuccessfulParry % 4 == 0) //play sound every 4 frames { SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact, player.Center); } @@ -89,19 +91,19 @@ namespace CalamityMod.Items.Accessories offset += 10f; } - player.Calamity().blazingCoreSuccessfulParry--; - if (player.Calamity().blazingCoreSuccessfulParry <= 0) + player.Calamity().divineProvSuccessfulParry--; + if (player.Calamity().divineProvSuccessfulParry <= 0) { offset = 0f; - player.Calamity().blazingCoreEmpoweredParry = false; + player.Calamity().divineProvEmpoweredParry = false; } } public static void HandleParryCountdown(Player player) { - player.Calamity().blazingCoreParry--; + player.Calamity().divineProvParry--; - if (player.Calamity().blazingCoreParry > 0) + if (player.Calamity().divineProvParry > 0) { player.controlJump = false; player.controlDown = false; diff --git a/Items/Accessories/BlazingCore.png b/Items/Accessories/DivineProvidence.png similarity index 100% rename from Items/Accessories/BlazingCore.png rename to Items/Accessories/DivineProvidence.png diff --git a/Items/Accessories/ElementalinaBottle.cs b/Items/Accessories/ElementalinaBottle.cs index 0ea04c9cac..cd7d33b0d4 100644 --- a/Items/Accessories/ElementalinaBottle.cs +++ b/Items/Accessories/ElementalinaBottle.cs @@ -23,12 +23,12 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().elementalHeart; + public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().allElementals.HasValue; public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.sandElemental = true; + modPlayer.sandElemental = !hideVisual; SpawnElemental(player); } diff --git a/Items/Accessories/EtherealTalisman.cs b/Items/Accessories/EtherealTalisman.cs index d6135d8c6c..16567724e8 100644 --- a/Items/Accessories/EtherealTalisman.cs +++ b/Items/Accessories/EtherealTalisman.cs @@ -73,9 +73,6 @@ namespace CalamityMod.Items.Accessories #endregion public override void UpdateAccessory(Player player, bool hideVisual) { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.eTalisman = true; - player.manaMagnet = true; if (manaFlowerEnabled) player.manaFlower = true; diff --git a/Items/Accessories/EyeoftheStorm.cs b/Items/Accessories/EyeoftheStorm.cs index e317f2a6d6..83227565ad 100644 --- a/Items/Accessories/EyeoftheStorm.cs +++ b/Items/Accessories/EyeoftheStorm.cs @@ -26,20 +26,12 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - public override bool CanEquipAccessory(Player player, int slot, bool modded) - { - CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.elementalHeart) - { - return false; - } - return true; - } + public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().allElementals.HasValue; public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.cloudElemental = true; + modPlayer.cloudElemental = !hideVisual; if (player.whoAmI == Main.myPlayer) { if (player.FindBuffIndex(ModContent.BuffType()) == -1) diff --git a/Items/Accessories/FeatherCrown.cs b/Items/Accessories/FeatherCrown.cs index c331bb080a..83c538e911 100644 --- a/Items/Accessories/FeatherCrown.cs +++ b/Items/Accessories/FeatherCrown.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Accessories { CreateRecipe(). AddRecipeGroup("AnyGoldCrown"). - AddIngredient(6). + AddIngredient(8). AddIngredient(ItemID.Feather, 8). AddTile(TileID.Anvils). Register(); diff --git a/Items/Accessories/FlameLickedShell.cs b/Items/Accessories/FlameLickedShell.cs index 53f57e9697..244eddd3d0 100644 --- a/Items/Accessories/FlameLickedShell.cs +++ b/Items/Accessories/FlameLickedShell.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; internal const int flameLickedParry = 30; - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.AccessoryParryHotKey); + public override void ModifyTooltips(List list) => list.IntegrateDynamicHotkey(Main.LocalPlayer.Calamity().AccessoryParryItem != null ? Main.LocalPlayer.Calamity().AccessoryParryItem : Item); public override void SetStaticDefaults() { CalamityItemSets.ExtraDebuffTooltip_Enemy[Type] = [ModContent.BuffType()]; @@ -36,6 +36,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.flameLickedShell = true; + modPlayer.AccessoryParryItem = Item; player.noKnockback = true; } diff --git a/Items/Accessories/FragmentsOfAnotherWorld.cs b/Items/Accessories/FragmentsOfAnotherWorld.cs index 046e44ba43..b863550841 100644 --- a/Items/Accessories/FragmentsOfAnotherWorld.cs +++ b/Items/Accessories/FragmentsOfAnotherWorld.cs @@ -33,9 +33,6 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.fragmentsOfAnotherWorld = true; - player.buffImmune[ModContent.BuffType()] = true; player.GetAttackSpeed() += MeleeSpeedIncrease; player.specialistDamage *= RangedSpecialistDmgMult; diff --git a/Items/Accessories/FrozenCube.cs b/Items/Accessories/FrozenCube.cs index de230c812f..004f4426c6 100644 --- a/Items/Accessories/FrozenCube.cs +++ b/Items/Accessories/FrozenCube.cs @@ -14,13 +14,13 @@ namespace CalamityMod.Items.Accessories { public class FrozenCube : ModItem, ILocalizedModType { - public static int mistBaseDamage = 1; - public static int slamBaseDamage = 20; - public static int baseAttackSpeed = 90; - public static int baseAttackCooldown = 180; + public static int mistBaseDamage => 5; + public static int slamBaseDamage => 20; + public static int baseAttackSpeed => 90; + public static int baseAttackCooldown => 180; - public static int usedDefenseDivide = 3; - public static int debuff = ModContent.BuffType(); + public static int usedDefenseDivide => 3; + public static int debuff => ModContent.BuffType(); public static readonly SoundStyle noise = new("CalamityMod/Sounds/Item/ElumphantSound") { Volume = 0.6f }; public static readonly SoundStyle cry = new("CalamityMod/Sounds/Item/ElumphantCry") { Volume = 0.6f }; @@ -56,7 +56,7 @@ namespace CalamityMod.Items.Accessories if (player.ownedProjectileCounts[projectile] < 1 && !player.dead) { int damage = (int)player.GetTotalDamage().ApplyTo(slamBaseDamage); - Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.Center, Vector2.Zero, projectile, damage, 0f, player.whoAmI); + Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, Vector2.Zero, projectile, damage, 0f, player.whoAmI); } } public override void UpdateVanity(Player player) @@ -68,8 +68,8 @@ namespace CalamityMod.Items.Accessories int projectile = ProjectileType(); if (player.ownedProjectileCounts[projectile] < 1 && !player.dead) { - int damage = 0; - Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.Center, Vector2.Zero, projectile, damage, 0f, player.whoAmI); + int damage = (int)player.GetTotalDamage().ApplyTo(slamBaseDamage); + Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, Vector2.Zero, projectile, damage, 0f, player.whoAmI); } } diff --git a/Items/Accessories/GloveofPrecision.cs b/Items/Accessories/GloveofPrecision.cs index 81a152d40d..3f56f41052 100644 --- a/Items/Accessories/GloveofPrecision.cs +++ b/Items/Accessories/GloveofPrecision.cs @@ -21,7 +21,6 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.gloveOfPrecision = true; player.GetDamage() += 0.10f; player.GetCritChance() += 10; modPlayer.rogueVelocity += 0.15f; diff --git a/Items/Accessories/HarpyRing.cs b/Items/Accessories/HarpyRing.cs index c1648a12b3..9ed2cfcdd0 100644 --- a/Items/Accessories/HarpyRing.cs +++ b/Items/Accessories/HarpyRing.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.harpyRing = true; - player.moveSpeed += 0.1f; + player.moveSpeed += 0.2f; } public override void AddRecipes() diff --git a/Items/Accessories/HeartoftheElements.cs b/Items/Accessories/HeartoftheElements.cs index 977f8ed488..45437ee6e9 100644 --- a/Items/Accessories/HeartoftheElements.cs +++ b/Items/Accessories/HeartoftheElements.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Accessories public override bool CanEquipAccessory(Player player, int slot, bool modded) { CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.brimElemental || modPlayer.sandElemental || modPlayer.oasisElemental || modPlayer.cloudElemental || modPlayer.waterElemental) + if (modPlayer.brimElemental.HasValue || modPlayer.sandElemental.HasValue || modPlayer.oasisElemental.HasValue || modPlayer.cloudElemental.HasValue || modPlayer.waterElemental.HasValue) { return false; } @@ -50,8 +50,7 @@ namespace CalamityMod.Items.Accessories Lighting.AddLight((int)player.Center.X / 16, (int)player.Center.Y / 16, Main.DiscoR / 255f, Main.DiscoG / 255f, Main.DiscoB / 255f); CalamityPlayer modPlayer = player.Calamity(); - modPlayer.allElementals = true; - modPlayer.elementalHeart = true; + modPlayer.allElementals = !hideVisual; int brimmy = ProjectileType(); int siren = ProjectileType(); @@ -115,7 +114,6 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.allElementalsVanity = true; - // modPlayer.elementalHeart = true; int brimmy = ProjectileType(); int siren = ProjectileType(); diff --git a/Items/Accessories/IVDripOnTheRocks.cs b/Items/Accessories/IVDripOnTheRocks.cs index d934e91c64..d8054bf039 100644 --- a/Items/Accessories/IVDripOnTheRocks.cs +++ b/Items/Accessories/IVDripOnTheRocks.cs @@ -68,8 +68,8 @@ namespace CalamityMod.Items.Accessories { Item.width = 58; Item.height = 60; - Item.value = CalamityGlobalItem.RarityLimeBuyPrice; - Item.rare = ItemRarityID.Lime; + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.rare = ItemRarityID.Orange; Item.accessory = true; } diff --git a/Items/Accessories/InfectedJewel.cs b/Items/Accessories/InfectedJewel.cs index c88977e5ba..7ec49586d9 100644 --- a/Items/Accessories/InfectedJewel.cs +++ b/Items/Accessories/InfectedJewel.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public static int RegenBoost = 2; - public static int ReducedDoTAmount = 8; - public static int PostDebuffRegenTimeBoost = CalamityUtils.SecondsToFrames(10); + public static int ReducedDoTAmount = 12; + public static int PostDebuffRegenTimeBoost = CalamityUtils.SecondsToFrames(15); public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), ReducedDoTAmount.ToRegenPerSecond(), PostDebuffRegenTimeBoost.FramesToSeconds()); public override void SetDefaults() { diff --git a/Items/Accessories/InterstellarStompers.cs b/Items/Accessories/InterstellarStompers.cs index 2f82b292fb..0991544716 100644 --- a/Items/Accessories/InterstellarStompers.cs +++ b/Items/Accessories/InterstellarStompers.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Accessories Item.expert = true; } - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.GravistarSabatonHotkey); + public override void ModifyTooltips(List list) => list.IntegrateDynamicHotkey(Item); public override void UpdateAccessory(Player player, bool hideVisual) { diff --git a/Items/Accessories/LivingDew.cs b/Items/Accessories/LivingDew.cs index 2ab98916c6..407e5680c2 100644 --- a/Items/Accessories/LivingDew.cs +++ b/Items/Accessories/LivingDew.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public static int RegenTimeBoost => 1; - public static float NaturalRegenPower => 1.5f; + public static float NaturalRegenPower => 1.75f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((NaturalRegenPower - 1f).ToPercent(), RegenTimeBoost.ToPercent()); public override void SetDefaults() { diff --git a/Items/Accessories/NebulousCore.cs b/Items/Accessories/NebulousCore.cs index 91b3cc3860..c76d9086dd 100644 --- a/Items/Accessories/NebulousCore.cs +++ b/Items/Accessories/NebulousCore.cs @@ -5,6 +5,7 @@ using CalamityMod.Rarities; using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -12,6 +13,13 @@ namespace CalamityMod.Items.Accessories public class NebulousCore : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static float DamageBoost => 0.12f; + public static int HealLifeOnRevive => 300; + public static int ReviveCooldown => CalamityUtils.SecondsToFrames(90); + public static int MaxStars => 15; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), HealLifeOnRevive, ReviveCooldown.FramesToSeconds()); + public override void SetStaticDefaults() { CalamityItemSets.ExtraDebuffTooltip_Enemy[Type] = [ModContent.BuffType()]; @@ -37,12 +45,12 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.nebulousCore = true; - player.GetDamage() += 0.1f; + player.GetDamage() += DamageBoost; // Spawn nebula stars if (Main.rand.NextBool(15)) { - // Count the number of current active nebula stars; if this is at least 10, no more can spawn + // Count the number of current active nebula stars; if this is at least 15, no more can spawn int numProj = 0; foreach (Projectile p in Main.ActiveProjectiles) { @@ -51,7 +59,7 @@ namespace CalamityMod.Items.Accessories numProj++; } } - if (Main.rand.Next(15) >= numProj && numProj < 10) + if (Main.rand.Next(15) >= numProj && numProj < MaxStars) { int spawnRadius = 24; for (int j = 0; j < 50; j++) // Attempt to spawn the star randomly around the player diff --git a/Items/Accessories/NecklaceofVexation.cs b/Items/Accessories/NecklaceofVexation.cs index 39d4b09ccd..388b882207 100644 --- a/Items/Accessories/NecklaceofVexation.cs +++ b/Items/Accessories/NecklaceofVexation.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Accessories { CreateRecipe(). AddIngredient(ItemID.AvengerEmblem). - AddIngredient(2). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/Nucleogenesis.cs b/Items/Accessories/Nucleogenesis.cs index cf8c623f47..76d204055d 100644 --- a/Items/Accessories/Nucleogenesis.cs +++ b/Items/Accessories/Nucleogenesis.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.nucleogenesis = true; modPlayer.shadowMinions = true; //shadowflame - modPlayer.holyMinions = true; //holy flames + modPlayer.statisMinions = true; modPlayer.voltaicJelly = true; //static discharge modPlayer.starTaintedGenerator = true; //astral infection and irradiated player.GetKnockback() += 3f; diff --git a/Items/Accessories/OasisElementalinaBottle.cs b/Items/Accessories/OasisElementalinaBottle.cs index f3315de701..fbdc11ce02 100644 --- a/Items/Accessories/OasisElementalinaBottle.cs +++ b/Items/Accessories/OasisElementalinaBottle.cs @@ -26,20 +26,12 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - public override bool CanEquipAccessory(Player player, int slot, bool modded) - { - CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.elementalHeart) - { - return false; - } - return true; - } + public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().allElementals.HasValue; public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.oasisElemental = true; + modPlayer.oasisElemental = !hideVisual; if (player.whoAmI == Main.myPlayer) { if (player.FindBuffIndex(ModContent.BuffType()) == -1) diff --git a/Items/Accessories/OrnateShield.cs b/Items/Accessories/OrnateShield.cs index b8207f6c8b..ec74a3a62c 100644 --- a/Items/Accessories/OrnateShield.cs +++ b/Items/Accessories/OrnateShield.cs @@ -37,8 +37,8 @@ namespace CalamityMod.Items.Accessories public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). - AddIngredient(ItemID.CrystalShard, 10). + AddIngredient(12). + AddIngredient(ItemID.CrystalShard, 20). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/PearlofEnthrallment.cs b/Items/Accessories/PearlofEnthrallment.cs index fe448ea569..03aa737e0a 100644 --- a/Items/Accessories/PearlofEnthrallment.cs +++ b/Items/Accessories/PearlofEnthrallment.cs @@ -29,20 +29,12 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - public override bool CanEquipAccessory(Player player, int slot, bool modded) - { - CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.elementalHeart) - { - return false; - } - return true; - } + public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().allElementals.HasValue; public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.waterElemental = true; + modPlayer.waterElemental = !hideVisual; if (player.whoAmI == Main.myPlayer) { var source = player.GetSource_Accessory(Item); diff --git a/Items/Accessories/PlaguedFuelPack.cs b/Items/Accessories/PlaguedFuelPack.cs index 7ba1dcb02f..6af7b7c0ad 100644 --- a/Items/Accessories/PlaguedFuelPack.cs +++ b/Items/Accessories/PlaguedFuelPack.cs @@ -17,12 +17,9 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - // TODO -- Check if the slot contains the other rogue jetpack, in which case, let the player swap accs - public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().hasJetpack; - public override void UpdateAccessory(Player player, bool hideVisual) { - player.Calamity().hasJetpack = true; + player.Calamity().rogueDashItem = Item; player.GetDamage() += 0.08f; player.Calamity().rogueVelocity += 0.15f; player.Calamity().plaguedFuelPack = true; @@ -30,6 +27,6 @@ namespace CalamityMod.Items.Accessories player.Calamity().stealthGenMoving += 0.1f; } - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.BoosterDashHotKey); + public override void ModifyTooltips(List list) => list.IntegrateDynamicHotkey(Item); } } diff --git a/Items/Accessories/PlanebreakersPouch.cs b/Items/Accessories/PlanebreakersPouch.cs index 30445b7dcc..3d14c9d991 100644 --- a/Items/Accessories/PlanebreakersPouch.cs +++ b/Items/Accessories/PlanebreakersPouch.cs @@ -27,11 +27,11 @@ namespace CalamityMod.Items.Accessories player.GetCritChance() += 7; player.magicQuiver = true; CalamityPlayer modPlayer = player.Calamity(); - modPlayer.deadshotBrooch = true; + modPlayer.ammoCycleItem = Item; modPlayer.ammoCost *= 0.8f; } - public override void ModifyTooltips(List tooltips) => tooltips.IntegrateHotkey(CalamityKeybinds.AmmoCycleHotkey); + public override void ModifyTooltips(List tooltips) => tooltips.IntegrateDynamicHotkey(Item); public override void AddRecipes() { diff --git a/Items/Accessories/ProfanedSoulCrystal.cs b/Items/Accessories/ProfanedSoulCrystal.cs index 2d446d05c8..89a8f45dd3 100644 --- a/Items/Accessories/ProfanedSoulCrystal.cs +++ b/Items/Accessories/ProfanedSoulCrystal.cs @@ -637,5 +637,7 @@ namespace CalamityMod.Items.Accessories AddDecraftCondition(CalamityConditions.DownedSupremeCalamitas, CalamityConditions.DownedExoMechs). Register(); } + + public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25), 6f); //alternates between emerald green and amber (BanditHueh) } } diff --git a/Items/Accessories/Radiance.cs b/Items/Accessories/Radiance.cs index 46823c36ed..7f818c6c3b 100644 --- a/Items/Accessories/Radiance.cs +++ b/Items/Accessories/Radiance.cs @@ -20,10 +20,10 @@ namespace CalamityMod.Items.Accessories public static int MinRegenBoost => 2; public static int MaxRegenBoost => 8; - public static int ReducedDoTAmount => 20; - public static int PostDebuffRegenTimeBoost => CalamityUtils.SecondsToFrames(10); + public static int ReducedDoTAmount => 24; + public static int PostDebuffRegenTimeBoost => CalamityUtils.SecondsToFrames(15); public static float RegenTimeBoost => 1; - public static float NaturalRegenPower => 1.5f; + public static float NaturalRegenPower => 1.75f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinRegenBoost.ToRegenPerSecond(),MaxRegenBoost.ToRegenPerSecond(),ReducedDoTAmount.ToRegenPerSecond(), (NaturalRegenPower - 1f).ToPercent(),RegenTimeBoost.ToPercent()); public override void SetStaticDefaults() { diff --git a/Items/Accessories/RaidersTalisman.cs b/Items/Accessories/RaidersTalisman.cs index 2e45d69df2..fdbbeef494 100644 --- a/Items/Accessories/RaidersTalisman.cs +++ b/Items/Accessories/RaidersTalisman.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Items.Accessories { CreateRecipe(). AddIngredient(ItemID.Leather, 5). + AddIngredient(ItemID.FlinxFur, 5). AddIngredient(ItemID.Obsidian, 20). AddTile(TileID.Anvils). Register(); diff --git a/Items/Accessories/ReaperToothNecklace.cs b/Items/Accessories/ReaperToothNecklace.cs index dd2aaed632..f2fd577ead 100644 --- a/Items/Accessories/ReaperToothNecklace.cs +++ b/Items/Accessories/ReaperToothNecklace.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Accessories CreateRecipe(). AddIngredient(). AddIngredient(6). - AddIngredient(15). + AddIngredient(20). AddTile(TileID.TinkerersWorkbench). Register(); } diff --git a/Items/Accessories/Regenerator.cs b/Items/Accessories/Regenerator.cs index dc1bc73dd3..e43dd4bc88 100644 --- a/Items/Accessories/Regenerator.cs +++ b/Items/Accessories/Regenerator.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.regenerator = true; player.longInvince = true; // Gives better iframes because god help you if you end up getting hit twice + player.GetDamage() += player.Calamity().regeneratorDamage; } public override void ModifyTooltips(List list) diff --git a/Items/Accessories/RoseStone.cs b/Items/Accessories/RoseStone.cs index 981a849630..3d63327597 100644 --- a/Items/Accessories/RoseStone.cs +++ b/Items/Accessories/RoseStone.cs @@ -26,20 +26,12 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - public override bool CanEquipAccessory(Player player, int slot, bool modded) - { - CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.elementalHeart) - { - return false; - } - return true; - } + public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().allElementals.HasValue; public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.brimElemental = true; + modPlayer.brimElemental = !hideVisual; if (player.whoAmI == Main.myPlayer) { var source = player.GetSource_Accessory(Item); diff --git a/Items/Accessories/SigilofCalamitas.cs b/Items/Accessories/SigilofCalamitas.cs index a3dee2aa70..eaf536d589 100644 --- a/Items/Accessories/SigilofCalamitas.cs +++ b/Items/Accessories/SigilofCalamitas.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Accessories { CreateRecipe(). AddIngredient(ItemID.CelestialEmblem). - AddIngredient(5). + AddIngredient(8). AddIngredient(15). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Accessories/SpectralVeil.cs b/Items/Accessories/SpectralVeil.cs index 3cc01929cb..d0d9b60bef 100644 --- a/Items/Accessories/SpectralVeil.cs +++ b/Items/Accessories/SpectralVeil.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Accessories Item.expert = true; } - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.SpectralVeilHotKey); + public override void ModifyTooltips(List list) => list.IntegrateDynamicHotkey(Item); public override void UpdateAccessory(Player player, bool hideVisual) { diff --git a/Items/Accessories/SpringStool.cs b/Items/Accessories/SpringStool.cs index b3c39d4ca4..9d9ac064f9 100644 --- a/Items/Accessories/SpringStool.cs +++ b/Items/Accessories/SpringStool.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using CalamityMod.CalPlayer; using CalamityMod.Cooldowns; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; @@ -15,7 +16,7 @@ namespace CalamityMod.Items.Accessories public class SpringStool : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.SpringStoolJumpHotKey); + public override void ModifyTooltips(List list) => list.IntegrateDynamicHotkey(Item); public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((JumpCooldown).FramesToSeconds(), (CritRateBoostAboveTargets)); public static int JumpCooldown = CalamityUtils.SecondsToFrames(20); @@ -32,7 +33,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.GetModPlayer().springStool = true; + player.GetModPlayer().springStoolItem = Item; } public override void AddRecipes() @@ -48,7 +49,8 @@ namespace CalamityMod.Items.Accessories public class SpringStoolPlayer : ModPlayer { - public bool springStool = false; + public bool springStool { get => springStoolItem != null; } + public Item springStoolItem = null; public int springStoolTimer = 0; public bool hasGroundedSinceJump = true; @@ -73,7 +75,7 @@ namespace CalamityMod.Items.Accessories public override void PostUpdateEquips() { // Ensures the special jump initiates only works when unmounted, not grappled to a surface, and the ability is off cooldown - if (CalamityKeybinds.SpringStoolJumpHotKey.JustPressed && springStool && Main.myPlayer == Player.whoAmI && !Player.HasCooldown(Stooldown.ID) && !Player.mount.Active && hasGroundedSinceJump && !(Player.grappling[0] >= 0)) + if (springStool && Main.myPlayer == Player.whoAmI && !Player.HasCooldown(Stooldown.ID) && springStoolItem.JustPressedKeybind() && !Player.mount.Active && hasGroundedSinceJump && !(Player.grappling[0] >= 0)) { springStoolTimer = 12; @@ -214,13 +216,13 @@ namespace CalamityMod.Items.Accessories public override void ResetEffects() { - springStool = false; + springStoolItem = null; springStoolTimer = 0; } public override void UpdateDead() { - springStool = false; + springStoolItem = null; springStoolTimer = 0; hasGroundedSinceJump = true; } diff --git a/Items/Accessories/StatMeter.cs b/Items/Accessories/StatMeter.cs index bb95d2b0ca..d210db091b 100644 --- a/Items/Accessories/StatMeter.cs +++ b/Items/Accessories/StatMeter.cs @@ -211,8 +211,8 @@ namespace CalamityMod.Items.Accessories OnePlace((float)player.lifeRegen / 2f), // Divided by 2 to show HP/s, because vanilla! Also normally we'd divide this by 2 in Expert without Well Fed, but we disable that shit Sign(moveSpeedBoost) + TwoPlaces(100f * moveSpeedBoost), TwoPlaces(20f * player.GetJumpBoost())); - // Show wing stats only if over 0 flight time - if (wingFlightTime > 0f) + // Show wing stats only if over 0 flight time and wings are equipped + if (wingFlightTime > 0f && player.equippedWings != null) stats3 += this.GetLocalization("FlightTime").Format(TwoPlaces(wingFlightTime / 60f)); stats3 += "\n" + this.GetLocalization("MiscStats").Format( player.aggro, diff --git a/Items/Accessories/StatisBlessing.cs b/Items/Accessories/StatisBlessing.cs index 153d639c83..49616a4fb2 100644 --- a/Items/Accessories/StatisBlessing.cs +++ b/Items/Accessories/StatisBlessing.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.holyMinions = true; + modPlayer.statisMinions = true; player.GetKnockback() += 2.5f; player.GetDamage() += 0.12f; } diff --git a/Items/Accessories/StatisCurse.cs b/Items/Accessories/StatisCurse.cs index 5e6decb0b0..0f45b84c4b 100644 --- a/Items/Accessories/StatisCurse.cs +++ b/Items/Accessories/StatisCurse.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.shadowMinions = true; - modPlayer.holyMinions = true; + modPlayer.statisMinions = true; player.GetKnockback() += 2.75f; player.GetDamage() += 0.12f; player.buffImmune[ModContent.BuffType()] = true; diff --git a/Items/Accessories/SupremeBaitTackleBoxFishingStation.cs b/Items/Accessories/SupremeBaitTackleBoxFishingStation.cs index a287e37757..14455cee53 100644 --- a/Items/Accessories/SupremeBaitTackleBoxFishingStation.cs +++ b/Items/Accessories/SupremeBaitTackleBoxFishingStation.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Items.Accessories player.accFishingLine = true; player.accTackleBox = true; player.accLavaFishing = true; - player.Calamity().fishingStation = true; } public override void AddRecipes() diff --git a/Items/Accessories/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index bc4d57d665..5934412adc 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Accessories AddIngredient(12). AddIngredient(15). AddIngredient(15). - AddIngredient(15). + AddIngredient(20). AddIngredient(4). AddTile(). Register(); diff --git a/Items/Accessories/ThePact.cs b/Items/Accessories/ThePact.cs new file mode 100644 index 0000000000..3b8fef1ac1 --- /dev/null +++ b/Items/Accessories/ThePact.cs @@ -0,0 +1,63 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatBuffs; +using CalamityMod.Systems.Collections; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories +{ + public class ThePact : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Accessories"; + + public static float MaxLifeMult => 2; + public static float ChanceToBeCrit => 0.25f; + public static float CritDmgTaken => 2.25f; + public static int BoostDuration => 900; + public static int DebuffInflictionDuration => 60; + public static float NaturalRegenBoost => 1.75f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxLifeMult, ChanceToBeCrit.ToPercent(), CritDmgTaken); + + public override void SetStaticDefaults() + { + CalamityItemSets.ExtraDebuffTooltip_Enemy[Type] = [ModContent.BuffType()]; + } + + public override void SetDefaults() + { + Item.width = 46; + Item.height = 64; + Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; + Item.rare = ItemRarityID.LightRed; + Item.accessory = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.Calamity().CanBeCritByThePact = true; + + if (player.HasBuff() && player.miscCounter % 3 == 0 && player.potionDelay > 0) + { + player.potionDelay -= 1; + if (player.potionDelay < 0) + player.potionDelay = 0; + if (player.HasBuff(BuffID.PotionSickness)) + { + for (var i = 0; i < player.buffType.Length; i++) + { + if (player.buffType[i] == BuffID.PotionSickness) + { + player.buffTime[i] = player.potionDelay; + } + } + } + } + } + } +} diff --git a/Items/Accessories/ThePact.png b/Items/Accessories/ThePact.png new file mode 100644 index 0000000000..697214549b Binary files /dev/null and b/Items/Accessories/ThePact.png differ diff --git a/Items/Accessories/ThePointer.cs b/Items/Accessories/ThePointer.cs index cbf05e1b17..7d09678505 100644 --- a/Items/Accessories/ThePointer.cs +++ b/Items/Accessories/ThePointer.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using CalamityMod.Particles; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -23,12 +24,12 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.ThePointerLock); + public override void ModifyTooltips(List list) => list.IntegrateDynamicHotkey(Item); public override void UpdateAccessory(Player player, bool hideVisual) { LockOnHelper.ForceUsability = true; - if (CalamityKeybinds.ThePointerLock.JustPressed) + if (Item.JustPressedKeybind()) { LockOnHelper.Toggle(); if (LockOnHelper.AimedTarget != null) diff --git a/Items/Accessories/TheTransformer.cs b/Items/Accessories/TheTransformer.cs index fb3ba3f541..9491464ebb 100644 --- a/Items/Accessories/TheTransformer.cs +++ b/Items/Accessories/TheTransformer.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories public override void ModifyTooltips(List list) { list.FindAndReplace("[GFB]", Lang.SupportGlyphs(this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal"))); - list.IntegrateHotkey(CalamityKeybinds.TransformerHotKey); + list.IntegrateDynamicHotkey(Item); } public override void SetStaticDefaults() { diff --git a/Items/Accessories/TrinketofChi.cs b/Items/Accessories/TrinketofChi.cs index 8acc1c7521..86c6024da1 100644 --- a/Items/Accessories/TrinketofChi.cs +++ b/Items/Accessories/TrinketofChi.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Items.Accessories public override void SetDefaults() { - Item.width = 34; - Item.height = 32; + Item.width = 36; + Item.height = 54; Item.value = Item.buyPrice(gold: 10); // Sold by Shady Salesman Item.rare = ItemRarityID.Orange; Item.accessory = true; diff --git a/Items/Accessories/TrinketofChi.png b/Items/Accessories/TrinketofChi.png index 7928c1d2d8..58962b4f72 100644 Binary files a/Items/Accessories/TrinketofChi.png and b/Items/Accessories/TrinketofChi.png differ diff --git a/Items/Accessories/V8000Engine.cs b/Items/Accessories/V8000Engine.cs index 2c5b7238df..bc2401e8ba 100644 --- a/Items/Accessories/V8000Engine.cs +++ b/Items/Accessories/V8000Engine.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Accessories AddIngredient(ModContent.ItemType()). AddIngredient(ModContent.ItemType(), 5). AddIngredient(ItemID.Nanites, 200). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Accessories/VoidofCalamity.cs b/Items/Accessories/VoidofCalamity.cs index 4de3c063c4..32769385b1 100644 --- a/Items/Accessories/VoidofCalamity.cs +++ b/Items/Accessories/VoidofCalamity.cs @@ -31,8 +31,6 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.voidOfCalamity = true; player.GetDamage() += 0.12f; if (player.whoAmI == Main.myPlayer) { diff --git a/Items/Accessories/WarbanneroftheRighteous.cs b/Items/Accessories/WarbanneroftheRighteous.cs index 1b880b8310..3d86e9105a 100644 --- a/Items/Accessories/WarbanneroftheRighteous.cs +++ b/Items/Accessories/WarbanneroftheRighteous.cs @@ -2,8 +2,12 @@ using CalamityMod.CalPlayer; using CalamityMod.Cooldowns; using CalamityMod.NPCs; +using CalamityMod.NPCs.HiveMind; +using CalamityMod.NPCs.Leviathan; using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.NPCs.Perforator; using CalamityMod.Projectiles.Typeless; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -75,7 +79,7 @@ namespace CalamityMod.Items.Accessories float generousHitboxWidth = Math.Max(nPC.Hitbox.Width / 2f, nPC.Hitbox.Height / 2f) + 100; // Adds some room so max bonus isnt when you're ON the hitbox float intensity = Utils.Remap(Utils.Distance(player.Center, nPC.Center), MaxDistance + generousHitboxWidth, generousHitboxWidth, 1, 3, true); // We have to have this seperate from bonus, otherwise all effected enemies take damage based on the closest enemy - if (Utils.Distance(nPC.Center, player.Center) < MaxDistance + generousHitboxWidth && (nPC.IsAnEnemy(true, true, false) || nPC.type == ModContent.NPCType()) && !nPC.dontTakeDamage) + if (Utils.Distance(nPC.Center, player.Center) < MaxDistance + generousHitboxWidth && (nPC.IsAnEnemy(true, true, false) || nPC.type == ModContent.NPCType()) && !nPC.dontTakeDamage && !CalamityNPCSets.ProtectedHostileNPC[nPC.type]) { float minDamageMult = 0.10f; int maxTargets = 7; diff --git a/Items/Accessories/Wings/AureateBooster.cs b/Items/Accessories/Wings/AureateBooster.cs index b2f0dce8a1..0048c702c0 100644 --- a/Items/Accessories/Wings/AureateBooster.cs +++ b/Items/Accessories/Wings/AureateBooster.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Items.Accessories.Wings { CreateRecipe(). AddIngredient(ItemID.SoulofFlight, 20). - AddIngredient(5). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/Wings/ElysianWings.cs b/Items/Accessories/Wings/ElysianWings.cs index 6c0a213294..52f9814b2a 100644 --- a/Items/Accessories/Wings/ElysianWings.cs +++ b/Items/Accessories/Wings/ElysianWings.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories.Wings public override float MaxAscentSpeed => 3f; public override float BaseAscent => 0.15f; - public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(240, 10f, 3f); + public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(210, 10f, 3f); public override void SetDefaults() { diff --git a/Items/Accessories/Wings/HadalMantle.cs b/Items/Accessories/Wings/HadalMantle.cs index a0de1808f7..47936b848c 100644 --- a/Items/Accessories/Wings/HadalMantle.cs +++ b/Items/Accessories/Wings/HadalMantle.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Accessories.Wings { CreateRecipe(). AddIngredient(ItemID.SoulofFlight, 20). - AddIngredient(5). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/Wings/MoonWalkers.cs b/Items/Accessories/Wings/MoonWalkers.cs index 7915738b80..83bbec06ab 100644 --- a/Items/Accessories/Wings/MoonWalkers.cs +++ b/Items/Accessories/Wings/MoonWalkers.cs @@ -121,7 +121,6 @@ namespace CalamityMod.Items.Accessories.Wings modPlayer.angelTreads = true; } modPlayer.tracersDust = !hideVisual && toggleEnabled; - modPlayer.moonWalkers = true; } public override void AddRecipes() @@ -129,7 +128,7 @@ namespace CalamityMod.Items.Accessories.Wings CreateRecipe(). AddIngredient(). AddIngredient(ItemID.SoulofFlight,20). - AddIngredient(ItemID.LunarBar, 5). + AddIngredient(ItemID.LunarBar, 10). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Accessories/Wings/SilvaWings.cs b/Items/Accessories/Wings/SilvaWings.cs index ef7f77b57e..3fe1670b44 100644 --- a/Items/Accessories/Wings/SilvaWings.cs +++ b/Items/Accessories/Wings/SilvaWings.cs @@ -55,9 +55,9 @@ namespace CalamityMod.Items.Accessories.Wings { CreateRecipe(). AddIngredient(ItemID.SoulofFlight, 20). - AddIngredient(3). - AddIngredient(15). - AddIngredient(2). + AddIngredient(45). + AddIngredient(10). + AddIngredient(3). AddTile(). Register(); } diff --git a/Items/Accessories/Wings/SkylineWings.cs b/Items/Accessories/Wings/SkylineWings.cs index 427b82779d..3e0536db58 100644 --- a/Items/Accessories/Wings/SkylineWings.cs +++ b/Items/Accessories/Wings/SkylineWings.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Accessories.Wings public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(10). AddIngredient(ItemID.Feather, 5). AddTile(TileID.Anvils). Register(); diff --git a/Items/Accessories/Wings/SoulofCryogen.cs b/Items/Accessories/Wings/SoulofCryogen.cs index 1ee669e46a..b75906c918 100644 --- a/Items/Accessories/Wings/SoulofCryogen.cs +++ b/Items/Accessories/Wings/SoulofCryogen.cs @@ -41,7 +41,6 @@ namespace CalamityMod.Items.Accessories.Wings public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.cryogenSoul = true; if (modPlayer.wingProjectileCooldown <= 0) { if (player.controlJump && player.jump == 0 && player.velocity.Y != 0f && !player.mount.Active && !player.mount.Cart) diff --git a/Items/Accessories/Wings/StarlightWings.cs b/Items/Accessories/Wings/StarlightWings.cs index 4f3b1fb1ec..2b5ae40bee 100644 --- a/Items/Accessories/Wings/StarlightWings.cs +++ b/Items/Accessories/Wings/StarlightWings.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Accessories.Wings { CreateRecipe(). AddIngredient(ItemID.SoulofFlight, 20). - AddIngredient(5). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/Wings/TarragonWings.cs b/Items/Accessories/Wings/TarragonWings.cs index 7a1d17a559..d7485793ed 100644 --- a/Items/Accessories/Wings/TarragonWings.cs +++ b/Items/Accessories/Wings/TarragonWings.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Accessories.Wings { CreateRecipe(). AddIngredient(ItemID.SoulofFlight, 20). - AddIngredient(5). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/Wings/TiredTail.cs b/Items/Accessories/Wings/TiredTail.cs new file mode 100644 index 0000000000..2620f80d32 --- /dev/null +++ b/Items/Accessories/Wings/TiredTail.cs @@ -0,0 +1,484 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Items.Armor.Auric; +using CalamityMod.Items.Armor.Bloodflare; +using CalamityMod.Items.Armor.Demonshade; +using CalamityMod.Items.Armor.Empyrean; +using CalamityMod.Items.Armor.Fearmonger; +using CalamityMod.Items.Armor.GemTech; +using CalamityMod.Items.Armor.GodSlayer; +using CalamityMod.Items.Armor.Hydrothermic; +using CalamityMod.Items.Armor.OmegaBlue; +using CalamityMod.Items.Armor.Prismatic; +using CalamityMod.Items.Armor.Silva; +using CalamityMod.Items.Armor.Tarragon; +using CalamityMod.Items.Materials; +using CalamityMod.Rarities; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.UI.Chat; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Items.Accessories.Wings +{ + // The equip sprite is actually blank as a custom draw layer is used to draw the real sprites without any base sprites conflicting + + [AutoloadEquip(EquipType.Wings)] + public class TiredTail : BaseWings + { + public override float BonusAscentWhileFalling => 0.95f; + public override float BonusAscentWhileRising => 0.15f; + public override float RisingSpeedThreshold => 1f; + public override float MaxAscentSpeed => 4.5f; + public override float BaseAscent => 0.1f; + + float BoostPower => 3f; + + public override void SetStaticDefaults() + { + ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(210, 8.5f, 2.88f, true, 16, 10f); + } + + public override void SetDefaults() + { + base.SetDefaults(); + Item.width = 22; + Item.height = 20; + Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; + Item.rare = ModContent.RarityType(); + Item.Calamity().devItem = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + if (!hideVisual) + player.GetModPlayer().tiredTailDraw = true; + if (player.velocity.Y != 0) + { + if (player.dashDelay != -1) //This differs from Starboard - Starboard checks for 1 full second passing after a dash begun, while this happens as soon as the dash ends + player.runSlowdown *= 6; + } + + + } + + public override void UpdateVanity(Player player) + { + player.GetModPlayer().tiredTailDraw = true; + } + + public override bool WingUpdate(Player player, bool inUse) => true; + + public override void AdditionalFlightMovement(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) + { + if (player.TryingToHoverDown && player.controlJump && player.wingTime > 0f && !player.merman) + { + player.wingTime += 0.5f; + player.velocity.Y *= 0.8f; + if (player.velocity.Y > -2f && player.velocity.Y < 1f) + player.velocity.Y = 1E-05f; + + ascentWhenFalling *= 0f; + ascentWhenRising *= 0f; + constantAscend *= 0f; + } + if (player.TryingToHoverUp) + { + ascentWhenFalling *= BoostPower; + ascentWhenRising *= BoostPower; + maxCanAscendMultiplier /= 1.5f; + maxAscentMultiplier /= 1.5f; + constantAscend *= BoostPower; + player.wingTime -= 1; + } + } + + public override void AddRecipes() + { + + CreateRecipe(). + AddIngredient(3). + AddIngredient(ItemID.Sapphire). + AddTile(TileID.DemonAltar). + Register(); + } + } + + public class TiredTailPlayer : ModPlayer + { + public bool tiredTailDraw = false; + public List<(Vector2 pos, float rot)> tailPos; + public override void ResetEffects() + { + //Handled here to prevent issues with instancing of chat tags + if (TiredTailTextEffects.displayTimer > 0) + { + TiredTailTextEffects.expansionFactor += 0.033f; + + TiredTailTextEffects.displayTimer -= 1; + } + else + { + TiredTailTextEffects.expansionFactor = 0f; + } + + tiredTailDraw = false; + } + public override void PostUpdate() + { + if (tiredTailDraw) + { + if (tailPos == null) + { + tailPos = new(); + for (var i = 0; i < 3; i++) + { + + tailPos.Add(new(Player.Center, 0)); + } + } + for (var i = 0; i < tailPos.Count; i++) + { + Vector2 nextCent = Vector2.Zero; + float nextRot = 0; + if (i == 0) + { + nextCent = Player.Center + new Vector2(0, 6); + nextRot = new Vector2(Player.direction, -0.325f).ToRotation(); + } + else + { + nextCent = tailPos[i - 1].Item1; + nextRot = tailPos[i - 1].Item2; + } + + Vector2 destinationOffset = nextCent - tailPos[i].Item1; + if (nextRot != tailPos[i].Item2) + { + float angle = MathHelper.WrapAngle(nextRot - tailPos[i].Item2); + destinationOffset = destinationOffset.RotatedBy(angle * 0.1f); + } + var rotation = destinationOffset.ToRotation(); + + var center = nextCent - destinationOffset.SafeNormalize(Vector2.Zero) * (14 * 1); + if (i == tailPos.Count - 1) + { + center = nextCent - destinationOffset.SafeNormalize(Vector2.Zero) * (21 * 1); + } + tailPos[i] = new(center, rotation); + } + } + else + { + tailPos = null; + } + } + } + public class TailDraw : PlayerDrawLayer + { + List ColorPallettes = new(); + public override void SetStaticDefaults() + { + if (Main.netMode != NetmodeID.Server) + Main.QueueMainThreadAction(() => + { + //Load palettes automatically + var texture = ModContent.Request("CalamityMod/Items/Accessories/Wings/TiredTailPallette", ReLogic.Content.AssetRequestMode.ImmediateLoad).Value; + var BaseArray = new Color[texture.Width * texture.Height]; + texture.GetData(BaseArray); + List pal = new(); + for (var i = 0; i < BaseArray.Length; i++) + { + if (i % texture.Width == 0) + { + if (pal.Count > 0) + ColorPallettes.Add(pal.ToArray()); + pal = new(); + } + pal.Add(BaseArray[i].ToVector4()); + } + ColorPallettes.Add(pal.ToArray()); + ArmorPallettes = + [ + //silva + ([ItemType(),ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[2]), + //god slayer + ([ItemType(),ItemType(),ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[3]), + //hydro + ([ItemType(),ItemType(),ItemType(),ItemType(),ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[4]), + //auric + ([ItemType(),ItemType(),ItemType(),ItemType(),ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[5]), + //fearmonger + ([ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[6]), + //Bloodlfare + ([ItemType(),ItemType(),ItemType(),ItemType(),ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[7]), + //Tarragon + ([ItemType(),ItemType(),ItemType(),ItemType(),ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[8]), + //Omega Blue + ([ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[9]), + //Gem Tech + ([ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[10]), + //Demonshade + ([ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[11]), + //Prismatic + ([ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[12]), + //Empyrean + ([ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[13]), + //Solar + ([ItemID.SolarFlareHelmet], + [ItemID.SolarFlareBreastplate], + [ItemID.SolarFlareLeggings], + ColorPallettes[14]), + //Vortex + ([ItemID.VortexHelmet], + [ItemID.VortexBreastplate], + [ItemID.VortexLeggings], + ColorPallettes[15]), + //Nebula + ([ItemID.NebulaHelmet], + [ItemID.NebulaBreastplate], + [ItemID.NebulaLeggings], + ColorPallettes[16]), + //Stardust + ([ItemID.StardustHelmet], + [ItemID.StardustBreastplate], + [ItemID.StardustLeggings], + ColorPallettes[17]), + ]; + }); + + } + + List<(List heads, List bodies, List legs, Vector4[] pallette)> ArmorPallettes = []; + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) => true; + + public override Position GetDefaultPosition() => new BeforeParent(PlayerDrawLayers.Wings); + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + var player = drawInfo.drawPlayer; + var modplayer = drawInfo.drawPlayer.GetModPlayer(); + var tex1 = Request("CalamityMod/Items/Accessories/Wings/TiredTailSegment").Value; + var tex2 = Request("CalamityMod/Items/Accessories/Wings/TiredTailTail").Value; + if (modplayer.tailPos != null) + { + var TargetPallette = ColorPallettes[1]; + foreach (var item in ArmorPallettes) + { + if ((item.heads.Count == 0 || item.heads.Any(x => ContentSamples.ItemsByType[x].headSlot == player.head)) + && (item.bodies.Count == 0 || item.bodies.Any(x => ContentSamples.ItemsByType[x].bodySlot == player.body)) + && (item.legs.Count == 0 || item.legs.Any(x => ContentSamples.ItemsByType[x].legSlot == player.legs))) + { + TargetPallette = item.pallette; + break; + } + } + //manual override for Empyrean's transform to work + if (player.Calamity().meldTransformationPower || player.Calamity().meldTransformationForce) + { + TargetPallette = ArmorPallettes.First(x => x.heads.Contains(ItemType())).pallette; + } + using var SegmentLease = RenderTargetPool.Shared.Rent(Main.instance.GraphicsDevice, tex1.Width, tex1.Height); + using var TailLease = RenderTargetPool.Shared.Rent(Main.instance.GraphicsDevice, tex2.Width, tex2.Height); + using (Main.spriteBatch.Scope()) + { + using (SegmentLease.Scope(clearColor: Color.Transparent)) + { + var shaderSnap = new SpriteBatchSnapshot(); + shaderSnap.SortMode = SpriteSortMode.Immediate; + shaderSnap.SamplerState = SamplerState.PointClamp; + shaderSnap.TransformMatrix = Matrix.identity; + Main.spriteBatch.Begin(shaderSnap); + + MiscShaderData paletteSwap = GameShaders.Misc["CalamityMod:PaletteSwap"]; + paletteSwap.Shader.Parameters["sourcePalette"].SetValue(ColorPallettes[0]); + paletteSwap.Shader.Parameters["paletteSize"].SetValue(ColorPallettes[0].Length); + paletteSwap.Shader.Parameters["targetPalette"].SetValue(TargetPallette); + paletteSwap.Shader.Parameters["matchThreshold"].SetValue(0.0001f); + paletteSwap.Apply(); + Main.spriteBatch.Draw(tex1, Vector2.Zero, Color.White); + Main.spriteBatch.End(); + } + using (TailLease.Scope(clearColor: Color.Transparent)) + { + var shaderSnap = new SpriteBatchSnapshot(); + shaderSnap.SortMode = SpriteSortMode.Immediate; + shaderSnap.SamplerState = SamplerState.PointClamp; + shaderSnap.TransformMatrix = Matrix.identity; + Main.spriteBatch.Begin(shaderSnap); + + MiscShaderData paletteSwap = GameShaders.Misc["CalamityMod:PaletteSwap"]; + paletteSwap.Shader.Parameters["sourcePalette"].SetValue(ColorPallettes[0]); + paletteSwap.Shader.Parameters["paletteSize"].SetValue(ColorPallettes[0].Length); + paletteSwap.Shader.Parameters["targetPalette"].SetValue(TargetPallette); + paletteSwap.Shader.Parameters["matchThreshold"].SetValue(0.01f); + paletteSwap.Apply(); + Main.spriteBatch.Draw(tex2, Vector2.Zero, Color.White); + Main.spriteBatch.End(); + } + } + var calamityPlayer = drawInfo.drawPlayer.Calamity(); + //Copied from the rogue steallth visuals + // TODO -- rogue stealth visuals are an utter catastrophe and should be fully destroyed on next stealth rework + float r = 1; + float g = 1; + float b = 1; + float a = 1; + if (calamityPlayer.rogueStealth > 0f && calamityPlayer.rogueStealthMax > 0f && drawInfo.drawPlayer.townNPCs < 3f && CalamityClientConfig.Instance.StealthInvisibility) + { + // A translucent orchid color, the rogue class color + float colorValue = calamityPlayer.rogueStealth / calamityPlayer.rogueStealthMax * 0.9f; //0 to 0.9 + r = 1f - (colorValue * 0.89f); //255 to 50 + g = 1f - colorValue; //255 to 25 + b = 1f - (colorValue * 0.89f); //255 to 50 + a = 1f - colorValue; //255 to 25 + } + + for (var i = modplayer.tailPos.Count - 1; i >= 0; i--) + { + var color2 = Lighting.GetColor(modplayer.tailPos[i].pos.ToTileCoordinates()); + var color = new Color((int)(color2.R * r), (int)(color2.G * g), (int)(color2.B * b), (int)(color2.A * a)); + if (i == modplayer.tailPos.Count - 1) + { + drawInfo.DrawDataCache.Add(new(TailLease.Target, modplayer.tailPos[i].pos - Main.screenPosition, null, color, modplayer.tailPos[i].rot + (float)Math.PI, tex2.Size() / 2f, 1f, SpriteEffects.None, 0)); + } + else + { + drawInfo.DrawDataCache.Add(new(SegmentLease.Target, modplayer.tailPos[i].pos - Main.screenPosition, null, color, modplayer.tailPos[i].rot + (float)Math.PI, tex1.Size() / 2f, 1f, SpriteEffects.None, 0)); + } + } + } + + } + } + + public sealed class TiredTailTextEffects(string text) : TextSnippet + { + //Handled by TiredTailPlayer as this effect is for TiredTail + public static float expansionFactor = 0; + public static int displayTimer = 0; + public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = new Vector2(), Color color = new Color(), float scale = 1) + { + //size = new Vector2(GetStringLength(FontAssets.MouseText.Value), FontAssets.MouseText.Value.MeasureString(" ").Y * scale); + + if (color == default || color == Main.MouseTextColorReal) + { + color = Colors.AlphaDarken(HotPink.TextColor); + } + var textarray = text.ToArray(); + for (var i = 0; i < textarray.Length; i++) + { + if (expansionFactor - 10 > i) + { + textarray[i] = (i == 0 ? 'ɔ' : '»'); + } + } + var textToDraw = new string(textarray); + + size = FontAssets.MouseText.Value.MeasureString(textToDraw) * scale; + + if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0)) + { + var pos = position; + using var lease = ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice); + string txt = ""; + var matrix = spriteBatch.transformMatrix; + using (spriteBatch.Scope()) + { + using (lease.Scope(clearColor: Color.Transparent)) + { + var max = FontAssets.MouseText.Value.MeasureString(text) * Math.Min(1f, expansionFactor); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, matrix); + + foreach (var item in textarray) + {//new(92,83,117) + pos = position; + pos.X += Math.Min(FontAssets.MouseText.Value.MeasureString(txt).X, max.X + 9999); + float sin = (MathF.Sin(pos.X * 0.02f + Main.GlobalTimeWrappedHourly * -1.5f) + 1) * 0.5f; + float sin2 = (MathF.Sin(pos.X * 0.02f + Main.GlobalTimeWrappedHourly * -0.9f) + 1) * 0.5f; + float sin3 = MathF.Sin(pos.X * 0.02f + Main.GlobalTimeWrappedHourly * -1.5f + MathHelper.PiOver2); + var c = new Color(171, 153, 204); + if (txt.Length == 0 || txt.Length == text.Length - 1) + c = Color.Cyan; + else if (txt.Length % 4 == 3) + { + c = Color.HotPink; + } + c = Color.Lerp(Colors.AlphaDarken(new Color(0, 255, 200)), c, MathHelper.Clamp(expansionFactor - 2, 0, 1)); + float posMult = Math.Max(MathHelper.Clamp((expansionFactor - 10) * 0.5f, 0, 3), MathHelper.Clamp((expansionFactor - 2) * 0.5f, 0, 1)); + var origin = FontAssets.MouseText.Value.MeasureString(item.ToString()) * 0.5f; + ChatManager.DrawColorCodedString(spriteBatch, FontAssets.MouseText.Value, item.ToString(), origin + pos + new Vector2(0, item == 'ɔ' ? -1 : 0) + new Vector2((-2f + 4 * sin2) * posMult, (-2 + sin * 4) * posMult), c, sin3 * posMult * 0.1f, origin, new Vector2(scale)); + txt += item; + } + spriteBatch.End(); + } + + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + foreach (var item in ChatManager.ShadowDirections) + { + spriteBatch.Draw(lease.Target, Vector2.Zero + Vector2.TransformNormal(item * 2, matrix), null, Color.Black, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.End(); + } + } + return true; + } + + public override void Update() + { + displayTimer = 10; + } + public override float GetStringLength(DynamicSpriteFont font) + { + float size = font.MeasureString(text).X; + return size * Scale; + } + } +} diff --git a/Items/Accessories/Wings/TiredTail.png b/Items/Accessories/Wings/TiredTail.png new file mode 100644 index 0000000000..5f61600e97 Binary files /dev/null and b/Items/Accessories/Wings/TiredTail.png differ diff --git a/Items/Accessories/Wings/TiredTailPallette.png b/Items/Accessories/Wings/TiredTailPallette.png new file mode 100644 index 0000000000..602c4336bd Binary files /dev/null and b/Items/Accessories/Wings/TiredTailPallette.png differ diff --git a/Items/Accessories/Wings/TiredTailSegment.png b/Items/Accessories/Wings/TiredTailSegment.png new file mode 100644 index 0000000000..33aad216b1 Binary files /dev/null and b/Items/Accessories/Wings/TiredTailSegment.png differ diff --git a/Items/Accessories/Wings/TiredTailTail.png b/Items/Accessories/Wings/TiredTailTail.png new file mode 100644 index 0000000000..768b71bc8e Binary files /dev/null and b/Items/Accessories/Wings/TiredTailTail.png differ diff --git a/Items/Accessories/Wings/TiredTail_Wings.png b/Items/Accessories/Wings/TiredTail_Wings.png new file mode 100644 index 0000000000..08ddcaa27a Binary files /dev/null and b/Items/Accessories/Wings/TiredTail_Wings.png differ diff --git a/Items/Accessories/Wings/VoidStriders.cs b/Items/Accessories/Wings/VoidStriders.cs index 5dd34f3139..261524e395 100644 --- a/Items/Accessories/Wings/VoidStriders.cs +++ b/Items/Accessories/Wings/VoidStriders.cs @@ -123,7 +123,6 @@ namespace CalamityMod.Items.Accessories.Wings modPlayer.angelTreads = true; } modPlayer.tracersDust = !hideVisual && toggleEnabled; - modPlayer.voidStriders = true; } public override void AddRecipes() diff --git a/Items/Accessories/WulfrumAcrobaticsPack.cs b/Items/Accessories/WulfrumAcrobaticsPack.cs index b9f1911f34..263560efa6 100644 --- a/Items/Accessories/WulfrumAcrobaticsPack.cs +++ b/Items/Accessories/WulfrumAcrobaticsPack.cs @@ -51,9 +51,9 @@ namespace CalamityMod.Items.Accessories public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(10). AddIngredient(). - AddIngredient(ItemID.Chain, 2). + AddIngredient(ItemID.Chain, 3). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Ammo/BloodfireArrow.cs b/Items/Ammo/BloodfireArrow.cs index 6fd88990ef..f837f16b33 100644 --- a/Items/Ammo/BloodfireArrow.cs +++ b/Items/Ammo/BloodfireArrow.cs @@ -34,7 +34,8 @@ namespace CalamityMod.Items.Ammo public override void AddRecipes() { CreateRecipe(333). - AddIngredient(). + AddIngredient(). + AddIngredient(). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Ammo/BloodfireBullet.cs b/Items/Ammo/BloodfireBullet.cs index 91630337cb..8ce5c795ef 100644 --- a/Items/Ammo/BloodfireBullet.cs +++ b/Items/Ammo/BloodfireBullet.cs @@ -34,7 +34,8 @@ namespace CalamityMod.Items.Ammo public override void AddRecipes() { CreateRecipe(333). - AddIngredient(). + AddIngredient(). + AddIngredient(). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Ammo/CinderArrow.cs b/Items/Ammo/CinderArrow.cs index 1d647a03d4..30b7a18227 100644 --- a/Items/Ammo/CinderArrow.cs +++ b/Items/Ammo/CinderArrow.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Ammo { Item.width = 22; Item.height = 36; - Item.damage = 12; + Item.damage = 17; Item.DamageType = DamageClass.Ranged; Item.maxStack = Item.CommonMaxStack; Item.consumable = true; diff --git a/Items/Ammo/DryadsTear.cs b/Items/Ammo/DryadsTear.cs index c71578ffd1..cbbf0de76c 100644 --- a/Items/Ammo/DryadsTear.cs +++ b/Items/Ammo/DryadsTear.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Ammo { Item.width = 8; Item.height = 8; - Item.damage = 10; + Item.damage = 18; Item.DamageType = DamageClass.Ranged; Item.maxStack = Item.CommonMaxStack; Item.consumable = true; diff --git a/Items/Ammo/ElysianArrow.cs b/Items/Ammo/ElysianArrow.cs index c5533bdfe1..a4bd1b0057 100644 --- a/Items/Ammo/ElysianArrow.cs +++ b/Items/Ammo/ElysianArrow.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Ammo { Item.width = 22; Item.height = 36; - Item.damage = 15; + Item.damage = 20; Item.DamageType = DamageClass.Ranged; Item.maxStack = Item.CommonMaxStack; Item.consumable = true; diff --git a/Items/Ammo/HailstormBullet.cs b/Items/Ammo/HailstormBullet.cs index db811b79bc..4abdfbf323 100644 --- a/Items/Ammo/HailstormBullet.cs +++ b/Items/Ammo/HailstormBullet.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Ammo { Item.width = 14; Item.height = 20; - Item.damage = 12; + Item.damage = 9; Item.DamageType = DamageClass.Ranged; Item.consumable = true; Item.knockBack = 2f; diff --git a/Items/Ammo/VeriumBolt.cs b/Items/Ammo/VeriumBolt.cs index ae59a0bc45..9749a1b5b8 100644 --- a/Items/Ammo/VeriumBolt.cs +++ b/Items/Ammo/VeriumBolt.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Ammo { Item.width = 8; Item.height = 8; - Item.damage = 11; + Item.damage = 15; Item.DamageType = DamageClass.Ranged; Item.maxStack = Item.CommonMaxStack; Item.consumable = true; diff --git a/Items/Armor/Aerospec/AerospecBreastplate.cs b/Items/Armor/Aerospec/AerospecBreastplate.cs index 46b8982385..d11b0a2c1d 100644 --- a/Items/Armor/Aerospec/AerospecBreastplate.cs +++ b/Items/Armor/Aerospec/AerospecBreastplate.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Armor.Aerospec public override void AddRecipes() { CreateRecipe(). - AddIngredient(15). + AddIngredient(20). AddIngredient(ItemID.Feather, 2). AddTile(TileID.Anvils). Register(); diff --git a/Items/Armor/Aerospec/AerospecHeadMagic.cs b/Items/Armor/Aerospec/AerospecHeadMagic.cs index 19435bdd7d..ca262b9bd4 100644 --- a/Items/Armor/Aerospec/AerospecHeadMagic.cs +++ b/Items/Armor/Aerospec/AerospecHeadMagic.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Armor.Aerospec public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(10). AddIngredient(ItemID.Feather). AddTile(TileID.Anvils). SortBeforeFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/Aerospec/AerospecHeadMelee.cs b/Items/Armor/Aerospec/AerospecHeadMelee.cs index b57eada540..aa945e437e 100644 --- a/Items/Armor/Aerospec/AerospecHeadMelee.cs +++ b/Items/Armor/Aerospec/AerospecHeadMelee.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Armor.Aerospec public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(10). AddIngredient(ItemID.Feather). AddTile(TileID.Anvils). SortBeforeFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/Aerospec/AerospecHeadRanged.cs b/Items/Armor/Aerospec/AerospecHeadRanged.cs index 39ea869177..4b13b777a4 100644 --- a/Items/Armor/Aerospec/AerospecHeadRanged.cs +++ b/Items/Armor/Aerospec/AerospecHeadRanged.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Armor.Aerospec public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(10). AddIngredient(ItemID.Feather). AddTile(TileID.Anvils). SortAfterFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/Aerospec/AerospecHeadRogue.cs b/Items/Armor/Aerospec/AerospecHeadRogue.cs index de0f62a21d..70bf01d7ba 100644 --- a/Items/Armor/Aerospec/AerospecHeadRogue.cs +++ b/Items/Armor/Aerospec/AerospecHeadRogue.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Items.Armor.Aerospec public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(10). AddIngredient(ItemID.Feather). AddTile(TileID.Anvils). SortAfterFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/Aerospec/AerospecHeadSummon.cs b/Items/Armor/Aerospec/AerospecHeadSummon.cs index f7d31c08be..3e71483098 100644 --- a/Items/Armor/Aerospec/AerospecHeadSummon.cs +++ b/Items/Armor/Aerospec/AerospecHeadSummon.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Items.Armor.Aerospec public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(10). AddIngredient(ItemID.Feather). AddTile(TileID.Anvils). SortBeforeFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/Aerospec/AerospecLeggings.cs b/Items/Armor/Aerospec/AerospecLeggings.cs index 202f00ed8f..845d544d6c 100644 --- a/Items/Armor/Aerospec/AerospecLeggings.cs +++ b/Items/Armor/Aerospec/AerospecLeggings.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Armor.Aerospec public override void AddRecipes() { CreateRecipe(). - AddIngredient(10). + AddIngredient(15). AddIngredient(ItemID.Feather, 2). AddTile(TileID.Anvils). Register(); diff --git a/Items/Armor/Astral/AstralBreastplate.cs b/Items/Armor/Astral/AstralBreastplate.cs index 1e8a002664..56e441ef7c 100644 --- a/Items/Armor/Astral/AstralBreastplate.cs +++ b/Items/Armor/Astral/AstralBreastplate.cs @@ -36,8 +36,7 @@ namespace CalamityMod.Items.Armor.Astral public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). - AddIngredient(ItemID.MeteoriteBar, 9). + AddIngredient(24). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Armor/Astral/AstralHelm.cs b/Items/Armor/Astral/AstralHelm.cs index 6458df3a5a..6b93ddc9de 100644 --- a/Items/Armor/Astral/AstralHelm.cs +++ b/Items/Armor/Astral/AstralHelm.cs @@ -110,8 +110,7 @@ namespace CalamityMod.Items.Armor.Astral public override void AddRecipes() { CreateRecipe(). - AddIngredient(8). - AddIngredient(ItemID.MeteoriteBar, 6). + AddIngredient(12). AddTile(TileID.LunarCraftingStation). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Astral/AstralLeggings.cs b/Items/Armor/Astral/AstralLeggings.cs index ec9a0d4f04..80bc512397 100644 --- a/Items/Armor/Astral/AstralLeggings.cs +++ b/Items/Armor/Astral/AstralLeggings.cs @@ -33,8 +33,7 @@ namespace CalamityMod.Items.Armor.Astral public override void AddRecipes() { CreateRecipe(). - AddIngredient(10). - AddIngredient(ItemID.MeteoriteBar, 8). + AddIngredient(18). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Armor/Auric/AuricTeslaBodyArmor.cs b/Items/Armor/Auric/AuricTeslaBodyArmor.cs index 4b2eae5319..87adef91cc 100644 --- a/Items/Armor/Auric/AuricTeslaBodyArmor.cs +++ b/Items/Armor/Auric/AuricTeslaBodyArmor.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Items.Armor.Auric AddIngredient(). AddIngredient(). AddIngredient(). - AddIngredient(18). + AddIngredient(20). AddTile(). Register(); @@ -80,7 +80,7 @@ namespace CalamityMod.Items.Armor.Auric AddIngredient(). AddIngredient(). AddIngredient(). - AddIngredient(18). + AddIngredient(20). AddTile(). Register(); } diff --git a/Items/Armor/Auric/AuricTeslaHeadMagic.cs b/Items/Armor/Auric/AuricTeslaHeadMagic.cs index e4a908579e..1971055fb5 100644 --- a/Items/Armor/Auric/AuricTeslaHeadMagic.cs +++ b/Items/Armor/Auric/AuricTeslaHeadMagic.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Items.Armor.Auric AddIngredient(). AddIngredient(). AddIngredient(). - AddIngredient(12). + AddIngredient(10). AddTile(). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Auric/AuricTeslaHeadMelee.cs b/Items/Armor/Auric/AuricTeslaHeadMelee.cs index feb38df486..69c73aab3d 100644 --- a/Items/Armor/Auric/AuricTeslaHeadMelee.cs +++ b/Items/Armor/Auric/AuricTeslaHeadMelee.cs @@ -52,9 +52,8 @@ namespace CalamityMod.Items.Armor.Auric modPlayer.bloodflareSet = true; modPlayer.bloodflareMelee = true; modPlayer.godSlayer = true; - modPlayer.godSlayerDamage = true; + modPlayer.godSlayerMelee = true; modPlayer.auricSet = true; - modPlayer.auricSetMelee = true; player.aggro += SetBonusAggroBoost; if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID)) @@ -104,7 +103,7 @@ namespace CalamityMod.Items.Armor.Auric AddIngredient(). AddIngredient(). AddIngredient(). - AddIngredient(12). + AddIngredient(10). AddTile(). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Auric/AuricTeslaHeadRanged.cs b/Items/Armor/Auric/AuricTeslaHeadRanged.cs index acd69acec9..90ea45c870 100644 --- a/Items/Armor/Auric/AuricTeslaHeadRanged.cs +++ b/Items/Armor/Auric/AuricTeslaHeadRanged.cs @@ -100,7 +100,7 @@ namespace CalamityMod.Items.Armor.Auric AddIngredient(). AddIngredient(). AddIngredient(). - AddIngredient(12). + AddIngredient(10). AddTile(). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Auric/AuricTeslaHeadRogue.cs b/Items/Armor/Auric/AuricTeslaHeadRogue.cs index ffe8c73ddf..7dfee1ddac 100644 --- a/Items/Armor/Auric/AuricTeslaHeadRogue.cs +++ b/Items/Armor/Auric/AuricTeslaHeadRogue.cs @@ -50,7 +50,6 @@ namespace CalamityMod.Items.Armor.Auric modPlayer.tarraSet = true; modPlayer.tarraThrowing = true; modPlayer.bloodflareSet = true; - modPlayer.bloodflareThrowing = true; modPlayer.godSlayer = true; modPlayer.godSlayerThrowing = true; modPlayer.auricSet = true; @@ -87,8 +86,8 @@ namespace CalamityMod.Items.Armor.Auric Color[] armorColors = { AuricTeslaBodyArmor.tooltipTarragonColor, AuricTeslaBodyArmor.tooltipBloodflareColor, AuricTeslaBodyArmor.tooltipGodslayerColor }; var LocalizedText = CalamityUtils.GetTextFromModItem(Type, $"SetBonus{setBonusTooltipNumber}"); line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(RogueDamageBoostAtFullHealth.ToPercent(), SetBonusHurtDamageThreshold, CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(), GodSlayerChestplate.DashCooldown.FramesToSeconds()) - : setBonusTooltipNumber == 2 ? LocalizedText.Format(DefenseBoostAboveHealthThreshold, DefenseBoostHealthThreshold.ToPercent()) - : LocalizedText.Format(CritsToActivateImmunity, ImmunityDuration.FramesToSeconds(), ImmunityCooldown.FramesToSeconds(), RogueDamageBoostWhileDebuffed.ToPercent())); + : setBonusTooltipNumber == 2 ? LocalizedText.ToString() + : LocalizedText.Format(CritsToActivateImmunity, ImmunityDuration.FramesToSeconds(), ImmunityCooldown.FramesToSeconds())); line.OverrideColor = armorColors[setBonusTooltipNumber - 1]; } } @@ -105,7 +104,7 @@ namespace CalamityMod.Items.Armor.Auric AddIngredient(). AddIngredient(). AddIngredient(). - AddIngredient(12). + AddIngredient(10). AddTile(). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Auric/AuricTeslaHeadSummon.cs b/Items/Armor/Auric/AuricTeslaHeadSummon.cs index 206c06785e..f6a84997c7 100644 --- a/Items/Armor/Auric/AuricTeslaHeadSummon.cs +++ b/Items/Armor/Auric/AuricTeslaHeadSummon.cs @@ -101,7 +101,7 @@ namespace CalamityMod.Items.Armor.Auric AddIngredient(). AddIngredient(). AddIngredient(). - AddIngredient(12). + AddIngredient(10). AddTile(). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Bloodflare/BloodflareBodyArmor.cs b/Items/Armor/Bloodflare/BloodflareBodyArmor.cs index 5dcf752f3e..8dbef44c5c 100644 --- a/Items/Armor/Bloodflare/BloodflareBodyArmor.cs +++ b/Items/Armor/Bloodflare/BloodflareBodyArmor.cs @@ -34,7 +34,8 @@ namespace CalamityMod.Items.Armor.Bloodflare public override void AddRecipes() { CreateRecipe(). - AddIngredient(16). + AddIngredient(50). + AddIngredient(20). AddIngredient(4). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Armor/Bloodflare/BloodflareCuisses.cs b/Items/Armor/Bloodflare/BloodflareCuisses.cs index b037201ed0..71b45a6b0c 100644 --- a/Items/Armor/Bloodflare/BloodflareCuisses.cs +++ b/Items/Armor/Bloodflare/BloodflareCuisses.cs @@ -36,7 +36,8 @@ namespace CalamityMod.Items.Armor.Bloodflare public override void AddRecipes() { CreateRecipe(). - AddIngredient(13). + AddIngredient(35). + AddIngredient(15). AddIngredient(3). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Armor/Bloodflare/BloodflareHeadMagic.cs b/Items/Armor/Bloodflare/BloodflareHeadMagic.cs index c4f3fea04a..8b66f597f7 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadMagic.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadMagic.cs @@ -59,7 +59,8 @@ namespace CalamityMod.Items.Armor.Bloodflare public override void AddRecipes() { CreateRecipe(). - AddIngredient(11). + AddIngredient(25). + AddIngredient(10). AddIngredient(2). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/Bloodflare/BloodflareHeadMelee.cs b/Items/Armor/Bloodflare/BloodflareHeadMelee.cs index ff42b9d5dd..b18a7a335a 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadMelee.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadMelee.cs @@ -59,7 +59,8 @@ namespace CalamityMod.Items.Armor.Bloodflare public override void AddRecipes() { CreateRecipe(). - AddIngredient(11). + AddIngredient(25). + AddIngredient(10). AddIngredient(2). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/Bloodflare/BloodflareHeadRanged.cs b/Items/Armor/Bloodflare/BloodflareHeadRanged.cs index f4c1376e75..45437ee384 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadRanged.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadRanged.cs @@ -60,7 +60,8 @@ namespace CalamityMod.Items.Armor.Bloodflare public override void AddRecipes() { CreateRecipe(). - AddIngredient(11). + AddIngredient(25). + AddIngredient(10). AddIngredient(2). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/Bloodflare/BloodflareHeadRogue.cs b/Items/Armor/Bloodflare/BloodflareHeadRogue.cs index 230ad7fed4..03c8191af6 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadRogue.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadRogue.cs @@ -21,8 +21,6 @@ namespace CalamityMod.Items.Armor.Bloodflare // Set Bonus public static float SetBonusRogueStealth = 1.2f; - public static int DefenseBoostAboveHealthThreshold = 30; - public static float DefenseBoostHealthThreshold = 0.8f; public override void SetDefaults() { @@ -41,10 +39,9 @@ namespace CalamityMod.Items.Armor.Bloodflare { var modPlayer = player.Calamity(); modPlayer.bloodflareSet = true; - modPlayer.bloodflareThrowing = true; modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), DefenseBoostAboveHealthThreshold, DefenseBoostHealthThreshold.ToPercent()); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth()); } public override void UpdateEquip(Player player) @@ -58,7 +55,8 @@ namespace CalamityMod.Items.Armor.Bloodflare public override void AddRecipes() { CreateRecipe(). - AddIngredient(11). + AddIngredient(25). + AddIngredient(10). AddIngredient(2). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/Bloodflare/BloodflareHeadSummon.cs b/Items/Armor/Bloodflare/BloodflareHeadSummon.cs index 2748a27213..ca4323039d 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadSummon.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadSummon.cs @@ -59,7 +59,8 @@ namespace CalamityMod.Items.Armor.Bloodflare public override void AddRecipes() { CreateRecipe(). - AddIngredient(11). + AddIngredient(25). + AddIngredient(10). AddIngredient(2). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/Brimflame/BrimflameBoots.cs b/Items/Armor/Brimflame/BrimflameBoots.cs index 76732610d6..3f7c688699 100644 --- a/Items/Armor/Brimflame/BrimflameBoots.cs +++ b/Items/Armor/Brimflame/BrimflameBoots.cs @@ -34,8 +34,8 @@ namespace CalamityMod.Items.Armor.Brimflame public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). - AddIngredient(3). + AddIngredient(10). + AddIngredient(6). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Armor/Brimflame/BrimflameCowl.cs b/Items/Armor/Brimflame/BrimflameCowl.cs index 753d63d6ab..e433b7f052 100644 --- a/Items/Armor/Brimflame/BrimflameCowl.cs +++ b/Items/Armor/Brimflame/BrimflameCowl.cs @@ -67,8 +67,8 @@ namespace CalamityMod.Items.Armor.Brimflame public override void AddRecipes() { CreateRecipe(). + AddIngredient(8). AddIngredient(4). - AddIngredient(2). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Brimflame/BrimflameRobes.cs b/Items/Armor/Brimflame/BrimflameRobes.cs index e729bb80ae..1d622d7dc7 100644 --- a/Items/Armor/Brimflame/BrimflameRobes.cs +++ b/Items/Armor/Brimflame/BrimflameRobes.cs @@ -44,8 +44,8 @@ namespace CalamityMod.Items.Armor.Brimflame public override void AddRecipes() { CreateRecipe(). + AddIngredient(12). AddIngredient(8). - AddIngredient(4). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Daedalus/DaedalusBreastplate.cs b/Items/Armor/Daedalus/DaedalusBreastplate.cs index 1b29e447df..c9ddda3988 100644 --- a/Items/Armor/Daedalus/DaedalusBreastplate.cs +++ b/Items/Armor/Daedalus/DaedalusBreastplate.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Armor.Daedalus public override void AddRecipes() { CreateRecipe(). - AddIngredient(15). + AddIngredient(24). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Armor/Daedalus/DaedalusHeadMagic.cs b/Items/Armor/Daedalus/DaedalusHeadMagic.cs index 188e83ea26..53d96f4232 100644 --- a/Items/Armor/Daedalus/DaedalusHeadMagic.cs +++ b/Items/Armor/Daedalus/DaedalusHeadMagic.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Armor.Daedalus public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(12). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Daedalus/DaedalusHeadMelee.cs b/Items/Armor/Daedalus/DaedalusHeadMelee.cs index e5e8e4b668..453fc420c9 100644 --- a/Items/Armor/Daedalus/DaedalusHeadMelee.cs +++ b/Items/Armor/Daedalus/DaedalusHeadMelee.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Armor.Daedalus public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(12). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Daedalus/DaedalusHeadRanged.cs b/Items/Armor/Daedalus/DaedalusHeadRanged.cs index 0eadffe839..a52e3a6e8e 100644 --- a/Items/Armor/Daedalus/DaedalusHeadRanged.cs +++ b/Items/Armor/Daedalus/DaedalusHeadRanged.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Armor.Daedalus public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(12). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Daedalus/DaedalusHeadRogue.cs b/Items/Armor/Daedalus/DaedalusHeadRogue.cs index 2007d1a7df..cce4c68ae0 100644 --- a/Items/Armor/Daedalus/DaedalusHeadRogue.cs +++ b/Items/Armor/Daedalus/DaedalusHeadRogue.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Items.Armor.Daedalus public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(12). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Daedalus/DaedalusHeadSummon.cs b/Items/Armor/Daedalus/DaedalusHeadSummon.cs index 2b2026327c..727f0b4279 100644 --- a/Items/Armor/Daedalus/DaedalusHeadSummon.cs +++ b/Items/Armor/Daedalus/DaedalusHeadSummon.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Items.Armor.Daedalus public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(12). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Daedalus/DaedalusLeggings.cs b/Items/Armor/Daedalus/DaedalusLeggings.cs index 34b19ad388..f4380f4639 100644 --- a/Items/Armor/Daedalus/DaedalusLeggings.cs +++ b/Items/Armor/Daedalus/DaedalusLeggings.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Armor.Daedalus public override void AddRecipes() { CreateRecipe(). - AddIngredient(10). + AddIngredient(18). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Armor/Demonshade/DemonshadeGreaves.cs b/Items/Armor/Demonshade/DemonshadeGreaves.cs index 1afb8f1d2c..4d63a9c4e0 100644 --- a/Items/Armor/Demonshade/DemonshadeGreaves.cs +++ b/Items/Armor/Demonshade/DemonshadeGreaves.cs @@ -2,7 +2,12 @@ using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; +using Terraria.Localization; using Terraria.ModLoader; +using System.IO; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria.ModLoader.IO; namespace CalamityMod.Items.Armor.Demonshade { @@ -14,6 +19,7 @@ namespace CalamityMod.Items.Armor.Demonshade // Shadow Speed... (elusive) public static float MoveSpeedBoost = 0.3f; public static float AccelerationBoost = 0.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent(), AccelerationBoost.ToPercent()); public override void SetDefaults() { @@ -26,10 +32,47 @@ namespace CalamityMod.Items.Armor.Demonshade Item.Calamity().devItem = true; } + #region Toggleable Acceleration effect + + bool toggleEnabled = true; + + public override bool CanRightClick() => Main.keyState.PressingShift(); + public override void RightClick(Player player) + { + toggleEnabled = !toggleEnabled; + Item.NetStateChanged(); + } + public override bool ConsumeItem(Player player) => false; + public override void SaveData(TagCompound tag) + { + tag.Add("toggleEffect", toggleEnabled); + } + + public override void LoadData(TagCompound tag) + { + toggleEnabled = tag.GetBool("toggleEffect"); + } + + public override void NetSend(BinaryWriter writer) + { + writer.Write(toggleEnabled); + } + + public override void NetReceive(BinaryReader reader) + { + toggleEnabled = reader.ReadBoolean(); + } + + public override void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) + { + CalamityUtils.DrawInventoryDot(spriteBatch, position, new Vector2(16, 16) * Main.inventoryScale, toggleEnabled); + } + #endregion + public override void UpdateEquip(Player player) { var modPlayer = player.Calamity(); - modPlayer.shadowSpeed = true; + modPlayer.shadowSpeed = toggleEnabled; player.moveSpeed += MoveSpeedBoost; } diff --git a/Items/Armor/Demonshade/DemonshadeHelm.cs b/Items/Armor/Demonshade/DemonshadeHelm.cs index 997c216a6f..1a3debbb51 100644 --- a/Items/Armor/Demonshade/DemonshadeHelm.cs +++ b/Items/Armor/Demonshade/DemonshadeHelm.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Armor.Demonshade { player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusSummonDamageBoost.ToPercent(), CalamityUtils.GetArmorSetBonusKey(), EnrageDuration.FramesToSeconds(), (1f + MultDamageBoost).Round(), (1D + MultDamageTakenBoost).Round()); var modPlayer = player.Calamity(); - modPlayer.dsSetBonus = true; + modPlayer.demonshadeSet = true; modPlayer.wearingRogueArmor = true; modPlayer.WearingPostMLSummonerSet = true; player.maxMinions += SetBonusMinionSlotBoost; @@ -80,5 +80,7 @@ namespace CalamityMod.Items.Armor.Demonshade public string ExtensionTexture => "CalamityMod/Items/Armor/Demonshade/DemonshadeHelm_Extension"; public Vector2 ExtensionSpriteOffset(PlayerDrawSet drawInfo) => new Vector2(0, -4f); + + public static Color DemonshadeRarityColor() => CalamityUtils.ColorSwap(new Color(255, 132, 22), new Color(221, 85, 7), 4f); } } diff --git a/Items/Armor/FathomSwarmer/FathomSwarmerBoots.cs b/Items/Armor/FathomSwarmer/FathomSwarmerBoots.cs index 1727744f85..9051803e8c 100644 --- a/Items/Armor/FathomSwarmer/FathomSwarmerBoots.cs +++ b/Items/Armor/FathomSwarmer/FathomSwarmerBoots.cs @@ -41,8 +41,8 @@ namespace CalamityMod.Items.Armor.FathomSwarmer { CreateRecipe(). AddIngredient(9). - AddIngredient(8). - AddIngredient(4). + AddIngredient(50). + AddIngredient(15). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Armor/FathomSwarmer/FathomSwarmerBreastplate.cs b/Items/Armor/FathomSwarmer/FathomSwarmerBreastplate.cs index 66e7ff78d1..74dc96e551 100644 --- a/Items/Armor/FathomSwarmer/FathomSwarmerBreastplate.cs +++ b/Items/Armor/FathomSwarmer/FathomSwarmerBreastplate.cs @@ -47,8 +47,8 @@ namespace CalamityMod.Items.Armor.FathomSwarmer { CreateRecipe(). AddIngredient(12). - AddIngredient(10). - AddIngredient(5). + AddIngredient(75). + AddIngredient(20). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/FathomSwarmer/FathomSwarmerVisage.cs b/Items/Armor/FathomSwarmer/FathomSwarmerVisage.cs index f6da56b0e4..5c5a11ee04 100644 --- a/Items/Armor/FathomSwarmer/FathomSwarmerVisage.cs +++ b/Items/Armor/FathomSwarmer/FathomSwarmerVisage.cs @@ -40,7 +40,6 @@ namespace CalamityMod.Items.Armor.FathomSwarmer { player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusSummonDamageBoost.ToPercent(), SetBonusSubmergedSummonDamageBoost.ToPercent(), SetBonusSubmergedDefenseBoost, SetBonusSubmergedRegenBoost.ToRegenPerSecond()); var modPlayer = player.Calamity(); - modPlayer.fathomSwarmer = true; player.spikedBoots = 2; player.maxMinions += SetBonusMinionSlotBoost; player.GetDamage() += SetBonusSummonDamageBoost; @@ -72,9 +71,9 @@ namespace CalamityMod.Items.Armor.FathomSwarmer public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). - AddIngredient(6). - AddIngredient(3). + AddIngredient(6). + AddIngredient(25). + AddIngredient(10). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/GodSlayer/GodSlayerChestplate.cs b/Items/Armor/GodSlayer/GodSlayerChestplate.cs index cefd8ea258..ea6bdac934 100644 --- a/Items/Armor/GodSlayer/GodSlayerChestplate.cs +++ b/Items/Armor/GodSlayer/GodSlayerChestplate.cs @@ -41,8 +41,8 @@ namespace CalamityMod.Items.Armor.GodSlayer public override void AddRecipes() { CreateRecipe(). - AddIngredient(15). - AddIngredient(3). + AddIngredient(20). + AddIngredient(4). AddTile(). Register(); } diff --git a/Items/Armor/GodSlayer/GodSlayerHeadMelee.cs b/Items/Armor/GodSlayer/GodSlayerHeadMelee.cs index b43f8bf6f0..4e0b206b54 100644 --- a/Items/Armor/GodSlayer/GodSlayerHeadMelee.cs +++ b/Items/Armor/GodSlayer/GodSlayerHeadMelee.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Armor.GodSlayer { var modPlayer = player.Calamity(); modPlayer.godSlayer = true; - modPlayer.godSlayerDamage = true; + modPlayer.godSlayerMelee = true; var hotkey = CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(); player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusHurtDamageThreshold, hotkey, GodSlayerChestplate.DashCooldown.FramesToSeconds()); player.aggro += SetBonusAggroBoost; @@ -64,7 +64,7 @@ namespace CalamityMod.Items.Armor.GodSlayer public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(10). AddIngredient(2). AddTile(). SortBeforeFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs b/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs index 1eff59c595..95be023141 100644 --- a/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs +++ b/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Items.Armor.GodSlayer public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(10). AddIngredient(2). AddTile(). SortBeforeFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/GodSlayer/GodSlayerHeadRogue.cs b/Items/Armor/GodSlayer/GodSlayerHeadRogue.cs index c89fbe2355..1f3558d511 100644 --- a/Items/Armor/GodSlayer/GodSlayerHeadRogue.cs +++ b/Items/Armor/GodSlayer/GodSlayerHeadRogue.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Items.Armor.GodSlayer public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(10). AddIngredient(2). AddTile(). SortBeforeFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/GodSlayer/GodSlayerLeggings.cs b/Items/Armor/GodSlayer/GodSlayerLeggings.cs index e5dade9642..6e3520da96 100644 --- a/Items/Armor/GodSlayer/GodSlayerLeggings.cs +++ b/Items/Armor/GodSlayer/GodSlayerLeggings.cs @@ -36,8 +36,8 @@ namespace CalamityMod.Items.Armor.GodSlayer public override void AddRecipes() { CreateRecipe(). - AddIngredient(10). - AddIngredient(2). + AddIngredient(15). + AddIngredient(3). AddTile(). Register(); } diff --git a/Items/Armor/Hydrothermic/HydrothermicArmor.cs b/Items/Armor/Hydrothermic/HydrothermicArmor.cs index b35d5bc00d..4a84055052 100644 --- a/Items/Armor/Hydrothermic/HydrothermicArmor.cs +++ b/Items/Armor/Hydrothermic/HydrothermicArmor.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void AddRecipes() { CreateRecipe(). - AddIngredient(15). + AddIngredient(20). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs b/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs index c6961124b2..e41dc81b8b 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(10). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadMelee.cs b/Items/Armor/Hydrothermic/HydrothermicHeadMelee.cs index eafe23a27c..06835f8d07 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadMelee.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadMelee.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(10). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs b/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs index e772532f66..ed9ccc7826 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(10). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadRogue.cs b/Items/Armor/Hydrothermic/HydrothermicHeadRogue.cs index c906206ff5..fab79f3fc8 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadRogue.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadRogue.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(10). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs b/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs index 86ad6eba9f..886c10563a 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(10). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Hydrothermic/HydrothermicSubligar.cs b/Items/Armor/Hydrothermic/HydrothermicSubligar.cs index f896863d03..6e7c575afe 100644 --- a/Items/Armor/Hydrothermic/HydrothermicSubligar.cs +++ b/Items/Armor/Hydrothermic/HydrothermicSubligar.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void AddRecipes() { CreateRecipe(). - AddIngredient(10). + AddIngredient(15). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Armor/OmegaBlue/OmegaBlueChestplate.cs b/Items/Armor/OmegaBlue/OmegaBlueChestplate.cs index 83f1874634..c501318e2c 100644 --- a/Items/Armor/OmegaBlue/OmegaBlueChestplate.cs +++ b/Items/Armor/OmegaBlue/OmegaBlueChestplate.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Armor.OmegaBlue { CreateRecipe(). AddIngredient(5). - AddIngredient(18). + AddIngredient(25). AddIngredient(3). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs b/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs index beb164e68f..32bf50a7ab 100644 --- a/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs +++ b/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs @@ -98,7 +98,7 @@ namespace CalamityMod.Items.Armor.OmegaBlue { CreateRecipe(). AddIngredient(3). - AddIngredient(12). + AddIngredient(15). AddIngredient(). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/OmegaBlue/OmegaBlueTentacles.cs b/Items/Armor/OmegaBlue/OmegaBlueTentacles.cs index d0d6e96c73..09aaf332b1 100644 --- a/Items/Armor/OmegaBlue/OmegaBlueTentacles.cs +++ b/Items/Armor/OmegaBlue/OmegaBlueTentacles.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Armor.OmegaBlue { CreateRecipe(). AddIngredient(4). - AddIngredient(15). + AddIngredient(20). AddIngredient(2). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Armor/Reaver/ReaverCuisses.cs b/Items/Armor/Reaver/ReaverCuisses.cs index 991ad6b50e..4802b63328 100644 --- a/Items/Armor/Reaver/ReaverCuisses.cs +++ b/Items/Armor/Reaver/ReaverCuisses.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Armor.Reaver public override void AddRecipes() { CreateRecipe(). - AddIngredient(10). + AddIngredient(15). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Armor/Reaver/ReaverHeadExplore.cs b/Items/Armor/Reaver/ReaverHeadExplore.cs index 307e36a692..756ddeb157 100644 --- a/Items/Armor/Reaver/ReaverHeadExplore.cs +++ b/Items/Armor/Reaver/ReaverHeadExplore.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Items.Armor.Reaver public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(10). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Reaver/ReaverHeadMobility.cs b/Items/Armor/Reaver/ReaverHeadMobility.cs index 613eb37fb2..aa34f36acc 100644 --- a/Items/Armor/Reaver/ReaverHeadMobility.cs +++ b/Items/Armor/Reaver/ReaverHeadMobility.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Armor.Reaver public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(10). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Reaver/ReaverHeadTank.cs b/Items/Armor/Reaver/ReaverHeadTank.cs index 6ab102d56c..7df946b0b4 100644 --- a/Items/Armor/Reaver/ReaverHeadTank.cs +++ b/Items/Armor/Reaver/ReaverHeadTank.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Armor.Reaver // Set Bonus public static int SetBonusAggroBoost = 600; - public static float SetBonusDebuffDamageReduction = 0.2f; + public static float SetBonusDebuffDamageReduction = 0.5f; public static float SetBonusMobilityReduction = 0.3f; public static int ReaverRageDuration = CalamityUtils.SecondsToFrames(5); public static int ReaverRageDefenseBoost = 5; @@ -61,7 +61,7 @@ namespace CalamityMod.Items.Armor.Reaver public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(10). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Reaver/ReaverScaleMail.cs b/Items/Armor/Reaver/ReaverScaleMail.cs index 60d307b21b..1d14e87516 100644 --- a/Items/Armor/Reaver/ReaverScaleMail.cs +++ b/Items/Armor/Reaver/ReaverScaleMail.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Armor.Reaver public override void AddRecipes() { CreateRecipe(). - AddIngredient(15). + AddIngredient(20). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Silva/SilvaArmor.cs b/Items/Armor/Silva/SilvaArmor.cs index 6c7104676c..516b82f1b1 100644 --- a/Items/Armor/Silva/SilvaArmor.cs +++ b/Items/Armor/Silva/SilvaArmor.cs @@ -44,9 +44,9 @@ namespace CalamityMod.Items.Armor.Silva public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). - AddIngredient(10). - AddIngredient(3). + AddIngredient(90). + AddIngredient(12). + AddIngredient(4). AddTile(). Register(); } diff --git a/Items/Armor/Silva/SilvaHeadMagic.cs b/Items/Armor/Silva/SilvaHeadMagic.cs index 1b6ae86e25..9056c9788f 100644 --- a/Items/Armor/Silva/SilvaHeadMagic.cs +++ b/Items/Armor/Silva/SilvaHeadMagic.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -59,8 +59,8 @@ namespace CalamityMod.Items.Armor.Silva public override void AddRecipes() { CreateRecipe(). - AddIngredient(6). - AddIngredient(5). + AddIngredient(30). + AddIngredient(8). AddIngredient(2). AddTile(). SortBeforeFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/Silva/SilvaHeadSummon.cs b/Items/Armor/Silva/SilvaHeadSummon.cs index 356c625801..f0ba705b0c 100644 --- a/Items/Armor/Silva/SilvaHeadSummon.cs +++ b/Items/Armor/Silva/SilvaHeadSummon.cs @@ -58,8 +58,8 @@ namespace CalamityMod.Items.Armor.Silva public override void AddRecipes() { CreateRecipe(). - AddIngredient(6). - AddIngredient(5). + AddIngredient(30). + AddIngredient(8). AddIngredient(2). AddTile(). SortBeforeFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/Silva/SilvaLeggings.cs b/Items/Armor/Silva/SilvaLeggings.cs index 9faf9d6353..394c7b844d 100644 --- a/Items/Armor/Silva/SilvaLeggings.cs +++ b/Items/Armor/Silva/SilvaLeggings.cs @@ -37,9 +37,9 @@ namespace CalamityMod.Items.Armor.Silva public override void AddRecipes() { CreateRecipe(). - AddIngredient(9). - AddIngredient(7). - AddIngredient(2). + AddIngredient(60). + AddIngredient(10). + AddIngredient(3). AddTile(). Register(); } diff --git a/Items/Armor/Statigel/StatigelGreaves.cs b/Items/Armor/Statigel/StatigelGreaves.cs index ecb28cc6d6..9a1a3353b0 100644 --- a/Items/Armor/Statigel/StatigelGreaves.cs +++ b/Items/Armor/Statigel/StatigelGreaves.cs @@ -33,8 +33,8 @@ namespace CalamityMod.Items.Armor.Statigel public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). - AddIngredient(7). + AddIngredient(10). + AddIngredient(10). AddTile(TileID.Solidifier). Register(); } diff --git a/Items/Armor/Statigel/StatigelHeadMagic.cs b/Items/Armor/Statigel/StatigelHeadMagic.cs index c89fd173f6..04a26acd0f 100644 --- a/Items/Armor/Statigel/StatigelHeadMagic.cs +++ b/Items/Armor/Statigel/StatigelHeadMagic.cs @@ -33,8 +33,6 @@ namespace CalamityMod.Items.Armor.Statigel public override void UpdateArmorSet(Player player) { player.setBonus = CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); - var modPlayer = player.Calamity(); - modPlayer.statigelSet = true; player.GetJumpState().Enable(); Player.jumpHeight += (int)(StatigelArmor.SetBonusJumpHeightPercentBoost * 15); player.jumpSpeedBoost += StatigelArmor.SetBonusJumpSpeedBoost; @@ -51,8 +49,8 @@ namespace CalamityMod.Items.Armor.Statigel public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). - AddIngredient(5). + AddIngredient(8). + AddIngredient(8). AddTile(TileID.Solidifier). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Statigel/StatigelHeadMelee.cs b/Items/Armor/Statigel/StatigelHeadMelee.cs index f6c99987d2..e35503a5fb 100644 --- a/Items/Armor/Statigel/StatigelHeadMelee.cs +++ b/Items/Armor/Statigel/StatigelHeadMelee.cs @@ -35,8 +35,6 @@ namespace CalamityMod.Items.Armor.Statigel public override void UpdateArmorSet(Player player) { player.setBonus = this.GetLocalization("SetBonus").Format(StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); - var modPlayer = player.Calamity(); - modPlayer.statigelSet = true; player.GetJumpState().Enable(); Player.jumpHeight += (int)(StatigelArmor.SetBonusJumpHeightPercentBoost * 15); player.jumpSpeedBoost += StatigelArmor.SetBonusJumpSpeedBoost; @@ -53,8 +51,8 @@ namespace CalamityMod.Items.Armor.Statigel public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). - AddIngredient(5). + AddIngredient(8). + AddIngredient(8). AddTile(TileID.Solidifier). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Statigel/StatigelHeadRanged.cs b/Items/Armor/Statigel/StatigelHeadRanged.cs index 980989d6c0..a0187c6129 100644 --- a/Items/Armor/Statigel/StatigelHeadRanged.cs +++ b/Items/Armor/Statigel/StatigelHeadRanged.cs @@ -31,8 +31,6 @@ namespace CalamityMod.Items.Armor.Statigel public override void UpdateArmorSet(Player player) { player.setBonus = CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); - var modPlayer = player.Calamity(); - modPlayer.statigelSet = true; player.GetJumpState().Enable(); Player.jumpHeight += (int)(StatigelArmor.SetBonusJumpHeightPercentBoost * 15); player.jumpSpeedBoost += StatigelArmor.SetBonusJumpSpeedBoost; @@ -47,8 +45,8 @@ namespace CalamityMod.Items.Armor.Statigel public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). - AddIngredient(5). + AddIngredient(8). + AddIngredient(8). AddTile(TileID.Solidifier). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Statigel/StatigelHeadRogue.cs b/Items/Armor/Statigel/StatigelHeadRogue.cs index 747b2bb836..ed9fb8470d 100644 --- a/Items/Armor/Statigel/StatigelHeadRogue.cs +++ b/Items/Armor/Statigel/StatigelHeadRogue.cs @@ -36,7 +36,6 @@ namespace CalamityMod.Items.Armor.Statigel { player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); var modPlayer = player.Calamity(); - modPlayer.statigelSet = true; player.GetJumpState().Enable(); modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; @@ -54,8 +53,8 @@ namespace CalamityMod.Items.Armor.Statigel public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). - AddIngredient(5). + AddIngredient(8). + AddIngredient(8). AddTile(TileID.Solidifier). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Statigel/StatigelHeadSummon.cs b/Items/Armor/Statigel/StatigelHeadSummon.cs index 758ec5d5ba..05058e6c99 100644 --- a/Items/Armor/Statigel/StatigelHeadSummon.cs +++ b/Items/Armor/Statigel/StatigelHeadSummon.cs @@ -39,7 +39,6 @@ namespace CalamityMod.Items.Armor.Statigel { player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusSummonDamageBoost.ToPercent(), StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); var modPlayer = player.Calamity(); - modPlayer.statigelSet = true; modPlayer.slimeGod = true; player.GetJumpState().Enable(); Player.jumpHeight += (int)(StatigelArmor.SetBonusJumpHeightPercentBoost * 15); @@ -48,18 +47,13 @@ namespace CalamityMod.Items.Armor.Statigel if (player.whoAmI == Main.myPlayer) { var source = player.GetSource_Accessory(Item); - if (player.FindBuffIndex(ModContent.BuffType()) == -1) - { - player.AddBuff(ModContent.BuffType(), 3600, true); - } + if (player.FindBuffIndex(ModContent.BuffType()) == -1) + player.AddBuff(ModContent.BuffType(), 3600, true); int minionID = -1; int minionDamage = (int)player.GetTotalDamage().ApplyTo(SlimeDamage); - - if (WorldGen.crimson && player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) - minionID = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), minionDamage, 0f, Main.myPlayer); - else if (!WorldGen.crimson && player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) - minionID = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), minionDamage, 0f, Main.myPlayer); + if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) + minionID = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), minionDamage, 0f, Main.myPlayer); if (Main.projectile.IndexInRange(minionID)) Main.projectile[minionID].originalDamage = SlimeDamage; @@ -75,8 +69,8 @@ namespace CalamityMod.Items.Armor.Statigel public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). - AddIngredient(5). + AddIngredient(8). + AddIngredient(8). AddTile(TileID.Solidifier). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Tarragon/TarragonBreastplate.cs b/Items/Armor/Tarragon/TarragonBreastplate.cs index f51bbea2a2..c7f1a8153d 100644 --- a/Items/Armor/Tarragon/TarragonBreastplate.cs +++ b/Items/Armor/Tarragon/TarragonBreastplate.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Armor.Tarragon public override void AddRecipes() { CreateRecipe(). - AddIngredient(15). + AddIngredient(24). AddIngredient(18). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Armor/Tarragon/TarragonHeadMagic.cs b/Items/Armor/Tarragon/TarragonHeadMagic.cs index 5081997c12..491bc384cd 100644 --- a/Items/Armor/Tarragon/TarragonHeadMagic.cs +++ b/Items/Armor/Tarragon/TarragonHeadMagic.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Armor.Tarragon public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(12). AddIngredient(6). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/Tarragon/TarragonHeadMelee.cs b/Items/Armor/Tarragon/TarragonHeadMelee.cs index ee44143770..72aafa2f5e 100644 --- a/Items/Armor/Tarragon/TarragonHeadMelee.cs +++ b/Items/Armor/Tarragon/TarragonHeadMelee.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Armor.Tarragon public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(12). AddIngredient(6). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/Tarragon/TarragonHeadRanged.cs b/Items/Armor/Tarragon/TarragonHeadRanged.cs index b066013fdc..54423f9d3d 100644 --- a/Items/Armor/Tarragon/TarragonHeadRanged.cs +++ b/Items/Armor/Tarragon/TarragonHeadRanged.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Items.Armor.Tarragon public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(12). AddIngredient(6). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/Tarragon/TarragonHeadRogue.cs b/Items/Armor/Tarragon/TarragonHeadRogue.cs index 70adc74719..eb07595466 100644 --- a/Items/Armor/Tarragon/TarragonHeadRogue.cs +++ b/Items/Armor/Tarragon/TarragonHeadRogue.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Armor.Tarragon modPlayer.tarraThrowing = true; modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), CritsToActivateImmunity, ImmunityDuration.FramesToSeconds(), ImmunityCooldown.FramesToSeconds(), RogueDamageBoostWhileDebuffed.ToPercent()); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), CritsToActivateImmunity, ImmunityDuration.FramesToSeconds(), ImmunityCooldown.FramesToSeconds()); } public override void UpdateEquip(Player player) @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Armor.Tarragon public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(12). AddIngredient(6). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/Tarragon/TarragonHeadSummon.cs b/Items/Armor/Tarragon/TarragonHeadSummon.cs index 875953b77a..1f2f13fa7f 100644 --- a/Items/Armor/Tarragon/TarragonHeadSummon.cs +++ b/Items/Armor/Tarragon/TarragonHeadSummon.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Armor.Tarragon public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(12). AddIngredient(6). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/Tarragon/TarragonLeggings.cs b/Items/Armor/Tarragon/TarragonLeggings.cs index 0b9a6fad3c..1c089b649a 100644 --- a/Items/Armor/Tarragon/TarragonLeggings.cs +++ b/Items/Armor/Tarragon/TarragonLeggings.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Armor.Tarragon public override void AddRecipes() { CreateRecipe(). - AddIngredient(11). + AddIngredient(18). AddIngredient(12). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Armor/Wulfrum/WulfrumSet.cs b/Items/Armor/Wulfrum/WulfrumSet.cs index 4d3f16e4b3..d22c2761f2 100644 --- a/Items/Armor/Wulfrum/WulfrumSet.cs +++ b/Items/Armor/Wulfrum/WulfrumSet.cs @@ -205,7 +205,7 @@ namespace CalamityMod.Items.Armor.Wulfrum public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(10). AddIngredient(). AddTile(TileID.Anvils). Register(); @@ -245,7 +245,7 @@ namespace CalamityMod.Items.Armor.Wulfrum public override void AddRecipes() { CreateRecipe(). - AddIngredient(10). + AddIngredient(20). AddIngredient(). AddTile(TileID.Anvils). Register(); @@ -281,7 +281,7 @@ namespace CalamityMod.Items.Armor.Wulfrum public override void AddRecipes() { CreateRecipe(). - AddIngredient(8). + AddIngredient(15). AddIngredient(). AddTile(TileID.Anvils). Register(); diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index d70f62349e..831dbb3b0b 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -204,8 +204,8 @@ namespace CalamityMod.Items stats[(int)VanillaWingID.LeafWings].FlyTime = 170; stats[(int)VanillaWingID.LeafWings].AccRunSpeedOverride = 9f; stats[(int)VanillaWingID.LeafWings].AccRunAccelerationMult = 2f; - // (Spectre Wings) 1 -> 1.5 acceleration multiplier - stats[(int)VanillaWingID.GhostWings].AccRunAccelerationMult = 1.5f; + // (Spectre Wings) 1 -> 2 acceleration multiplier + stats[(int)VanillaWingID.GhostWings].AccRunAccelerationMult = 2f; // 170 -> 210 flight time stats[(int)VanillaWingID.BeetleWings].FlyTime = 210; @@ -1128,33 +1128,12 @@ namespace CalamityMod.Items { modPlayer.magmaStoneVisuals = !hideVisual; // hides the fire dust when hiding the accessory } - - // The Frog Leg line is prevented from stacking. - // Additionally, Amphibian boots are directly nerfed so they aren't the best in slot boots at all times. - // - // 21MAY2024: Ozzatron: Disabled this code. Frog Leg is allowed to stack. Amphibian Boots specific nerf is applied below. - /* - switch (item.type) + if (item.type == ItemID.VolatileGelatin) { - default: - break; - case ItemID.AmphibianBoots: - if (modPlayer.alreadyHasFrogLeg) - player.jumpSpeedBoost -= BalancingConstants.VanillaFrogLegJumpSpeedBoost; - else - player.jumpSpeedBoost += BalancingConstants.AmphibianBootsJumpSpeedBoost - BalancingConstants.VanillaFrogLegJumpSpeedBoost; - modPlayer.alreadyHasFrogLeg = true; - break; - case ItemID.FrogLeg: - case ItemID.FrogFlipper: - case ItemID.FrogGear: - case ItemID.FrogWebbing: - if (modPlayer.alreadyHasFrogLeg) - player.jumpSpeedBoost -= BalancingConstants.VanillaFrogLegJumpSpeedBoost; - modPlayer.alreadyHasFrogLeg = true; - break; + modPlayer.volatileGelatinVisuals = !hideVisual; } - */ + + // Amphibian boots are directly nerfed so they aren't the best in slot boots at all times. if (item.type == ItemID.AmphibianBoots) player.jumpSpeedBoost += BalancingConstants.AmphibianBootsJumpSpeedBoost - BalancingConstants.VanillaFrogLegJumpSpeedBoost; @@ -1213,17 +1192,20 @@ namespace CalamityMod.Items { player.GetJumpState().Available = true; } - if (player.wingsLogic <= 0 && player.velocity.Y != 0 && player.maxRunSpeed < 8) + if (player.wingsLogic <= 0 && player.velocity.Y != 0 && player.maxRunSpeed < 7) { - player.maxRunSpeed = 5f; + player.maxRunSpeed = 7f; } - player.jumpSpeedBoost += 1.6f; + player.jumpSpeedBoost += 2f; if (player.controlDown) - player.maxFallSpeed *= 1.5f; + player.maxFallSpeed *= (player.Calamity().ironBoots || player.Calamity().gSabaton) ? 1.5f : 2f; else player.maxFallSpeed *= 1.2f; } + if (item.type == ItemID.EmpressFlightBooster) + player.wingTimeMax += 150; + if (item.type == ItemID.DemonWings && !player.mount.Active) player.maxFallSpeed *= 1.2f; @@ -1293,7 +1275,6 @@ namespace CalamityMod.Items float moveSpeedBoost = modPlayer.moveSpeedBonus * 0.06f; float flightSpeedMult = 1f + - (modPlayer.soaring ? SoaringPotion.FlightBoost : 0f) + (modPlayer.reaverSpeed ? ReaverHeadMobility.SetBonusFlightBoost : 0f) + moveSpeedBoost; @@ -1319,14 +1300,14 @@ namespace CalamityMod.Items break; case ItemID.FlameWings: maxAscentMultiplier *= 1.1067f; - constantAscend *= 1.25f; + constantAscend *= 1.2f; break; case ItemID.ButterflyWings: maxAscentMultiplier *= 0.6667f; constantAscend *= 5f; break; case ItemID.GhostWings: - maxAscentMultiplier *= 0.6025f; + maxAscentMultiplier *= 0.6625f; constantAscend *= 5f; break; default: diff --git a/Items/CalamityGlobalItemLoot.cs b/Items/CalamityGlobalItemLoot.cs index a3bf25dbd3..ad89f62418 100644 --- a/Items/CalamityGlobalItemLoot.cs +++ b/Items/CalamityGlobalItemLoot.cs @@ -76,7 +76,8 @@ namespace CalamityMod.Items ItemID.LucyTheAxe, ItemID.PewMaticHorn, ItemID.WeatherPain, - ItemID.HoundiusShootius + ItemID.HoundiusShootius, + ModContent.ItemType() }; loot.Add(DropHelper.CalamityStyle(DropHelper.BagWeaponDropRateFraction, deerclopsWeapons)); loot.AddRevBagAccessories(); @@ -300,9 +301,17 @@ namespace CalamityMod.Items loot.Add(ModContent.ItemType(), 2, 2, 5); break; + // Reimplement primary loot rule to include Fledgling Wings + case ItemID.FloatingIslandFishingCrate: + RemoveLootRuleFromSkyCrates(loot); + loot.Add(ItemDropRule.OneFromOptionsNotScalingWithLuck(1, ItemID.ShinyRedBalloon, ItemID.LuckyHorseshoe, ItemID.Starfury, ItemID.CelestialMagnet, ItemID.CreativeWings)); + break; + // 2-5 Essences of Sunlight @ 50% // This is our equivalent to Souls of Light/Night case ItemID.FloatingIslandFishingCrateHard: + RemoveLootRuleFromSkyCrates(loot); + loot.Add(ItemDropRule.OneFromOptionsNotScalingWithLuck(1, ItemID.ShinyRedBalloon, ItemID.LuckyHorseshoe, ItemID.Starfury, ItemID.CelestialMagnet, ItemID.CreativeWings)); RemoveHardmodeOresFromBiomeCrates(loot); loot.AddHardmodeOresToCrates(HardmodeCrateType.Biome); loot.Add(ModContent.ItemType(), 2, 2, 5); @@ -583,6 +592,34 @@ namespace CalamityMod.Items ItemID.BandofRegeneration, ItemID.ShoeSpikes, ModContent.ItemType()); // Climbing Claws is in Wooden/Pearlwood (vanilla) in case you're curious + + private static void RemoveLootRuleFromSkyCrates(ItemLoot loot) + { + List rules = loot.Get(false); + AlwaysAtleastOneSuccessDropRule main = null; + foreach (IItemDropRule rule in rules) + { + if (rule is AlwaysAtleastOneSuccessDropRule a) + main = a; + } + if (main is null) + return; + + // Remove the primary loot rule and the rule for Fledgling Wings + foreach (IItemDropRule rule in main.rules) + { + if (rule is OneFromOptionsNotScaledWithLuckDropRule one && one.chanceDenominator == 1) + { + one.chanceNumerator = 0; + continue; + } + if (rule is CommonDrop c && c.itemId == ItemID.CreativeWings) + { + c.chanceNumerator = 0; + continue; + } + } + } #endregion #region Goodie Bag Bat Hook diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 55823811b7..e51b48f5aa 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -394,8 +394,9 @@ namespace CalamityMod.Items if (showTheTip) { - var str = PlayerInput.CurrentProfile.InputModes[InputMode.Keyboard].KeyStatus["SmartCursor"].First().ToString(); - tooltips.Insert(++lastTooltipIndex, (new TooltipLine(Mod, "CalamityMod:AltExpandTooltip", CalamityUtils.GetTextValue("Misc.AltExpand").Replace("{0}", str)))); + var bind = PlayerInput.CurrentProfile.InputModes[InputMode.Keyboard].KeyStatus["SmartCursor"]; + string str = bind.Count == 0 ? GetTextValue("Misc.HotkeyNotBound") : bind.First().ToString(); + tooltips.Insert(++lastTooltipIndex, (new TooltipLine(Mod, "CalamityMod:AltExpandTooltip", GetTextValue("Misc.AltExpand").Replace("{0}", str)))); tooltips[lastTooltipIndex].OverrideColor = new Color(170, 170, 170); } else if (foundDebuff) @@ -415,110 +416,6 @@ namespace CalamityMod.Items { if (item.type == ModContent.ItemType()) nameLine.OverrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - - // Developer items - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = new Color(249, 197, 255); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = new Color(0, 0, 255); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = TheDanceofLight.GetSyncedLightColor(); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = new Color(0.34f, 0.34f + 0.66f * Main.DiscoG / 255f, 0.34f + 0.5f * Main.DiscoG / 255f); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = ShatteredCommunity.GetRarityColor(); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = ShatteredCommunity.GetRarityColor(); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25), 6f); //alternates between emerald green and amber (BanditHueh) - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(210, 0, 255), new Color(255, 248, 24), 4f); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(131, 239, 255), new Color(36, 55, 230), 4f); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(255, 69, 0), new Color(139, 0, 0), 4f); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(191, 45, 71), new Color(185, 187, 253), 4f); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(204, 86, 80), new Color(237, 69, 141), 4f); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = new Color(129, 29, 149); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(255, 255, 255), new Color(0xD1, 0xCC, 0x6F), 4f); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = new Color(220, 20, 60); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = new Color(207, 17, 117); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = new Color(227, 226, 180); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(154, 255, 151), new Color(228, 151, 255), 4f); - if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) - nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(255, 132, 22), new Color(221, 85, 7), 4f); - if (item.type == ModContent.ItemType()) - { - nameLine.OverrideColor = CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly / 2f % 1f, new Color[] - { - new Color(255, 196, 55), - new Color(255, 231, 107), - new Color(255, 254, 243) - }); - } - - // TODO -- for cleanliness, ALL color math should either be a one-line color swap or inside the item's own file - // The items that currently violate this are all below: - // Eternity, Flamsteed Ring, Earth - if (item.type == ModContent.ItemType()) - { - List colorSet = new List() - { - new Color(188, 192, 193), // white - new Color(157, 100, 183), // purple - new Color(249, 166, 77), // honey-ish orange - new Color(255, 105, 234), // pink - new Color(67, 204, 219), // sky blue - new Color(249, 245, 99), // bright yellow - new Color(236, 168, 247), // purplish pink - }; - if (nameLine != null) - { - int colorIndex = (int)(Main.GlobalTimeWrappedHourly / 2 % colorSet.Count); - Color currentColor = colorSet[colorIndex]; - Color nextColor = colorSet[(colorIndex + 1) % colorSet.Count]; - nameLine.OverrideColor = Color.Lerp(currentColor, nextColor, Main.GlobalTimeWrappedHourly % 2f > 1f ? 1f : Main.GlobalTimeWrappedHourly % 1f); - } - } - if (item.type == ModContent.ItemType()) - { - if (Main.GlobalTimeWrappedHourly % 1f < 0.6f) - { - nameLine.OverrideColor = new Color(89, 229, 255); - } - else if (Main.GlobalTimeWrappedHourly % 1f < 0.8f) - { - nameLine.OverrideColor = Color.Lerp(new Color(89, 229, 255), Color.White, (Main.GlobalTimeWrappedHourly % 1f - 0.6f) / 0.2f); - } - else - { - nameLine.OverrideColor = Color.Lerp(Color.White, new Color(89, 229, 255), (Main.GlobalTimeWrappedHourly % 1f - 0.8f) / 0.2f); - } - } - if (item.type == ModContent.ItemType()) - { - List earthColors = new List() - { - Color.OrangeRed, - Color.MediumTurquoise, - Color.LimeGreen - }; - if (nameLine != null) - { - int colorIndex = (int)(Main.GlobalTimeWrappedHourly / 2 % earthColors.Count); - Color currentColor = earthColors[colorIndex]; - Color nextColor = earthColors[(colorIndex + 1) % earthColors.Count]; - nameLine.OverrideColor = Color.Lerp(currentColor, nextColor, Main.GlobalTimeWrappedHourly % 2f > 1f ? 1f : Main.GlobalTimeWrappedHourly % 1f); - } - } } #endregion @@ -875,6 +772,10 @@ namespace CalamityMod.Items if (item.type == ItemID.GravityGlobe) EditTooltipByNum(1, (line) => line.Text = EditedTooltip("GravityGlobe")); + // Reworked Volatile Gelatin + if (item.type == ItemID.VolatileGelatin) + EditTooltipByNum(0, (line) => line.Text += "\n" + EditedTooltip("VolatileGelatin")); + // Flame Waker Boots now has a functional effect which inherits to Hellfire Treads. if (item.type == ItemID.FlameWakerBoots) EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlameWakerBoots")); @@ -1478,23 +1379,23 @@ namespace CalamityMod.Items /// /// Currently, the dictionary functions as follows:
/// 1-5 insanely fast
- /// 6-9 very fast
- /// 10-14 fast
- /// 15-22 average
- /// 23-29 slow
- /// 30-37 very slow
- /// 38-45 extremely slow
- /// 46+ snail + /// 6-10 very fast
+ /// 11-17 fast
+ /// 18-24 average
+ /// 25-30 slow
+ /// 31-43 very slow
+ /// 44-60 extremely slow
+ /// 61+ snail ///
private static readonly Dictionary SpeedTooltips = new Dictionary() { { 5, Language.GetText("LegacyTooltip.6") }, - { 9, Language.GetText("LegacyTooltip.7") }, - { 14, Language.GetText("LegacyTooltip.8") }, - { 22, Language.GetText("LegacyTooltip.9") }, - { 29, Language.GetText("LegacyTooltip.10") }, - { 37, Language.GetText("LegacyTooltip.11") }, - { 45, Language.GetText("LegacyTooltip.12") }, + { 10, Language.GetText("LegacyTooltip.7") }, + { 17, Language.GetText("LegacyTooltip.8") }, + { 24, Language.GetText("LegacyTooltip.9") }, + { 30, Language.GetText("LegacyTooltip.10") }, + { 43, Language.GetText("LegacyTooltip.11") }, + { 60, Language.GetText("LegacyTooltip.12") }, // TODO: Using int.MaxValue here may be considered kind of strange - only alternatives I can think of require hardcoding. { int.MaxValue, Language.GetText("LegacyTooltip.13") } }; @@ -1773,14 +1674,6 @@ namespace CalamityMod.Items return false; } - - // Rainbow effect originally made for Orderbringer because it used to have a special rarity - // But why did it have one in the first place?? - // Might be used for Miracle stuff later or something idk - /*if (line.Name == "ItemName" && line.Mod == "Terraria" && item.type == ModContent.ItemType()) - { - - }*/ return true; } #endregion diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 9ed8e64673..fd9b336192 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -86,7 +86,6 @@ namespace CalamityMod.Items { ItemID.CrystalDart, Do(DamageExact(20)) }, // VANILLA: 14 DMG { ItemID.CrystalStorm, Do(DamageExact(40)) }, // VANILLA: 32 DMG { ItemID.CrystalVileShard, Do(DamageExact(35)) }, // VANILLA: 25 DMG - { ItemID.CursedArrow, Do(DamageExact(14)) }, // VANILLA: 17 DMG { ItemID.CursedDart, Do(DamageExact(25)) }, // VANILLA: 9 DMG { ItemID.Cutlass, Do(DamageExact(90), UseExact(11)) }, // VANILLA: 53 DMG, 16 UT { ItemID.DaedalusStormbow, Do(DamageExact(30)) }, // VANILLA: 38 DMG @@ -114,7 +113,7 @@ namespace CalamityMod.Items { ItemID.Flamethrower, Do(DamageExact(21), ShootSpeedDelta(+3f)) }, // VANILLA: 35 DMG, 7 VEL { ItemID.FlowerofFire, Do(DamageRatio(0.78f)) }, // VANILLA: 48 DMG. Uses ratios due to remix seed { ItemID.FlowerPow, Do(DamageExact(80)) }, // Displays as 160 damage. VANILLA: 65 DMG (displays as 130) - { ItemID.FlyingKnife, Do(DamageExact(53)) }, // VANILLA: 40 DMG + { ItemID.FlyingKnife, Do(DamageExact(45)) }, // VANILLA: 40 DMG { ItemID.Frostbrand, Do(UseMeleeSpeed, DamageExact(110)) }, // VANILLA: 49 DMG { ItemID.Gatligator, Do(UseExact(6)) }, // VANILLA: 7 UT { ItemID.GoldShortsword, Do(TrueMelee, DamageExact(17)) }, // VANILLA: 12 DMG @@ -128,14 +127,11 @@ namespace CalamityMod.Items { ItemID.Handgun, Do(UseExact(20)) }, // VANILLA: 15 UT { ItemID.HighVelocityBullet, Do(DamageExact(13)) }, // VANILLA: 11 DMG { ItemID.HiveFive, Do(DamageExact(27)) }, // VANILLA: 24 DMG - { ItemID.HornetStaff, Do(DamageExact(18)) }, // VANILLA: 12 DMG { ItemID.IceBlade, Do(UseMeleeSpeed) }, { ItemID.IceBoomerang, Do(ShootSpeedExact(9), UseExact(25)) }, // VANILLA: 20 UT, 11.5 VEL { ItemID.IceRod, Do(ShootSpeedExact(20), UseExact(6)) }, // VANILLA: 9 UT, 12 VEL { ItemID.IceSickle, Do(UseMeleeSpeed, DamageExact(75), ShootSpeedExact(20f)) }, // VANILLA: 50 DMG, 12 VEL - { ItemID.IchorArrow, Do(DamageExact(13)) }, // VANILLA: 16 DMG { ItemID.IchorBullet, Do(DamageExact(11)) }, // VANILLA: 13 DMG - { ItemID.ImpStaff, Do(DamageExact(25)) }, // VANILLA: 17 DMG { ItemID.InfernoFork, Do(DamageExact(83), ShootSpeedExact(11)) }, // VANILLA: 70 DMG, 8 VEL { ItemID.InfluxWaver, Do(UseMeleeSpeed, DamageExact(80), UseExact(25)) }, // VANILLA: 100 DMG, 20 UT { ItemID.IronShortsword, Do(TrueMelee, DamageExact(10)) }, // VANILLA: 8 DMG @@ -212,7 +208,7 @@ namespace CalamityMod.Items { ItemID.ShadowbeamStaff, Do(DamageExact(100)) }, // VANILLA: 80 DMG { ItemID.ShadowFlameBow, Do(DamageExact(55)) }, // VANILLA: 47 DMG { ItemID.ShadowFlameHexDoll, Do(DamageExact(40), ShootSpeedExact(30)) }, // VANILLA: 32 DMG, 9 VEL - { ItemID.ShadowFlameKnife, Do(DamageExact(50)) }, // VANILLA: 38 DMG + { ItemID.ShadowFlameKnife, Do(DamageExact(43)) }, // VANILLA: 38 DMG { ItemID.SharpTears, Do(DamageExact(49)) }, // Blood Thorn. VANILLA: 34 DMG { ItemID.Shotgun, Do(DamageExact(36)) }, // VANILLA: 24 DMG { ItemID.SilverBullet, Do(DamageExact(8)) }, // VANILLA: 9 DMG @@ -220,7 +216,6 @@ namespace CalamityMod.Items { ItemID.SkyFracture, Do(DamageExact(46)) }, // VANILLA: 38 DMG { ItemID.SlapHand, Do(UseTurn, DamageExact(120)) }, // VANILLA: 55 DMG { ItemID.Smolstar, Do(DamageExact(9)) }, // Blade Staff. VANILLA: 6 DMG - { ItemID.SniperRifle, Do(DamageExact(200), UseExact(40)) }, // VANILLA: 185 DMG, 36 UT { ItemID.SoulDrain, Do(DamageExact(38)) }, // Life Drain. VANILLA: 35 DMG { ItemID.SpaceGun, Do(DamageExact(23)) }, // VANILLA: 17 DMG { ItemID.Spear, Do(TrueMelee, DamageExact(14)) }, // VANILLA: 8 DMG @@ -236,7 +231,7 @@ namespace CalamityMod.Items { ItemID.TacticalShotgun, Do(DamageExact(34)) }, // VANILLA: 29 DMG { ItemID.TaxCollectorsStickOfDoom, Do(UseTurn, DamageExact(80), UseExact(10)) }, // Classy Cane. VANILLA: 16 DMG, 15 UT { ItemID.TendonBow, Do(DamageExact(17)) }, // VANILLA: 19 DMG - { ItemID.TerraBlade, Do(DamageExact(95)) }, // VANILLA: 85 DMG + { ItemID.TerraBlade, Do(DamageExact(90)) }, // VANILLA: 85 DMG { ItemID.Terragrim, Do(TrueMeleeNoSpeed, DamageExact(13)) }, // VANILLA: 17 DMG { ItemID.Terrarian, Do(DamageExact(90)) }, // VANILLA: 190 DMG. Required due to fixing iframes so yoyo and shots can hit simultaneously { ItemID.TheEyeOfCthulhu, Do(DamageExact(80)) }, // VANILLA: 115 DMG @@ -252,12 +247,11 @@ namespace CalamityMod.Items { ItemID.ToxicFlask, Do(DamageExact(62), UseExact(33)) }, // VANILLA: 52 DMG, 45 UT { ItemID.Toxikarp, Do(UseExact(9)) }, // VANILLA: 10 UT { ItemID.Trident, Do(TrueMelee, DamageExact(20)) }, // VANILLA: 14 DMG - { ItemID.TrueExcalibur, Do(TrueMelee, DamageExact(112)) }, // VANILLA: 72 DMG - { ItemID.TrueNightsEdge, Do(DamageExact(105)) }, // VANILLA: 70 DMG + { ItemID.TrueExcalibur, Do(TrueMelee, DamageExact(105)) }, // VANILLA: 72 DMG + { ItemID.TrueNightsEdge, Do(DamageExact(99)) }, // VANILLA: 70 DMG { ItemID.Tsunami, Do(DamageExact(45)) }, // VANILLA: 53 DMG { ItemID.TungstenBullet, Do(DamageExact(8)) }, // VANILLA: 9 DMG { ItemID.TungstenShortsword, Do(TrueMelee, DamageExact(15)) }, // VANILLA: 10 DMG - { ItemID.UnholyArrow, Do(DamageExact(11)) }, // VANILLA: 12 DMG { ItemID.UnholyTrident, Do(DamageRatio(0.91f)) }, // VANILLA: 88 DMG. Uses ratios due to remix seed { ItemID.Uzi, Do(UseExact(8)) }, // VANILLA: 9 UT { ItemID.ValkyrieYoyo, Do(DamageExact(48)) }, // VANILLA: 70 DMG. Has the same stats as Red's Throw @@ -289,6 +283,7 @@ namespace CalamityMod.Items { ItemID.AdamantiteDrill, Do(TrueMeleeNoSpeed, DamageExact(33), TileBoostExact(+0)) }, // VANILLA: 20 DMG, -1 TILE { ItemID.AdamantitePickaxe, Do(TileBoostExact(+1)) }, // VANILLA: 0 TILE { ItemID.AdamantiteWaraxe, Do(UseTimeExact(10), AxePower(160), TileBoostExact(+1)) }, // VANILLA: 8 SPD, 100 AXE, 0 TILE + { ItemID.AshWoodHammer, Do(UseTimeExact(7), HammerPower(25)) }, // VANILLA: 20 SPD, 45 HAM { ItemID.BloodLustCluster, Do(UseTimeExact(13), AxePower(100)) }, // VANILLA: 15 SPD, 75 AXE { ItemID.BonePickaxe, Do(UseTimeExact(6)) }, // VANILLA: 11 SPD { ItemID.BorealWoodHammer, Do(UseTimeExact(11), HammerPower(25)) }, // VANILLA: 23 SPD, 35 HAM @@ -399,6 +394,7 @@ namespace CalamityMod.Items #endregion #region CATEGORY 5: UseTurn + { ItemID.AshWoodSword, Do(UseTurn) }, { ItemID.BeeKeeper, Do(UseTurn) }, { ItemID.BladeofGrass, Do(UseTurn) }, { ItemID.BloodButcherer, Do(UseTurn) }, diff --git a/Items/Critters/BabyFlakCrabItem.cs b/Items/Critters/BabyFlakCrabItem.cs index 61d480672a..bc3fd2082a 100644 --- a/Items/Critters/BabyFlakCrabItem.cs +++ b/Items/Critters/BabyFlakCrabItem.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Items.Critters public override void SetDefaults() { Item.DefaultToCapturedCritter(ModContent.NPCType()); - Item.value = Item.sellPrice(silver: 10); - Item.rare = ItemRarityID.LightPurple; + Item.value = Item.sellPrice(silver: 5); + Item.rare = ItemRarityID.White; } } } diff --git a/Items/DraedonMisc/VoltageRegulationSystem.cs b/Items/DraedonMisc/VoltageRegulationSystem.cs index 08079cd86a..73c483832c 100644 --- a/Items/DraedonMisc/VoltageRegulationSystem.cs +++ b/Items/DraedonMisc/VoltageRegulationSystem.cs @@ -59,8 +59,8 @@ namespace CalamityMod.Items.DraedonMisc CreateRecipe(). AddIngredient(10). AddIngredient(10). - AddIngredient(5). - AddIngredient(ItemID.LunarBar, 5). + AddIngredient(10). + AddIngredient(ItemID.LunarBar, 10). AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(4, out Func condition), condition). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Dyes/ProfanedFlameDye.cs b/Items/Dyes/ProfanedFlameDye.cs index 5170ee340b..fbdfae0100 100644 --- a/Items/Dyes/ProfanedFlameDye.cs +++ b/Items/Dyes/ProfanedFlameDye.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Graphics.Shaders; using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.Items.Dyes { @@ -14,6 +15,7 @@ namespace CalamityMod.Items.Dyes public override void SafeSetStaticDefaults() { Item.ResearchUnlockCount = 3; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SafeSetDefaults() diff --git a/Items/Dyes/ProfanedMoonlightDye.cs b/Items/Dyes/ProfanedMoonlightDye.cs index 7b19417b60..110cdac0fb 100644 --- a/Items/Dyes/ProfanedMoonlightDye.cs +++ b/Items/Dyes/ProfanedMoonlightDye.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Graphics.Shaders; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Dyes @@ -12,6 +13,7 @@ namespace CalamityMod.Items.Dyes public override void SafeSetStaticDefaults() { Item.ResearchUnlockCount = 3; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SafeSetDefaults() diff --git a/Items/Fishing/FishingRods/EarlyBloomRod.cs b/Items/Fishing/FishingRods/EarlyBloomRod.cs index 417a8f5c16..7b1a7cac84 100644 --- a/Items/Fishing/FishingRods/EarlyBloomRod.cs +++ b/Items/Fishing/FishingRods/EarlyBloomRod.cs @@ -46,8 +46,7 @@ namespace CalamityMod.Items.Fishing.FishingRods public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.WoodFishingPole). - AddIngredient(6). + AddIngredient(8). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Fishing/FishingRods/FeralDoubleRod.cs b/Items/Fishing/FishingRods/FeralDoubleRod.cs index 46f766c8fb..c5f19e68c3 100644 --- a/Items/Fishing/FishingRods/FeralDoubleRod.cs +++ b/Items/Fishing/FishingRods/FeralDoubleRod.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Fishing.FishingRods public override void AddRecipes() { CreateRecipe(). - AddIngredient(6). + AddIngredient(8). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Fishing/FishingRods/HeronRod.cs b/Items/Fishing/FishingRods/HeronRod.cs index d869d50d5b..1010d34331 100644 --- a/Items/Fishing/FishingRods/HeronRod.cs +++ b/Items/Fishing/FishingRods/HeronRod.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Fishing.FishingRods public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(8). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Fishing/FishingRods/RiftReeler.cs b/Items/Fishing/FishingRods/RiftReeler.cs index 7b74df80bf..2d7a844748 100644 --- a/Items/Fishing/FishingRods/RiftReeler.cs +++ b/Items/Fishing/FishingRods/RiftReeler.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Fishing.FishingRods { CreateRecipe(). AddIngredient(ItemID.HotlineFishingHook). - AddIngredient(6). + AddIngredient(8). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Fishing/FishingRods/TheDevourerofCods.cs b/Items/Fishing/FishingRods/TheDevourerofCods.cs index 4d2de64f1f..684d355ddf 100644 --- a/Items/Fishing/FishingRods/TheDevourerofCods.cs +++ b/Items/Fishing/FishingRods/TheDevourerofCods.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Items.Fishing.FishingRods public override void AddRecipes() { CreateRecipe(). - AddIngredient(6). + AddIngredient(8). AddTile(). Register(); } diff --git a/Items/Fishing/FishingRods/VerstaltiteFishingRod.cs b/Items/Fishing/FishingRods/VerstaltiteFishingRod.cs index d789304590..a122f03b56 100644 --- a/Items/Fishing/FishingRods/VerstaltiteFishingRod.cs +++ b/Items/Fishing/FishingRods/VerstaltiteFishingRod.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Fishing.FishingRods public override void AddRecipes() { CreateRecipe(). - AddIngredient(6). + AddIngredient(8). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Fishing/FishingRods/WulfrumRod.cs b/Items/Fishing/FishingRods/WulfrumRod.cs index fe6708af6e..68e14d39f5 100644 --- a/Items/Fishing/FishingRods/WulfrumRod.cs +++ b/Items/Fishing/FishingRods/WulfrumRod.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Fishing.FishingRods public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(8). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Fishing/GlimmeringGemfish.cs b/Items/Fishing/GlimmeringGemfish.cs index 104d5559ac..1f136008a4 100644 --- a/Items/Fishing/GlimmeringGemfish.cs +++ b/Items/Fishing/GlimmeringGemfish.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using Terraria; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; @@ -45,13 +46,18 @@ namespace CalamityMod.Items.Fishing { int gemMin = 1; int gemMax = 3; - itemLoot.Add(ItemID.Amethyst, 2, gemMin, gemMax); - itemLoot.Add(ItemID.Topaz, 2, gemMin, gemMax); - itemLoot.Add(ItemID.Sapphire, 4, gemMin, gemMax); - itemLoot.Add(ItemID.Emerald, 4, gemMin, gemMax); - itemLoot.Add(ItemID.Ruby, 8, gemMin, gemMax); - itemLoot.Add(ItemID.Diamond, 10, gemMin, gemMax); - itemLoot.Add(ItemID.Amber, 8, gemMin, gemMax); + + IItemDropRule[] gems = [ + new CommonDrop(ItemID.Amethyst, 2, gemMin, gemMax), + new CommonDrop(ItemID.Topaz, 2, gemMin, gemMax), + new CommonDrop(ItemID.Sapphire, 4, gemMin, gemMax), + new CommonDrop(ItemID.Emerald, 4, gemMin, gemMax), + new CommonDrop(ItemID.Ruby, 8, gemMin, gemMax), + new CommonDrop(ItemID.Diamond, 8, gemMin, gemMax), + new CommonDrop(ItemID.Amber, 8, gemMin, gemMax), + ]; + + itemLoot.Add(new AlwaysAtleastOneSuccessDropRule(gems)); // Add Thorium gems if Thorium is loaded. Mod thorium = ExternalMods.thorium; diff --git a/Items/Fishing/Spadefish.cs b/Items/Fishing/Spadefish.cs index a2172c962b..5b21ce7e7a 100644 --- a/Items/Fishing/Spadefish.cs +++ b/Items/Fishing/Spadefish.cs @@ -290,8 +290,6 @@ namespace CalamityMod.Items.Fishing bool reset = false; - float oldSpin = 0; - int digDir = 0; float spinSin => MathF.Sin(spin); public override void SetDefaults() diff --git a/Items/Fishing/Spadefish.png b/Items/Fishing/Spadefish.png index 87e8d5a6fb..601b91c115 100644 Binary files a/Items/Fishing/Spadefish.png and b/Items/Fishing/Spadefish.png differ diff --git a/Items/Fishing/StuffedFish.cs b/Items/Fishing/StuffedFish.cs index 658d83fb17..4ee77f6e42 100644 --- a/Items/Fishing/StuffedFish.cs +++ b/Items/Fishing/StuffedFish.cs @@ -112,31 +112,6 @@ namespace CalamityMod.Items.Fishing } else CalamityMod.Log.Warn("Could not find either Marine Kelp or Marine Kelp Seeds from Thorium. These items will not be added to Stuffed Fish."); - - // Ozzatron 30DEC2022: It is unlikely SoA will ever be ported to 1.4 and beyond. Commenting this out indefinitely. - /* - Mod soa = CalamityMod.Instance.soa; - if (soa is not null) - { - try - { - itemLoot.Add(soa.Find("Welkinbell").Type, 4, herbMin, herbMax); - itemLoot.Add(soa.Find("WelkinbellSeeds").Type, 10, seedMin, seedMax); - - itemLoot.AddIf(() => Main.hardMode, soa.Find("Illumifern").Type, 4, herbMin, herbMax); - itemLoot.AddIf(() => Main.hardMode, soa.Find("IllumifernSeeds").Type, 10, seedMin, seedMax); - - // TODO -- There is no way to determine if SoA's Abaddon is dead without reflection. - // Dan Yami has confirmed that downed calls will be added to SoA eventually. - //itemLoot.AddIf(() => SacredTools.ModdedWorld.downedAbaddon, soa.Find("Enduflora").Type, 4, herbMin, herbMax); - //itemLoot.AddIf(() => SacredTools.ModdedWorld.downedAbaddon, soa.Find("EndufloraSeeds").Type, 10, seedMin, seedMax); - } - catch - { - CalamityMod.Log.Debug("One of the items in this file got renamed internally. Please report this in the #bugs-read-pins channel of the official Calamity discord server."); - } - } - */ } public override void ModifyTooltips(List list) diff --git a/Items/Materials/AerialiteBar.cs b/Items/Materials/AerialiteBar.cs index cb0828ae7b..9b77cf0757 100644 --- a/Items/Materials/AerialiteBar.cs +++ b/Items/Materials/AerialiteBar.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Materials public override void AddRecipes() { CreateRecipe(). - AddIngredient(4). + AddIngredient(3). AddTile(TileID.Furnaces). Register(); } diff --git a/Items/Materials/AstralBar.cs b/Items/Materials/AstralBar.cs index c216053063..9144f56b26 100644 --- a/Items/Materials/AstralBar.cs +++ b/Items/Materials/AstralBar.cs @@ -29,8 +29,8 @@ namespace CalamityMod.Items.Materials public override void AddRecipes() { CreateRecipe(). - AddIngredient(3). AddIngredient(2). + AddIngredient(3). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Materials/Bloodstone.cs b/Items/Materials/Bloodstone.cs index 2f1ab7ea6b..271968d400 100644 --- a/Items/Materials/Bloodstone.cs +++ b/Items/Materials/Bloodstone.cs @@ -5,6 +5,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Materials { + [LegacyName("BloodstoneCore")] public class Bloodstone : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Materials"; diff --git a/Items/Materials/BloodstoneCore.cs b/Items/Materials/BloodstoneCore.cs deleted file mode 100644 index 2e5607f957..0000000000 --- a/Items/Materials/BloodstoneCore.cs +++ /dev/null @@ -1,36 +0,0 @@ -using CalamityMod.Rarities; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Materials -{ - public class BloodstoneCore : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Materials"; - public override void SetStaticDefaults() - { - Item.ResearchUnlockCount = 25; - ItemID.Sets.SortingPriorityMaterials[Type] = 113; - } - - public override void SetDefaults() - { - Item.width = 15; - Item.height = 12; - Item.maxStack = Item.CommonMaxStack; - Item.value = Item.sellPrice(gold: 2); - Item.rare = ModContent.RarityType(); - } - - public override void AddRecipes() - { - CreateRecipe(2). - AddIngredient(5). - AddIngredient(). - AddIngredient(). - AddTile(TileID.MythrilAnvil). - Register(); - } - } -} diff --git a/Items/Materials/BloodstoneCore.png b/Items/Materials/BloodstoneCore.png deleted file mode 100644 index 4784da5dc1..0000000000 Binary files a/Items/Materials/BloodstoneCore.png and /dev/null differ diff --git a/Items/Materials/CoreofCalamity.cs b/Items/Materials/CoreofCalamity.cs index b2b4a1572f..d889896cb2 100644 --- a/Items/Materials/CoreofCalamity.cs +++ b/Items/Materials/CoreofCalamity.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Materials AddIngredient(). AddIngredient(). AddIngredient(). - AddIngredient(ItemID.Ectoplasm, 3). + AddIngredient(ItemID.Ectoplasm). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Materials/UnholyCore.cs b/Items/Materials/UnholyCore.cs index 101ac3199a..2bc0d699c1 100644 --- a/Items/Materials/UnholyCore.cs +++ b/Items/Materials/UnholyCore.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Items.Materials public override void AddRecipes() { CreateRecipe(). - AddIngredient(4). - AddIngredient(ItemID.Hellstone, 4). + AddIngredient(3). + AddIngredient(ItemID.Hellstone, 2). AddTile(TileID.Hellforge). Register(); } diff --git a/Items/Mounts/Brimrose.cs b/Items/Mounts/Brimrose.cs index 0368904f0e..441aa69276 100644 --- a/Items/Mounts/Brimrose.cs +++ b/Items/Mounts/Brimrose.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Mounts public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(10). AddIngredient(20). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Pets/GeyserShell.cs b/Items/Pets/GeyserShell.cs index 10d9d9b507..e5ecc5a9d3 100644 --- a/Items/Pets/GeyserShell.cs +++ b/Items/Pets/GeyserShell.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Pets { Item.DefaultToVanitypet(ModContent.ProjectileType(), ModContent.BuffType()); Item.value = Item.sellPrice(gold: 2); - Item.rare = ItemRarityID.Pink; + Item.rare = ItemRarityID.Orange; } public override void UseStyle(Player player, Rectangle heldItemFrame) diff --git a/Items/Placeables/Banners/BurrowerBanner.png b/Items/Placeables/Banners/BurrowerBanner.png index b7b032ef0f..fcf058699f 100644 Binary files a/Items/Placeables/Banners/BurrowerBanner.png and b/Items/Placeables/Banners/BurrowerBanner.png differ diff --git a/Items/Placeables/Furniture/AstralBeaconItem.cs b/Items/Placeables/Furniture/AstralBeaconItem.cs index 0d65f56b47..860514818c 100644 --- a/Items/Placeables/Furniture/AstralBeaconItem.cs +++ b/Items/Placeables/Furniture/AstralBeaconItem.cs @@ -20,9 +20,9 @@ namespace CalamityMod.Items.Placeables.Furniture public override void AddRecipes() { CreateRecipe(). + AddIngredient(30). AddIngredient(5). AddIngredient(20). - AddIngredient(30). AddTile(TileID.HeavyWorkBench). Register(); } diff --git a/Items/Placeables/Furniture/CorruptionEffigy.png b/Items/Placeables/Furniture/CorruptionEffigy.png index d7ba8c6e67..8156c8441a 100644 Binary files a/Items/Placeables/Furniture/CorruptionEffigy.png and b/Items/Placeables/Furniture/CorruptionEffigy.png differ diff --git a/Items/Placeables/Furniture/CraftingStations/CosmicAnvilItem.cs b/Items/Placeables/Furniture/CraftingStations/CosmicAnvilItem.cs index 5da9b8e3af..75f187544e 100644 --- a/Items/Placeables/Furniture/CraftingStations/CosmicAnvilItem.cs +++ b/Items/Placeables/Furniture/CraftingStations/CosmicAnvilItem.cs @@ -29,11 +29,6 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations AddRecipeGroup("HardmodeAnvil"). AddIngredient(10). AddIngredient(ItemID.LunarBar, 10). - AddIngredient(ItemID.FragmentSolar, 12). - AddIngredient(ItemID.FragmentVortex, 12). - AddIngredient(ItemID.FragmentNebula, 12). - AddIngredient(ItemID.FragmentStardust, 12). - AddIngredient(12). AddIngredient(20). AddTile(TileID.LunarCraftingStation). Register(); diff --git a/Items/Placeables/Furniture/CrimsonEffigy.png b/Items/Placeables/Furniture/CrimsonEffigy.png index 28df6f8fa0..1fe7117bd2 100644 Binary files a/Items/Placeables/Furniture/CrimsonEffigy.png and b/Items/Placeables/Furniture/CrimsonEffigy.png differ diff --git a/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs b/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs index e9d47d8eef..3cc1f958ab 100644 --- a/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs +++ b/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs @@ -62,11 +62,13 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings "Altixal", "apotofkoolaid", "ArchonSystem", + "Astrum Deus", "Atalya", "Ben-TK", "Big E", "carnymassacre", "CDMusic", + "Cei", "CongratsIsTrash", "Cooper", "CosmaticMango", @@ -90,12 +92,12 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings "sixtydegrees", "StipulateVenus", "Sunny", - "_tofu", "Tomat", "Triangle", "TYESKI", "Xyk", "YuH", + "Zarachard", }; public static IList formerDevList = new List() @@ -114,9 +116,9 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings "Blockaroz", "Boffin", "Bravioli", - "Cei", "Chetto", "Chill Dude", + "ClockworkShade", "Cobalion", "Daim", "DarkTiny", @@ -189,7 +191,6 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings "Runefield", "Sargassum", "sentri", - "Shade", "SharZz", "Shucks", "Silver-Lord of Ash", diff --git a/Items/Placeables/Furniture/PiggyCageGold.png b/Items/Placeables/Furniture/PiggyCageGold.png index 481b99da72..1c76eec452 100644 Binary files a/Items/Placeables/Furniture/PiggyCageGold.png and b/Items/Placeables/Furniture/PiggyCageGold.png differ diff --git a/Items/Placeables/Furniture/ResilientCandle.cs b/Items/Placeables/Furniture/ResilientCandle.cs index 0bb9adab8a..8f9d6ca529 100644 --- a/Items/Placeables/Furniture/ResilientCandle.cs +++ b/Items/Placeables/Furniture/ResilientCandle.cs @@ -10,14 +10,14 @@ namespace CalamityMod.Items.Placeables.Furniture { public new string LocalizationCategory => "Items.Placeables"; - public static float DefenseRatioBonus = 0.1f; + public static float DefenseRatioBonus = 0.15f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DefenseRatioBonus.ToPercent(), (0.5f + DefenseRatioBonus).ToPercent(), (0.75f + DefenseRatioBonus).ToPercent(), (1f + DefenseRatioBonus).ToPercent()); public override void SetDefaults() { Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.buyPrice(gold: 25); // Sold by Wizard - Item.rare = ItemRarityID.Pink; + Item.rare = ItemRarityID.Purple; } } } diff --git a/Items/Placeables/Furniture/SpitefulCandle.cs b/Items/Placeables/Furniture/SpitefulCandle.cs index 1c6cf59f01..de60ea2da3 100644 --- a/Items/Placeables/Furniture/SpitefulCandle.cs +++ b/Items/Placeables/Furniture/SpitefulCandle.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.Furniture { Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.buyPrice(gold: 25); // Sold by Wizard - Item.rare = ItemRarityID.Pink; + Item.rare = ItemRarityID.Purple; } } } diff --git a/Items/Placeables/Furniture/VigorousCandle.cs b/Items/Placeables/Furniture/VigorousCandle.cs index e203002839..9bfcb02fb6 100644 --- a/Items/Placeables/Furniture/VigorousCandle.cs +++ b/Items/Placeables/Furniture/VigorousCandle.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.Furniture { Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.buyPrice(gold: 25); // Sold by Wizard - Item.rare = ItemRarityID.Pink; + Item.rare = ItemRarityID.Purple; } } } diff --git a/Items/Placeables/Furniture/WeightlessCandle.cs b/Items/Placeables/Furniture/WeightlessCandle.cs index 834e56cb4d..ea8b595f98 100644 --- a/Items/Placeables/Furniture/WeightlessCandle.cs +++ b/Items/Placeables/Furniture/WeightlessCandle.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture { Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.buyPrice(gold: 25); // Sold by Wizard - Item.rare = ItemRarityID.Pink; + Item.rare = ItemRarityID.Purple; } } } diff --git a/Items/Placeables/FurnitureWulfrum/AnodizedWulfrumTrim.cs b/Items/Placeables/FurnitureWulfrum/AnodizedWulfrumTrim.cs index e763e16d37..b1b10e69d4 100644 --- a/Items/Placeables/FurnitureWulfrum/AnodizedWulfrumTrim.cs +++ b/Items/Placeables/FurnitureWulfrum/AnodizedWulfrumTrim.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Walls; using Terraria.ID; using Terraria.ModLoader; @@ -21,6 +22,11 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum AddIngredient(). AddTile(TileID.HeavyWorkBench). Register(); + CreateRecipe(). + AddIngredient(4). + AddTile(TileID.WorkBenches). + DisableDecraft(). + Register(); } } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumPlating.cs b/Items/Placeables/FurnitureWulfrum/WulfrumPlating.cs index a77f27331c..6c032ef1db 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumPlating.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumPlating.cs @@ -27,6 +27,11 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum AddTile(TileID.WorkBenches). DisableDecraft(). Register(); + CreateRecipe(). + AddIngredient(4). + AddTile(TileID.WorkBenches). + DisableDecraft(). + Register(); } } } diff --git a/Items/Placeables/Pylons/CragsPylon.cs b/Items/Placeables/Pylons/CragsPylon.cs index 43631e2f86..ffa871b73e 100644 --- a/Items/Placeables/Pylons/CragsPylon.cs +++ b/Items/Placeables/Pylons/CragsPylon.cs @@ -16,15 +16,5 @@ namespace CalamityMod.Items.Placeables.Pylons Item.value = Item.sellPrice(gold: 2); Item.rare = ItemRarityID.Blue; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(15). - AddIngredient(10). - AddIngredient(ItemID.Hellstone, 15). - AddTile(TileID.Anvils). - Register(); - } } } diff --git a/Items/Placeables/Walls/AnodizedWulfrumTrimWall.cs b/Items/Placeables/Walls/AnodizedWulfrumTrimWall.cs index aef59907c9..d60c4b01fd 100644 --- a/Items/Placeables/Walls/AnodizedWulfrumTrimWall.cs +++ b/Items/Placeables/Walls/AnodizedWulfrumTrimWall.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.FurnitureWulfrum; using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; @@ -17,8 +17,8 @@ namespace CalamityMod.Items.Placeables.Walls public override void AddRecipes() { - CreateRecipe(8). - AddIngredient(). + CreateRecipe(4). + AddIngredient(). AddTile(TileID.WorkBenches). Register(); } diff --git a/Items/Placeables/Walls/RoundedAnodizedWulfrumPanelWall.cs b/Items/Placeables/Walls/RoundedAnodizedWulfrumPanelWall.cs index 566caf0e2f..18766b942d 100644 --- a/Items/Placeables/Walls/RoundedAnodizedWulfrumPanelWall.cs +++ b/Items/Placeables/Walls/RoundedAnodizedWulfrumPanelWall.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void AddRecipes() { - CreateRecipe(8). + CreateRecipe(4). AddIngredient(). AddTile(TileID.WorkBenches). Register(); diff --git a/Items/Placeables/Walls/WulfrumComplexPanelWall.cs b/Items/Placeables/Walls/WulfrumComplexPanelWall.cs index 17c7c70994..8e8c35a078 100644 --- a/Items/Placeables/Walls/WulfrumComplexPanelWall.cs +++ b/Items/Placeables/Walls/WulfrumComplexPanelWall.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.FurnitureWulfrum; using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; @@ -17,10 +17,8 @@ namespace CalamityMod.Items.Placeables.Walls public override void AddRecipes() { - CreateRecipe(8). - AddIngredient(). - AddIngredient(). - AddIngredient(). + CreateRecipe(4). + AddIngredient(). AddTile(TileID.WorkBenches). Register(); } diff --git a/Items/Placeables/Walls/WulfrumPillar.cs b/Items/Placeables/Walls/WulfrumPillar.cs index 224ebd54e7..4d4022dabb 100644 --- a/Items/Placeables/Walls/WulfrumPillar.cs +++ b/Items/Placeables/Walls/WulfrumPillar.cs @@ -17,8 +17,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void AddRecipes() { - CreateRecipe(8). - AddIngredient(). + CreateRecipe(4). AddIngredient(). AddTile(TileID.WorkBenches). Register(); diff --git a/Items/Potions/AstralInjection.cs b/Items/Potions/AstralInjection.cs index 4cbbc4eaf7..c5f4553b86 100644 --- a/Items/Potions/AstralInjection.cs +++ b/Items/Potions/AstralInjection.cs @@ -38,8 +38,8 @@ namespace CalamityMod.Items.Potions { CreateRecipe(15). AddIngredient(ItemID.SuperManaPotion, 15). - AddIngredient(4). AddIngredient(). + AddIngredient(4). AddTile(TileID.Bottles). Register() .DisableDecraft(); diff --git a/Items/Potions/Food/HadalStew.cs b/Items/Potions/Food/HadalStew.cs index 49567ef489..80b3f38274 100644 --- a/Items/Potions/Food/HadalStew.cs +++ b/Items/Potions/Food/HadalStew.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Potions.Food { public new string LocalizationCategory => "Items.Potions"; public static int BuffType = BuffID.WellFed3; - public static int BuffDuration = CalamityUtils.MinutesToFrames(8); + public static int BuffDuration = CalamityUtils.MinutesToFrames(4); public static int SicknessDuration = CalamityUtils.SecondsToFrames(50); public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(BuffDuration / 3600); @@ -55,14 +55,14 @@ namespace CalamityMod.Items.Potions.Food { CreateRecipe(). AddIngredient(3). - AddIngredient(). + AddIngredient(2). AddIngredient(ItemID.Bowl). AddTile(TileID.CookingPots). Register(); CreateRecipe(). AddIngredient(3). - AddIngredient(). + AddIngredient(2). AddIngredient(ItemID.Bowl). AddTile(TileID.CookingPots). Register(); diff --git a/Items/Potions/Food/LavaChickenBroth.cs b/Items/Potions/Food/LavaChickenBroth.cs index f418a525e5..911cc73642 100644 --- a/Items/Potions/Food/LavaChickenBroth.cs +++ b/Items/Potions/Food/LavaChickenBroth.cs @@ -14,6 +14,8 @@ namespace CalamityMod.Items.Potions.Food { public new string LocalizationCategory => "Items.Potions"; public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/SoupConsumption"); + public static readonly SoundStyle MisophonicUseSound = new("CalamityMod/Sounds/Item/SoupConsumptionMisophonic"); + public SlotId DrinkSoundSlot; public override void SetStaticDefaults() @@ -38,7 +40,10 @@ namespace CalamityMod.Items.Potions.Food } public override bool? UseItem(Player player) { - DrinkSoundSlot = SoundEngine.PlaySound(UseSound, player.Center); + if (!CalamityClientConfig.Instance.MisophoniaSupport) + DrinkSoundSlot = SoundEngine.PlaySound(UseSound, player.Center); + else + DrinkSoundSlot = SoundEngine.PlaySound(MisophonicUseSound, player.Center); return true; } diff --git a/Items/Potions/SoaringPotion.cs b/Items/Potions/SoaringPotion.cs index 0404bafdb8..1934f9a9fb 100644 --- a/Items/Potions/SoaringPotion.cs +++ b/Items/Potions/SoaringPotion.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Items.Potions { public new string LocalizationCategory => "Items.Potions"; - public static float FlightBoost = 0.1f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(FlightBoost.ToPercent()); + public static float FlightTimeBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(FlightTimeBoost.ToPercent()); public override void SetStaticDefaults() { diff --git a/Items/SummonItems/AstralChunk.cs b/Items/SummonItems/AstralChunk.cs index 539b1854a8..b28431bf9e 100644 --- a/Items/SummonItems/AstralChunk.cs +++ b/Items/SummonItems/AstralChunk.cs @@ -55,9 +55,9 @@ namespace CalamityMod.Items.SummonItems public override void AddRecipes() { CreateRecipe(). - AddIngredient(30). - AddIngredient(ItemID.FallenStar, 20). AddIngredient(8). + AddIngredient(ItemID.FallenStar, 20). + AddIngredient(30). AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(2, out Func condition), condition). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/SummonItems/CharredIdol.cs b/Items/SummonItems/CharredIdol.cs index 48063cc2bc..f9b862ef9c 100644 --- a/Items/SummonItems/CharredIdol.cs +++ b/Items/SummonItems/CharredIdol.cs @@ -49,9 +49,9 @@ namespace CalamityMod.Items.SummonItems public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.SoulofNight, 5). + AddIngredient(5). AddIngredient(7). - AddIngredient(2). + AddIngredient(ItemID.SoulofNight, 5). AddTile(TileID.Hellforge). Register(); } diff --git a/Items/SummonItems/CosmicWorm.cs b/Items/SummonItems/CosmicWorm.cs index 341e60f662..a1c210079a 100644 --- a/Items/SummonItems/CosmicWorm.cs +++ b/Items/SummonItems/CosmicWorm.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.SummonItems Item.useTime = 10; Item.useStyle = ItemUseStyleID.HoldUp; Item.consumable = false; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) diff --git a/Items/SummonItems/DeathWhistle.cs b/Items/SummonItems/DeathWhistle.cs index 50784255c0..f01a6ca8eb 100644 --- a/Items/SummonItems/DeathWhistle.cs +++ b/Items/SummonItems/DeathWhistle.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.SummonItems int posX = (int)(player.position.X + Main.rand.Next(-250, 251)); int posY = (int)(player.position.Y - 500f); int bossToSpawn = ModContent.NPCType(); - CalamityUtils.SpawnBossOnPosUsingItem(player, bossToSpawn, posX, posY, SoundID.ScaryScream); + CalamityUtils.SpawnBossOnPosUsingItem(player, bossToSpawn, posX, posY, CalamityClientConfig.Instance.MisophoniaSupport ? SoundID.Roar : SoundID.ScaryScream); return true; } diff --git a/Items/SummonItems/ProfanedCore.cs b/Items/SummonItems/ProfanedCore.cs index 0176a2ae0c..4cb746ce79 100644 --- a/Items/SummonItems/ProfanedCore.cs +++ b/Items/SummonItems/ProfanedCore.cs @@ -1,4 +1,6 @@ -using CalamityMod.Events; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Events; using CalamityMod.NPCs; using CalamityMod.NPCs.Providence; using CalamityMod.Projectiles.Boss; @@ -36,28 +38,27 @@ namespace CalamityMod.Items.SummonItems public override bool CanUseItem(Player player) { - var Prov = CalamityGlobalNPC.holyBoss; - bool canPissOffProvi = Prov != -1 && Main.npc[Prov].life >= (Main.npc[Prov].lifeMax * 0.95f) && Main.npc[Prov].Calamity().newAI[3] >= 180f && !Main.npc[Prov].Calamity().CurrentlyEnraged; - return ((!NPC.AnyNPCs(ModContent.NPCType()) && (player.ZoneHallow || player.ZoneUnderworldHeight)) || canPissOffProvi) && !BossRushEvent.BossRushActive; + return !NPC.AnyNPCs(ModContent.NPCType()) && (player.ZoneHallow || player.ZoneUnderworldHeight) && !BossRushEvent.BossRushActive; } public override bool? UseItem(Player player) { - var Prov = CalamityGlobalNPC.holyBoss; - bool usingToMakeProviPissedOff = Prov != -1 && Main.npc[Prov].life >= (Main.npc[Prov].lifeMax * 0.95f) && Main.npc[Prov].Calamity().newAI[3] >= 180f && !Main.npc[Prov].Calamity().CurrentlyEnraged; - if (usingToMakeProviPissedOff) + int posX = (int)player.position.X; + int posY = (int)(player.position.Y - 100f); + int bossToSpawn = ModContent.NPCType(); + NPC prov = CalamityUtils.SpawnBossOnPosUsingItem(player, bossToSpawn, posX, posY, Providence.SpawnSound); + if (Main.getGoodWorld) { - (Main.npc[Prov].ModNPC as Providence).hasBeenGivenFullPower = true; + (prov.ModNPC as Providence).hasBeenGivenFullPower = true; Projectile.NewProjectile(Item.GetSource_FromThis(), player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0); } - else - { - int posX = (int)player.position.X; - int posY = (int)(player.position.Y - 100f); - int bossToSpawn = ModContent.NPCType(); - CalamityUtils.SpawnBossOnPosUsingItem(player, bossToSpawn, posX, posY, Providence.SpawnSound); - } return true; } + + public override void ModifyTooltips(List tooltips) + { + string enrageTooltip = Main.getGoodWorld ? "\n" + this.GetLocalizedValue("EnrageText") : ""; + tooltips.FindAndReplace("[ENRAGE]", enrageTooltip); + } } } diff --git a/Items/SummonItems/Starcore.cs b/Items/SummonItems/Starcore.cs index c1fb8b87ce..db47c407a1 100644 --- a/Items/SummonItems/Starcore.cs +++ b/Items/SummonItems/Starcore.cs @@ -28,9 +28,9 @@ namespace CalamityMod.Items.SummonItems public override void AddRecipes() { CreateRecipe(). - AddIngredient(25). + AddIngredient(8). AddIngredient(8). - AddIngredient(4). + AddIngredient(25). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/SummonItems/YharonEgg.cs b/Items/SummonItems/YharonEgg.cs index f5b1b48745..9e5f3d5bf6 100644 --- a/Items/SummonItems/YharonEgg.cs +++ b/Items/SummonItems/YharonEgg.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.SummonItems Item.useTime = 10; Item.useStyle = ItemUseStyleID.HoldUp; Item.consumable = false; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) diff --git a/Items/Tools/AbyssalWarhammer.cs b/Items/Tools/AbyssalWarhammer.cs index 9339432c58..b09100613e 100644 --- a/Items/Tools/AbyssalWarhammer.cs +++ b/Items/Tools/AbyssalWarhammer.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityPinkBuyPrice; + Item.value = Item.sellPrice(gold: 3); Item.rare = ItemRarityID.Pink; Item.UseSound = SoundID.Item1; Item.autoReuse = true; @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(). - AddIngredient(8). + AddIngredient(12). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Tools/AcidwoodHammer.cs b/Items/Tools/AcidwoodHammer.cs index 4bd66b4d49..86857307bf 100644 --- a/Items/Tools/AcidwoodHammer.cs +++ b/Items/Tools/AcidwoodHammer.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -9,21 +10,11 @@ namespace CalamityMod.Items.Tools public new string LocalizationCategory => "Items.Tools"; public override void SetDefaults() { - Item.damage = 10; - Item.knockBack = 3.5f; - Item.useTime = 9; - Item.useAnimation = 20; - Item.hammer = 25; - - Item.DamageType = DamageClass.Melee; + Item.CloneDefaults(ItemID.ShadewoodHammer); // Ash Wood > Acidwood > Shadewood Item.width = 40; Item.height = 40; - Item.useTurn = true; - Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityWhiteBuyPrice; - Item.rare = ItemRarityID.White; - Item.UseSound = SoundID.Item1; - Item.autoReuse = true; + Item.damage = 8; + Item.useTime = 8; // Due to vanilla tool tweaks; otherwise apply 40% hammer power } public override void AddRecipes() { diff --git a/Items/Tools/AerialHamaxe.cs b/Items/Tools/AerialHamaxe.cs index 844958f74b..4d935cd5c6 100644 --- a/Items/Tools/AerialHamaxe.cs +++ b/Items/Tools/AerialHamaxe.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.value = Item.sellPrice(silver: 60); Item.rare = ItemRarityID.Orange; Item.UseSound = SoundID.Item1; Item.autoReuse = true; @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(10). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Tools/AstralHamaxe.cs b/Items/Tools/AstralHamaxe.cs index 0caf445b78..b6b8a3f1b1 100644 --- a/Items/Tools/AstralHamaxe.cs +++ b/Items/Tools/AstralHamaxe.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityCyanBuyPrice; + Item.value = Item.sellPrice(gold: 4, silver: 50); Item.rare = ItemRarityID.Cyan; Item.UseSound = SoundID.Item1; Item.autoReuse = true; @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(). - AddIngredient(8). + AddIngredient(18). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Tools/AstralPickaxe.cs b/Items/Tools/AstralPickaxe.cs index a0fc904380..6f0c168811 100644 --- a/Items/Tools/AstralPickaxe.cs +++ b/Items/Tools/AstralPickaxe.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityCyanBuyPrice; + Item.value = Item.sellPrice(gold: 6); Item.rare = ItemRarityID.Cyan; Item.UseSound = SoundID.Item1; Item.autoReuse = true; @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(18). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Tools/BeastialPickaxe.cs b/Items/Tools/BeastialPickaxe.cs index 9269689fc5..b62feef26f 100644 --- a/Items/Tools/BeastialPickaxe.cs +++ b/Items/Tools/BeastialPickaxe.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityLimeBuyPrice; + Item.value = Item.sellPrice(gold: 4, silver: 35); Item.rare = ItemRarityID.Lime; Item.UseSound = SoundID.Item1; Item.autoReuse = true; @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(15). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Tools/BerserkerWaraxe.cs b/Items/Tools/BerserkerWaraxe.cs index 9f08128517..e7bb1a9bc5 100644 --- a/Items/Tools/BerserkerWaraxe.cs +++ b/Items/Tools/BerserkerWaraxe.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityLimeBuyPrice; + Item.value = Item.sellPrice(gold: 4, silver: 35); Item.rare = ItemRarityID.Lime; Item.UseSound = SoundID.Item1; Item.autoReuse = true; @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(). - AddIngredient(9). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Tools/BlossomPickaxe.cs b/Items/Tools/BlossomPickaxe.cs index 3af6f63a84..03cf2acb1f 100644 --- a/Items/Tools/BlossomPickaxe.cs +++ b/Items/Tools/BlossomPickaxe.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; + Item.value = Item.sellPrice(gold: 10); Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.rare = ModContent.RarityType(); @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(18). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Tools/BrimstoneLocus.cs b/Items/Tools/BrimstoneLocus.cs index 19e3fab570..10370ad4a2 100644 --- a/Items/Tools/BrimstoneLocus.cs +++ b/Items/Tools/BrimstoneLocus.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Tools { CreateRecipe(). AddIngredient(). - AddIngredient(3). + AddIngredient(10). Register(); } } diff --git a/Items/Tools/ClimateChange/AridArtifact.cs b/Items/Tools/ClimateChange/AridArtifact.cs index 2e685defcd..c8ab0cfa54 100644 --- a/Items/Tools/ClimateChange/AridArtifact.cs +++ b/Items/Tools/ClimateChange/AridArtifact.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Tools.ClimateChange CreateRecipe(). AddRecipeGroup("Sand", 50). AddRecipeGroup("AnyAdamantiteBar", 10). - AddIngredient(ItemID.AncientCloth, 5). + AddIngredient(ItemID.AncientCloth, 3). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Tools/ClimateChange/Cosmolight.cs b/Items/Tools/ClimateChange/Cosmolight.cs index 1eced6ca1b..c894283834 100644 --- a/Items/Tools/ClimateChange/Cosmolight.cs +++ b/Items/Tools/ClimateChange/Cosmolight.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Tools.ClimateChange CreateRecipe(). AddIngredient(). AddIngredient(ItemID.Sundial). - AddIngredient(3). + AddIngredient(12). AddIngredient(ItemID.FragmentSolar, 15). AddTile(TileID.DemonAltar). Register(); @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Tools.ClimateChange CreateRecipe(). AddIngredient(). AddIngredient(ItemID.Moondial). - AddIngredient(3). + AddIngredient(12). AddIngredient(ItemID.FragmentSolar, 15). AddTile(TileID.DemonAltar). Register(); diff --git a/Items/Tools/CrystylCrusher.cs b/Items/Tools/CrystylCrusher.cs index 79a4fa8f1c..deeaaa7431 100644 --- a/Items/Tools/CrystylCrusher.cs +++ b/Items/Tools/CrystylCrusher.cs @@ -144,5 +144,7 @@ namespace CalamityMod.Items.Tools AddTile(). Register(); } + + public static Color RarityColor() => new Color(129, 29, 149); } } diff --git a/Items/Tools/DriftwoodHammer.cs b/Items/Tools/DriftwoodHammer.cs index 4db3883330..d5a85df5c4 100644 --- a/Items/Tools/DriftwoodHammer.cs +++ b/Items/Tools/DriftwoodHammer.cs @@ -10,26 +10,15 @@ namespace CalamityMod.Items.Tools { public new string LocalizationCategory => "Items.Tools"; - public static int NormalUseTime = 11; - public static int FasterUseTime = 8; + public static int NormalUseTime = 9; // Equals Shadewood + public static int FasterUseTime = 7; public override void SetDefaults() { - Item.damage = 13; - Item.knockBack = 4f; - Item.useTime = NormalUseTime; - Item.useAnimation = 31; - Item.hammer = 25; - - Item.DamageType = DamageClass.Melee; + Item.CloneDefaults(ItemID.ShadewoodHammer); // Driftwood (base) = Shadewood Item.width = 40; Item.height = 42; - Item.useTurn = true; - Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityWhiteBuyPrice; - Item.rare = ItemRarityID.White; - Item.UseSound = SoundID.Item1; - Item.autoReuse = true; + Item.useTime = NormalUseTime; } // The tool is mechanically faster when wet. diff --git a/Items/Tools/Gelpick.cs b/Items/Tools/Gelpick.cs index fc35ce49da..8b7dcf1334 100644 --- a/Items/Tools/Gelpick.cs +++ b/Items/Tools/Gelpick.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; + Item.value = Item.sellPrice(silver: 75); Item.rare = ItemRarityID.LightRed; Item.UseSound = SoundID.Item1; Item.autoReuse = true; @@ -32,8 +32,8 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). - AddIngredient(12). + AddIngredient(18). + AddIngredient(18). AddTile(TileID.Solidifier). Register(); } diff --git a/Items/Tools/GenesisPickaxe.cs b/Items/Tools/GenesisPickaxe.cs index 444ac16aac..6672362d5d 100644 --- a/Items/Tools/GenesisPickaxe.cs +++ b/Items/Tools/GenesisPickaxe.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityRedBuyPrice; + Item.value = Item.sellPrice(gold: 7); Item.rare = ItemRarityID.Red; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/Grax.cs b/Items/Tools/Grax.cs index c586a680e5..b692e7290b 100644 --- a/Items/Tools/Grax.cs +++ b/Items/Tools/Grax.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Items.Tools CreateRecipe(). AddIngredient(). AddRecipeGroup("LunarHamaxe"). - AddIngredient(5). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Tools/GreatbayPickaxe.cs b/Items/Tools/GreatbayPickaxe.cs index ca95c84031..bd7f066dfb 100644 --- a/Items/Tools/GreatbayPickaxe.cs +++ b/Items/Tools/GreatbayPickaxe.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -20,7 +21,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityGreenBuyPrice; + Item.value = Item.sellPrice(silver: 30); Item.rare = ItemRarityID.Green; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/MarniteDeconstructor.cs b/Items/Tools/MarniteDeconstructor.cs index 25f1c986f9..38d4bc78d6 100644 --- a/Items/Tools/MarniteDeconstructor.cs +++ b/Items/Tools/MarniteDeconstructor.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Tools Item.noMelee = true; Item.noUseGraphic = true; - Item.value = CalamityGlobalItem.RarityBlueBuyPrice; + Item.value = Item.sellPrice(silver: 30); Item.rare = ItemRarityID.Blue; } diff --git a/Items/Tools/MarniteObliterator.cs b/Items/Tools/MarniteObliterator.cs index 4e8ffccdb8..3ee7960dd3 100644 --- a/Items/Tools/MarniteObliterator.cs +++ b/Items/Tools/MarniteObliterator.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Tools Item.noMelee = true; Item.noUseGraphic = true; - Item.value = CalamityGlobalItem.RarityBlueBuyPrice; + Item.value = Item.sellPrice(silver: 30); Item.rare = ItemRarityID.Blue; } diff --git a/Items/Tools/MonolithHammer.cs b/Items/Tools/MonolithHammer.cs index 0280dc5695..b5e9e68bda 100644 --- a/Items/Tools/MonolithHammer.cs +++ b/Items/Tools/MonolithHammer.cs @@ -12,23 +12,14 @@ namespace CalamityMod.Items.Tools public new string LocalizationCategory => "Items.Tools"; public override void SetDefaults() { - Item.damage = 29; - Item.knockBack = 2.5f; - Item.useTime = 5; - Item.useAnimation = 9; - Item.hammer = 35; - Item.tileBoost = 1; - - Item.DamageType = DamageClass.Melee; + Item.CloneDefaults(ItemID.PearlwoodHammer); // Monolith >= Pearlwood Item.width = 46; Item.height = 44; - Item.useTurn = true; - Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; - Item.rare = ItemRarityID.Orange; - Item.UseSound = SoundID.Item1; - Item.autoReuse = true; + Item.damage = 30; + Item.useAnimation = 14; + Item.tileBoost = 1; } + public override void MeleeEffects(Player player, Rectangle hitbox) { if (Main.rand.NextBool(3)) diff --git a/Items/Tools/ReefclawHamaxe.cs b/Items/Tools/ReefclawHamaxe.cs index 366d49d15d..d896019c96 100644 --- a/Items/Tools/ReefclawHamaxe.cs +++ b/Items/Tools/ReefclawHamaxe.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,7 +22,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityGreenBuyPrice; + Item.value = Item.sellPrice(silver: 30); Item.rare = ItemRarityID.Green; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/SeismicHampick.cs b/Items/Tools/SeismicHampick.cs index 626b208649..9b3181d210 100644 --- a/Items/Tools/SeismicHampick.cs +++ b/Items/Tools/SeismicHampick.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityYellowBuyPrice; + Item.value = Item.sellPrice(gold: 4, silver: 35); Item.rare = ItemRarityID.Yellow; Item.UseSound = SoundID.Item1; Item.autoReuse = true; @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(15). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Tools/ShardlightPickaxe.cs b/Items/Tools/ShardlightPickaxe.cs index 019d52c300..e20c0c045a 100644 --- a/Items/Tools/ShardlightPickaxe.cs +++ b/Items/Tools/ShardlightPickaxe.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityPinkBuyPrice; + Item.value = Item.sellPrice(gold: 3); Item.rare = ItemRarityID.Pink; Item.UseSound = SoundID.Item1; Item.autoReuse = true; @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(18). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Tools/SkyfringePickaxe.cs b/Items/Tools/SkyfringePickaxe.cs index f92338d42d..e41e1309c4 100644 --- a/Items/Tools/SkyfringePickaxe.cs +++ b/Items/Tools/SkyfringePickaxe.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.value = Item.sellPrice(silver: 60); Item.rare = ItemRarityID.Orange; Item.UseSound = SoundID.Item1; Item.autoReuse = true; @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(15). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Tools/SpawnBlocker/AntiCystOintment.cs b/Items/Tools/SpawnBlocker/AntiCystOintment.cs index 08abe17ffe..113db25d9e 100644 --- a/Items/Tools/SpawnBlocker/AntiCystOintment.cs +++ b/Items/Tools/SpawnBlocker/AntiCystOintment.cs @@ -60,45 +60,6 @@ namespace CalamityMod.Items.Tools.SpawnBlocker player.Calamity().disablePerfCystSpawns |= Enabled; } - /* - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) - { - Texture2D texture; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/AntiCystOintment").Value; - spriteBatch.Draw(texture, position, null, Color.White, 0f, origin, scale, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/AntiCystOintment").Value; - spriteBatch.Draw(texture, position, null, Color.White, 0f, origin, scale, SpriteEffects.None, 0); - } - - return false; - } - - public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) - { - Texture2D texture; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/AntiCystOintment").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/AntiCystOintment").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - return false; - } - */ - public override void ModifyTooltips(List tooltips) { string text; diff --git a/Items/Tools/SpawnBlocker/AntiTumorOintment.cs b/Items/Tools/SpawnBlocker/AntiTumorOintment.cs index 564dc8d4c3..97b59f6657 100644 --- a/Items/Tools/SpawnBlocker/AntiTumorOintment.cs +++ b/Items/Tools/SpawnBlocker/AntiTumorOintment.cs @@ -60,45 +60,6 @@ namespace CalamityMod.Items.Tools.SpawnBlocker player.Calamity().disableHiveCystSpawns |= Enabled; } - /* - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) - { - Texture2D texture; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/AntiTumorOintment").Value; - spriteBatch.Draw(texture, position, null, Color.White, 0f, origin, scale, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/AntiTumorOintment").Value; - spriteBatch.Draw(texture, position, null, Color.White, 0f, origin, scale, SpriteEffects.None, 0); - } - - return false; - } - - public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) - { - Texture2D texture; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/AntiTumorOintment").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/AntiTumorOintment").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - return false; - } - */ - public override void ModifyTooltips(List tooltips) { string text; diff --git a/Items/Tools/SpawnBlocker/BleachBall.cs b/Items/Tools/SpawnBlocker/BleachBall.cs index c2c6df1948..1cf4051fc4 100644 --- a/Items/Tools/SpawnBlocker/BleachBall.cs +++ b/Items/Tools/SpawnBlocker/BleachBall.cs @@ -61,45 +61,6 @@ namespace CalamityMod.Items.Tools.SpawnBlocker player.Calamity().disableNaturalScourgeSpawns |= Enabled; } - /* - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) - { - Texture2D texture; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/BleachBall").Value; - spriteBatch.Draw(texture, position, null, Color.White, 0f, origin, scale, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/BleachBall").Value; - spriteBatch.Draw(texture, position, null, Color.White, 0f, origin, scale, SpriteEffects.None, 0); - } - - return false; - } - - public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) - { - Texture2D texture; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/BleachBall").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/BleachBall").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - return false; - } - */ - public override void ModifyTooltips(List tooltips) { string text; diff --git a/Items/Tools/SpawnBlocker/BrokenWaterFilter.cs b/Items/Tools/SpawnBlocker/BrokenWaterFilter.cs index 9740d03c89..5efb08dac3 100644 --- a/Items/Tools/SpawnBlocker/BrokenWaterFilter.cs +++ b/Items/Tools/SpawnBlocker/BrokenWaterFilter.cs @@ -60,45 +60,6 @@ namespace CalamityMod.Items.Tools.SpawnBlocker player.Calamity().noStupidNaturalARSpawns |= Enabled; } - /* - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) - { - Texture2D texture; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/BrokenWaterFilter").Value; - spriteBatch.Draw(texture, position, null, Color.White, 0f, origin, scale, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/BrokenWaterFilter").Value; - spriteBatch.Draw(texture, position, null, Color.White, 0f, origin, scale, SpriteEffects.None, 0); - } - - return false; - } - - public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) - { - Texture2D texture; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/BrokenWaterFilter").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/BrokenWaterFilter").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - return false; - } - */ - public override void ModifyTooltips(List tooltips) { string text; diff --git a/Items/Tools/SpawnBlocker/SirenproofEarMuffs.cs b/Items/Tools/SpawnBlocker/SirenproofEarMuffs.cs index 29c1e1e10d..f467ff0e9c 100644 --- a/Items/Tools/SpawnBlocker/SirenproofEarMuffs.cs +++ b/Items/Tools/SpawnBlocker/SirenproofEarMuffs.cs @@ -60,45 +60,6 @@ namespace CalamityMod.Items.Tools.SpawnBlocker player.Calamity().disableAnahitaSpawns |= Enabled; } - /* - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) - { - Texture2D texture; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/SirenproofEarMuffs").Value; - spriteBatch.Draw(texture, position, null, Color.White, 0f, origin, scale, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/SirenproofEarMuffs").Value; - spriteBatch.Draw(texture, position, null, Color.White, 0f, origin, scale, SpriteEffects.None, 0); - } - - return false; - } - - public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) - { - Texture2D texture; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/SirenproofEarMuffs").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/SirenproofEarMuffs").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - return false; - } - */ - public override void ModifyTooltips(List tooltips) { string text; diff --git a/Items/Tools/SpawnBlocker/VoodooDemonVoodooDoll.cs b/Items/Tools/SpawnBlocker/VoodooDemonVoodooDoll.cs index dd57546bb3..910e38e235 100644 --- a/Items/Tools/SpawnBlocker/VoodooDemonVoodooDoll.cs +++ b/Items/Tools/SpawnBlocker/VoodooDemonVoodooDoll.cs @@ -62,45 +62,6 @@ namespace CalamityMod.Items.Tools.SpawnBlocker player.Calamity().disableVoodooSpawns |= Enabled; } - /* - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) - { - Texture2D texture; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/VoodooDemonVoodooDoll").Value; - spriteBatch.Draw(texture, position, null, Color.White, 0f, origin, scale, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/VoodooDemonVoodooDoll").Value; - spriteBatch.Draw(texture, position, null, Color.White, 0f, origin, scale, SpriteEffects.None, 0); - } - - return false; - } - - public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) - { - Texture2D texture; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/VoodooDemonVoodooDoll").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/VoodooDemonVoodooDoll").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - return false; - } - */ - public override void ModifyTooltips(List tooltips) { string text; diff --git a/Items/Tools/TectonicTruncator.cs b/Items/Tools/TectonicTruncator.cs index 8e56a87c84..ffeedf415b 100644 --- a/Items/Tools/TectonicTruncator.cs +++ b/Items/Tools/TectonicTruncator.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityYellowBuyPrice; + Item.value = Item.sellPrice(gold: 4, silver: 35); Item.rare = ItemRarityID.Yellow; Item.UseSound = SoundID.Item1; Item.autoReuse = true; @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(). - AddIngredient(9). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Tools/WulfrumDiggingTurtle.cs b/Items/Tools/WulfrumDiggingTurtle.cs index 828c7d88a9..289d8c5b98 100644 --- a/Items/Tools/WulfrumDiggingTurtle.cs +++ b/Items/Tools/WulfrumDiggingTurtle.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(15). - AddIngredient(3). + AddIngredient(10). AddIngredient(). Register(); } diff --git a/Items/Tools/WulfrumDrill.cs b/Items/Tools/WulfrumDrill.cs index a7e47e03ea..9e9fa45008 100644 --- a/Items/Tools/WulfrumDrill.cs +++ b/Items/Tools/WulfrumDrill.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Tools Item.noMelee = true; Item.noUseGraphic = true; - Item.value = CalamityGlobalItem.RarityBlueBuyPrice; + Item.value = Item.sellPrice(silver: 5); Item.rare = ItemRarityID.Blue; } @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(15). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Tools/WulfrumScaffoldKit.cs b/Items/Tools/WulfrumScaffoldKit.cs index c32bd9c1df..14d0e58bdd 100644 --- a/Items/Tools/WulfrumScaffoldKit.cs +++ b/Items/Tools/WulfrumScaffoldKit.cs @@ -109,7 +109,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(). - AddIngredient(6). + AddIngredient(10). AddIngredient(). AddTile(TileID.Anvils). Register(); diff --git a/Items/Tools/WulfrumTreasurePinger.cs b/Items/Tools/WulfrumTreasurePinger.cs index b5d2490121..37e8c3d8fa 100644 --- a/Items/Tools/WulfrumTreasurePinger.cs +++ b/Items/Tools/WulfrumTreasurePinger.cs @@ -282,7 +282,7 @@ namespace CalamityMod.Items.Tools { //Intentionally craftable anywhere. CreateRecipe(). - AddIngredient(5). + AddIngredient(10). Register() .DisableDecraft(); } diff --git a/Items/TreasureBags/ProvidenceBag.cs b/Items/TreasureBags/ProvidenceBag.cs index 965665155d..90580b17e1 100644 --- a/Items/TreasureBags/ProvidenceBag.cs +++ b/Items/TreasureBags/ProvidenceBag.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Items.TreasureBags itemLoot.Add(ModContent.ItemType(), 10); // Equipment - itemLoot.Add(ModContent.ItemType()); + itemLoot.Add(ModContent.ItemType()); itemLoot.AddRevBagAccessories(); // Vanity diff --git a/Items/TreasureBags/SlimeGodBag.cs b/Items/TreasureBags/SlimeGodBag.cs index 9889e3fbe4..44657ccb8d 100644 --- a/Items/TreasureBags/SlimeGodBag.cs +++ b/Items/TreasureBags/SlimeGodBag.cs @@ -68,8 +68,7 @@ namespace CalamityMod.Items.TreasureBags ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType() + ModContent.ItemType() })); // Equipment diff --git a/Items/VanillaArmorChanges/GladiatorArmorSetChange.cs b/Items/VanillaArmorChanges/GladiatorArmorSetChange.cs index 93c2886fbf..4dc579c4ad 100644 --- a/Items/VanillaArmorChanges/GladiatorArmorSetChange.cs +++ b/Items/VanillaArmorChanges/GladiatorArmorSetChange.cs @@ -14,13 +14,14 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Gladiator"; - public const int HelmetRogueDamageBoostPercent = 3; + public const int HelmetRogueDamageBoostPercent = 8; public const int ChestplateRogueCritBoostPercent = 3; - public const int LeggingRogueVelocityBoostPercent = 3; + public const int LeggingRogueVelocityBoostPercent = 10; + public const float SetBonusRogueStealth = 0.6f; public override void UpdateSetBonusText(ref string setBonusText) { - setBonusText += $"\n{CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}")}"; + setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(SetBonusRogueStealth.ToStealth())}"; } public override void ApplyHeadPieceEffect(Player player) @@ -40,10 +41,8 @@ namespace CalamityMod.Items.VanillaArmorChanges public override void ApplyArmorSetBonus(Player player) { - player.Calamity().rogueStealthMax += 0.6f; + player.Calamity().rogueStealthMax += SetBonusRogueStealth; player.Calamity().wearingRogueArmor = true; - player.GetDamage() += 0.05f; - player.Calamity().rogueVelocity += 0.1f; } } } diff --git a/Items/Weapons/DraedonsArsenal/AqueousHunterDrone.cs b/Items/Weapons/DraedonsArsenal/AqueousHunterDrone.cs index 3e47eb756f..bd5de5f274 100644 --- a/Items/Weapons/DraedonsArsenal/AqueousHunterDrone.cs +++ b/Items/Weapons/DraedonsArsenal/AqueousHunterDrone.cs @@ -26,6 +26,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public static int ArmorPenetration = 15; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ArmorPenetration); + public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 4f; + public override void SetDefaults() { CalamityGlobalItem modItem = Item.Calamity(); @@ -33,7 +35,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.width = 34; Item.height = 32; Item.shootSpeed = 10f; - Item.damage = 24; + Item.damage = 18; Item.ArmorPenetration = ArmorPenetration; Item.mana = 10; Item.useAnimation = Item.useTime = 36; diff --git a/Items/Weapons/DraedonsArsenal/Auger.cs b/Items/Weapons/DraedonsArsenal/Auger.cs index f7ce73b68d..33bc3e191f 100644 --- a/Items/Weapons/DraedonsArsenal/Auger.cs +++ b/Items/Weapons/DraedonsArsenal/Auger.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { Item.width = 26; Item.height = 26; - Item.damage = 60; + Item.damage = 55; Item.DamageType = TrueMeleeDamageClass.Instance; Item.useTime = Item.useAnimation = 12; Item.knockBack = 12f; diff --git a/Items/Weapons/DraedonsArsenal/PulseGrenade.cs b/Items/Weapons/DraedonsArsenal/PulseGrenade.cs index 480f8fbc4a..f487494fa2 100644 --- a/Items/Weapons/DraedonsArsenal/PulseGrenade.cs +++ b/Items/Weapons/DraedonsArsenal/PulseGrenade.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.width = 30; Item.height = 40; - Item.damage = 59; + Item.damage = 123; Item.DamageType = RogueDamageClass.Instance; Item.noMelee = true; Item.noUseGraphic = true; @@ -40,6 +40,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.shootSpeed = 16f; Item.shoot = ModContent.ProjectileType(); } + + public override float StealthDamageMultiplier => 0.85f; public override bool CanUseItem(Player player) { return (player.ownedProjectileCounts[Item.shoot] <= 0 && player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0); diff --git a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs index 5b65b1c0a3..3176eb58bd 100644 --- a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs +++ b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { Item.width = 38; Item.height = 24; - Item.damage = 200; + Item.damage = 160; Item.mana = 12; Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.HoldUp; diff --git a/Items/Weapons/Magic/AlphaDraconis.cs b/Items/Weapons/Magic/AlphaDraconis.cs index 9789aa3161..e889f27f6c 100644 --- a/Items/Weapons/Magic/AlphaDraconis.cs +++ b/Items/Weapons/Magic/AlphaDraconis.cs @@ -72,9 +72,9 @@ namespace CalamityMod.Items.Weapons.Magic { CreateRecipe(). AddIngredient(). - AddIngredient(6). - AddIngredient(5). - AddIngredient(10). + AddIngredient(8). + AddIngredient(4). + AddIngredient(20). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Magic/AstralStaff.cs b/Items/Weapons/Magic/AstralStaff.cs index c7cc0e9a90..9f89c9cd4b 100644 --- a/Items/Weapons/Magic/AstralStaff.cs +++ b/Items/Weapons/Magic/AstralStaff.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { CreateRecipe(). - AddIngredient(6). + AddIngredient(12). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Magic/Biofusillade.cs b/Items/Weapons/Magic/Biofusillade.cs index e5f34f725b..90ebcbd833 100644 --- a/Items/Weapons/Magic/Biofusillade.cs +++ b/Items/Weapons/Magic/Biofusillade.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Magic { CreateRecipe(). AddIngredient(ItemID.SpellTome). - AddIngredient(8). + AddIngredient(12). AddTile(TileID.Bookcases). Register(); } diff --git a/Items/Weapons/Magic/BrimroseStaff.cs b/Items/Weapons/Magic/BrimroseStaff.cs index 4521a1989a..5c01032e74 100644 --- a/Items/Weapons/Magic/BrimroseStaff.cs +++ b/Items/Weapons/Magic/BrimroseStaff.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { CreateRecipe(). - AddIngredient(6). + AddIngredient(8). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Magic/BurningSea.cs b/Items/Weapons/Magic/BurningSea.cs index 30a9db9b37..4670c54a5e 100644 --- a/Items/Weapons/Magic/BurningSea.cs +++ b/Items/Weapons/Magic/BurningSea.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Magic { CreateRecipe(). AddIngredient(ItemID.SpellTome). - AddIngredient(5). + AddIngredient(8). AddTile(TileID.Bookcases). Register(); } diff --git a/Items/Weapons/Magic/CosmicRainbow.cs b/Items/Weapons/Magic/CosmicRainbow.cs index dab7555774..11f066f058 100644 --- a/Items/Weapons/Magic/CosmicRainbow.cs +++ b/Items/Weapons/Magic/CosmicRainbow.cs @@ -29,8 +29,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.autoReuse = true; Item.noMelee = true; - Item.value = CalamityGlobalItem.RarityRedBuyPrice; - Item.rare = ItemRarityID.Red; + Item.value = CalamityGlobalItem.RarityPurpleBuyPrice; + Item.rare = ItemRarityID.Purple; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Magic/Effervescence.cs b/Items/Weapons/Magic/Effervescence.cs index 2856620fe7..bc7454d962 100644 --- a/Items/Weapons/Magic/Effervescence.cs +++ b/Items/Weapons/Magic/Effervescence.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Magic CreateRecipe(). AddIngredient(ItemID.BubbleGun). AddIngredient(ItemID.LunarBar, 5). - AddIngredient(ItemID.ShimmerBlock, 5). + AddIngredient(ItemID.ShimmerBlock, 10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Magic/Eternity.cs b/Items/Weapons/Magic/Eternity.cs index 913475841f..f101f76a05 100644 --- a/Items/Weapons/Magic/Eternity.cs +++ b/Items/Weapons/Magic/Eternity.cs @@ -60,5 +60,22 @@ namespace CalamityMod.Items.Weapons.Magic AddTile(). Register(); } + + public static Color RarityColor() + { + List colorSet = [ + new Color(188, 192, 193), // white + new Color(157, 100, 183), // purple + new Color(249, 166, 77), // honey-ish orange + new Color(255, 105, 234), // pink + new Color(67, 204, 219), // sky blue + new Color(249, 245, 99), // bright yellow + new Color(236, 168, 247), // purplish pink + ]; + int colorIndex = (int)(Main.GlobalTimeWrappedHourly / 2 % colorSet.Count); + Color currentColor = colorSet[colorIndex]; + Color nextColor = colorSet[(colorIndex + 1) % colorSet.Count]; + return Color.Lerp(currentColor, nextColor, Main.GlobalTimeWrappedHourly % 2f > 1f ? 1f : Main.GlobalTimeWrappedHourly % 1f); + } } } diff --git a/Items/Weapons/Magic/EventHorizon.cs b/Items/Weapons/Magic/EventHorizon.cs index 3215eaa9db..233722f229 100644 --- a/Items/Weapons/Magic/EventHorizon.cs +++ b/Items/Weapons/Magic/EventHorizon.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 40; Item.height = 46; - Item.damage = 120; + Item.damage = 138; Item.knockBack = 3.5f; Item.noMelee = true; Item.DamageType = DamageClass.Magic; diff --git a/Items/Weapons/Magic/EvergladeSpray.cs b/Items/Weapons/Magic/EvergladeSpray.cs index 22b05cc0fe..c2abdd2338 100644 --- a/Items/Weapons/Magic/EvergladeSpray.cs +++ b/Items/Weapons/Magic/EvergladeSpray.cs @@ -38,12 +38,12 @@ namespace CalamityMod.Items.Weapons.Magic { CreateRecipe(). AddIngredient(ItemID.GoldenShower). - AddIngredient(3). + AddIngredient(10). AddTile(TileID.Bookcases). Register(); CreateRecipe(). AddIngredient(ItemID.CursedFlames). - AddIngredient(3). + AddIngredient(10). AddTile(TileID.Bookcases). Register(); } diff --git a/Items/Weapons/Magic/ForbiddenSun.cs b/Items/Weapons/Magic/ForbiddenSun.cs index 4a8289e334..2cd429ec99 100644 --- a/Items/Weapons/Magic/ForbiddenSun.cs +++ b/Items/Weapons/Magic/ForbiddenSun.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Magic { CreateRecipe(). AddIngredient(ItemID.SpellTome). - AddIngredient(6). + AddIngredient(10). AddTile(TileID.Bookcases). Register(); } diff --git a/Items/Weapons/Magic/GleamingMagnolia.cs b/Items/Weapons/Magic/GleamingMagnolia.cs index 56a4cd3c5b..dbf35201bb 100644 --- a/Items/Weapons/Magic/GleamingMagnolia.cs +++ b/Items/Weapons/Magic/GleamingMagnolia.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5.5f; - Item.value = CalamityGlobalItem.RarityPinkBuyPrice; - Item.rare = ItemRarityID.Pink; + Item.value = CalamityGlobalItem.RarityLightPurpleBuyPrice; + Item.rare = ItemRarityID.LightPurple; Item.UseSound = SoundID.Item109; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Magic/HeliumFlash.cs b/Items/Weapons/Magic/HeliumFlash.cs index aa0592be55..ce4d6da0c8 100644 --- a/Items/Weapons/Magic/HeliumFlash.cs +++ b/Items/Weapons/Magic/HeliumFlash.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.width = 112; Item.height = 112; Item.DamageType = DamageClass.Magic; - Item.damage = 3000; + Item.damage = 3200; Item.knockBack = 9.5f; Item.mana = 120; Item.useAnimation = Item.useTime = AftershotCooldownFrames; diff --git a/Items/Weapons/Magic/LashesofChaos.cs b/Items/Weapons/Magic/LashesofChaos.cs index 1c05db456a..74a3367f25 100644 --- a/Items/Weapons/Magic/LashesofChaos.cs +++ b/Items/Weapons/Magic/LashesofChaos.cs @@ -1,11 +1,11 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; -using CalamityMod.Items.Weapons.Summon; using CalamityMod.Particles; using CalamityMod.Projectiles.Magic; using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic public int FiringMode = 0; // 0 = hellfireballs, 1 = hellblasts public int ProjectilesFired = 0; + public static readonly SoundStyle FireSound = new SoundStyle("CalamityMod/Sounds/Custom/CalamitasClone/CalClone_BigFireballBit", 4) with { Volume = 0.6f, MaxInstances = 4 }; public override void SetStaticDefaults() { CalamityItemSets.ExtraDebuffTooltip_Enemy[Type] = [ModContent.BuffType()]; @@ -32,13 +33,14 @@ namespace CalamityMod.Items.Weapons.Magic Item.mana = 28; Item.useAnimation = Item.useTime = 46; Item.useStyle = ItemUseStyleID.Shoot; + Item.UseSound = FireSound; Item.noMelee = true; Item.knockBack = 7.5f; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 14f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 22f; } // Shoots twice as fast (and uses half as much mana to compensate) during hellblasts @@ -52,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { ProjectilesFired++; - type = FiringMode == 1 ? ModContent.ProjectileType() : Item.shoot; + type = FiringMode == 1 ? ModContent.ProjectileType() : Item.shoot; Projectile.NewProjectile(source, position, velocity, type, damage, knockback, Main.myPlayer); // DUST @@ -86,11 +88,13 @@ namespace CalamityMod.Items.Weapons.Magic { FiringMode = 1; ProjectilesFired = 0; + SoundEngine.PlaySound(SoundID.Item100 with { Volume = 0.8f }, player.Center); } if (FiringMode == 1 && ProjectilesFired >= 10) { FiringMode = 0; ProjectilesFired = 0; + SoundEngine.PlaySound(SoundID.Item100 with { Volume = 0.8f }, player.Center); } return false; } diff --git a/Items/Weapons/Magic/Mistlestorm.cs b/Items/Weapons/Magic/Mistlestorm.cs index f9fd80822b..d39417d4c1 100644 --- a/Items/Weapons/Magic/Mistlestorm.cs +++ b/Items/Weapons/Magic/Mistlestorm.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Weapons.Magic CreateRecipe(). AddIngredient(ItemID.Razorpine). AddIngredient(ItemID.LeafBlower). - AddIngredient(5). + AddIngredient(10). AddIngredient(3). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Weapons/Magic/NanoPurge.cs b/Items/Weapons/Magic/NanoPurge.cs index d78bf8a75f..4aa5bef678 100644 --- a/Items/Weapons/Magic/NanoPurge.cs +++ b/Items/Weapons/Magic/NanoPurge.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Magic { CreateRecipe(). AddIngredient(ItemID.LaserMachinegun). - AddIngredient(7). + AddIngredient(10). AddIngredient(ItemID.Nanites, 100). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Weapons/Magic/NuclearFury.cs b/Items/Weapons/Magic/NuclearFury.cs index 53f67402a2..8d0a365b83 100644 --- a/Items/Weapons/Magic/NuclearFury.cs +++ b/Items/Weapons/Magic/NuclearFury.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 38; Item.height = 40; - Item.damage = 108; + Item.damage = 91; Item.DamageType = DamageClass.Magic; Item.mana = 30; Item.useAnimation = Item.useTime = 25; diff --git a/Items/Weapons/Magic/Omicron.cs b/Items/Weapons/Magic/Omicron.cs index fe5f1c9c71..d061f550bb 100644 --- a/Items/Weapons/Magic/Omicron.cs +++ b/Items/Weapons/Magic/Omicron.cs @@ -69,8 +69,8 @@ namespace CalamityMod.Items.Weapons.Magic CreateRecipe(). AddIngredient(). AddIngredient(). - AddIngredient(10). - AddIngredient(ItemID.FragmentNebula, 5). + AddIngredient(8). + AddIngredient(20). AddTile(). Register(); } diff --git a/Items/Weapons/Magic/Rancor.cs b/Items/Weapons/Magic/Rancor.cs index cc4ed7049d..fc1d07b505 100644 --- a/Items/Weapons/Magic/Rancor.cs +++ b/Items/Weapons/Magic/Rancor.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 66; Item.height = 82; - Item.damage = 290; + Item.damage = 333; Item.DamageType = DamageClass.Magic; Item.noUseGraphic = true; Item.channel = true; diff --git a/Items/Weapons/Magic/RecitationoftheBeast.cs b/Items/Weapons/Magic/RecitationoftheBeast.cs index 171a1c539b..ec118563e8 100644 --- a/Items/Weapons/Magic/RecitationoftheBeast.cs +++ b/Items/Weapons/Magic/RecitationoftheBeast.cs @@ -46,8 +46,8 @@ namespace CalamityMod.Items.Weapons.Magic { CreateRecipe(). AddIngredient(ItemID.DemonScythe). - AddIngredient(6). - AddIngredient(6). + AddIngredient(20). + AddIngredient(8). AddTile(TileID.Bookcases). Register(); } diff --git a/Items/Weapons/Magic/SHPC.cs b/Items/Weapons/Magic/SHPC.cs index 3c886885ef..a0bb9212c9 100644 --- a/Items/Weapons/Magic/SHPC.cs +++ b/Items/Weapons/Magic/SHPC.cs @@ -55,8 +55,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 20f; - Item.value = CalamityGlobalItem.RarityPinkBuyPrice; - Item.rare = ItemRarityID.Pink; + Item.value = CalamityGlobalItem.RarityLightPurpleBuyPrice; + Item.rare = ItemRarityID.LightPurple; } #region Weapon-Specific Functions diff --git a/Items/Weapons/Magic/SanguineFlare.cs b/Items/Weapons/Magic/SanguineFlare.cs index f712d13968..d863d9657d 100644 --- a/Items/Weapons/Magic/SanguineFlare.cs +++ b/Items/Weapons/Magic/SanguineFlare.cs @@ -49,7 +49,8 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(25). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Magic/ShadecrystalBarrage.cs b/Items/Weapons/Magic/ShadecrystalBarrage.cs index ffcb99ec1f..f991cae233 100644 --- a/Items/Weapons/Magic/ShadecrystalBarrage.cs +++ b/Items/Weapons/Magic/ShadecrystalBarrage.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Magic { CreateRecipe(). AddIngredient(ItemID.CrystalStorm). - AddIngredient(6). + AddIngredient(12). AddTile(TileID.Bookcases). Register(); } diff --git a/Items/Weapons/Magic/ShiftingSands.cs b/Items/Weapons/Magic/ShiftingSands.cs index df373ff41f..01d41978b1 100644 --- a/Items/Weapons/Magic/ShiftingSands.cs +++ b/Items/Weapons/Magic/ShiftingSands.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Magic { CreateRecipe(). AddIngredient(ItemID.MagicMissile). - AddIngredient(ItemID.AncientCloth, 5). + AddIngredient(ItemID.AncientCloth, 2). AddIngredient(). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Weapons/Magic/SkyGlaze.cs b/Items/Weapons/Magic/SkyGlaze.cs index cfe95212aa..25947b658f 100644 --- a/Items/Weapons/Magic/SkyGlaze.cs +++ b/Items/Weapons/Magic/SkyGlaze.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 52; Item.height = 74; - Item.damage = 11; + Item.damage = 10; Item.DamageType = DamageClass.Magic; Item.mana = 9; Item.useAnimation = Item.useTime = 25; diff --git a/Items/Weapons/Magic/SoulPiercer.cs b/Items/Weapons/Magic/SoulPiercer.cs index df63864e59..9d4d4adf67 100644 --- a/Items/Weapons/Magic/SoulPiercer.cs +++ b/Items/Weapons/Magic/SoulPiercer.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). + AddIngredient(10). AddTile(). Register(); } diff --git a/Items/Weapons/Magic/StaffofBlushie.cs b/Items/Weapons/Magic/StaffofBlushie.cs index d89bd90aa0..6b21277e97 100644 --- a/Items/Weapons/Magic/StaffofBlushie.cs +++ b/Items/Weapons/Magic/StaffofBlushie.cs @@ -2,6 +2,7 @@ using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; @@ -44,5 +45,7 @@ namespace CalamityMod.Items.Weapons.Magic AddTile(). Register(); } + + public static Color RarityColor() => Color.Blue; } } diff --git a/Items/Weapons/Magic/Sylvestaff.cs b/Items/Weapons/Magic/Sylvestaff.cs index 48bfd4d5f2..1e03004da4 100644 --- a/Items/Weapons/Magic/Sylvestaff.cs +++ b/Items/Weapons/Magic/Sylvestaff.cs @@ -111,5 +111,7 @@ namespace CalamityMod.Items.Weapons.Magic spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, scale, SpriteEffects.None, 0); return false; } + + public static Color RarityColor() => new Color(249, 197, 255); } } diff --git a/Items/Weapons/Magic/TacticiansTrumpCard.cs b/Items/Weapons/Magic/TacticiansTrumpCard.cs index f6e98b2b9f..9fc9780f4c 100644 --- a/Items/Weapons/Magic/TacticiansTrumpCard.cs +++ b/Items/Weapons/Magic/TacticiansTrumpCard.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(). AddIngredient(). AddIngredient(). - AddIngredient(5). + AddIngredient(10). AddIngredient(3). AddTile(TileID.MythrilAnvil). Register(); @@ -63,7 +63,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(). AddIngredient(). AddIngredient(). - AddIngredient(5). + AddIngredient(10). AddIngredient(3). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Weapons/Magic/TheWand.cs b/Items/Weapons/Magic/TheWand.cs index 2d7c137bd9..1958269759 100644 --- a/Items/Weapons/Magic/TheWand.cs +++ b/Items/Weapons/Magic/TheWand.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 40; Item.height = 36; - Item.damage = 14; // same as 1.4 Wand of Sparking + Item.damage = 1; Item.mana = 200; Item.DamageType = DamageClass.Magic; Item.noMelee = true; @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.knockBack = 0.5f; Item.UseSound = SoundID.Item102; Item.autoReuse = true; - Item.value = CalamityGlobalItem.RarityVioletBuyPrice; + Item.value = Item.buyPrice(platinum: 15); // Sold by Shady Salesman Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 24f; Item.rare = ModContent.RarityType(); @@ -57,14 +57,5 @@ namespace CalamityMod.Items.Weapons.Magic if (Main.rand.NextBool(3)) Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.Torch); } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.WandofSparking). - AddIngredient(8). - AddTile(). - Register(); - } } } diff --git a/Items/Weapons/Magic/Tradewinds.cs b/Items/Weapons/Magic/Tradewinds.cs index c99d7ec652..f1a6e1a77e 100644 --- a/Items/Weapons/Magic/Tradewinds.cs +++ b/Items/Weapons/Magic/Tradewinds.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(10). AddTile(TileID.Bookcases). Register(); } diff --git a/Items/Weapons/Magic/UndinesRetribution.cs b/Items/Weapons/Magic/UndinesRetribution.cs index 2213a85c36..24d5d80277 100644 --- a/Items/Weapons/Magic/UndinesRetribution.cs +++ b/Items/Weapons/Magic/UndinesRetribution.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Magic } for (int i = 0; i < 3; i++) { - realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(51) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - /* - */ player.position.X), player.MountedCenter.Y + 600f); //- + realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(51) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y + 600f); //- realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-50, 51); //200 realPlayerPos.Y += (float)(100 * i); //-= mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X; //+ - diff --git a/Items/Weapons/Magic/UnstableCastersGauntlet.cs b/Items/Weapons/Magic/UnstableCastersGauntlet.cs index f83fcc004f..e07644ade7 100644 --- a/Items/Weapons/Magic/UnstableCastersGauntlet.cs +++ b/Items/Weapons/Magic/UnstableCastersGauntlet.cs @@ -26,8 +26,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.noUseGraphic = true; Item.channel = true; Item.knockBack = 3f; - Item.value = CalamityGlobalItem.RarityRedBuyPrice; - Item.rare = ItemRarityID.Red; + Item.value = CalamityGlobalItem.RarityPurpleBuyPrice; + Item.rare = ItemRarityID.Purple; Item.Calamity().donorItem = true; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Magic/ValkyrieRay.cs b/Items/Weapons/Magic/ValkyrieRay.cs index 10aff81ac9..2984ac8b0f 100644 --- a/Items/Weapons/Magic/ValkyrieRay.cs +++ b/Items/Weapons/Magic/ValkyrieRay.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic // This math is handled in its holdout projectile, ValkyrieRayStaff. public const int ChargeFrames = 24; public const int CooldownFrames = 12; - public const float GemDistance = 18f; + public const float GemDistance = 27f; public static readonly Color LightColor = new Color(235, 40, 121); public override void SetStaticDefaults() @@ -39,8 +39,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.useTurn = false; Item.noMelee = true; Item.noUseGraphic = true; - Item.value = CalamityGlobalItem.RarityPinkBuyPrice; - Item.rare = ItemRarityID.Pink; + Item.value = CalamityGlobalItem.RarityLightPurpleBuyPrice; + Item.rare = ItemRarityID.LightPurple; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 25f; Item.autoReuse = true; diff --git a/Items/Weapons/Magic/ValkyrieRay.png b/Items/Weapons/Magic/ValkyrieRay.png index 18ec195aa0..26af6f70c6 100644 Binary files a/Items/Weapons/Magic/ValkyrieRay.png and b/Items/Weapons/Magic/ValkyrieRay.png differ diff --git a/Items/Weapons/Magic/VenusianTrident.cs b/Items/Weapons/Magic/VenusianTrident.cs index c98dcc9c6a..455b1b864c 100644 --- a/Items/Weapons/Magic/VenusianTrident.cs +++ b/Items/Weapons/Magic/VenusianTrident.cs @@ -3,7 +3,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; using CalamityMod.Systems.Collections; using CalamityMod.Rarities; -using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Weapons/Magic/Viscera.cs b/Items/Weapons/Magic/Viscera.cs index b7e8e976c7..f87d31d310 100644 --- a/Items/Weapons/Magic/Viscera.cs +++ b/Items/Weapons/Magic/Viscera.cs @@ -61,7 +61,8 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { CreateRecipe(). - AddIngredient(4). + AddIngredient(25). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Melee/AbyssBlade.cs b/Items/Weapons/Melee/AbyssBlade.cs index 3a8120a2be..4d32b8058c 100644 --- a/Items/Weapons/Melee/AbyssBlade.cs +++ b/Items/Weapons/Melee/AbyssBlade.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 74; Item.height = 74; - Item.damage = 123; + Item.damage = 114; Item.knockBack = 7.5f; Item.useTime = 65; Item.useAnimation = 65; diff --git a/Items/Weapons/Melee/AcidwoodSword.cs b/Items/Weapons/Melee/AcidwoodSword.cs index f204f19fe8..9ae1d55e07 100644 --- a/Items/Weapons/Melee/AcidwoodSword.cs +++ b/Items/Weapons/Melee/AcidwoodSword.cs @@ -9,18 +9,12 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetDefaults() { - Item.damage = 11; + Item.CloneDefaults(ItemID.ShadewoodSword); // Ash Wood > Acidwood > Shadewood Item.width = 36; Item.height = 40; - Item.DamageType = DamageClass.Melee; + Item.damage = 12; Item.useAnimation = Item.useTime = 18; - Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 3f; - Item.UseSound = SoundID.Item1; - Item.autoReuse = true; - Item.useTurn = true; - Item.value = CalamityGlobalItem.RarityWhiteBuyPrice; - Item.rare = ItemRarityID.White; } public override void AddRecipes() { diff --git a/Items/Weapons/Melee/AirSpinner.cs b/Items/Weapons/Melee/AirSpinner.cs index 4d88c54792..403f64caa5 100644 --- a/Items/Weapons/Melee/AirSpinner.cs +++ b/Items/Weapons/Melee/AirSpinner.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(10). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Weapons/Melee/AnarchyBlade.cs b/Items/Weapons/Melee/AnarchyBlade.cs index e3c51d2339..9d17eef1ee 100644 --- a/Items/Weapons/Melee/AnarchyBlade.cs +++ b/Items/Weapons/Melee/AnarchyBlade.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Items.Weapons.Melee { CreateRecipe(). AddIngredient(ItemID.BreakerBlade). - AddIngredient(5). + AddIngredient(8). AddIngredient(). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Weapons/Melee/ArkoftheCosmos.cs b/Items/Weapons/Melee/ArkoftheCosmos.cs index c119913376..f2f4c46f55 100644 --- a/Items/Weapons/Melee/ArkoftheCosmos.cs +++ b/Items/Weapons/Melee/ArkoftheCosmos.cs @@ -10,6 +10,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; +using Terraria.GameInput; using Terraria.ID; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; @@ -22,11 +23,6 @@ namespace CalamityMod.Items.Weapons.Melee public float Combo = 0f; public float Charge = 0f; - // Frame window for double right click to snip. - // The right click item activation takes 3 frames, so the frame window is frame 3 to frame 11. - public static int DoubleRightClickFrames = 11; - private int rmbFrames = 0; - public static float NeedleDamageMultiplier = 0.7f; //Damage on the non-homing needle projectile public static float MaxThrowReach = 760; public static float SnapDamageMultiplier = 1.2f; //Extra damage from making the scissors snap @@ -68,21 +64,25 @@ namespace CalamityMod.Items.Weapons.Melee var blastTooltip = tooltips.FirstOrDefault(x => x.Text.Contains("[BLAST]") && x.Mod == "Terraria"); if (blastTooltip != null) { - blastTooltip.Text = Lang.SupportGlyphs(this.GetLocalizedValue("BlastInfo")); + var key = Item.GetDynamicModHotkey().GetAssignedKeysOrEmpty(PlayerInput.CurrentInputMode); + if (key.Count > 0) + blastTooltip.Text = Lang.SupportGlyphs(this.GetLocalizedValue("BlastInfoKeybind")); + else + blastTooltip.Text = Lang.SupportGlyphs(this.GetLocalizedValue("BlastInfo")); blastTooltip.OverrideColor = Color.Lerp(Color.HotPink, Color.Crimson, 0.5f + (float)Math.Sin(Main.GlobalTimeWrappedHourly) * 0.625f); } + tooltips.IntegrateDynamicHotkey(Item); } public override void SetDefaults() { Item.width = Item.height = 136; - Item.damage = 1800; + Item.damage = 1700; Item.DamageType = DamageClass.MeleeNoSpeed; Item.crit = 15; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = 15; - Item.useTime = 15; + Item.useAnimation = Item.useTime = 15; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Shoot; Item.knockBack = 9.5f; @@ -100,14 +100,30 @@ namespace CalamityMod.Items.Weapons.Melee { player.Calamity().mouseWorldListener = true; - if (rmbFrames > 0) - --rmbFrames; - if (CanUseItem(player) && Combo != 4) Item.channel = false; if (Combo == 4) Item.channel = true; + + if (Main.myPlayer == player.whoAmI && Item.CurrentlyPressingKeybind() && Charge > 0) + { + Projectile blast = Main.projectile.FirstOrDefault(p => p.active && p.owner == player.whoAmI && p.type == ProjectileType(), null); + + if (blast == null) + { + float speed = Item.shootSpeed; + int dmg = (int)player.GetTotalDamage(Item.DamageType).ApplyTo(Item.damage); + Vector2 pos = player.Center; + int shoot = Item.shoot; + float kb = Item.knockBack; + var velocity = player.DirectionTo(Main.MouseWorld) * Item.shootSpeed; + PlayerLoader.ModifyShootStats(player, Item, ref pos, ref velocity, ref shoot, ref dmg, ref kb); + float angle = velocity.ToRotation(); + Projectile.NewProjectile(player.GetSource_ItemUse(Item), player.Center + angle.ToRotationVector2() * 90f, velocity, ProjectileType(), (int)(dmg * BlastDamageMultiplier), 0, player.whoAmI, Charge); + Charge = 0; + } + } } public override bool CanUseItem(Player player) @@ -122,15 +138,16 @@ namespace CalamityMod.Items.Weapons.Melee { if (player.altFunctionUse == 2) { - // If it has been less than N frames since the last alt function use, this is a double right click. - bool rightMouseDoubleClick = rmbFrames > 0; // Check if a parry holdout or blast is already present. Projectile parrier = Main.projectile.FirstOrDefault(p => p.active && p.owner == player.whoAmI && p.type == ProjectileType(), null); Projectile blast = Main.projectile.FirstOrDefault(p => p.active && p.owner == player.whoAmI && p.type == ProjectileType(), null); - bool canExecuteBlast = rightMouseDoubleClick && Charge > 0 && blast is null; + bool canExecuteBlast = Charge > 0 && blast is null; bool canExecuteParry = parrier is null && !canExecuteBlast; + //Disable blast usage if hotkey is bound + if (Item.GetDynamicModHotkey().GetAssignedKeysOrEmpty(PlayerInput.CurrentInputMode).Count > 0) + canExecuteBlast = false; // The blast is checked first, so that it overrides the first right click triggering a parry. Blasts delete any active parry holdouts on use. if (canExecuteBlast) @@ -139,13 +156,6 @@ namespace CalamityMod.Items.Weapons.Melee float angle = velocity.ToRotation(); Projectile.NewProjectile(source, player.Center + angle.ToRotationVector2() * 90f, velocity, ProjectileType(), (int)(damage * BlastDamageMultiplier), 0, player.whoAmI, Charge); Charge = 0; - - // If the parry holdout has existed for very few frames, just delete it. - if (parrier is not null && parrier.timeLeft > ArkoftheCosmosParryHoldout.MaxTime - DoubleRightClickFrames) - { - parrier.active = false; - parrier.netUpdate = true; - } } // If the blast cannot be executed, then the parry is executed, assuming no existing holdout is present. @@ -162,9 +172,6 @@ namespace CalamityMod.Items.Weapons.Melee if (!anyArkParryExists) Projectile.NewProjectile(source, player.Center, velocity, ProjectileType(), damage, 0, player.whoAmI, 0, 0); } - - // Regardless of what transpires from the right click, set the double right click frames appropriately. - rmbFrames = DoubleRightClickFrames; return false; } diff --git a/Items/Weapons/Melee/ArkoftheElements.cs b/Items/Weapons/Melee/ArkoftheElements.cs index 13cd093f00..c3c661f5ec 100644 --- a/Items/Weapons/Melee/ArkoftheElements.cs +++ b/Items/Weapons/Melee/ArkoftheElements.cs @@ -60,13 +60,12 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 112; Item.height = 172; - Item.damage = 507; + Item.damage = 444; Item.DamageType = DamageClass.MeleeNoSpeed; Item.crit = 10; Item.noUseGraphic = true; Item.noMelee = true; - Item.useAnimation = 20; - Item.useTime = 20; + Item.useAnimation = Item.useTime = 20; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Shoot; Item.knockBack = 8.5f; diff --git a/Items/Weapons/Melee/AstralPike.cs b/Items/Weapons/Melee/AstralPike.cs index 68a9bd3f48..4114495689 100644 --- a/Items/Weapons/Melee/AstralPike.cs +++ b/Items/Weapons/Melee/AstralPike.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(8). + AddIngredient(12). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Melee/AstralScythe.cs b/Items/Weapons/Melee/AstralScythe.cs index 912b7417a7..90ed8130eb 100644 --- a/Items/Weapons/Melee/AstralScythe.cs +++ b/Items/Weapons/Melee/AstralScythe.cs @@ -15,12 +15,11 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 56; Item.height = 60; - Item.damage = 120; + Item.damage = 80; Item.DamageType = DamageClass.Melee; Item.useTurn = true; - Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 20; Item.knockBack = 6f; Item.UseSound = SoundID.Item71; Item.autoReuse = true; @@ -30,12 +29,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.shootSpeed = 5f; } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) - { - Projectile.NewProjectile(source, position, velocity, type, (int)(damage * 0.6), knockback, player.whoAmI); - return false; - } - public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 300); diff --git a/Items/Weapons/Melee/Ataraxia.cs b/Items/Weapons/Melee/Ataraxia.cs index 49cf9686b6..7af3af3ddc 100644 --- a/Items/Weapons/Melee/Ataraxia.cs +++ b/Items/Weapons/Melee/Ataraxia.cs @@ -21,10 +21,9 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 94; Item.height = 92; Item.DamageType = DamageClass.Melee; - Item.damage = 675; + Item.damage = 325; Item.knockBack = 2.5f; - Item.useAnimation = 10; - Item.useTime = 10; + Item.useAnimation = Item.useTime = 10; Item.autoReuse = true; Item.useTurn = true; @@ -47,12 +46,11 @@ namespace CalamityMod.Items.Weapons.Melee // Center projectile int centerID = ModContent.ProjectileType(); - int centerDamage = (damage / 2); - Projectile.NewProjectile(source, position, velocity, centerID, centerDamage, knockback, player.whoAmI); + Projectile.NewProjectile(source, position, velocity, centerID, damage, knockback, player.whoAmI); - // Side projectiles (these deal 75% damage) + // Side projectiles (these deal 50% damage) int sideID = ModContent.ProjectileType(); - int sideDamage = ((int)(0.75f * centerDamage) / 2); + int sideDamage = (int)(0.5f * damage); Vector2 originalVelocity = velocity; velocity.Normalize(); velocity *= 22f; diff --git a/Items/Weapons/Melee/Basher.cs b/Items/Weapons/Melee/Basher.cs index 50c00db006..0cb494645a 100644 --- a/Items/Weapons/Melee/Basher.cs +++ b/Items/Weapons/Melee/Basher.cs @@ -34,8 +34,8 @@ namespace CalamityMod.Items.Weapons.Melee Item.noUseGraphic = true; Item.noMelee = true; Item.useStyle = ItemUseStyleID.Shoot; - Item.value = CalamityGlobalItem.RarityBlueBuyPrice; - Item.rare = ItemRarityID.Blue; + Item.value = CalamityGlobalItem.RarityGreenBuyPrice; + Item.rare = ItemRarityID.Green; } public override bool MeleePrefix() => true; public override bool CanUseItem(Player player) => false; diff --git a/Items/Weapons/Melee/BladecrestOathsword.cs b/Items/Weapons/Melee/BladecrestOathsword.cs index ab15acffd1..1ef5c6040c 100644 --- a/Items/Weapons/Melee/BladecrestOathsword.cs +++ b/Items/Weapons/Melee/BladecrestOathsword.cs @@ -16,10 +16,9 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 56; Item.height = 56; - Item.damage = 42; + Item.damage = 35; Item.knockBack = 3f; - Item.useTime = 53; - Item.useAnimation = 53; + Item.useAnimation = Item.useTime = 53; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 6f; diff --git a/Items/Weapons/Melee/BlightedCleaver.cs b/Items/Weapons/Melee/BlightedCleaver.cs index 9ab9a0150b..7a988b3e8e 100644 --- a/Items/Weapons/Melee/BlightedCleaver.cs +++ b/Items/Weapons/Melee/BlightedCleaver.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 88; Item.height = 88; - Item.damage = 90; + Item.damage = 52; Item.DamageType = DamageClass.Melee; Item.useAnimation = Item.useTime = 28; Item.useStyle = ItemUseStyleID.Swing; @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Melee public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { float adjustedItemScale = player.GetAdjustedItemScale(Item); - Projectile.NewProjectile(source, player.MountedCenter, velocity, type, (int)(damage * 0.75), knockback * 0.5f, player.whoAmI, (float)player.direction * player.gravDir, 32f, adjustedItemScale); + Projectile.NewProjectile(source, player.MountedCenter, velocity, type, damage, knockback * 0.5f, player.whoAmI, (float)player.direction * player.gravDir, 32f, adjustedItemScale); NetMessage.SendData(MessageID.PlayerControls, -1, -1, null, player.whoAmI); return false; } @@ -93,7 +93,7 @@ namespace CalamityMod.Items.Weapons.Melee CreateRecipe(). AddIngredient(). AddIngredient(ItemID.BrokenHeroSword). - AddIngredient(ItemID.ChlorophyteBar, 15). + AddIngredient(ItemID.ChlorophyteBar, 10). AddIngredient(ItemID.VialofVenom, 10). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Weapons/Melee/Bonebreaker.cs b/Items/Weapons/Melee/Bonebreaker.cs index c193ac8313..ab138d4ded 100644 --- a/Items/Weapons/Melee/Bonebreaker.cs +++ b/Items/Weapons/Melee/Bonebreaker.cs @@ -21,8 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 32; Item.height = 32; Item.useStyle = ItemUseStyleID.Swing; - Item.useAnimation = 20; - Item.useTime = 20; + Item.useAnimation = Item.useTime = 23; Item.damage = BaseDamage; Item.DamageType = DamageClass.MeleeNoSpeed; Item.knockBack = 7f; diff --git a/Items/Weapons/Melee/BotanicPiercer.cs b/Items/Weapons/Melee/BotanicPiercer.cs index 1d67b9f7ff..c97ee2bb6f 100644 --- a/Items/Weapons/Melee/BotanicPiercer.cs +++ b/Items/Weapons/Melee/BotanicPiercer.cs @@ -21,14 +21,13 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 112; Item.height = 112; - Item.damage = 110; + Item.damage = 80; Item.DamageType = DamageClass.Melee; Item.noMelee = true; Item.useTurn = true; Item.noUseGraphic = true; - Item.useAnimation = 17; + Item.useAnimation = Item.useTime = 17; Item.useStyle = ItemUseStyleID.Shoot; - Item.useTime = 17; Item.knockBack = 8.5f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Weapons/Melee/Brimlash.cs b/Items/Weapons/Melee/Brimlash.cs index f8cb726434..b5d2069700 100644 --- a/Items/Weapons/Melee/Brimlash.cs +++ b/Items/Weapons/Melee/Brimlash.cs @@ -55,8 +55,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). - AddIngredient(4). + AddIngredient(8). + AddIngredient(8). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Melee/BrimstoneSword.cs b/Items/Weapons/Melee/BrimstoneSword.cs index 35e119edbf..0afbb31bc6 100644 --- a/Items/Weapons/Melee/BrimstoneSword.cs +++ b/Items/Weapons/Melee/BrimstoneSword.cs @@ -91,7 +91,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(6). + AddIngredient(8). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Melee/BrokenBiomeBlade.cs b/Items/Weapons/Melee/BrokenBiomeBlade.cs index c4503e4546..2e91a5381e 100644 --- a/Items/Weapons/Melee/BrokenBiomeBlade.cs +++ b/Items/Weapons/Melee/BrokenBiomeBlade.cs @@ -34,16 +34,16 @@ namespace CalamityMod.Items.Weapons.Melee #region stats public static int BaseDamage = 38; - public static int DefaultAttunement_BaseDamage = 38; + public static int DefaultAttunement_BaseDamage = 34; - public static int EvilAttunement_BaseDamage = 50; + public static int EvilAttunement_BaseDamage = 45; public static int EvilAttunement_Lifesteal = 2; public static int EvilAttunement_BounceIFrames = 10; - public static int ColdAttunement_BaseDamage = 40; + public static int ColdAttunement_BaseDamage = 38; public static float ColdAttunement_ThirdSwingBoost = 1.15f; - public static int HotAttunement_BaseDamage = 42; + public static int HotAttunement_BaseDamage = 38; public static int HotAttunement_ShredPlayerIFrames = 6; public static int HotAttunement_LocalIFrames = 30; //Be warned its got one extra update so all the iframes should be divided in 2 public static float HotAttunement_ShredDecayRate = 1f; //How much charge is lost per frame. @@ -183,7 +183,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void ModifyWeaponDamage(Player player, ref StatModifier damage) { - damage += (mainAttunement?.DamageMultiplier ?? 1f) - 1f; + damage *= (mainAttunement?.DamageMultiplier ?? 1f); } public void SafeCheckAttunements() diff --git a/Items/Weapons/Melee/CometQuasher.cs b/Items/Weapons/Melee/CometQuasher.cs index 303ec17ba6..a92b7a305c 100644 --- a/Items/Weapons/Melee/CometQuasher.cs +++ b/Items/Weapons/Melee/CometQuasher.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 92; Item.height = 94; - Item.damage = 48; + Item.damage = 45; Item.DamageType = TrueMeleeDamageClass.Instance; Item.useAnimation = Item.useTime = 38; @@ -42,8 +42,8 @@ namespace CalamityMod.Items.Weapons.Melee CreateRecipe(). AddIngredient(ItemID.MeteoriteBar, 20). AddIngredient(4). - AddIngredient(12). AddIngredient(ItemID.FallenStar, 5). + AddIngredient(12). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Weapons/Melee/CosmicShiv.cs b/Items/Weapons/Melee/CosmicShiv.cs index ba39ea2a6e..fbb0ee09d2 100644 --- a/Items/Weapons/Melee/CosmicShiv.cs +++ b/Items/Weapons/Melee/CosmicShiv.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Melee { CreateRecipe(). AddIngredient(). - AddIngredient(8). + AddIngredient(10). AddTile(). Register(); } diff --git a/Items/Weapons/Melee/CrescentMoon.cs b/Items/Weapons/Melee/CrescentMoon.cs index f09743e25f..d028eca339 100644 --- a/Items/Weapons/Melee/CrescentMoon.cs +++ b/Items/Weapons/Melee/CrescentMoon.cs @@ -50,8 +50,8 @@ namespace CalamityMod.Items.Weapons.Melee CreateRecipe(). AddIngredient(ItemID.BlueMoon). AddIngredient(8). - AddIngredient(3). - AddIngredient(16). + AddIngredient(4). + AddIngredient(20). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Melee/DarklightGreatsword.cs b/Items/Weapons/Melee/DarklightGreatsword.cs index 25fd6b6150..a98384a00b 100644 --- a/Items/Weapons/Melee/DarklightGreatsword.cs +++ b/Items/Weapons/Melee/DarklightGreatsword.cs @@ -16,11 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee internal const float ShootSpeed = 2f; - internal const float ProjectileDamageMultiplier = 0.8f; - - internal const float TrueMeleeSlashProjectileDamageMultiplier = 0.8f; - - internal const float SlashProjectileDamageMultiplier = 0.4125f; // Makes them do 33% damage since main projectile does 80% damage + internal const float SlashProjectileDamageMultiplier = 0.33f; internal const int SlashProjectileLimit = 4; @@ -34,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 92; Item.height = 100; - Item.damage = 75; + Item.damage = 60; Item.DamageType = DamageClass.Melee; Item.useAnimation = Item.useTime = 30; Item.useStyle = ItemUseStyleID.Swing; @@ -59,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Melee // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction velocity = (Main.MouseWorld - position).SafeNormalize(Vector2.UnitY) * ShootSpeed; type = Main.rand.NextBool() ? type : ModContent.ProjectileType(); - Projectile.NewProjectile(source, position, velocity, type, (int)(damage * ProjectileDamageMultiplier), knockback * ProjectileDamageMultiplier, player.whoAmI); + Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); return false; } diff --git a/Items/Weapons/Melee/DeathsAscension.cs b/Items/Weapons/Melee/DeathsAscension.cs index 8468e0ba75..d5286e12bf 100644 --- a/Items/Weapons/Melee/DeathsAscension.cs +++ b/Items/Weapons/Melee/DeathsAscension.cs @@ -14,16 +14,11 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public const int RiftLifeTime = 600; - - public const float OrbitalScytheDamageMult = 0.4f; - + public const float OrbitalScytheDamageMult = 0.3f; public const float RiftScytheDamageMult = 0.125f; - public const int RiftOrbitalAmount = 4; - public const int ScytheShotAmount = 4; - public override void SetStaticDefaults() { ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; @@ -33,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 70; Item.height = 70; - Item.damage = 700; + Item.damage = 500; Item.knockBack = 9f; Item.useAnimation = Item.useTime = 24; Item.DamageType = DamageClass.Melee; @@ -96,7 +91,7 @@ namespace CalamityMod.Items.Weapons.Melee { float SpeedX = velocity.X + Main.rand.NextFloat(-spreadfactor, spreadfactor + 1); float SpeedY = velocity.Y + Main.rand.NextFloat(-spreadfactor, spreadfactor + 1); - Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, (int)(damage * 0.125f), knockback, player.whoAmI); + Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, (int)(damage * 0.2f), knockback, player.whoAmI); } // Tell the rift(s) to shoot diff --git a/Items/Weapons/Melee/DefiledGreatsword.cs b/Items/Weapons/Melee/DefiledGreatsword.cs index 66e1955b04..ae3aef26da 100644 --- a/Items/Weapons/Melee/DefiledGreatsword.cs +++ b/Items/Weapons/Melee/DefiledGreatsword.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 102; Item.height = 102; - Item.damage = 119; + Item.damage = 111; Item.DamageType = DamageClass.Melee; Item.useAnimation = Item.useTime = 28; Item.useStyle = ItemUseStyleID.Swing; @@ -137,8 +137,8 @@ namespace CalamityMod.Items.Weapons.Melee { CreateRecipe(). AddIngredient(). - AddIngredient(). - AddIngredient(15). + AddIngredient(10). + AddIngredient(5). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Melee/DevilsDevastation.cs b/Items/Weapons/Melee/DevilsDevastation.cs index 76da84fb72..117748c85f 100644 --- a/Items/Weapons/Melee/DevilsDevastation.cs +++ b/Items/Weapons/Melee/DevilsDevastation.cs @@ -20,6 +20,10 @@ namespace CalamityMod.Items.Weapons.Melee { public new string LocalizationCategory => "Items.Weapons.Melee"; public int throwCount = 0; + + public static int BigSlashDamageMult = 10; + public static float MarkDamageMult = 1.5f; // Multiplied on top of the big slash mult + public override void SetStaticDefaults() { CalamityItemSets.ExtraDebuffTooltip_Enemy[Type] = [ModContent.BuffType()]; @@ -81,7 +85,7 @@ namespace CalamityMod.Items.Weapons.Melee } if (player.Calamity().demonSwordKillMode && player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0 && player.Calamity().killModeCooldown == KillMode.cooldownMax + KillMode.buffMax) { - Projectile.NewProjectile(player.GetSource_ItemUse(Item), player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), Item.damage * 15, Item.knockBack, player.whoAmI, 0, throwCount); //This used to be 30x damage. + Projectile.NewProjectile(player.GetSource_ItemUse(Item), player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), Item.damage * BigSlashDamageMult, Item.knockBack, player.whoAmI, 0, throwCount); //This used to be 30x damage. } } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Melee/DevilsSunrise.cs b/Items/Weapons/Melee/DevilsSunrise.cs index 803e40bb4d..9862d325a9 100644 --- a/Items/Weapons/Melee/DevilsSunrise.cs +++ b/Items/Weapons/Melee/DevilsSunrise.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Melee { CreateRecipe(). AddIngredient(ItemID.Terragrim). - AddIngredient(25). + AddIngredient(50). AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Weapons/Melee/DraconicDestruction.cs b/Items/Weapons/Melee/DraconicDestruction.cs index b1b62226f8..035b9e70ee 100644 --- a/Items/Weapons/Melee/DraconicDestruction.cs +++ b/Items/Weapons/Melee/DraconicDestruction.cs @@ -62,5 +62,7 @@ namespace CalamityMod.Items.Weapons.Melee AddTile(). Register(); } + + public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(255, 69, 0), new Color(139, 0, 0), 4f); } } diff --git a/Items/Weapons/Melee/DragonPow.cs b/Items/Weapons/Melee/DragonPow.cs index d1e27ec1d4..64adc9d3bc 100644 --- a/Items/Weapons/Melee/DragonPow.cs +++ b/Items/Weapons/Melee/DragonPow.cs @@ -24,10 +24,9 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 76; Item.height = 82; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 660; + Item.damage = 333; Item.knockBack = 9f; - Item.useAnimation = 20; - Item.useTime = 20; + Item.useAnimation = Item.useTime = 20; Item.autoReuse = true; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/DriftwoodSword.cs b/Items/Weapons/Melee/DriftwoodSword.cs index ffda7cc8d6..62c8348e65 100644 --- a/Items/Weapons/Melee/DriftwoodSword.cs +++ b/Items/Weapons/Melee/DriftwoodSword.cs @@ -12,18 +12,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - Item.damage = 14; + Item.CloneDefaults(ItemID.ShadewoodSword); // Driftwood (base) = Shadewood Item.width = 42; Item.height = 46; - Item.DamageType = DamageClass.Melee; - Item.useAnimation = Item.useTime = 20; - Item.useStyle = ItemUseStyleID.Swing; - Item.knockBack = 4f; - Item.UseSound = SoundID.Item1; - Item.autoReuse = true; - Item.useTurn = true; - Item.value = CalamityGlobalItem.RarityWhiteBuyPrice; - Item.rare = ItemRarityID.White; } public override void MeleeEffects(Player player, Rectangle hitbox) @@ -32,9 +23,9 @@ namespace CalamityMod.Items.Weapons.Melee Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.MagnetSphere); } - public override float UseSpeedMultiplier(Player player) => player.Calamity().countsAsAnyWet ? 1.66f : 1f; + public override float UseSpeedMultiplier(Player player) => player.Calamity().countsAsAnyWet ? 1.25f : 1f; - public override void ModifyWeaponKnockback(Player player, ref StatModifier knockback) => knockback.Base += player.Calamity().countsAsAnyWet ? 1.5f : 0f; + public override void ModifyWeaponKnockback(Player player, ref StatModifier knockback) => knockback.Base += player.Calamity().countsAsAnyWet ? 1.25f : 0f; public override void AddRecipes() { diff --git a/Items/Weapons/Melee/Earth.cs b/Items/Weapons/Melee/Earth.cs index bad5ef2a16..58cd6afbea 100644 --- a/Items/Weapons/Melee/Earth.cs +++ b/Items/Weapons/Melee/Earth.cs @@ -76,5 +76,14 @@ namespace CalamityMod.Items.Weapons.Melee AddTile(). Register(); } + + public static Color RarityColor() + { + List earthColors = [ Color.OrangeRed, Color.MediumTurquoise, Color.LimeGreen ]; + int colorIndex = (int)(Main.GlobalTimeWrappedHourly / 2 % earthColors.Count); + Color currentColor = earthColors[colorIndex]; + Color nextColor = earthColors[(colorIndex + 1) % earthColors.Count]; + return Color.Lerp(currentColor, nextColor, Main.GlobalTimeWrappedHourly % 2f > 1f ? 1f : Main.GlobalTimeWrappedHourly % 1f); + } } } diff --git a/Items/Weapons/Melee/EmpyreanKnives.cs b/Items/Weapons/Melee/EmpyreanKnives.cs index 07a926f727..75543894b5 100644 --- a/Items/Weapons/Melee/EmpyreanKnives.cs +++ b/Items/Weapons/Melee/EmpyreanKnives.cs @@ -17,13 +17,12 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 18; Item.height = 20; - Item.damage = 130; + Item.damage = 110; Item.DamageType = DamageClass.MeleeNoSpeed; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = 15; + Item.useAnimation = Item.useTime = 15; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 15; Item.knockBack = 3f; Item.UseSound = SoundID.Item39; Item.autoReuse = true; diff --git a/Items/Weapons/Melee/EssenceFlayer.cs b/Items/Weapons/Melee/EssenceFlayer.cs index 2154aef30e..a5d200ed3e 100644 --- a/Items/Weapons/Melee/EssenceFlayer.cs +++ b/Items/Weapons/Melee/EssenceFlayer.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). + AddIngredient(10). AddTile(). Register(); } diff --git a/Items/Weapons/Melee/EvilSmasher.cs b/Items/Weapons/Melee/EvilSmasher.cs index 596829a8c7..75b084b8bc 100644 --- a/Items/Weapons/Melee/EvilSmasher.cs +++ b/Items/Weapons/Melee/EvilSmasher.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 64; Item.height = 66; Item.damage = 200; - Item.DamageType = AverageDamageClass.Instance; + Item.DamageType = AllClassDamageClass.Instance; //Allow it to proc all class on hit effects Item.useAnimation = Item.useTime = 120; Item.channel = true; Item.knockBack = 6f; diff --git a/Items/Weapons/Melee/ExaltedOathblade.cs b/Items/Weapons/Melee/ExaltedOathblade.cs index 101b4ff14d..7752464b70 100644 --- a/Items/Weapons/Melee/ExaltedOathblade.cs +++ b/Items/Weapons/Melee/ExaltedOathblade.cs @@ -96,7 +96,6 @@ namespace CalamityMod.Items.Weapons.Melee CreateRecipe(). AddIngredient(). AddIngredient(ItemID.BrokenHeroSword). - AddIngredient(8). AddIngredient(8). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Weapons/Melee/FallenPaladinsHammer.cs b/Items/Weapons/Melee/FallenPaladinsHammer.cs index 4415eec8c9..3bdae47fdb 100644 --- a/Items/Weapons/Melee/FallenPaladinsHammer.cs +++ b/Items/Weapons/Melee/FallenPaladinsHammer.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 14; Item.height = 28; - Item.damage = 368; + Item.damage = 315; Item.noMelee = true; Item.noUseGraphic = true; Item.autoReuse = true; @@ -40,8 +40,8 @@ namespace CalamityMod.Items.Weapons.Melee CreateRecipe(). AddIngredient(ItemID.PaladinsHammer). AddIngredient(). - AddIngredient(5). - AddIngredient(5). + AddIngredient(8). + AddIngredient(8). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Melee/FaultLine.cs b/Items/Weapons/Melee/FaultLine.cs index 51436cd0e4..1e66ee50af 100644 --- a/Items/Weapons/Melee/FaultLine.cs +++ b/Items/Weapons/Melee/FaultLine.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(6). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Melee/FeralthornClaymore.cs b/Items/Weapons/Melee/FeralthornClaymore.cs index 62e01c0075..956a44edeb 100644 --- a/Items/Weapons/Melee/FeralthornClaymore.cs +++ b/Items/Weapons/Melee/FeralthornClaymore.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Melee/FlarefrostBlade.cs b/Items/Weapons/Melee/FlarefrostBlade.cs index 259086b8b5..e84720bddb 100644 --- a/Items/Weapons/Melee/FlarefrostBlade.cs +++ b/Items/Weapons/Melee/FlarefrostBlade.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Items.Weapons.Melee } public override void SetDefaults() { - Item.width = 64; - Item.height = 66; + Item.width = 82; + Item.height = 90; Item.damage = 125; Item.DamageType = DamageClass.Melee; Item.useAnimation = Item.useTime = 29; @@ -67,9 +67,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(8). - AddIngredient(ItemID.HellstoneBar, 8). - AddIngredient(ItemID.SoulofLight, 3). + AddIngredient(10). + AddIngredient(ItemID.HellstoneBar, 10). + AddIngredient(ItemID.SoulofLight, 10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Melee/FlarefrostBlade.png b/Items/Weapons/Melee/FlarefrostBlade.png index dedd00ceb0..d9f2c33caf 100644 Binary files a/Items/Weapons/Melee/FlarefrostBlade.png and b/Items/Weapons/Melee/FlarefrostBlade.png differ diff --git a/Items/Weapons/Melee/ForbiddenOathblade.cs b/Items/Weapons/Melee/ForbiddenOathblade.cs index c98f63055c..b98dd6c086 100644 --- a/Items/Weapons/Melee/ForbiddenOathblade.cs +++ b/Items/Weapons/Melee/ForbiddenOathblade.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Items.Weapons.Melee CreateRecipe(). AddIngredient(). AddIngredient(). - AddIngredient(5). + AddIngredient(8). AddIngredient(8). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Weapons/Melee/ForsakenSaber.cs b/Items/Weapons/Melee/ForsakenSaber.cs index bc4f7501e2..8c1b78c6dc 100644 --- a/Items/Weapons/Melee/ForsakenSaber.cs +++ b/Items/Weapons/Melee/ForsakenSaber.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetDefaults() { - Item.width = 46; - Item.height = 56; + Item.width = 66; + Item.height = 74; Item.damage = 80; Item.DamageType = DamageClass.Melee; Item.useAnimation = Item.useTime = 15; diff --git a/Items/Weapons/Melee/ForsakenSaber.png b/Items/Weapons/Melee/ForsakenSaber.png index 950f44264d..50b0db511a 100644 Binary files a/Items/Weapons/Melee/ForsakenSaber.png and b/Items/Weapons/Melee/ForsakenSaber.png differ diff --git a/Items/Weapons/Melee/FourSeasonsGalaxia.cs b/Items/Weapons/Melee/FourSeasonsGalaxia.cs index 681c4a05ce..f8b2d163c6 100644 --- a/Items/Weapons/Melee/FourSeasonsGalaxia.cs +++ b/Items/Weapons/Melee/FourSeasonsGalaxia.cs @@ -169,12 +169,14 @@ namespace CalamityMod.Items.Weapons.Melee if (mainAttunement == null || player.altFunctionUse != ItemAlternativeFunctionID.None) return false; - return true; + Projectile blade = Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockback, player.whoAmI); + blade.originalDamage = (int)MathF.Round(blade.originalDamage * mainAttunement.DamageMultiplier); + return false; } public override void ModifyWeaponDamage(Player player, ref StatModifier damage) { - damage += (mainAttunement?.DamageMultiplier ?? 1f) - 1f; + damage *= (mainAttunement?.DamageMultiplier ?? 1f); } public void SafeCheckAttunements() diff --git a/Items/Weapons/Melee/FracturedArk.cs b/Items/Weapons/Melee/FracturedArk.cs index bf19a29e79..3527447583 100644 --- a/Items/Weapons/Melee/FracturedArk.cs +++ b/Items/Weapons/Melee/FracturedArk.cs @@ -140,13 +140,13 @@ namespace CalamityMod.Items.Weapons.Melee { CreateRecipe(). AddIngredient(ItemID.EnchantedSword). - AddIngredient(5). + AddIngredient(10). AddRecipeGroup("AnyCopperBar", 10). AddTile(TileID.Anvils). Register(); CreateRecipe(). AddIngredient(ItemID.Terragrim). - AddIngredient(5). + AddIngredient(10). AddRecipeGroup("AnyCopperBar", 10). AddTile(TileID.Anvils). Register(); diff --git a/Items/Weapons/Melee/GaelsGreatsword.cs b/Items/Weapons/Melee/GaelsGreatsword.cs index 71bccf18c8..4d37a1313d 100644 --- a/Items/Weapons/Melee/GaelsGreatsword.cs +++ b/Items/Weapons/Melee/GaelsGreatsword.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.Calamity().devItem = true; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Melee/GalactusBlade.cs b/Items/Weapons/Melee/GalactusBlade.cs index 623a1e3b37..34aa0cee4b 100644 --- a/Items/Weapons/Melee/GalactusBlade.cs +++ b/Items/Weapons/Melee/GalactusBlade.cs @@ -131,11 +131,8 @@ namespace CalamityMod.Items.Weapons.Melee { CreateRecipe(). AddIngredient(ItemID.StarWrath). + AddIngredient(5). AddIngredient(10). - AddIngredient(ItemID.FragmentSolar, 5). - AddIngredient(ItemID.FragmentVortex, 5). - AddIngredient(ItemID.FragmentNebula, 5). - AddIngredient(ItemID.FragmentStardust, 5). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Melee/GalaxySmasher.png b/Items/Weapons/Melee/GalaxySmasher.png index 9b40695ec7..6f43040182 100644 Binary files a/Items/Weapons/Melee/GalaxySmasher.png and b/Items/Weapons/Melee/GalaxySmasher.png differ diff --git a/Items/Weapons/Melee/GalileoGladius.cs b/Items/Weapons/Melee/GalileoGladius.cs index 0f9a59b975..465854b9ee 100644 --- a/Items/Weapons/Melee/GalileoGladius.cs +++ b/Items/Weapons/Melee/GalileoGladius.cs @@ -69,8 +69,8 @@ namespace CalamityMod.Items.Weapons.Melee CreateRecipe(). AddIngredient(ItemID.Gladius). AddIngredient(8). - AddIngredient(5). - AddIngredient(15). + AddIngredient(4). + AddIngredient(20). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Melee/GeliticBlade.cs b/Items/Weapons/Melee/GeliticBlade.cs index 5747f80feb..8f1e8dfd36 100644 --- a/Items/Weapons/Melee/GeliticBlade.cs +++ b/Items/Weapons/Melee/GeliticBlade.cs @@ -55,8 +55,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(18). - AddIngredient(18). + AddIngredient(14). + AddIngredient(14). AddTile(TileID.Solidifier). Register(); } diff --git a/Items/Weapons/Melee/GoldplumeSpear.cs b/Items/Weapons/Melee/GoldplumeSpear.cs index 4ae1af9abe..7aa106132f 100644 --- a/Items/Weapons/Melee/GoldplumeSpear.cs +++ b/Items/Weapons/Melee/GoldplumeSpear.cs @@ -18,14 +18,13 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 54; Item.height = 54; - Item.damage = 31; + Item.damage = 26; Item.DamageType = DamageClass.Melee; Item.noMelee = true; Item.useTurn = true; Item.noUseGraphic = true; - Item.useAnimation = 25; + Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Shoot; - Item.useTime = 25; Item.knockBack = 5.75f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; @@ -40,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(10). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Weapons/Melee/GrandDad.cs b/Items/Weapons/Melee/GrandDad.cs index 2adf365c8e..641d59cc06 100644 --- a/Items/Weapons/Melee/GrandDad.cs +++ b/Items/Weapons/Melee/GrandDad.cs @@ -29,15 +29,14 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 124; Item.height = 124; - Item.damage = 5777; // Feel free to change these 7s as balance requires. The other 7s should stay - Update: no more 2777... :( + Item.damage = 5577; // Feel free to change these 7s as balance requires. The other 7s should stay - Update: no more 2777... :( Item.DamageType = TrueMeleeDamageClass.Instance; - Item.useAnimation = 77; - Item.useTime = 77; + Item.useAnimation = Item.useTime = 77; Item.useTurn = true; Item.knockBack = 77f; Item.autoReuse = true; - Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; - Item.rare = ModContent.RarityType(); + Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; + Item.rare = ModContent.RarityType(); Item.channel = true; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Melee/GreatswordofJudgement.cs b/Items/Weapons/Melee/GreatswordofJudgement.cs index 34d63e2784..2cc6d412ee 100644 --- a/Items/Weapons/Melee/GreatswordofJudgement.cs +++ b/Items/Weapons/Melee/GreatswordofJudgement.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 78; Item.height = 78; - Item.damage = 280; + Item.damage = 225; Item.DamageType = DamageClass.Melee; Item.useStyle = ItemUseStyleID.Swing; Item.useAnimation = Item.useTime = 20; @@ -164,8 +164,8 @@ namespace CalamityMod.Items.Weapons.Melee { CreateRecipe(). AddIngredient(ItemID.LunarBar, 7). + AddIngredient(ItemID.ShimmerBlock, 10). AddIngredient(). - AddIngredient(ItemID.FragmentStardust, 5). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Melee/HellfireFlamberge.cs b/Items/Weapons/Melee/HellfireFlamberge.cs index e4e2d52b0e..d8026ed15f 100644 --- a/Items/Weapons/Melee/HellfireFlamberge.cs +++ b/Items/Weapons/Melee/HellfireFlamberge.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(15). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Melee/HellionFlowerSpear.cs b/Items/Weapons/Melee/HellionFlowerSpear.cs index 362f888b31..ea85b0c971 100644 --- a/Items/Weapons/Melee/HellionFlowerSpear.cs +++ b/Items/Weapons/Melee/HellionFlowerSpear.cs @@ -19,14 +19,13 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 64; Item.height = 64; - Item.damage = 85; + Item.damage = 100; Item.DamageType = DamageClass.Melee; Item.noMelee = true; Item.useTurn = true; Item.noUseGraphic = true; - Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.useStyle = ItemUseStyleID.Shoot; - Item.useTime = 20; Item.knockBack = 7.5f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; @@ -41,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Melee/Hellkite.cs b/Items/Weapons/Melee/Hellkite.cs index 5cb216baa4..a27c40675f 100644 --- a/Items/Weapons/Melee/Hellkite.cs +++ b/Items/Weapons/Melee/Hellkite.cs @@ -25,14 +25,14 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 124; Item.height = 124; - Item.damage = 760; + Item.damage = 570; Item.DamageType = TrueMeleeDamageClass.Instance; Item.useAnimation = Item.useTime = 71; Item.useTurn = true; Item.knockBack = 13f; Item.autoReuse = true; - Item.value = CalamityGlobalItem.RarityLimeBuyPrice; - Item.rare = ItemRarityID.Lime; + Item.value = CalamityGlobalItem.RarityYellowBuyPrice; + Item.rare = ItemRarityID.Yellow; Item.channel = true; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Melee/HolyCollider.cs b/Items/Weapons/Melee/HolyCollider.cs index a0d8a82f4c..cc0d03f0e1 100644 --- a/Items/Weapons/Melee/HolyCollider.cs +++ b/Items/Weapons/Melee/HolyCollider.cs @@ -25,11 +25,10 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 114; Item.height = 146; - Item.damage = 2900; + Item.damage = 2200; Item.DamageType = TrueMeleeDamageClass.Instance; - Item.useAnimation = 45; + Item.useAnimation = Item.useTime = 45; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 45; Item.useTurn = true; Item.knockBack = 7.75f; Item.autoReuse = true; diff --git a/Items/Weapons/Melee/IllustriousKnives.cs b/Items/Weapons/Melee/IllustriousKnives.cs index fe800a7be0..2b9106d0ba 100644 --- a/Items/Weapons/Melee/IllustriousKnives.cs +++ b/Items/Weapons/Melee/IllustriousKnives.cs @@ -62,5 +62,7 @@ namespace CalamityMod.Items.Weapons.Melee AddTile(). Register(); } + + public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(154, 255, 151), new Color(228, 151, 255), 4f); } } diff --git a/Items/Weapons/Melee/Lacerator.cs b/Items/Weapons/Melee/Lacerator.cs index 95595ad0cc..d0808f5ded 100644 --- a/Items/Weapons/Melee/Lacerator.cs +++ b/Items/Weapons/Melee/Lacerator.cs @@ -56,7 +56,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(4). + AddIngredient(25). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Melee/LifehuntScythe.cs b/Items/Weapons/Melee/LifehuntScythe.cs index ae3eeebd78..b1134b9e16 100644 --- a/Items/Weapons/Melee/LifehuntScythe.cs +++ b/Items/Weapons/Melee/LifehuntScythe.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(15). + AddIngredient(12). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Melee/Lightspeed.cs b/Items/Weapons/Melee/Lightspeed.cs index 2b6cae8972..e43ef1598a 100644 --- a/Items/Weapons/Melee/Lightspeed.cs +++ b/Items/Weapons/Melee/Lightspeed.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - Item.width = 74; - Item.height = 94; + Item.width = 94; + Item.height = 92; Item.useStyle = ItemUseStyleID.Shoot; Item.damage = 200; Item.DamageType = TrueMeleeDamageClass.Instance; diff --git a/Items/Weapons/Melee/Lightspeed.png b/Items/Weapons/Melee/Lightspeed.png index 6fc05ab7e6..fef0720fcc 100644 Binary files a/Items/Weapons/Melee/Lightspeed.png and b/Items/Weapons/Melee/Lightspeed.png differ diff --git a/Items/Weapons/Melee/Lucrecia.cs b/Items/Weapons/Melee/Lucrecia.cs index e2160af239..44b75f67cb 100644 --- a/Items/Weapons/Melee/Lucrecia.cs +++ b/Items/Weapons/Melee/Lucrecia.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 54; Item.height = 54; Item.useStyle = ItemUseStyleID.Shoot; - Item.damage = 132; + Item.damage = 124; Item.DamageType = DamageClass.Melee; Item.useAnimation = Item.useTime = 34; Item.shootSpeed = 10f; diff --git a/Items/Weapons/Melee/MajesticGuard.cs b/Items/Weapons/Melee/MajesticGuard.cs index 98046d1acc..c0fbf4639a 100644 --- a/Items/Weapons/Melee/MajesticGuard.cs +++ b/Items/Weapons/Melee/MajesticGuard.cs @@ -16,10 +16,9 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 100; Item.height = 100; - Item.damage = 365; + Item.damage = 270; Item.DamageType = TrueMeleeDamageClass.Instance; - Item.useAnimation = 50; - Item.useTime = 50; + Item.useAnimation = Item.useTime = 50; Item.useTurn = true; Item.knockBack = 12f; Item.autoReuse = true; diff --git a/Items/Weapons/Melee/MawOfInfinity.cs b/Items/Weapons/Melee/MawOfInfinity.cs index 5d1f55e272..5c68403adf 100644 --- a/Items/Weapons/Melee/MawOfInfinity.cs +++ b/Items/Weapons/Melee/MawOfInfinity.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Items.Weapons.Melee } public override void SetDefaults() { - Item.width = 78; - Item.height = 94; + Item.width = 74; + Item.height = 84; Item.damage = 2080; Item.DamageType = DamageClass.Melee; Item.useTime = Item.useAnimation = 33; diff --git a/Items/Weapons/Melee/MawOfInfinity.png b/Items/Weapons/Melee/MawOfInfinity.png index 077d762192..849fc2a04a 100644 Binary files a/Items/Weapons/Melee/MawOfInfinity.png and b/Items/Weapons/Melee/MawOfInfinity.png differ diff --git a/Items/Weapons/Melee/MawOfInfinityGlow.png b/Items/Weapons/Melee/MawOfInfinityGlow.png index 6525db49f3..0fa16f3476 100644 Binary files a/Items/Weapons/Melee/MawOfInfinityGlow.png and b/Items/Weapons/Melee/MawOfInfinityGlow.png differ diff --git a/Items/Weapons/Melee/MonolithSword.cs b/Items/Weapons/Melee/MonolithSword.cs index a04e7b32fe..a4350a5406 100644 --- a/Items/Weapons/Melee/MonolithSword.cs +++ b/Items/Weapons/Melee/MonolithSword.cs @@ -18,18 +18,11 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - Item.damage = 30; + Item.CloneDefaults(ItemID.PearlwoodSword); // Monolith >= Pearlwood Item.width = 40; Item.height = 46; - Item.DamageType = DamageClass.Melee; + Item.damage = 30; Item.useAnimation = Item.useTime = 7; - Item.useStyle = ItemUseStyleID.Swing; - Item.knockBack = 4f; - Item.UseSound = SoundID.Item1; - Item.autoReuse = true; - Item.useTurn = true; - Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; - Item.rare = ItemRarityID.Orange; Item.ArmorPenetration = ArmorPenetration; } public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox) diff --git a/Items/Weapons/Melee/NeptunesBounty.cs b/Items/Weapons/Melee/NeptunesBounty.cs index 599732a4a1..b75794002b 100644 --- a/Items/Weapons/Melee/NeptunesBounty.cs +++ b/Items/Weapons/Melee/NeptunesBounty.cs @@ -21,10 +21,9 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 122; Item.height = 122; - Item.damage = 444; + Item.damage = 420; Item.knockBack = 9f; - Item.useTime = 65; - Item.useAnimation = 65; + Item.useAnimation = Item.useTime = 65; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 3f; diff --git a/Items/Weapons/Melee/Oblivion.cs b/Items/Weapons/Melee/Oblivion.cs index 178a6e626d..ca9d8bf80d 100644 --- a/Items/Weapons/Melee/Oblivion.cs +++ b/Items/Weapons/Melee/Oblivion.cs @@ -1,7 +1,8 @@ using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Melee.Yoyos; using CalamityMod.Systems.Collections; +using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -13,9 +14,10 @@ namespace CalamityMod.Items.Weapons.Melee { public new string LocalizationCategory => "Items.Weapons.Melee"; + public static float Lifetime => 15; //Technically has infinite lifetime, but manually sets 15 seconds. See projectile file for details public static float Reach = 512f; public static float Speed = 36f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(Reach.ToTiles(), Speed); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(Reach.ToTiles(), Speed, Lifetime); public override void SetStaticDefaults() { @@ -30,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 28; Item.height = 38; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 50; + Item.damage = 35; Item.knockBack = 4f; Item.useTime = 22; Item.useAnimation = 22; @@ -48,5 +50,14 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ItemRarityID.Lime; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; } + + public override bool CanUseItem(Player player) + { + CalamityPlayer modPlayer = player.Calamity(); + if (modPlayer.oblivionCooldown == 0) + return true; + else + return false; + } } } diff --git a/Items/Weapons/Melee/OmegaBiomeBlade.cs b/Items/Weapons/Melee/OmegaBiomeBlade.cs index c41913c66d..df460ccd9b 100644 --- a/Items/Weapons/Melee/OmegaBiomeBlade.cs +++ b/Items/Weapons/Melee/OmegaBiomeBlade.cs @@ -32,9 +32,9 @@ namespace CalamityMod.Items.Weapons.Melee public bool OnHitProc = false; #region stats - public static int BaseDamage = 200; + public static int BaseDamage = 150; - public static int WhirlwindAttunement_BaseDamage = 120; + public static int WhirlwindAttunement_BaseDamage = 150; public static int WhirlwindAttunement_LocalIFrames = 20; //Remember its got one extra update public static float WhirlwindAttunement_EnergyDamageMult = 0.5f; public static float WhirlwindAttunement_BaseSwingDamageMult = 0.4f; @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Melee public static int WhirlwindAttunement_PassiveBaseDamage = 80; - public static int SuperPogoAttunement_BaseDamage = 190; + public static int SuperPogoAttunement_BaseDamage = 200; public static int SuperPogoAttunement_PlayerShredIFrames = 8; public static int SuperPogoAttunement_LocalIFrames = 24; //Be warned its got one extra update so all the iframes should be divided in 2 public static float SuperPogoAttunement_ShotDamageMult = 2.5f; @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons.Melee public static int SuperPogoAttunement_PassiveLifeSteal = 7; - public static int ShockwaveAttunement_BaseDamage = 550; + public static int ShockwaveAttunement_BaseDamage = 600; public static float ShockwaveAttunement_BeamDamageMult = 0.25f; public static int ShockwaveAttunement_DashHitIFrames = 20; public static float ShockwaveAttunement_FullChargeMult = 3.6f; @@ -245,7 +245,7 @@ namespace CalamityMod.Items.Weapons.Melee if (mainAttunement == null) return; - damage += (mainAttunement?.DamageMultiplier ?? 1f) - 1f; + damage *= (mainAttunement?.DamageMultiplier ?? 1f); } public void SafeCheckAttunements() @@ -315,8 +315,8 @@ namespace CalamityMod.Items.Weapons.Melee if (secondaryAttunement.id == AttunementID.FlailBlade && MeatHook == null) { - int damage = (int)player.GetTotalDamage().ApplyTo(FlailBladeAttunement_PassiveBaseDamage); - MeatHook = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, ProjectileType(), damage, 0f, player.whoAmI); + MeatHook = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, ProjectileType(), FlailBladeAttunement_PassiveBaseDamage, 0f, player.whoAmI); + MeatHook.originalDamage = FlailBladeAttunement_PassiveBaseDamage; } secondaryAttunement.PassiveEffect(player, source, ref UseTimer, ref OnHitProc, MeatHook); @@ -356,7 +356,9 @@ namespace CalamityMod.Items.Weapons.Melee if (mainAttunement == null || player.altFunctionUse != ItemAlternativeFunctionID.None) return false; - return true; + Projectile blade = Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockback, player.whoAmI); + blade.originalDamage = (int)MathF.Round(blade.originalDamage * mainAttunement.DamageMultiplier); + return false; } internal static ChargingEnergyParticleSet BiomeEnergyParticles = new ChargingEnergyParticleSet(-1, 2, Color.White, Color.White, 0.04f, 20f); @@ -412,9 +414,9 @@ namespace CalamityMod.Items.Weapons.Melee { CreateRecipe(). AddIngredient(). - AddIngredient(3). - AddIngredient(3). - AddIngredient(). + AddIngredient(18). + AddIngredient(6). + AddIngredient(3). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Melee/Orderbringer.cs b/Items/Weapons/Melee/Orderbringer.cs index b184ca0daf..1d5ac85c5f 100644 --- a/Items/Weapons/Melee/Orderbringer.cs +++ b/Items/Weapons/Melee/Orderbringer.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.width = Item.height = 112; - Item.damage = 800; + Item.damage = 700; Item.DamageType = DamageClass.Melee; Item.useAnimation = Item.useTime = 16; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Melee/PerfectDark.cs b/Items/Weapons/Melee/PerfectDark.cs index c97e8bf4bd..b0c7d81332 100644 --- a/Items/Weapons/Melee/PerfectDark.cs +++ b/Items/Weapons/Melee/PerfectDark.cs @@ -19,11 +19,10 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 50; Item.height = 50; - Item.damage = 29; + Item.damage = 24; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 24; + Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 24; Item.useTurn = true; Item.knockBack = 4.25f; Item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/Pwnagehammer.cs b/Items/Weapons/Melee/Pwnagehammer.cs index 0b0e47fa19..90ae943eee 100644 --- a/Items/Weapons/Melee/Pwnagehammer.cs +++ b/Items/Weapons/Melee/Pwnagehammer.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 66; Item.height = 66; - Item.damage = 150; + Item.damage = 140; Item.noMelee = true; Item.noUseGraphic = true; Item.autoReuse = true; diff --git a/Items/Weapons/Melee/Quagmire.cs b/Items/Weapons/Melee/Quagmire.cs index 111b1073f8..5cd02012b4 100644 --- a/Items/Weapons/Melee/Quagmire.cs +++ b/Items/Weapons/Melee/Quagmire.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(6). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Melee/RedSun.cs b/Items/Weapons/Melee/RedSun.cs index cc2950afc7..b3df54f05a 100644 --- a/Items/Weapons/Melee/RedSun.cs +++ b/Items/Weapons/Melee/RedSun.cs @@ -117,5 +117,7 @@ namespace CalamityMod.Items.Weapons.Melee AddTile(). Register(); } + + public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(204, 86, 80), new Color(237, 69, 141), 4f); } } diff --git a/Items/Weapons/Melee/SaharaSlicers.cs b/Items/Weapons/Melee/SaharaSlicers.cs index 415b9f6834..6cc1a949c4 100644 --- a/Items/Weapons/Melee/SaharaSlicers.cs +++ b/Items/Weapons/Melee/SaharaSlicers.cs @@ -28,10 +28,9 @@ namespace CalamityMod.Items.Weapons.Melee Item.noUseGraphic = true; Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; - Item.damage = 23; + Item.damage = 20; Item.DamageType = TrueMeleeDamageClass.Instance; - Item.useTime = 12; - Item.useAnimation = 12; + Item.useAnimation = Item.useTime = 12; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 3.3f; Item.knockBack = 6f; @@ -49,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Melee if (player.Calamity().saharaSlicersBolts > 0) { SoundEngine.PlaySound(SoundID.DD2_GhastlyGlaivePierce with { Pitch = 1.5f }, player.Center); - Projectile.NewProjectile(source, position, velocity * 2, ModContent.ProjectileType(), (int)(damage * 1.2), knockback * 1.2f, player.whoAmI, 1); + Projectile.NewProjectile(source, position, velocity * 2, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 1); player.Calamity().saharaSlicersBolts--; } else diff --git a/Items/Weapons/Melee/SausageMaker.cs b/Items/Weapons/Melee/SausageMaker.cs index 2ac51b673b..2147e9fc62 100644 --- a/Items/Weapons/Melee/SausageMaker.cs +++ b/Items/Weapons/Melee/SausageMaker.cs @@ -20,14 +20,13 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 44; Item.height = 42; - Item.damage = 32; + Item.damage = 27; Item.DamageType = TrueMeleeDamageClass.Instance; Item.noMelee = true; Item.useTurn = true; Item.noUseGraphic = true; - Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.useStyle = ItemUseStyleID.Shoot; - Item.useTime = 20; Item.knockBack = 6.25f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Weapons/Melee/SeashineSword.cs b/Items/Weapons/Melee/SeashineSword.cs index 044d2272f4..ccce612bfc 100644 --- a/Items/Weapons/Melee/SeashineSword.cs +++ b/Items/Weapons/Melee/SeashineSword.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Items.Weapons.Melee Item.CloneDefaults(ItemID.EnchantedSword); Item.width = 40; Item.height = 40; - Item.useTime = 30; - Item.damage = 25; + Item.useTime = 40; + Item.damage = 22; Item.DamageType = DamageClass.Melee; Item.value = CalamityGlobalItem.RarityGreenBuyPrice; Item.knockBack = 4f; diff --git a/Items/Weapons/Melee/Shimmerspark.cs b/Items/Weapons/Melee/Shimmerspark.cs index d4e3ce1078..17f2385ac2 100644 --- a/Items/Weapons/Melee/Shimmerspark.cs +++ b/Items/Weapons/Melee/Shimmerspark.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(6). + AddIngredient(12). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Melee/SolsticeClaymore.cs b/Items/Weapons/Melee/SolsticeClaymore.cs index 8435cf73c5..ccaf184cfd 100644 --- a/Items/Weapons/Melee/SolsticeClaymore.cs +++ b/Items/Weapons/Melee/SolsticeClaymore.cs @@ -15,11 +15,10 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 86; Item.height = 86; - Item.damage = 300; + Item.damage = 235; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 16; + Item.useAnimation = Item.useTime = 16; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 16; Item.useTurn = true; Item.knockBack = 6.5f; Item.UseSound = SoundID.Item1; @@ -76,7 +75,7 @@ namespace CalamityMod.Items.Weapons.Melee { CreateRecipe(). AddIngredient(ItemID.BeamSword). - AddIngredient(20). + AddIngredient(18). AddIngredient(ItemID.LunarBar, 5). AddIngredient(ItemID.FragmentSolar, 5). AddIngredient(ItemID.FragmentStardust, 5). diff --git a/Items/Weapons/Melee/SoulHarvester.cs b/Items/Weapons/Melee/SoulHarvester.cs index b57c559428..6db0163d71 100644 --- a/Items/Weapons/Melee/SoulHarvester.cs +++ b/Items/Weapons/Melee/SoulHarvester.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 62; Item.height = 64; - Item.damage = 85; + Item.damage = 77; Item.DamageType = DamageClass.Melee; Item.useAnimation = Item.useTime = 22; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Melee/StarnightLance.cs b/Items/Weapons/Melee/StarnightLance.cs index 78aa68e9ab..0ad67fd9a5 100644 --- a/Items/Weapons/Melee/StarnightLance.cs +++ b/Items/Weapons/Melee/StarnightLance.cs @@ -20,14 +20,13 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 72; Item.height = 72; - Item.damage = 110; + Item.damage = 80; Item.DamageType = DamageClass.Melee; Item.noMelee = true; Item.useTurn = true; Item.noUseGraphic = true; - Item.useAnimation = 23; + Item.useAnimation = Item.useTime = 23; Item.useStyle = ItemUseStyleID.Shoot; - Item.useTime = 23; Item.knockBack = 6; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Weapons/Melee/StellarStriker.cs b/Items/Weapons/Melee/StellarStriker.cs index 87193b5c73..8bcd9d1bc3 100644 --- a/Items/Weapons/Melee/StellarStriker.cs +++ b/Items/Weapons/Melee/StellarStriker.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 100; Item.height = 118; - Item.damage = 123; + Item.damage = 100; Item.DamageType = TrueMeleeDamageClass.Instance; Item.useAnimation = Item.useTime = 28; diff --git a/Items/Weapons/Melee/StormSaber.cs b/Items/Weapons/Melee/StormSaber.cs index 87751604c1..22daf62b0a 100644 --- a/Items/Weapons/Melee/StormSaber.cs +++ b/Items/Weapons/Melee/StormSaber.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 58; Item.height = 64; - Item.damage = 50; + Item.damage = 38; Item.DamageType = DamageClass.Melee; Item.useTime = Item.useAnimation = 23; Item.useTurn = true; diff --git a/Items/Weapons/Melee/StreamGouge.cs b/Items/Weapons/Melee/StreamGouge.cs index 9d6763fb07..3fe98fa071 100644 --- a/Items/Weapons/Melee/StreamGouge.cs +++ b/Items/Weapons/Melee/StreamGouge.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). + AddIngredient(10). AddTile(). Register(); } diff --git a/Items/Weapons/Melee/TeardropCleaver.cs b/Items/Weapons/Melee/TeardropCleaver.cs index e91262ae77..8ef0354eb1 100644 --- a/Items/Weapons/Melee/TeardropCleaver.cs +++ b/Items/Weapons/Melee/TeardropCleaver.cs @@ -18,11 +18,10 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 54; Item.height = 76; - Item.damage = 38; + Item.damage = 33; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 24; + Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 24; Item.useTurn = true; Item.knockBack = 5.5f; Item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/Terratomere.cs b/Items/Weapons/Melee/Terratomere.cs index f2abc131a5..7cdd7b6db4 100644 --- a/Items/Weapons/Melee/Terratomere.cs +++ b/Items/Weapons/Melee/Terratomere.cs @@ -38,10 +38,9 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 60; Item.height = 66; - Item.damage = 145; + Item.damage = 120; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 21; - Item.useTime = 21; + Item.useAnimation = Item.useTime = 21; Item.useStyle = ItemUseStyleID.Swing; Item.useTurn = true; Item.knockBack = 7f; @@ -60,8 +59,7 @@ namespace CalamityMod.Items.Weapons.Melee { CreateRecipe(). AddIngredient(ItemID.TerraBlade). - AddIngredient(7). - AddIngredient(9). + AddIngredient(18). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Melee/Terratomere.png b/Items/Weapons/Melee/Terratomere.png index a7c34d324c..254ee9cc9d 100644 Binary files a/Items/Weapons/Melee/Terratomere.png and b/Items/Weapons/Melee/Terratomere.png differ diff --git a/Items/Weapons/Melee/TheGodsGambit.cs b/Items/Weapons/Melee/TheGodsGambit.cs index e013c7fb45..f9e148a210 100644 --- a/Items/Weapons/Melee/TheGodsGambit.cs +++ b/Items/Weapons/Melee/TheGodsGambit.cs @@ -50,8 +50,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(18). - AddIngredient(18). + AddIngredient(14). + AddIngredient(14). AddTile(TileID.Solidifier). Register(); } diff --git a/Items/Weapons/Melee/TheMutilator.cs b/Items/Weapons/Melee/TheMutilator.cs index 1ce3d7ff66..21a885b7e9 100644 --- a/Items/Weapons/Melee/TheMutilator.cs +++ b/Items/Weapons/Melee/TheMutilator.cs @@ -85,7 +85,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(25). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Melee/TheObliterator.cs b/Items/Weapons/Melee/TheObliterator.cs index 6e33876710..6f22bde96d 100644 --- a/Items/Weapons/Melee/TheObliterator.cs +++ b/Items/Weapons/Melee/TheObliterator.cs @@ -38,10 +38,9 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 42; Item.height = 40; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 400; + Item.damage = 370; Item.knockBack = 7.5f; - Item.useTime = 20; - Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMight.cs b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMight.cs index 1c3b293927..538b2cd881 100644 --- a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMight.cs +++ b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMight.cs @@ -2,6 +2,7 @@ using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -44,5 +45,7 @@ namespace CalamityMod.Items.Weapons.Melee AddTile(). Register(); } + + public static Color RarityColor() => new Color(227, 226, 180); } } diff --git a/Items/Weapons/Melee/TrueArkoftheAncients.cs b/Items/Weapons/Melee/TrueArkoftheAncients.cs index 965503a687..0e6047b246 100644 --- a/Items/Weapons/Melee/TrueArkoftheAncients.cs +++ b/Items/Weapons/Melee/TrueArkoftheAncients.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.width = Item.height = 72; - Item.damage = 130; + Item.damage = 100; Item.DamageType = DamageClass.MeleeNoSpeed; Item.noUseGraphic = true; Item.noMelee = true; diff --git a/Items/Weapons/Melee/TrueBiomeBlade.cs b/Items/Weapons/Melee/TrueBiomeBlade.cs index 0082fe6841..3ed2204089 100644 --- a/Items/Weapons/Melee/TrueBiomeBlade.cs +++ b/Items/Weapons/Melee/TrueBiomeBlade.cs @@ -48,23 +48,23 @@ namespace CalamityMod.Items.Weapons.Melee public static float EvilAttunement_SlashDamageBoost = 3f; public static int EvilAttunement_SlashIFrames = 60; - public static int ColdAttunement_BaseDamage = 140; + public static int ColdAttunement_BaseDamage = 105; public static float ColdAttunement_ThirdSwingBoost = 1.25f; public static float ColdAttunement_MistDamageReduction = 0.11f; - public static int HotAttunement_BaseDamage = 115; + public static int HotAttunement_BaseDamage = 105; public static int HotAttunement_PlayerShredIFrames = 8; public static float HotAttunement_ShotDamageBoost = 4.5f; public static int HotAttunement_LocalIFrames = 24; //Be warned its got one extra update so all the iframes should be divided in 2 public static float HotAttunement_ShredDecayRate = 0.65f; //How much charge is lost per frame. - public static int TropicalAttunement_BaseDamage = 132; + public static int TropicalAttunement_BaseDamage = 115; public static float TropicalAttunement_ChainDamageReduction = 0.6f; public static float TropicalAttunement_VineDamageReduction = 0.3f; public static float TropicalAttunement_SweetSpotDamageMultiplier = 1.5f; //It also crits, so be mindful of that public static int TropicalAttunement_LocalIFrames = 60; //Be warned its got 2 extra updates so all the iframes should be divided in 3 - public static int HolyAttunement_BaseDamage = 88; + public static int HolyAttunement_BaseDamage = 100; public static float HolyAttunement_BaseSwingDamageMult = 0.5f; public static float HolyAttunement_FullSwingDamageMult = 1f; public static float HolyAttunement_ThrowDamageBoost = 3f; @@ -207,7 +207,7 @@ namespace CalamityMod.Items.Weapons.Melee if (mainAttunement == null) return; - damage += (mainAttunement?.DamageMultiplier ?? 1f) - 1f; + damage *= (mainAttunement?.DamageMultiplier ?? 1f); } public void SafeCheckAttunements() diff --git a/Items/Weapons/Melee/Tumbleweed.cs b/Items/Weapons/Melee/Tumbleweed.cs index ec82471f8a..703a85dd56 100644 --- a/Items/Weapons/Melee/Tumbleweed.cs +++ b/Items/Weapons/Melee/Tumbleweed.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Melee { CreateRecipe(). AddIngredient(ItemID.Sunfury). - AddIngredient(ItemID.AncientCloth, 5). + AddIngredient(ItemID.AncientCloth, 2). AddIngredient(). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Weapons/Melee/VanishingPoint.png b/Items/Weapons/Melee/VanishingPoint.png index bbf16bd646..0415214359 100644 Binary files a/Items/Weapons/Melee/VanishingPoint.png and b/Items/Weapons/Melee/VanishingPoint.png differ diff --git a/Items/Weapons/Melee/VeinBurster.cs b/Items/Weapons/Melee/VeinBurster.cs index d9e51352cd..80b5b46c21 100644 --- a/Items/Weapons/Melee/VeinBurster.cs +++ b/Items/Weapons/Melee/VeinBurster.cs @@ -19,11 +19,10 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 52; Item.height = 50; - Item.damage = 45; + Item.damage = 38; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 41; + Item.useAnimation = Item.useTime = 41; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 41; Item.useTurn = true; Item.knockBack = 4.25f; Item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/WindBlade.cs b/Items/Weapons/Melee/WindBlade.cs index 16c5888422..1bfa238653 100644 --- a/Items/Weapons/Melee/WindBlade.cs +++ b/Items/Weapons/Melee/WindBlade.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(10). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Weapons/Melee/YinYo.cs b/Items/Weapons/Melee/YinYo.cs index b3a233e150..4291fef569 100644 --- a/Items/Weapons/Melee/YinYo.cs +++ b/Items/Weapons/Melee/YinYo.cs @@ -40,8 +40,8 @@ namespace CalamityMod.Items.Weapons.Melee Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 12f; - Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; - Item.rare = ItemRarityID.LightRed; + Item.value = CalamityGlobalItem.RarityPinkBuyPrice; + Item.rare = ItemRarityID.Pink; } public override void AddRecipes() diff --git a/Items/Weapons/Ranged/AcidwoodBow.cs b/Items/Weapons/Ranged/AcidwoodBow.cs index f5e8ce8ea4..1298ddd35f 100644 --- a/Items/Weapons/Ranged/AcidwoodBow.cs +++ b/Items/Weapons/Ranged/AcidwoodBow.cs @@ -9,22 +9,11 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 8; - Item.DamageType = DamageClass.Ranged; + Item.CloneDefaults(ItemID.ShadewoodBow); // Ash Wood > Acidwood > Shadewood Item.width = 20; Item.height = 50; - Item.useTime = 27; - Item.useAnimation = 27; - Item.useStyle = ItemUseStyleID.Shoot; - Item.noMelee = true; - Item.knockBack = 0f; - Item.value = CalamityGlobalItem.RarityWhiteBuyPrice; - Item.rare = ItemRarityID.White; - Item.UseSound = SoundID.Item5; - Item.autoReuse = true; - Item.shoot = ProjectileID.WoodenArrowFriendly; - Item.shootSpeed = 6.6f; - Item.useAmmo = AmmoID.Arrow; + Item.damage = 9; + Item.useAnimation = Item.useTime = 27; } public override void AddRecipes() diff --git a/Items/Weapons/Ranged/ArterialAssault.cs b/Items/Weapons/Ranged/ArterialAssault.cs index 33961056b5..e86945b1fe 100644 --- a/Items/Weapons/Ranged/ArterialAssault.cs +++ b/Items/Weapons/Ranged/ArterialAssault.cs @@ -54,7 +54,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(25). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Ranged/AstralBlaster.cs b/Items/Weapons/Ranged/AstralBlaster.cs index 573607889b..84af8eb4a7 100644 --- a/Items/Weapons/Ranged/AstralBlaster.cs +++ b/Items/Weapons/Ranged/AstralBlaster.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { CreateRecipe(). - AddIngredient(6). + AddIngredient(12). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Ranged/Auralis.cs b/Items/Weapons/Ranged/Auralis.cs index f396e088ac..6af713f90c 100644 --- a/Items/Weapons/Ranged/Auralis.cs +++ b/Items/Weapons/Ranged/Auralis.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Items.Weapons.Ranged { CreateRecipe(). AddIngredient(ItemID.SniperRifle). - AddIngredient(5). + AddIngredient(10). AddIngredient(5). AddIngredient(50). AddTile(TileID.MythrilAnvil). diff --git a/Items/Weapons/Ranged/BladedgeRailbow.cs b/Items/Weapons/Ranged/BladedgeRailbow.cs index d0876e9c16..bc278a0a96 100644 --- a/Items/Weapons/Ranged/BladedgeRailbow.cs +++ b/Items/Weapons/Ranged/BladedgeRailbow.cs @@ -169,7 +169,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Ranged/BloodBoiler.cs b/Items/Weapons/Ranged/BloodBoiler.cs index 24a1259bde..160d988ff9 100644 --- a/Items/Weapons/Ranged/BloodBoiler.cs +++ b/Items/Weapons/Ranged/BloodBoiler.cs @@ -65,7 +65,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { CreateRecipe(). - AddIngredient(6). + AddIngredient(25). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Ranged/BrimstoneFury.cs b/Items/Weapons/Ranged/BrimstoneFury.cs index d624424177..c3445ed0cb 100644 --- a/Items/Weapons/Ranged/BrimstoneFury.cs +++ b/Items/Weapons/Ranged/BrimstoneFury.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(8). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Ranged/CleansingBlaze.cs b/Items/Weapons/Ranged/CleansingBlaze.cs index 80a3ed689c..d29929e79c 100644 --- a/Items/Weapons/Ranged/CleansingBlaze.cs +++ b/Items/Weapons/Ranged/CleansingBlaze.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). + AddIngredient(10). AddTile(). Register(); } diff --git a/Items/Weapons/Ranged/Contagion.cs b/Items/Weapons/Ranged/Contagion.cs index 1f941bd2dc..8db0621ddf 100644 --- a/Items/Weapons/Ranged/Contagion.cs +++ b/Items/Weapons/Ranged/Contagion.cs @@ -53,5 +53,7 @@ namespace CalamityMod.Items.Weapons.Ranged Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } + + public static Color RarityColor() => new Color(207, 17, 117); } } diff --git a/Items/Weapons/Ranged/DarkechoGreatbow.cs b/Items/Weapons/Ranged/DarkechoGreatbow.cs index d08fcdd342..5804c8d40b 100644 --- a/Items/Weapons/Ranged/DarkechoGreatbow.cs +++ b/Items/Weapons/Ranged/DarkechoGreatbow.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { CreateRecipe(). - AddIngredient(8). + AddIngredient(12). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Ranged/DriftwoodBow.cs b/Items/Weapons/Ranged/DriftwoodBow.cs index f25de79fa3..a8bfded9cc 100644 --- a/Items/Weapons/Ranged/DriftwoodBow.cs +++ b/Items/Weapons/Ranged/DriftwoodBow.cs @@ -12,29 +12,16 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 10; - Item.DamageType = DamageClass.Ranged; + Item.CloneDefaults(ItemID.ShadewoodBow); // Driftwood (base) = Shadewood Item.width = 22; Item.height = 42; - Item.useTime = 28; - Item.useAnimation = 28; - Item.useStyle = ItemUseStyleID.Shoot; - Item.noMelee = true; - Item.knockBack = 0f; - Item.value = CalamityGlobalItem.RarityWhiteBuyPrice; - Item.rare = ItemRarityID.White; - Item.UseSound = SoundID.Item5; - Item.autoReuse = true; - Item.shoot = ProjectileID.WoodenArrowFriendly; - Item.shootSpeed = 6.6f; - Item.useAmmo = AmmoID.Arrow; } public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) { if (player.Calamity().countsAsAnyWet) { - velocity *= 1.3f; + velocity *= 1.2f; knockback += 1f; for (int i = 0; i <= 18; i++) diff --git a/Items/Weapons/Ranged/Galeforce.cs b/Items/Weapons/Ranged/Galeforce.cs index 5f76492ce8..90c21a16bf 100644 --- a/Items/Weapons/Ranged/Galeforce.cs +++ b/Items/Weapons/Ranged/Galeforce.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(10). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Weapons/Ranged/Goobow.cs b/Items/Weapons/Ranged/Goobow.cs index 5f0fd31abf..6a2834a6b9 100644 --- a/Items/Weapons/Ranged/Goobow.cs +++ b/Items/Weapons/Ranged/Goobow.cs @@ -63,8 +63,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { CreateRecipe(). - AddIngredient(18). - AddIngredient(18). + AddIngredient(14). + AddIngredient(14). AddTile(TileID.Solidifier). Register(); } diff --git a/Items/Weapons/Ranged/GunkShot.cs b/Items/Weapons/Ranged/GunkShot.cs index 2db7216cbd..35a0e2ed99 100644 --- a/Items/Weapons/Ranged/GunkShot.cs +++ b/Items/Weapons/Ranged/GunkShot.cs @@ -50,8 +50,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { CreateRecipe(). - AddIngredient(18). - AddIngredient(18). + AddIngredient(14). + AddIngredient(14). AddTile(TileID.Solidifier). Register(); } diff --git a/Items/Weapons/Ranged/HalleysInferno.cs b/Items/Weapons/Ranged/HalleysInferno.cs index 791aaa307d..448ade2543 100644 --- a/Items/Weapons/Ranged/HalleysInferno.cs +++ b/Items/Weapons/Ranged/HalleysInferno.cs @@ -1,4 +1,5 @@ -using System.Linq; +using System.Collections.Generic; +using System.Linq; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Projectiles.Ranged; @@ -20,13 +21,13 @@ namespace CalamityMod.Items.Weapons.Ranged public static readonly SoundStyle ShootSound = new("CalamityMod/Sounds/Item/HalleysInfernoShoot") { Volume = 0.68f }; public static readonly SoundStyle Hit = new("CalamityMod/Sounds/Item/HalleysInfernoHit") { Volume = 0.75f }; public static float MaxStarburstPerComet => 1; - public static float MaxStarburstPerStar => 0.5f; + public static float MaxStarburstPerStar => 0.25f; public static float LostAccuracyPerMiss => 4; public static float MaxAccuracy => 50; - public static float StarburstDmgMult => 2.5f; + public static float StarburstDmgMult => 2f; - public static float StarburstVelMult => 0.75f; + public static float StarburstVelMult => 1f; public override void SetDefaults() { Item.width = 84; @@ -59,6 +60,8 @@ namespace CalamityMod.Items.Weapons.Ranged ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } + public override void ModifyTooltips(List tooltips) => tooltips.IntegrateDynamicHotkey(Item); + public override void HoldItem(Player player) { if (player.mount.Type == MountID.Drill) @@ -84,9 +87,9 @@ namespace CalamityMod.Items.Weapons.Ranged { CreateRecipe(). AddIngredient(ItemID.ElfMelter). - AddIngredient(6). + AddIngredient(8). AddIngredient(4). - AddIngredient(12). + AddIngredient(20). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Ranged/HandheldTank.cs b/Items/Weapons/Ranged/HandheldTank.cs index 18c4fd76dd..1fed8279be 100644 --- a/Items/Weapons/Ranged/HandheldTank.cs +++ b/Items/Weapons/Ranged/HandheldTank.cs @@ -52,7 +52,6 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(ItemID.RocketLauncher). AddRecipeGroup("IronBar", 50). AddIngredient(5). - AddIngredient(ItemID.TigerSkin). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Ranged/HavocsBreath.cs b/Items/Weapons/Ranged/HavocsBreath.cs index 9ca4a9a5a4..3b12791325 100644 --- a/Items/Weapons/Ranged/HavocsBreath.cs +++ b/Items/Weapons/Ranged/HavocsBreath.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 1.5f; - Item.UseSound = SoundID.Item34; + Item.UseSound = SoundID.DD2_BetsyFireballShot; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; Item.autoReuse = true; @@ -38,9 +38,9 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - for (int i = 0; i <= 2; i++) + for (int i = 0; i <= 3; i++) { - Projectile.NewProjectile(source, position + velocity * 4f, velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.9f, 1.25f), type, damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, position, velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.9f, 1.25f), type, damage, knockback, player.whoAmI); } return false; } diff --git a/Items/Weapons/Ranged/Helstorm.cs b/Items/Weapons/Ranged/Helstorm.cs index 9f58bbae14..06b341f13b 100644 --- a/Items/Weapons/Ranged/Helstorm.cs +++ b/Items/Weapons/Ranged/Helstorm.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Ranged/MarksmanBow.cs b/Items/Weapons/Ranged/MarksmanBow.cs index 70ef2d68d4..d186f86242 100644 --- a/Items/Weapons/Ranged/MarksmanBow.cs +++ b/Items/Weapons/Ranged/MarksmanBow.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.Ectoplasm, 31). + AddIngredient(ItemID.Ectoplasm, 13). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Ranged/MonolithBow.cs b/Items/Weapons/Ranged/MonolithBow.cs index be48baab00..88a67cf331 100644 --- a/Items/Weapons/Ranged/MonolithBow.cs +++ b/Items/Weapons/Ranged/MonolithBow.cs @@ -13,24 +13,16 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 19; - Item.DamageType = DamageClass.Ranged; + Item.CloneDefaults(ItemID.PearlwoodBow); // Monolith >= Pearlwood Item.width = 24; Item.height = 54; + Item.damage = 19; Item.useTime = 5; Item.useAnimation = 20; + Item.useLimitPerAnimation = 4; Item.reuseDelay = 25; - Item.useStyle = ItemUseStyleID.Shoot; - Item.noMelee = true; - Item.knockBack = 0f; - Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; - Item.rare = ItemRarityID.Orange; - Item.UseSound = SoundID.Item5; - Item.autoReuse = true; - Item.shoot = ProjectileID.WoodenArrowFriendly; - Item.shootSpeed = 9f; - Item.useAmmo = AmmoID.Arrow; Item.consumeAmmoOnFirstShotOnly = true; + Item.shootSpeed = 9f; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/OmniGun.cs b/Items/Weapons/Ranged/OmniGun.cs index 24ad3ca221..4e626cac2d 100644 --- a/Items/Weapons/Ranged/OmniGun.cs +++ b/Items/Weapons/Ranged/OmniGun.cs @@ -1,10 +1,8 @@ using CalamityMod.Projectiles.Ranged; -using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged @@ -13,8 +11,6 @@ namespace CalamityMod.Items.Weapons.Ranged { public new string LocalizationCategory => "Items.Weapons.Ranged"; - public static int AmmoSavedPercent = 66; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent); public override void SetDefaults() { Item.width = 118; @@ -37,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.rare = ItemRarityID.Yellow; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; - public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0 && Main.rand.Next(100) >= AmmoSavedPercent; + public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI); diff --git a/Items/Weapons/Ranged/OntologicalDespoiler.cs b/Items/Weapons/Ranged/OntologicalDespoiler.cs index 2a68495738..46f4e9ad5d 100644 --- a/Items/Weapons/Ranged/OntologicalDespoiler.cs +++ b/Items/Weapons/Ranged/OntologicalDespoiler.cs @@ -92,6 +92,7 @@ namespace CalamityMod.Items.Weapons.Ranged CreateRecipe(). AddIngredient(). AddIngredient(). + AddIngredient(ItemID.IllegalGunParts). AddIngredient(3). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Weapons/Ranged/OverloadedBlaster.cs b/Items/Weapons/Ranged/OverloadedBlaster.cs index 66e42a42cc..ef8f145ad3 100644 --- a/Items/Weapons/Ranged/OverloadedBlaster.cs +++ b/Items/Weapons/Ranged/OverloadedBlaster.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Systems.Collections; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; @@ -15,6 +15,10 @@ namespace CalamityMod.Items.Weapons.Ranged public static int AmmoSavedPercent = 25; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent); + public override void SetStaticDefaults() + { + CalamityItemSets.ExtraDebuffTooltip_Enemy[Type] = [BuffID.Slimed]; + } public override void SetDefaults() { Item.width = 42; diff --git a/Items/Weapons/Ranged/PolarisParrotfish.cs b/Items/Weapons/Ranged/PolarisParrotfish.cs index fa94b9ccb1..ba634aedc2 100644 --- a/Items/Weapons/Ranged/PolarisParrotfish.cs +++ b/Items/Weapons/Ranged/PolarisParrotfish.cs @@ -40,8 +40,8 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 0.5f; - Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; - Item.rare = ItemRarityID.LightRed; + Item.value = CalamityGlobalItem.RarityPinkBuyPrice; + Item.rare = ItemRarityID.Pink; Item.UseSound = null; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Ranged/Sandblaster.cs b/Items/Weapons/Ranged/Sandblaster.cs index b48742dd8c..3a011bec2d 100644 --- a/Items/Weapons/Ranged/Sandblaster.cs +++ b/Items/Weapons/Ranged/Sandblaster.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Ranged { CreateRecipe(). AddIngredient(ItemID.Sandgun). - AddIngredient(ItemID.AncientCloth, 5). + AddIngredient(ItemID.AncientCloth, 2). AddIngredient(). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Weapons/Ranged/SomaPrime.cs b/Items/Weapons/Ranged/SomaPrime.cs index 8e85adde27..35963d313e 100644 --- a/Items/Weapons/Ranged/SomaPrime.cs +++ b/Items/Weapons/Ranged/SomaPrime.cs @@ -76,5 +76,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddTile(). Register(); } + + public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(255, 255, 255), new Color(0xD1, 0xCC, 0x6F), 4f); } } diff --git a/Items/Weapons/Ranged/SpeedBlaster.cs b/Items/Weapons/Ranged/SpeedBlaster.cs index d688e25497..cec54f549d 100644 --- a/Items/Weapons/Ranged/SpeedBlaster.cs +++ b/Items/Weapons/Ranged/SpeedBlaster.cs @@ -110,6 +110,7 @@ namespace CalamityMod.Items.Weapons.Ranged { CreateRecipe(). AddIngredient(ItemID.PainterPaintballGun). + AddIngredient(ItemID.IllegalGunParts). AddRecipeGroup("AnyMythrilBar", 5). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Weapons/Ranged/Spyker.cs b/Items/Weapons/Ranged/Spyker.cs index 739a788ce0..efae713b12 100644 --- a/Items/Weapons/Ranged/Spyker.cs +++ b/Items/Weapons/Ranged/Spyker.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Ranged CreateRecipe(). AddIngredient(). AddIngredient(ItemID.Stynger). - AddIngredient(5). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Ranged/Svantechnical.cs b/Items/Weapons/Ranged/Svantechnical.cs index 4a698709e7..fd621e9b44 100644 --- a/Items/Weapons/Ranged/Svantechnical.cs +++ b/Items/Weapons/Ranged/Svantechnical.cs @@ -82,5 +82,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddTile(). Register(); } + + public static Color RarityColor() => new Color(220, 20, 60); } } diff --git a/Items/Weapons/Ranged/TheBallista.cs b/Items/Weapons/Ranged/TheBallista.cs index 17cf943732..9d2fa67877 100644 --- a/Items/Weapons/Ranged/TheBallista.cs +++ b/Items/Weapons/Ranged/TheBallista.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Ranged CreateRecipe(). AddIngredient(ItemID.Marrow). AddIngredient(ItemID.AncientBattleArmorMaterial). - AddIngredient(ItemID.Ectoplasm, 10). + AddIngredient(ItemID.Ectoplasm, 5). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Ranged/TheBallista.png b/Items/Weapons/Ranged/TheBallista.png index 5ab9abf9ef..2857b1f82e 100644 Binary files a/Items/Weapons/Ranged/TheBallista.png and b/Items/Weapons/Ranged/TheBallista.png differ diff --git a/Items/Weapons/Rogue/AshenStalactite.cs b/Items/Weapons/Rogue/AshenStalactite.cs index 38d580285a..8a0a47e69b 100644 --- a/Items/Weapons/Rogue/AshenStalactite.cs +++ b/Items/Weapons/Rogue/AshenStalactite.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.maxStack = 1; - Item.value = CalamityGlobalItem.RarityOrangeBuyPrice / 4; // This buy price is intentionally reduced due to how common this item is. + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 15f; diff --git a/Items/Weapons/Rogue/AshenStalactite.png b/Items/Weapons/Rogue/AshenStalactite.png index 7eda8b46b2..2ddb0b93b3 100644 Binary files a/Items/Weapons/Rogue/AshenStalactite.png and b/Items/Weapons/Rogue/AshenStalactite.png differ diff --git a/Items/Weapons/Rogue/BlazingStar.cs b/Items/Weapons/Rogue/BlazingStar.cs index 10e95bab7c..30d2d10d08 100644 --- a/Items/Weapons/Rogue/BlazingStar.cs +++ b/Items/Weapons/Rogue/BlazingStar.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Items.Weapons.Rogue Item.useAnimation = 15; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 3; - Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; - Item.rare = ItemRarityID.LightRed; + Item.value = CalamityGlobalItem.RarityPinkBuyPrice; + Item.rare = ItemRarityID.Pink; Item.UseSound = SoundID.Item1; Item.shootSpeed = 13f; diff --git a/Items/Weapons/Rogue/BloodsoakedCrasher.cs b/Items/Weapons/Rogue/BloodsoakedCrasher.cs index 54c1b8412e..0949dd04a3 100644 --- a/Items/Weapons/Rogue/BloodsoakedCrasher.cs +++ b/Items/Weapons/Rogue/BloodsoakedCrasher.cs @@ -49,7 +49,8 @@ namespace CalamityMod.Items.Weapons.Rogue { CreateRecipe(). AddIngredient(). - AddIngredient(12). + AddIngredient(25). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Rogue/Brimblade.cs b/Items/Weapons/Rogue/Brimblade.cs index 371e0343d0..7d2fe567fc 100644 --- a/Items/Weapons/Rogue/Brimblade.cs +++ b/Items/Weapons/Rogue/Brimblade.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void AddRecipes() { CreateRecipe(). - AddIngredient(4). + AddIngredient(8). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Rogue/CosmicKunai.cs b/Items/Weapons/Rogue/CosmicKunai.cs index 540e906b7e..db863c5e58 100644 --- a/Items/Weapons/Rogue/CosmicKunai.cs +++ b/Items/Weapons/Rogue/CosmicKunai.cs @@ -24,13 +24,13 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 26; Item.height = 48; - Item.damage = 92; + Item.damage = 110; Item.noMelee = true; Item.noUseGraphic = true; - Item.useTime = 2; - Item.useAnimation = 10; + Item.useTime = 3; + Item.useAnimation = 12; Item.reuseDelay = 1; - Item.useLimitPerAnimation = 5; + Item.useLimitPerAnimation = 4; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 5f; Item.UseSound = SoundID.Item109; @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Rogue for (float i = 0; i < 9; i++) { float angle = MathHelper.TwoPi / 9f * i; - Projectile.NewProjectile(source, player.Center, angle.ToRotationVector2() * 8f, ModContent.ProjectileType(), damage * 3, knockback, player.whoAmI, angle); + Projectile.NewProjectile(source, player.Center, angle.ToRotationVector2() * 8f, ModContent.ProjectileType(), (int)(damage * 1.5f), knockback, player.whoAmI, angle); } } else if (stealthSalvo) diff --git a/Items/Weapons/Rogue/CrystalPiercer.cs b/Items/Weapons/Rogue/CrystalPiercer.cs index 04a79f2125..979ee8335c 100644 --- a/Items/Weapons/Rogue/CrystalPiercer.cs +++ b/Items/Weapons/Rogue/CrystalPiercer.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void AddRecipes() { CreateRecipe(). - AddIngredient(8). + AddIngredient(12). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Rogue/DuststormInABottle.cs b/Items/Weapons/Rogue/DuststormInABottle.cs index b93e62e28a..db7e555a0d 100644 --- a/Items/Weapons/Rogue/DuststormInABottle.cs +++ b/Items/Weapons/Rogue/DuststormInABottle.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Rogue { CreateRecipe(). AddIngredient(). - AddIngredient(ItemID.AncientCloth,5). + AddIngredient(ItemID.AncientCloth, 2). AddIngredient(). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Weapons/Rogue/DuststormInABottle.png b/Items/Weapons/Rogue/DuststormInABottle.png index 1e049812e3..723d93ce24 100644 Binary files a/Items/Weapons/Rogue/DuststormInABottle.png and b/Items/Weapons/Rogue/DuststormInABottle.png differ diff --git a/Items/Weapons/Rogue/EclipsesFall.cs b/Items/Weapons/Rogue/EclipsesFall.cs index b4bbba795e..e138faec61 100644 --- a/Items/Weapons/Rogue/EclipsesFall.cs +++ b/Items/Weapons/Rogue/EclipsesFall.cs @@ -495,7 +495,6 @@ namespace CalamityMod.Projectiles.Rogue { public new string LocalizationCategory => "Projectiles.Rogue"; public static int lifetime => 1200; - Color? color = null; public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; diff --git a/Items/Weapons/Rogue/Equanimity.cs b/Items/Weapons/Rogue/Equanimity.cs index a53b430182..0768922c81 100644 --- a/Items/Weapons/Rogue/Equanimity.cs +++ b/Items/Weapons/Rogue/Equanimity.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Items.Weapons.Rogue Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.maxStack = 1; - Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; - Item.rare = ItemRarityID.LightRed; + Item.value = CalamityGlobalItem.RarityPinkBuyPrice; + Item.rare = ItemRarityID.Pink; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 3f; Item.DamageType = RogueDamageClass.Instance; diff --git a/Items/Weapons/Rogue/ExecutionersBlade.cs b/Items/Weapons/Rogue/ExecutionersBlade.cs index 14849ad47c..d77d5dda00 100644 --- a/Items/Weapons/Rogue/ExecutionersBlade.cs +++ b/Items/Weapons/Rogue/ExecutionersBlade.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). + AddIngredient(10). AddTile(). Register(); } diff --git a/Items/Weapons/Rogue/FantasyTalisman.cs b/Items/Weapons/Rogue/FantasyTalisman.cs index 8b7f5a9494..8d27d06a14 100644 --- a/Items/Weapons/Rogue/FantasyTalisman.cs +++ b/Items/Weapons/Rogue/FantasyTalisman.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Weapons.Rogue Item.knockBack = 6f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; - Item.value = CalamityGlobalItem.RarityLimeBuyPrice; - Item.rare = ItemRarityID.Lime; + Item.value = CalamityGlobalItem.RarityYellowBuyPrice; + Item.rare = ItemRarityID.Yellow; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 18f; Item.DamageType = RogueDamageClass.Instance; diff --git a/Items/Weapons/Rogue/FeatherKnife.cs b/Items/Weapons/Rogue/FeatherKnife.cs index 9a28caea5e..950c0fe3bd 100644 --- a/Items/Weapons/Rogue/FeatherKnife.cs +++ b/Items/Weapons/Rogue/FeatherKnife.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(10). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Weapons/Rogue/FrostcrushValari.cs b/Items/Weapons/Rogue/FrostcrushValari.cs index 1f8298046b..b04572e037 100644 --- a/Items/Weapons/Rogue/FrostcrushValari.cs +++ b/Items/Weapons/Rogue/FrostcrushValari.cs @@ -27,8 +27,8 @@ namespace CalamityMod.Items.Weapons.Rogue Item.useTime = Item.useAnimation = 19; Item.knockBack = 12; - Item.value = CalamityGlobalItem.RarityLimeBuyPrice; - Item.rare = ItemRarityID.Lime; + Item.value = CalamityGlobalItem.RarityYellowBuyPrice; + Item.rare = ItemRarityID.Yellow; Item.useStyle = ItemUseStyleID.Swing; Item.UseSound = SoundID.Item1; Item.autoReuse = true; @@ -58,7 +58,6 @@ namespace CalamityMod.Items.Weapons.Rogue CreateRecipe(). AddIngredient(). AddIngredient(6). - AddIngredient(40). AddIngredient(ItemID.Ectoplasm, 5). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Weapons/Rogue/GelDart.cs b/Items/Weapons/Rogue/GelDart.cs index f3d4a13f8e..d64cca2580 100644 --- a/Items/Weapons/Rogue/GelDart.cs +++ b/Items/Weapons/Rogue/GelDart.cs @@ -51,8 +51,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override void AddRecipes() { CreateRecipe(). - AddIngredient(18). - AddIngredient(18). + AddIngredient(14). + AddIngredient(14). AddTile(TileID.Solidifier). Register(); } diff --git a/Items/Weapons/Rogue/GodsParanoia.cs b/Items/Weapons/Rogue/GodsParanoia.cs index d673dd0cfe..dd6c45755b 100644 --- a/Items/Weapons/Rogue/GodsParanoia.cs +++ b/Items/Weapons/Rogue/GodsParanoia.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). + AddIngredient(10). AddTile(). Register(); } diff --git a/Items/Weapons/Rogue/MangroveChakram.cs b/Items/Weapons/Rogue/MangroveChakram.cs index 1e923764aa..ea3b6e9366 100644 --- a/Items/Weapons/Rogue/MangroveChakram.cs +++ b/Items/Weapons/Rogue/MangroveChakram.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Rogue/NanoblackReaper.cs b/Items/Weapons/Rogue/NanoblackReaper.cs index 7c690b132a..a2b346ecba 100644 --- a/Items/Weapons/Rogue/NanoblackReaper.cs +++ b/Items/Weapons/Rogue/NanoblackReaper.cs @@ -52,13 +52,11 @@ namespace CalamityMod.Items.Weapons.Rogue public static float TesselationDamageRatio = 0.25f; public static float TesselationKnockback = 1.5f; - public override float StealthDamageMultiplier => 1.0f; - public override void SetDefaults() { Item.width = 78; Item.height = 64; - Item.damage = 315; + Item.damage = 555; Item.knockBack = Knockback; Item.ArmorPenetration = ArmorPenetration; Item.useTime = Item.useAnimation = 19; @@ -176,5 +174,7 @@ namespace CalamityMod.Items.Weapons.Rogue AddTile(). Register(); } + + public static Color RarityColor() => new Color(0.34f, 0.34f + 0.66f * Main.DiscoG / 255f, 0.34f + 0.5f * Main.DiscoG / 255f); } } diff --git a/Items/Weapons/Rogue/PhantasmalRuin.cs b/Items/Weapons/Rogue/PhantasmalRuin.cs index 1132a4b5fe..66921cfda3 100644 --- a/Items/Weapons/Rogue/PhantasmalRuin.cs +++ b/Items/Weapons/Rogue/PhantasmalRuin.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Items.Weapons.Rogue Item.UseSound = SoundID.Item1; Item.DamageType = RogueDamageClass.Instance; - Item.value = CalamityGlobalItem.RarityLimeBuyPrice; - Item.rare = ItemRarityID.Lime; + Item.value = CalamityGlobalItem.RarityYellowBuyPrice; + Item.rare = ItemRarityID.Yellow; } public override float StealthDamageMultiplier => 1.2f; diff --git a/Items/Weapons/Rogue/RadiantStar.cs b/Items/Weapons/Rogue/RadiantStar.cs index 3b22c78a60..0e75b055cc 100644 --- a/Items/Weapons/Rogue/RadiantStar.cs +++ b/Items/Weapons/Rogue/RadiantStar.cs @@ -46,9 +46,9 @@ namespace CalamityMod.Items.Weapons.Rogue { CreateRecipe(). AddIngredient(). - AddIngredient(10). - AddIngredient(15). + AddIngredient(12). AddIngredient(ItemID.FallenStar, 10). + AddIngredient(15). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Rogue/SandDollar.cs b/Items/Weapons/Rogue/SandDollar.cs index c7110b796b..f873ac1eba 100644 --- a/Items/Weapons/Rogue/SandDollar.cs +++ b/Items/Weapons/Rogue/SandDollar.cs @@ -42,8 +42,6 @@ namespace CalamityMod.Items.Weapons.Rogue } } - public override float StealthDamageMultiplier => 1f; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/ScarletDevil.cs b/Items/Weapons/Rogue/ScarletDevil.cs index e588335fb2..29021adc2b 100644 --- a/Items/Weapons/Rogue/ScarletDevil.cs +++ b/Items/Weapons/Rogue/ScarletDevil.cs @@ -48,10 +48,12 @@ namespace CalamityMod.Items.Weapons.Rogue AddIngredient(). AddIngredient(). AddIngredient(5). - AddIngredient(15). + AddIngredient(50). AddIngredient(ItemID.SoulofNight, 15). AddTile(). Register(); } + + public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(191, 45, 71), new Color(185, 187, 253), 4f); } } diff --git a/Items/Weapons/Rogue/SlickCane.png b/Items/Weapons/Rogue/SlickCane.png deleted file mode 100644 index 1aadfccbb4..0000000000 Binary files a/Items/Weapons/Rogue/SlickCane.png and /dev/null differ diff --git a/Items/Weapons/Rogue/SpearofPaleolith.png b/Items/Weapons/Rogue/SpearofPaleolith.png index a5d6a7b8cd..b292d5d958 100644 Binary files a/Items/Weapons/Rogue/SpearofPaleolith.png and b/Items/Weapons/Rogue/SpearofPaleolith.png differ diff --git a/Items/Weapons/Rogue/SubductionSlicer.cs b/Items/Weapons/Rogue/SubductionSlicer.cs index 1e806a465d..a39e0a8309 100644 --- a/Items/Weapons/Rogue/SubductionSlicer.cs +++ b/Items/Weapons/Rogue/SubductionSlicer.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void AddRecipes() { CreateRecipe(). - AddIngredient(9). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Rogue/TimeBolt.cs b/Items/Weapons/Rogue/TimeBolt.cs index f5605f6e5f..70326e75de 100644 --- a/Items/Weapons/Rogue/TimeBolt.cs +++ b/Items/Weapons/Rogue/TimeBolt.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -15,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 24; Item.height = 46; - Item.damage = 432; + Item.damage = 303; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 20; @@ -25,15 +26,13 @@ namespace CalamityMod.Items.Weapons.Rogue Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 16f; Item.DamageType = RogueDamageClass.Instance; } - public override float StealthDamageMultiplier => 0.7f; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); @@ -48,11 +47,12 @@ namespace CalamityMod.Items.Weapons.Rogue public override void AddRecipes() { CreateRecipe(). - AddIngredient(). - AddIngredient(ItemID.FastClock). - AddIngredient(5). - AddIngredient(20). - AddTile(TileID.MythrilAnvil). + AddIngredient(). + AddIngredient(). + AddIngredient(ItemID.GoldWatch). + AddIngredient(8). + AddIngredient(20). + AddTile(). Register(); } } diff --git a/Items/Weapons/Rogue/Turbulance.cs b/Items/Weapons/Rogue/Turbulance.cs index 732db8f0bb..ed42fa8382 100644 --- a/Items/Weapons/Rogue/Turbulance.cs +++ b/Items/Weapons/Rogue/Turbulance.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void AddRecipes() { CreateRecipe(). - AddIngredient(7). + AddIngredient(10). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Weapons/Rogue/Vega.cs b/Items/Weapons/Rogue/Vega.cs index c4943e230d..8625b8c2a5 100644 --- a/Items/Weapons/Rogue/Vega.cs +++ b/Items/Weapons/Rogue/Vega.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override float StealthDamageMultiplier => 1f; public override void HoldItem(Player player) { ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; @@ -91,9 +90,9 @@ namespace CalamityMod.Items.Weapons.Rogue { CreateRecipe(). AddIngredient(). - AddIngredient(7). + AddIngredient(8). AddIngredient(4). - AddIngredient(12). + AddIngredient(20). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Rogue/SlickCane.cs b/Items/Weapons/Rogue/WalkingCane.cs similarity index 67% rename from Items/Weapons/Rogue/SlickCane.cs rename to Items/Weapons/Rogue/WalkingCane.cs index 0331d03098..c2ec80ffb4 100644 --- a/Items/Weapons/Rogue/SlickCane.cs +++ b/Items/Weapons/Rogue/WalkingCane.cs @@ -3,17 +3,22 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class SlickCane : RogueWeapon + [LegacyName("SlickCane")] + public class WalkingCane : RogueWeapon { + public static float MoveSpeedBoost = 0.2f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { - Item.width = 42; - Item.height = 36; - Item.damage = 50; + Item.width = 48; + Item.height = 44; + Item.damage = 40; Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; @@ -22,10 +27,10 @@ namespace CalamityMod.Items.Weapons.Rogue Item.knockBack = 6f; Item.UseSound = SoundID.DD2_GhastlyGlaivePierce; Item.autoReuse = true; - Item.value = Item.buyPrice(gold: 35); // Sold by Bandit + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 16f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 20f; Item.DamageType = RogueDamageClass.Instance; } @@ -33,8 +38,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - float ai0 = Main.rand.NextFloat() * Item.shootSpeed * 1.5f * (float)player.direction; - int projectileIndex = Projectile.NewProjectile(source, position.X, position.Y+100, velocity.X*2f, velocity.Y*2f, type, damage, knockback, player.whoAmI, ai0, 0f); + float ai0 = Main.rand.NextFloat() * Item.shootSpeed * 1.5f * player.direction; + int projectileIndex = Projectile.NewProjectile(source, position + Vector2.UnitY * 100f, velocity * 2f, type, damage, knockback, player.whoAmI, ai0); if (projectileIndex.WithinBounds(Main.maxProjectiles)) Main.projectile[projectileIndex].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; diff --git a/Items/Weapons/Rogue/WalkingCane.png b/Items/Weapons/Rogue/WalkingCane.png new file mode 100644 index 0000000000..9bf218ea8f Binary files /dev/null and b/Items/Weapons/Rogue/WalkingCane.png differ diff --git a/Items/Weapons/Summon/AbandonedSlimeStaff.cs b/Items/Weapons/Summon/AbandonedSlimeStaff.cs index d64c3cd5e1..75d762aae0 100644 --- a/Items/Weapons/Summon/AbandonedSlimeStaff.cs +++ b/Items/Weapons/Summon/AbandonedSlimeStaff.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Summon { player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(true, type, player); - float damageMult = ((float)Math.Log(slimeSlots, 8f)) + 1f; + float damageMult = 0.8f + slimeSlots * 0.2f; var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, (int)(damage * damageMult), knockback, player.whoAmI); minion.originalDamage = (int)(Item.damage * damageMult); minion.minionSlots = slimeSlots; diff --git a/Items/Weapons/Summon/AmphibiansGuitar.cs b/Items/Weapons/Summon/AmphibiansGuitar.cs index 4f7e937905..2d8af9fcac 100644 --- a/Items/Weapons/Summon/AmphibiansGuitar.cs +++ b/Items/Weapons/Summon/AmphibiansGuitar.cs @@ -37,8 +37,8 @@ namespace CalamityMod.Items.Weapons.Summon CreateRecipe(). AddIngredient(ItemID.TheAxe). AddIngredient(ItemID.Frog). - AddIngredient(3). AddIngredient(8). + AddIngredient(3). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Summon/AresExoskeleton.cs b/Items/Weapons/Summon/AresExoskeleton.cs index dee0622c01..f96f0909cb 100644 --- a/Items/Weapons/Summon/AresExoskeleton.cs +++ b/Items/Weapons/Summon/AresExoskeleton.cs @@ -21,9 +21,9 @@ namespace CalamityMod.Items.Weapons.Summon public const int PlasmaCannonShootRate = 30; - public const int TeslaCannonShootRate = 36; + public const int TeslaCannonShootRate = 42; - public const int LaserCannonNormalShootRate = 15; + public const int LaserCannonNormalShootRate = 12; public const int GaussNukeShootRate = 240; @@ -31,13 +31,13 @@ namespace CalamityMod.Items.Weapons.Summon public const float MinionSlotsPerCannon = 3f; - public const float PlasmaCannonBlastFactor = 0.9f; + public const float PlasmaCannonBlastFactor = 1f; // Multiple orbs can arc together when there are 2+ tesla cannons, resulting in a LOT of hits. // The local i-frames are also quite high to combat this problem. public const float TeslaOrbDamageFactor = 1f; - public const float LaserDamageFactor = 1.1f; + public const float LaserDamageFactor = 1f; public const float NukeDamageFactor = 1f; @@ -75,7 +75,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = Item.height = 36; Item.mana = 80; - Item.damage = 625; + Item.damage = 550; Item.useStyle = ItemUseStyleID.HoldUp; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 24; diff --git a/Items/Weapons/Summon/CorroslimeStaff.cs b/Items/Weapons/Summon/BlightedSlimeStaff.cs similarity index 82% rename from Items/Weapons/Summon/CorroslimeStaff.cs rename to Items/Weapons/Summon/BlightedSlimeStaff.cs index 4708a0d420..412247aad7 100644 --- a/Items/Weapons/Summon/CorroslimeStaff.cs +++ b/Items/Weapons/Summon/BlightedSlimeStaff.cs @@ -8,14 +8,15 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class CorroslimeStaff : ModItem, ILocalizedModType + [LegacyName("CorroslimeStaff", "CrimslimeStaff")] + public class BlightedSlimeStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; public override void SetDefaults() { Item.width = 52; Item.height = 54; - Item.damage = 24; + Item.damage = 18; Item.mana = 10; Item.useAnimation = Item.useTime = 36; Item.useStyle = ItemUseStyleID.Swing; @@ -25,8 +26,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.LightRed; Item.UseSound = SoundID.Item44; Item.autoReuse = true; - Item.buffType = ModContent.BuffType(); - Item.shoot = ModContent.ProjectileType(); + Item.buffType = ModContent.BuffType(); + Item.shoot = ModContent.ProjectileType(); Item.DamageType = DamageClass.Summon; } diff --git a/Items/Weapons/Summon/CorroslimeStaff.png b/Items/Weapons/Summon/BlightedSlimeStaff.png similarity index 100% rename from Items/Weapons/Summon/CorroslimeStaff.png rename to Items/Weapons/Summon/BlightedSlimeStaff.png diff --git a/Items/Weapons/Summon/CalamarisLament.cs b/Items/Weapons/Summon/CalamarisLament.cs index a9cd33ee10..107a687826 100644 --- a/Items/Weapons/Summon/CalamarisLament.cs +++ b/Items/Weapons/Summon/CalamarisLament.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 88; Item.height = 108; - Item.damage = 110; + Item.damage = 120; Item.DamageType = DamageClass.Summon; Item.mana = 10; Item.useAnimation = Item.useTime = 24; diff --git a/Items/Weapons/Summon/CausticStaff.cs b/Items/Weapons/Summon/CausticStaff.cs index 82d159fbb9..b91456d5cc 100644 --- a/Items/Weapons/Summon/CausticStaff.cs +++ b/Items/Weapons/Summon/CausticStaff.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.width = 26; Item.height = 28; Item.mana = 10; - Item.damage = 15; + Item.damage = 18; Item.useStyle = ItemUseStyleID.Swing; Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Summon/Cosmilamp.cs b/Items/Weapons/Summon/Cosmilamp.cs index 2b2c829df1..e50b70b3cb 100644 --- a/Items/Weapons/Summon/Cosmilamp.cs +++ b/Items/Weapons/Summon/Cosmilamp.cs @@ -19,18 +19,11 @@ namespace CalamityMod.Items.Weapons.Summon public const float BeamHomeSpeed = 17f; - public const float LanternSummonCost = 2f; - - public override void SetStaticDefaults() - { - ItemID.Sets.StaffMinionSlotsRequired[Type] = 2f; - } - public override void SetDefaults() { Item.width = 42; Item.height = 60; - Item.damage = 127; + Item.damage = 95; Item.mana = 10; Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Summon/CrimslimeStaff.cs b/Items/Weapons/Summon/CrimslimeStaff.cs deleted file mode 100644 index fcef51fb1b..0000000000 --- a/Items/Weapons/Summon/CrimslimeStaff.cs +++ /dev/null @@ -1,42 +0,0 @@ -using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Buffs.Summon; -using CalamityMod.Projectiles.Summon; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Summon -{ - public class CrimslimeStaff : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Weapons.Summon"; - public override void SetDefaults() - { - Item.width = 52; - Item.height = 52; - Item.damage = 24; - Item.mana = 10; - Item.useAnimation = Item.useTime = 36; - Item.useStyle = ItemUseStyleID.Swing; - Item.noMelee = true; - Item.knockBack = 2f; - Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; - Item.rare = ItemRarityID.LightRed; - Item.UseSound = SoundID.Item44; - Item.autoReuse = true; - Item.buffType = ModContent.BuffType(); - Item.shoot = ModContent.ProjectileType(); - Item.DamageType = DamageClass.Summon; - } - - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) - { - player.AddBuff(Item.buffType, 2); - var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - minion.originalDamage = Item.damage; - return false; - } - } -} diff --git a/Items/Weapons/Summon/CrimslimeStaff.png b/Items/Weapons/Summon/CrimslimeStaff.png deleted file mode 100644 index 3e40afc20b..0000000000 Binary files a/Items/Weapons/Summon/CrimslimeStaff.png and /dev/null differ diff --git a/Items/Weapons/Summon/DankStaff.cs b/Items/Weapons/Summon/DankStaff.cs index 744d8c80d3..9595289417 100644 --- a/Items/Weapons/Summon/DankStaff.cs +++ b/Items/Weapons/Summon/DankStaff.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 58; Item.height = 58; - Item.damage = 14; + Item.damage = 10; Item.mana = 10; Item.useAnimation = Item.useTime = 36; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Summon/DazzlingStabberStaff.cs b/Items/Weapons/Summon/DazzlingStabberStaff.cs index 6349c7df8d..fc4a4f5556 100644 --- a/Items/Weapons/Summon/DazzlingStabberStaff.cs +++ b/Items/Weapons/Summon/DazzlingStabberStaff.cs @@ -23,15 +23,15 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 56; Item.height = 60; + Item.damage = 69; + Item.useAnimation = Item.useTime = 24; + Item.mana = 10; + Item.knockBack = 2f; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.UseSound = SoundID.DD2_DarkMageHealImpact; Item.DamageType = DamageClass.Summon; - Item.mana = 10; - Item.damage = 35; - Item.knockBack = 2f; Item.autoReuse = true; - Item.useAnimation = Item.useTime = 24; Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); @@ -50,21 +50,21 @@ namespace CalamityMod.Items.Weapons.Summon if (minions.owner == player.whoAmI) usedMinionSlots += minions.minionSlots; } - bool hasSlotsForSummon = true; - if (usedMinionSlots + 1 > player.maxMinions) - hasSlotsForSummon = false; + + int minionsSummoned = 0; + for (int i = 0; i < 3; i++) + { + if (usedMinionSlots + 1 + i > player.maxMinions) + break; + + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, i + 1); + minion.originalDamage = Item.damage; + minionsSummoned++; + } player.AddBuff(Item.buffType, 2); - int projCount = player.ownedProjectileCounts[type] + (hasSlotsForSummon ? 3 : 0); - if (hasSlotsForSummon) - { - for (int i = 0; i < 3; i++) - { - var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, i + 1); - minion.originalDamage = Item.damage; - } - } + int projCount = player.ownedProjectileCounts[type] + minionsSummoned; float angleMax = MathHelper.ToRadians(360f); if (projCount == 100) angleMax = 0f; diff --git a/Items/Weapons/Summon/DeepseaStaff.cs b/Items/Weapons/Summon/DeepseaStaff.cs index 74ee7ec666..9ce13c4bf5 100644 --- a/Items/Weapons/Summon/DeepseaStaff.cs +++ b/Items/Weapons/Summon/DeepseaStaff.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { Item.width = Item.height = 44; - Item.damage = 40; + Item.damage = 32; Item.mana = 10; Item.useAnimation = Item.useTime = 36; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Summon/DragonbloodDisgorger.cs b/Items/Weapons/Summon/DragonbloodDisgorger.cs index 53a032d191..e7e5a5cf31 100644 --- a/Items/Weapons/Summon/DragonbloodDisgorger.cs +++ b/Items/Weapons/Summon/DragonbloodDisgorger.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 64; Item.height = 62; - Item.damage = 215; + Item.damage = 222; Item.mana = 10; Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.Swing; @@ -53,7 +53,8 @@ namespace CalamityMod.Items.Weapons.Summon public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). + AddIngredient(25). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Summon/EnchantedKnifeStaff.cs b/Items/Weapons/Summon/EnchantedKnifeStaff.cs index c2b9993bd0..a4862638f0 100644 --- a/Items/Weapons/Summon/EnchantedKnifeStaff.cs +++ b/Items/Weapons/Summon/EnchantedKnifeStaff.cs @@ -9,11 +9,11 @@ namespace CalamityMod.Items.Weapons.Summon { public class EnchantedKnifeStaff : ModItem, ILocalizedModType { - public static float SwingTime = 20f; - public static float SwingWait = 10f; + public static float SwingTime = 18f; + public static float SwingWait = 6f; public static float ProjectileSpeed = 15f; - public static float DashCooldown = 30f; - public static float DashSpeed = 16f; + public static float ChaseSpeed = 10f; + public static float RecoilSpeed = -4f; public new string LocalizationCategory => "Items.Weapons.Summon"; diff --git a/Items/Weapons/Summon/Endogenesis.cs b/Items/Weapons/Summon/Endogenesis.cs index ef31f7934b..51a156fc22 100644 --- a/Items/Weapons/Summon/Endogenesis.cs +++ b/Items/Weapons/Summon/Endogenesis.cs @@ -101,5 +101,7 @@ namespace CalamityMod.Items.Weapons.Summon AddTile(). Register(); } + + public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(131, 239, 255), new Color(36, 55, 230), 4f); } } diff --git a/Items/Weapons/Summon/EntropysVigil.cs b/Items/Weapons/Summon/EntropysVigil.cs index 3708030c8d..66ddde39a1 100644 --- a/Items/Weapons/Summon/EntropysVigil.cs +++ b/Items/Weapons/Summon/EntropysVigil.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 52; Item.height = 52; - Item.damage = 42; + Item.damage = 38; Item.DamageType = DamageClass.Summon; Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Summon/EtherealSubjugator.cs b/Items/Weapons/Summon/EtherealSubjugator.cs index 1d95674621..e2311395fc 100644 --- a/Items/Weapons/Summon/EtherealSubjugator.cs +++ b/Items/Weapons/Summon/EtherealSubjugator.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 66; Item.height = 70; - Item.damage = 175; + Item.damage = 160; Item.DamageType = DamageClass.Summon; Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Summon/FlamsteedRing.cs b/Items/Weapons/Summon/FlamsteedRing.cs index 21714b2e37..8177b27702 100644 --- a/Items/Weapons/Summon/FlamsteedRing.cs +++ b/Items/Weapons/Summon/FlamsteedRing.cs @@ -204,5 +204,15 @@ namespace CalamityMod.Items.Weapons.Summon AddTile(). Register(); } + + public static Color RarityColor() + { + if (Main.GlobalTimeWrappedHourly % 1f < 0.6f) + return new Color(89, 229, 255); + else if (Main.GlobalTimeWrappedHourly % 1f < 0.8f) + return Color.Lerp(new Color(89, 229, 255), Color.White, (Main.GlobalTimeWrappedHourly % 1f - 0.6f) / 0.2f); + else + return Color.Lerp(Color.White, new Color(89, 229, 255), (Main.GlobalTimeWrappedHourly % 1f - 0.8f) / 0.2f); + } } } diff --git a/Items/Weapons/Summon/FleshOfInfidelity.cs b/Items/Weapons/Summon/FleshOfInfidelity.cs index 75b31facef..3204722a8c 100644 --- a/Items/Weapons/Summon/FleshOfInfidelity.cs +++ b/Items/Weapons/Summon/FleshOfInfidelity.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 42; Item.height = 42; - Item.damage = 20; + Item.damage = 14; Item.DamageType = DamageClass.Summon; Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Summon/FlowersOfMortality.cs b/Items/Weapons/Summon/FlowersOfMortality.cs index 82327f01db..3ac9033742 100644 --- a/Items/Weapons/Summon/FlowersOfMortality.cs +++ b/Items/Weapons/Summon/FlowersOfMortality.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 36; Item.height = 36; - Item.damage = 72; + Item.damage = 70; Item.DamageType = DamageClass.Summon; Item.mana = 10; Item.useAnimation = Item.useTime = 24; diff --git a/Items/Weapons/Summon/FrostBlossomStaff.cs b/Items/Weapons/Summon/FrostBlossomStaff.cs index 91a1ff43bd..38a48495d1 100644 --- a/Items/Weapons/Summon/FrostBlossomStaff.cs +++ b/Items/Weapons/Summon/FrostBlossomStaff.cs @@ -12,15 +12,11 @@ namespace CalamityMod.Items.Weapons.Summon public class FrostBlossomStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; - public override void SetStaticDefaults() - { - CalamityItemSets.ExtraDebuffTooltip_Enemy[Type] = [BuffID.Frostburn]; - } public override void SetDefaults() { Item.width = 34; Item.height = 24; - Item.damage = 10; + Item.damage = 15; Item.mana = 10; Item.useAnimation = Item.useTime = 36; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Summon/IgneousExaltation.cs b/Items/Weapons/Summon/IgneousExaltation.cs index 3b829ede05..9096dadb73 100644 --- a/Items/Weapons/Summon/IgneousExaltation.cs +++ b/Items/Weapons/Summon/IgneousExaltation.cs @@ -1,4 +1,5 @@ -using CalamityMod.Buffs.Summon; +using System.Collections.Generic; +using CalamityMod.Buffs.Summon; using CalamityMod.Items.Materials; using CalamityMod.Packets; using CalamityMod.Projectiles.Summon; @@ -61,20 +62,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.DamageType = DamageClass.Summon; } - public override bool CanRightClick() + public override void HoldItem(Player player) { - if (!Main.keyState.PressingShift()) - return false; - return true; + if (Main.myPlayer == player.whoAmI && Item.JustPressedKeybind()) + { + Main.LocalPlayer.Calamity().InvertExaltationLineRotationDirections = !Main.LocalPlayer.Calamity().InvertExaltationLineRotationDirections; + if (Main.netMode != NetmodeID.SinglePlayer) + ExaltationDirectionSyncPacket.Send(Main.LocalPlayer.Calamity()); + } } - public override void RightClick(Player player) - { - Main.LocalPlayer.Calamity().InvertExaltationLineRotationDirections = !Main.LocalPlayer.Calamity().InvertExaltationLineRotationDirections; - if (Main.netMode != NetmodeID.SinglePlayer) - ExaltationDirectionSyncPacket.Send(Main.LocalPlayer.Calamity()); - } - - public override bool ConsumeItem(Player player) => false; + public override void ModifyTooltips(List tooltips) => tooltips.IntegrateDynamicHotkey(Item); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { @@ -140,8 +137,8 @@ namespace CalamityMod.Items.Weapons.Summon public override void AddRecipes() { CreateRecipe(). - AddIngredient(10). - AddIngredient(5). + AddIngredient(8). + AddIngredient(8). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Summon/KingofConstellationsTenryu.cs b/Items/Weapons/Summon/KingofConstellationsTenryu.cs index 2e1c97e249..7c0d09b4d9 100644 --- a/Items/Weapons/Summon/KingofConstellationsTenryu.cs +++ b/Items/Weapons/Summon/KingofConstellationsTenryu.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.width = 44; Item.height = 62; Item.mana = 10; - Item.damage = 187; + Item.damage = 175; Item.useStyle = ItemUseStyleID.HoldUp; Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Summon/LegionofCelestia.cs b/Items/Weapons/Summon/LegionofCelestia.cs index 761c97911c..af662a6ce2 100644 --- a/Items/Weapons/Summon/LegionofCelestia.cs +++ b/Items/Weapons/Summon/LegionofCelestia.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 100; Item.height = 128; - Item.damage = 57; + Item.damage = 50; Item.DamageType = DamageClass.Summon; Item.mana = 10; Item.useAnimation = Item.useTime = 24; diff --git a/Items/Weapons/Summon/MidnightSunBeacon.cs b/Items/Weapons/Summon/MidnightSunBeacon.cs index 70c5412cfc..25d217acc0 100644 --- a/Items/Weapons/Summon/MidnightSunBeacon.cs +++ b/Items/Weapons/Summon/MidnightSunBeacon.cs @@ -51,8 +51,8 @@ namespace CalamityMod.Items.Weapons.Summon { CreateRecipe(). AddIngredient(ItemID.XenoStaff). - AddIngredient(ItemID.MoonlordTurretStaff). AddIngredient(5). + AddIngredient(15). AddTile(). Register(); } diff --git a/Items/Weapons/Summon/MirrorofKalandra.cs b/Items/Weapons/Summon/MirrorofKalandra.cs index b79de9d2a3..12404e5013 100644 --- a/Items/Weapons/Summon/MirrorofKalandra.cs +++ b/Items/Weapons/Summon/MirrorofKalandra.cs @@ -96,14 +96,14 @@ namespace CalamityMod.Items.Weapons.Summon { CreateRecipe(). AddIngredient(ItemID.MagicMirror). - AddIngredient(10). + AddIngredient(8). AddIngredient(10). AddCondition(Condition.NearShimmer). Register(); CreateRecipe(). AddIngredient(ItemID.IceMirror). - AddIngredient(10). + AddIngredient(8). AddIngredient(10). AddCondition(Condition.NearShimmer). Register(); diff --git a/Items/Weapons/Summon/OrthoceraShell.cs b/Items/Weapons/Summon/OrthoceraShell.cs index be0981aa6b..575526d69b 100644 --- a/Items/Weapons/Summon/OrthoceraShell.cs +++ b/Items/Weapons/Summon/OrthoceraShell.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 34; Item.height = 34; - Item.damage = 53; + Item.damage = 42; Item.mana = 10; Item.useAnimation = Item.useTime = 30; Item.useStyle = ItemUseStyleID.HoldUp; diff --git a/Items/Weapons/Summon/ResurrectionButterfly.cs b/Items/Weapons/Summon/ResurrectionButterfly.cs index 1e684ca31e..ed7dba5116 100644 --- a/Items/Weapons/Summon/ResurrectionButterfly.cs +++ b/Items/Weapons/Summon/ResurrectionButterfly.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons.Summon AddIngredient(5). AddIngredient(ItemID.ButterflyDust, 2). AddIngredient(ItemID.Silk, 40). - AddIngredient(ItemID.Ectoplasm, 20). + AddIngredient(ItemID.Ectoplasm, 5). AddTile(TileID.Loom). Register(); } diff --git a/Items/Weapons/Summon/SandSharknadoStaff.cs b/Items/Weapons/Summon/SandSharknadoStaff.cs index 884350d5e0..c93805c979 100644 --- a/Items/Weapons/Summon/SandSharknadoStaff.cs +++ b/Items/Weapons/Summon/SandSharknadoStaff.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 48; Item.height = 56; - Item.damage = 71; + Item.damage = 60; Item.knockBack = 2f; Item.mana = 10; @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Summon { CreateRecipe(). AddIngredient(). - AddIngredient(ItemID.AncientCloth, 5). + AddIngredient(ItemID.AncientCloth, 2). AddIngredient(). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Weapons/Summon/SarosPossession.cs b/Items/Weapons/Summon/SarosPossession.cs index 85e6139d53..ab5351a978 100644 --- a/Items/Weapons/Summon/SarosPossession.cs +++ b/Items/Weapons/Summon/SarosPossession.cs @@ -90,7 +90,6 @@ namespace CalamityMod.Items.Weapons.Summon float barScale = 1/(32f/TextureAssets.Item[Type].Width()) * 0.9f; Vector2 barOrigin = barBG.Size() * 0.5f; - float yOffset = 0f; Vector2 drawPos = position + new Vector2(0, (float)TextureAssets.Item[Type].Height() * 0.5f) * scale; Rectangle frameCrop = new Rectangle(0, 0, (int)((fill) * barFG.Width), barFG.Height); Color colorBG = Color.Black; diff --git a/Items/Weapons/Summon/ScabRipper.cs b/Items/Weapons/Summon/ScabRipper.cs index 539d0a401b..1f0fed5cdd 100644 --- a/Items/Weapons/Summon/ScabRipper.cs +++ b/Items/Weapons/Summon/ScabRipper.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 66; Item.height = 70; - Item.damage = 15; + Item.damage = 10; Item.mana = 10; Item.useAnimation = Item.useTime = 36; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/Summon/Sirius.cs b/Items/Weapons/Summon/Sirius.cs index 9eb6828716..26db2bac93 100644 --- a/Items/Weapons/Summon/Sirius.cs +++ b/Items/Weapons/Summon/Sirius.cs @@ -65,9 +65,9 @@ namespace CalamityMod.Items.Weapons.Summon { CreateRecipe(). AddIngredient(). - AddIngredient(5). - AddIngredient(2). - AddIngredient(12). + AddIngredient(8). + AddIngredient(4). + AddIngredient(20). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Summon/SlimePuppetStaff.cs b/Items/Weapons/Summon/SlimePuppetStaff.cs index 571993ea24..1823d77cd1 100644 --- a/Items/Weapons/Summon/SlimePuppetStaff.cs +++ b/Items/Weapons/Summon/SlimePuppetStaff.cs @@ -52,8 +52,8 @@ namespace CalamityMod.Items.Weapons.Summon public override void AddRecipes() { CreateRecipe(). - AddIngredient(18). - AddIngredient(18). + AddIngredient(14). + AddIngredient(14). AddTile(TileID.Solidifier). Register(); } diff --git a/Items/Weapons/Summon/StaffOfNecrosteocytes.cs b/Items/Weapons/Summon/StaffOfNecrosteocytes.cs index 46d99f5fd5..c53423819a 100644 --- a/Items/Weapons/Summon/StaffOfNecrosteocytes.cs +++ b/Items/Weapons/Summon/StaffOfNecrosteocytes.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 52; Item.height = 54; - Item.damage = 31; + Item.damage = 25; Item.mana = 10; Item.useAnimation = Item.useTime = 36; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Summon/StellarTorusStaff.cs b/Items/Weapons/Summon/StellarTorusStaff.cs index 6dc2fda202..d6f33e4304 100644 --- a/Items/Weapons/Summon/StellarTorusStaff.cs +++ b/Items/Weapons/Summon/StellarTorusStaff.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public static float EnemyDetectionDistance = 1200f; - public static int IFrames = 10; + public static int IFrames = 8; // In frames. public static float TimeBeforeCharging = 45f; @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 42; Item.height = 42; - Item.damage = 142; + Item.damage = 132; Item.useAnimation = Item.useTime = 24; Item.knockBack = 4f; Item.mana = 10; diff --git a/Items/Weapons/Summon/SunSpiritStaff.cs b/Items/Weapons/Summon/SunSpiritStaff.cs index 0bc84b41ec..03ce24238d 100644 --- a/Items/Weapons/Summon/SunSpiritStaff.cs +++ b/Items/Weapons/Summon/SunSpiritStaff.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 44; Item.height = 48; - Item.damage = 25; + Item.damage = 22; Item.mana = 10; Item.useAnimation = Item.useTime = 36; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Summon/TacticalPlagueEngine.cs b/Items/Weapons/Summon/TacticalPlagueEngine.cs index eac44d1874..85ca83d42c 100644 --- a/Items/Weapons/Summon/TacticalPlagueEngine.cs +++ b/Items/Weapons/Summon/TacticalPlagueEngine.cs @@ -13,13 +13,13 @@ namespace CalamityMod.Items.Weapons.Summon public class TacticalPlagueEngine : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; - public const int BulletShootRate = 125; + public const int BulletShootRate = 120; public override void SetDefaults() { Item.width = 28; Item.height = 20; - Item.damage = 140; + Item.damage = 110; Item.mana = 10; Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.HoldUp; diff --git a/Items/Weapons/Summon/TemporalUmbrella.cs b/Items/Weapons/Summon/TemporalUmbrella.cs index 60ffc3da53..e0c75c272b 100644 --- a/Items/Weapons/Summon/TemporalUmbrella.cs +++ b/Items/Weapons/Summon/TemporalUmbrella.cs @@ -65,5 +65,7 @@ namespace CalamityMod.Items.Weapons.Summon AddTile(). Register(); } + + public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(210, 0, 255), new Color(255, 248, 24), 4f); } } diff --git a/Items/Weapons/Summon/VengefulSunStaff.cs b/Items/Weapons/Summon/VengefulSunStaff.cs index 14f973ea85..8fd4492b3e 100644 --- a/Items/Weapons/Summon/VengefulSunStaff.cs +++ b/Items/Weapons/Summon/VengefulSunStaff.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 72; Item.height = 72; - Item.damage = 35; + Item.damage = 38; Item.mana = 10; Item.useAnimation = Item.useTime = 36; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Summon/VileFeeder.cs b/Items/Weapons/Summon/VileFeeder.cs index 1bd661c128..a84b85e78f 100644 --- a/Items/Weapons/Summon/VileFeeder.cs +++ b/Items/Weapons/Summon/VileFeeder.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 40; Item.height = 36; - Item.damage = 15; + Item.damage = 10; Item.DamageType = DamageClass.Summon; Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Summon/ViralSprout.cs b/Items/Weapons/Summon/ViralSprout.cs index 0fe8274228..dfd28bbb38 100644 --- a/Items/Weapons/Summon/ViralSprout.cs +++ b/Items/Weapons/Summon/ViralSprout.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Summon/ViridVanguard.cs b/Items/Weapons/Summon/ViridVanguard.cs index 9cd7b0a4d1..9e8e2d62f3 100644 --- a/Items/Weapons/Summon/ViridVanguard.cs +++ b/Items/Weapons/Summon/ViridVanguard.cs @@ -1,4 +1,5 @@ -using CalamityMod.Buffs.Summon; +using System.Collections.Generic; +using CalamityMod.Buffs.Summon; using CalamityMod.Items.Materials; using CalamityMod.Packets; using CalamityMod.Projectiles.Summon; @@ -40,8 +41,8 @@ namespace CalamityMod.Items.Weapons.Summon #region Damage Balancing Properties - //Sage Poison's damage is kept in the Sage Poison file - public static float ActiveAttackSlashDmgMult => 5f; + //Sage Poison's damage is kept in the Sage Poison file + public static float ActiveAttackSlashDmgMult => 4f; //Note: the following two only apply when not using the active attack public static float AxeDmgMult => 1.25f; @@ -77,7 +78,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 26; Item.height = 36; - Item.damage = 60; + Item.damage = 55; Item.DamageType = DamageClass.Summon; Item.mana = 10; Item.useAnimation = Item.useTime = 24; @@ -92,21 +93,17 @@ namespace CalamityMod.Items.Weapons.Summon Item.shoot = ModContent.ProjectileType(); Item.rare = ModContent.RarityType(); } - - public override bool CanRightClick() + public override void HoldItem(Player player) { - if (!Main.keyState.PressingShift()) - return false; - return true; - } - public override void RightClick(Player player) - { - Main.LocalPlayer.Calamity().InvertExaltationLineRotationDirections = !Main.LocalPlayer.Calamity().InvertExaltationLineRotationDirections; - if (Main.netMode != NetmodeID.SinglePlayer) - ExaltationDirectionSyncPacket.Send(Main.LocalPlayer.Calamity()); + if (Main.myPlayer == player.whoAmI && Item.JustPressedKeybind()) + { + Main.LocalPlayer.Calamity().InvertExaltationLineRotationDirections = !Main.LocalPlayer.Calamity().InvertExaltationLineRotationDirections; + if (Main.netMode != NetmodeID.SinglePlayer) + ExaltationDirectionSyncPacket.Send(Main.LocalPlayer.Calamity()); + } } - public override bool ConsumeItem(Player player) => false; + public override void ModifyTooltips(List tooltips) => tooltips.IntegrateDynamicHotkey(Item); public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) { @@ -171,7 +168,7 @@ namespace CalamityMod.Items.Weapons.Summon CreateRecipe(). AddIngredient(). AddIngredient(). - AddIngredient(15). + AddIngredient(12). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Summon/VoidConcentrationStaff.cs b/Items/Weapons/Summon/VoidConcentrationStaff.cs index 433e5068c8..7ca32eca2f 100644 --- a/Items/Weapons/Summon/VoidConcentrationStaff.cs +++ b/Items/Weapons/Summon/VoidConcentrationStaff.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Linq; using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; @@ -12,7 +11,6 @@ using CalamityMod.Particles; using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; -using CalamityMod.Systems.Collections; using CalamityMod.Utilities.Daybreak; using CalamityMod.Utilities.Daybreak.Buffers; using Microsoft.Xna.Framework; @@ -30,16 +28,17 @@ namespace CalamityMod.Items.Weapons.Summon public class VoidConcentrationStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public static float SummonerTagEffectiveness => 1.67f; public static SummonTag summonTag = new SummonTag() { - MultiplicativeTagDamage = 0.3f, //Percentage of damage dealt added by the void. This is doubled by summons. This was tested - 1.5x was too weak to be worth 4 slots. + MultiplicativeTagDamage = 0.3f, AllowsWhipStacking = true, TagOnHit = tagOnHit, TagModifyHitEffects = SummonTag.BlankTagModifyHit, AutoDrawTooltip = false }; - public static void tagOnHit(NPC npc, Projectile projectile, NPC.HitInfo hit, int damageDone) => npc.GetGlobalNPC().StoredDamage += (int)(damageDone); + public static void tagOnHit(NPC npc, Projectile projectile, NPC.HitInfo hit, int damageDone) => npc.GetGlobalNPC().StoredDamage += (int)(damageDone * (SummonerTagEffectiveness - 1)); public override void SetStaticDefaults() { ItemID.Sets.StaffMinionSlotsRequired[Type] = 4f; @@ -65,30 +64,28 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) + foreach (var item in Main.ActiveProjectiles) { - foreach (var item in Main.ActiveProjectiles) - { - if (item.type == ModContent.ProjectileType()) - item.Kill(); - } - if (player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) - Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); + if (item.type == ModContent.ProjectileType()) + item.Kill(); } - else + if (player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) + { + { + Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); + player.ownedProjectileCounts[ModContent.ProjectileType()]++; //update it instantly so it's read properly later in the same update + } + } + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(true); if (player.MinionAttackTargetNPC >= 0) { var target = Main.npc[player.MinionAttackTargetNPC]; - foreach (var item in Main.ActiveProjectiles) - { - if (item.type == ModContent.ProjectileType()) - item.Kill(); - } Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, target.whoAmI); } } + return false; } public override bool AltFunctionUse(Player player) => true; @@ -157,11 +154,11 @@ namespace CalamityMod.Projectiles.Summon } public class VoidConcentrationDarkEnergy : ModProjectile, ILocalizedModType { - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public new string LocalizationCategory => "Projectiles.Summon"; private double minDistance => 10; private double distance { get; set; } = 10; private double maxDistance => 400; + public override string GlowTexture => "CalamityMod/Projectiles/Summon/VoidConcentrationDarkEnergyGlow"; public override void SetStaticDefaults() { @@ -172,7 +169,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { Projectile.width = 32; - Projectile.height = 32; + Projectile.height = 34; Projectile.netImportant = true; Projectile.friendly = true; Projectile.ignoreWater = true; @@ -185,17 +182,6 @@ namespace CalamityMod.Projectiles.Summon Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 10; } - public override bool PreDraw(ref Color lightColor) - { - Texture2D texture = TextureAssets.Projectile[Type].Value; - texture = TextureAssets.Npc[ModContent.NPCType()].Value; - var gt = DarkEnergy.GlowTexture.Value; - Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - var frame = texture.Frame(1, 8, 0, Projectile.frame); - Main.EntitySpriteDraw(texture, drawPos, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale * 0.5f, SpriteEffects.None, 0); - Main.EntitySpriteDraw(gt, drawPos, frame, Color.White, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale * 0.5f, SpriteEffects.None, 0); - return false; - } public override void AI() { @@ -295,12 +281,12 @@ namespace CalamityMod.Projectiles.Summon public override bool? CanHitNPC(NPC target) => false; public override void AI() { - if (!Main.npc[(int)Projectile.ai[0]].active) + Player owner = Main.player[Projectile.owner]; + if (!Main.npc[(int)Projectile.ai[0]].active || owner.ownedProjectileCounts[ModContent.ProjectileType()] <= 0) { Projectile.Kill(); return; } - Player owner = Main.player[Projectile.owner]; Projectile.Center = Main.npc[(int)Projectile.ai[0]].Center; Main.npc[(int)Projectile.ai[0]].AddBuff(ModContent.BuffType(), 5); @@ -314,7 +300,7 @@ namespace CalamityMod.Projectiles.Summon if (Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center + 200 * v, v.RotatedBy(MathHelper.PiOver2) * 10, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), Projectile.knockBack, Projectile.owner); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center + 200 * v, v.RotatedBy(-MathHelper.PiOver2) * 10, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), Projectile.knockBack, Projectile.owner,1); + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center + 200 * v, v.RotatedBy(-MathHelper.PiOver2) * 10, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), Projectile.knockBack, Projectile.owner, 1); } } } @@ -515,7 +501,7 @@ namespace CalamityMod.Projectiles.Summon { Projectile.NewProjectile(npc.GetSource_OnHurt(null), npc.Center, Vector2.UnitX.RotatedBy(rot), ModContent.ProjectileType(), (int)Math.Max((dmg * VoidConcentrationStaff.summonTag.MultiplicativeTagDamage), 1), 0, -1, npc.whoAmI); } - } + } } base.PostAI(npc); } diff --git a/Items/Weapons/Summon/VoidEaterMarionette.cs b/Items/Weapons/Summon/VoidEaterMarionette.cs index f74c703f3c..e3266817a6 100644 --- a/Items/Weapons/Summon/VoidEaterMarionette.cs +++ b/Items/Weapons/Summon/VoidEaterMarionette.cs @@ -1,6 +1,8 @@ -using System.Linq; +using System.Collections.Generic; +using System.Linq; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.Summon; +using CalamityMod.Packets; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using CalamityMod.Systems.Collections; @@ -41,22 +43,25 @@ namespace CalamityMod.Items.Weapons.Summon Item.DamageType = DamageClass.Summon; Item.shootSpeed = 8; } - public override bool CanRightClick() + + public override void HoldItem(Player player) { - if (!Main.keyState.PressingShift()) - return false; - return true; - } - public override void RightClick(Player player) - { - if (player.ownedProjectileCounts[Item.shoot] > 0) + if (Main.myPlayer == player.whoAmI && player.ownedProjectileCounts[Item.shoot] > 0 && Item.JustPressedKeybind()) { var p = Main.projectile.First(x => x.active && x.type == Item.shoot && x.owner == player.whoAmI); - p.ModProjectile().FocusOnFetching = !p.ModProjectile().FocusOnFetching; - p.netUpdate = true; + if (p.ModProjectile is VoidEaterMarionetteProjectile vem) + { + + vem.FocusOnFetching = !vem.FocusOnFetching; + p.netUpdate = true; + if (vem.FocusOnFetching) + CombatText.NewText(player.Hitbox, Color.White, this.GetLocalizedValue("FetchStart"),true); + else + CombatText.NewText(player.Hitbox, Color.White, this.GetLocalizedValue("FetchEnd"), true); + } } } - public override bool ConsumeItem(Player player) => false; + public override void ModifyTooltips(List tooltips) => tooltips.IntegrateDynamicHotkey(Item); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.ownedProjectileCounts[type] > 0) diff --git a/Items/Weapons/Summon/WarloksMoonFist.cs b/Items/Weapons/Summon/WarloksMoonFist.cs index 1adfc5491b..c185a70c12 100644 --- a/Items/Weapons/Summon/WarloksMoonFist.cs +++ b/Items/Weapons/Summon/WarloksMoonFist.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public const int SlotCount = 4; - public const int PunchCooldownTime = 36; + public const int PunchCooldownTime = 30; public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 4f; @@ -56,9 +56,9 @@ namespace CalamityMod.Items.Weapons.Summon { CreateRecipe(). AddIngredient(ItemID.GolemFist). - AddIngredient(10). - AddIngredient(5). - AddIngredient(5). + AddIngredient(8). + AddIngredient(4). + AddIngredient(20). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Typeless/Aestheticus.cs b/Items/Weapons/Typeless/Aestheticus.cs index a7fa7ed44c..8a5e118585 100644 --- a/Items/Weapons/Typeless/Aestheticus.cs +++ b/Items/Weapons/Typeless/Aestheticus.cs @@ -16,9 +16,8 @@ namespace CalamityMod.Items.Weapons.Typeless Item.width = 58; Item.height = 58; Item.DamageType = AverageDamageClass.Instance; - Item.damage = 8; - Item.useAnimation = 25; - Item.useTime = 25; + Item.damage = 11; + Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 3f; Item.UseSound = SoundID.Item109; @@ -39,12 +38,12 @@ namespace CalamityMod.Items.Weapons.Typeless public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 600); } public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 600); } public override void AddRecipes() diff --git a/Items/Weapons/Typeless/ClaretCannon.cs b/Items/Weapons/Typeless/ClaretCannon.cs index 3d8b5fee1c..d5d7db3135 100644 --- a/Items/Weapons/Typeless/ClaretCannon.cs +++ b/Items/Weapons/Typeless/ClaretCannon.cs @@ -65,7 +65,8 @@ namespace CalamityMod.Items.Weapons.Typeless public override void AddRecipes() { CreateRecipe(). - AddIngredient(4). + AddIngredient(25). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Typeless/StratusSphere.cs b/Items/Weapons/Typeless/StratusSphere.cs index 5f57fda8ce..0fc5bffb2c 100644 --- a/Items/Weapons/Typeless/StratusSphere.cs +++ b/Items/Weapons/Typeless/StratusSphere.cs @@ -55,9 +55,9 @@ namespace CalamityMod.Items.Weapons.Typeless { CreateRecipe(). AddIngredient(ItemID.NebulaArcanum). - AddIngredient(6). + AddIngredient(8). AddIngredient(4). - AddIngredient(12). + AddIngredient(20). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Localization/en-US/Mods.CalamityMod.Biomes.hjson b/Localization/en-US/Mods.CalamityMod.Biomes.hjson index e0bdacb71f..d6072bc9bf 100644 --- a/Localization/en-US/Mods.CalamityMod.Biomes.hjson +++ b/Localization/en-US/Mods.CalamityMod.Biomes.hjson @@ -81,11 +81,6 @@ AstralCaveDesert: { TownNPCDialogueName: the Astral Cave Desert } -FloralParadiseBiome: { - DisplayName: Floral Paradise - TownNPCDialogueName: the Floral Paradise -} - BasaltGullyBiome: { DisplayName: Basalt Gully TownNPCDialogueName: the Basalt Gully diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index df2bdb73d8..e77cb7d5db 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -918,6 +918,17 @@ Encased: { Description: Increased defense by {0} and damage reduction by {1}%, but... } +FulfilledContract: { + DisplayName: Fulfilled Contract + Description: A reward earned through blood and tears + ItemTooltipPlayer: + ''' + 25% reduced Healing Potion cooldown + 75% increased natural regeneration power + All attacks inflict Laceration + ''' +} + GraxBoost: { DisplayName: Grax Boost Description: Your defenses and muscles are strong @@ -1027,7 +1038,7 @@ ReaverRage: { Rage of the earth Defense increased by {0} and damage increased by {1}% ''' - ItemTooltipPlayer: Increases your defense by 10 and damage by 10% + ItemTooltipPlayer: Increases your defense by 5 and damage by 10% } SandsWindBuff: { @@ -1274,9 +1285,9 @@ BabyBloodCrawlerBuff: { Description: The baby blood crawler will protect you } -BabySlimeGodBuff: { - DisplayName: Baby Slime God - Description: The Slime God will protect you +BabyPaladinBuff: { + DisplayName: Baby Paladin + Description: The blighted paladin will protect you } BabyStormlionBuff: { @@ -1294,6 +1305,11 @@ BlackHawkBuff: { Description: The fighter jet will protect you } +BlightedSlime: { + DisplayName: Blighted Slime + Description: The blighted slime will protect you +} + BrimseekerBuff: { DisplayName: Brimseeker Description: Does it want something from you? @@ -1334,11 +1350,6 @@ CloudElemental: { Description: The Cloud Elemental will protect you } -Corroslime: { - DisplayName: Corroslime - Description: The corroslime will protect you -} - CorvidHarbringerBuff: { DisplayName: Raven Description: The powerful raven will protect you @@ -1359,11 +1370,6 @@ CosmilampBuff: { Description: The cosmilamp will protect you } -Crimslime: { - DisplayName: Crimslime - Description: The crimslime will protect you -} - DaedalusCrystalBuff: { DisplayName: Daedalus Crystal Description: The Daedalus crystal will protect you @@ -1771,7 +1777,7 @@ Daybroken: { Shadowflame: { DisplayName: Shadowflame ItemTooltipPlayer: Heat - 15 DPS - ItemTooltipEnemy: Heat - 30 DPS + ItemTooltipEnemy: Heat - 20 DPS } ForbiddenStealthSummonTagBuff: { @@ -1803,14 +1809,16 @@ SmashedEvil: { Description: Increased damage, movement speed, and regeneration ItemTooltipEnemy: ''' - All types - 20 DPS + All types - 80 DPS + Ignores enemy weaknesses and resistances +5 damage taken ''' ItemTooltipPlayer: ''' - Regen returns to full strength 200% faster - 10% increased damage - 20% increased movement speed + Natural regeneration is much stronger and returns much quicker + 20% increased damage + Increased acceleration and deceleration + 5mph increased top speed ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Condition.hjson b/Localization/en-US/Mods.CalamityMod.Condition.hjson index d6bef60d40..a9982d1452 100644 --- a/Localization/en-US/Mods.CalamityMod.Condition.hjson +++ b/Localization/en-US/Mods.CalamityMod.Condition.hjson @@ -38,11 +38,11 @@ Drops: { DownedClamHM: After defeating the Giant Clam in Hardmode DownedGSS: After defeating the Great Sand Shark DownedBetsy: After defeating Betsy + DownedDreadnautilus: After defeating Dreadnautilus DownedT1AR: After defeating the first tier of Acid Rain DownedT2AR: After defeating the second tier of Acid Rain FirstKill: Drops only on the first kill MechBoss: Drops on the first kill of the final Mechanical Boss - ProvidenceEnraged: Drops if Providence has been enraged ProvidenceChallenge: ''' Drops if Providence was defeated only with the [i:CalamityMod/ProfanedSoulArtifact] Profaned Soul Artifact @@ -52,7 +52,6 @@ Drops: { // Other conditions HasFlareGun: While holding a Flare Gun upgrade -LacewingBestiary: When at least 40% of the Bestiary has been completed CrescentMoons: During a crescent moon GibbousMoons: During a gibbous moon HasRogueArmor: While wearing rogue armor diff --git a/Localization/en-US/Mods.CalamityMod.Configs.hjson b/Localization/en-US/Mods.CalamityMod.Configs.hjson index d4d7fac81b..fdee9b12c9 100644 --- a/Localization/en-US/Mods.CalamityMod.Configs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Configs.hjson @@ -6,7 +6,7 @@ CalamityClientConfig: { Graphics: Graphics Changes UI: UI Changes MeterPositions: Meter Positions - MusicToggles: Music Toggles + AudioToggles: Audio Toggles } AbyssLayer3Alt: { @@ -41,6 +41,15 @@ CalamityClientConfig: { ''' } + BoCSpriteChange: { + Label: "[i:BrainOfConfusion] Remove Potentially Disturbing Imagery" + Tooltip: + ''' + Replaces some boss sprites to remove potentially upsetting imagery that could trigger phobias. + Highly recommended if you are uncomfortable with body horror or have trypophobia. + ''' + } + BossHealthBarExtraInfo: { Label: "[i:CalamityMod/EncryptedSchematicPlanetoid] Boss Health Bar Extra Info" Tooltip: @@ -101,15 +110,6 @@ CalamityClientConfig: { ''' } - EnableVanillaTextureEdits: { - Label: "[i:Paintbrush] Enable Vanilla Texture Edits" - Tooltip: - ''' - Enables slight edits to vanilla boss textures to improve attack telegraphs. - Disable this for compatibility with texture packs. - ''' - } - EnergyShieldOpacity: { Label: "[i:CalamityMod/TheSponge] Energy Shield Opacity" Tooltip: @@ -187,6 +187,15 @@ CalamityClientConfig: { ''' } + MisophoniaSupport: { + Label: "[i:Megaphone] Disable Potentially Triggering Audio" + Tooltip: + ''' + Disables or alters multiple repetitive and potentially distressing sound effects. + Highly recommended for those with misophonia. + ''' + } + ParticleLimit: { Label: "[i:FragmentStardust] Max Particle Limit" Tooltip: @@ -208,15 +217,6 @@ CalamityClientConfig: { ''' } - BoCSpriteChange: { - Label: "[i:BrainOfConfusion] Remove Potentially Disturbing Imagery" - Tooltip: - ''' - Replaces some boss sprites to remove potentially upsetting imagery that could trigger phobias. - Highly recommended if you are uncomfortable with body horror or have trypophobia. - ''' - } - RageMeterPosX: { Label: "[i:LaserRuler] Rage Meter X Position" Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.DamageClasses.hjson b/Localization/en-US/Mods.CalamityMod.DamageClasses.hjson index 4b00ee161b..e91a8731b3 100644 --- a/Localization/en-US/Mods.CalamityMod.DamageClasses.hjson +++ b/Localization/en-US/Mods.CalamityMod.DamageClasses.hjson @@ -5,3 +5,4 @@ StealthDamageClass.DisplayName: stealth damage TrueMeleeDamageClass.DisplayName: true melee damage TrueMeleeNoSpeedDamageClass.DisplayName: true melee damage VoidTagDmgType.DisplayName: void tag damage +AllClassDamageClass.DisplayName: all-class damage diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson index 367ad5e519..b914d0c5d7 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson @@ -128,6 +128,16 @@ TarragonWings: { ''' } +TiredTail: { + DisplayName: Tired Tail + Tooltip: + ''' + {$CommonItemTooltip.FlightAndSlowfall} + {$CommonItemTooltip.PressDownToHover} + {$CommonItemTooltip.PressUpToBooster} + ''' +} + VoidStriders: { DisplayName: Void Striders TreadsName: Void Kicks diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index cd60e9ebfd..576833de12 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -52,7 +52,7 @@ AeroStone: { DisplayName: Aero Stone Tooltip: ''' - Provides an additional {0} seconds of flight time + Grants {0} additional seconds of flight time You slowly recover flight time while in the air while not flying or gliding 'One of the ancient relics' ''' @@ -226,9 +226,10 @@ AscendantInsignia: { DisplayName: Ascendant Insignia Tooltip: ''' - Increases wing flight time by {0}%, movement and jump speed by {1}%, and acceleration by {2}x - Pressing [KEY] grants you the power of ascension, providing infinite flight time for {3} seconds - Ascension has a {4} second cooldown + Grants {0} additional seconds of flight time + Increases movement speed by {1}%, jump speed by {2}%, and acceleration by {3}x + Pressing [KEY] fully restores flight time and prevents it from decreasing for {4} seconds + This ability has a {5} second cooldown ''' } @@ -252,15 +253,6 @@ AsgardsValor: { ''' } -FadedIdolatry: { - DisplayName: Faded Idolatry - Tooltip: - ''' - Summoned [i:CalamityMod/YharonsKindleStaff] Fiery Draconids cost one less minion slot - [c/ffe100:'Once everything has crumbled to dust, what will be left of the world you created?'] - ''' -} - BadgeofBravery: { DisplayName: Badge of Bravery Tooltip: @@ -301,20 +293,6 @@ BlackGlassBand: { ''' } -BlazingCore: { - DisplayName: Blazing Core - Tooltip: - ''' - {$Common.KnockbackImmunity} - The searing core of the Profaned Goddess - Pressing [KEY] will activate a parry, encasing you in luminous profaned crystal - Being hit shortly after encasement will shatter the crystal - Upon shattering, holy stars spiral outwards and damage taken is negated - After shattering, this damage reduction effect goes on cooldown - Damage parried whilst on cooldown summons additional healing stars, and will not be reduced - ''' -} - BloodflareCore: { DisplayName: Bloodflare Core Tooltip: @@ -441,7 +419,7 @@ CorrosiveSpine: { Tooltip: ''' 5% increased movement speed - 25% increased Sickness and Water debuff damage + 50% increased Sickness and Water debuff damage All attacks inflict [cbuff:CalamityMod/Irradiated] and reduces the severity of the sulphuric waters You burst into radioactive clouds when struck ''' @@ -474,6 +452,15 @@ CrownJewel: { ''' } +CrushingEgo: { + DisplayName: Crushing Ego + Tooltip: + ''' + Multiplies all damage by 1.3x, but at the cost of taking 20% increased damage + [c/ff00ff:'Don the mask of arrogance, and dance by your lonesome. Once the ball has gone quiet, you'll be the last man standing.'] + ''' +} + CryoStone: { DisplayName: Cryo Stone Tooltip: @@ -593,12 +580,17 @@ DiamondOfTheDeep: { ''' } -CrushingEgo: { - DisplayName: Crushing Ego +DivineProvidence: { + DisplayName: Divine Providence Tooltip: ''' - Multiplies all damage by 1.3x, but at the cost of taking 20% increased damage - [c/ff00ff:'Don the mask of arrogance, and dance by your lonesome. Once the ball has gone quiet, you'll be the last man standing.'] + {$Common.KnockbackImmunity} + Pressing [KEY] will activate a parry, encasing you in luminous profaned crystal + Being hit shortly after encasement will shatter the crystal + Upon shattering, holy stars spiral outwards and damage taken is negated + After shattering, this damage reduction effect goes on cooldown + Damage parried whilst on cooldown summons additional healing stars, and will not be reduced + [c/FF8C00:The searing core of the Profaned Goddess] ''' } @@ -663,20 +655,6 @@ EclipseMirror: { FlavorTooltip: "'Its reflection shows naught but darkness'" } -FragmentsOfAnotherWorld: { - DisplayName: Fragments of Another World - Tooltip: - ''' - Grants immunity to [cbuffplr:CalamityMod/WhisperingDeath] - {0}% increased melee speed - {1}x specialist ranged damage - {2}% reduced mana usage - +{3} maximum sentries - {4}% increased rogue attack speed - [c/ff0000:'Don't speak of your desires to the shadows, they listen.'] - ''' -} - ElectriciansGlove: { DisplayName: Electrician's Glove Tooltip: @@ -701,7 +679,11 @@ ElementalGauntlet: { ElementalinaBottle: { DisplayName: Elemental in a Bottle - Tooltip: Summons a sand elemental to fight for you + Tooltip: + ''' + Summons a sand elemental to fight for you + The elemental has reduced opacity if visibility is disabled + ''' } ElysianAegis: { @@ -758,7 +740,20 @@ EvasionScarf: { EyeoftheStorm: { DisplayName: Eye of the Storm - Tooltip: Summons a Cloud Elemental to fight for you + Tooltip: + ''' + Summons a Cloud Elemental to fight for you + The elemental has reduced opacity if visibility is disabled + ''' +} + +FadedIdolatry: { + DisplayName: Faded Idolatry + Tooltip: + ''' + Summoned [i:CalamityMod/YharonsKindleStaff] Fiery Draconids cost one less minion slot + [c/ffe100:'Once everything has crumbled to dust, what will be left of the world you created?'] + ''' } FeatherCrown: { @@ -800,7 +795,7 @@ FishStocks: { +10% critical strike chance +15% critical strike damage +10% damage reduction - +3HP/s life regeneration + +3 HP/s life regeneration +25% mining speed +50 fishing power +0.55 luck @@ -835,11 +830,25 @@ FleshTotem: { Summons an effigy above your head that stores mana as you use it, up to 600 mana The effigy occasionally pulses, restoring 25 mana Pulses appear more frequently the more mana is stored - Upon being struck, the effigy unleashes all stored up mana as vengeful souls that chase your enemies + Upon being struck, the effigy unleashes half of all stored up mana as vengeful souls that chase your enemies The effigy is transparent and silent if visibility is disabled ''' } +FragmentsOfAnotherWorld: { + DisplayName: Fragments of Another World + Tooltip: + ''' + Grants immunity to [cbuffplr:CalamityMod/WhisperingDeath] + {0}% increased melee speed + {1}x specialist ranged damage + {2}% reduced mana usage + +{3} maximum sentries + {4}% increased rogue attack speed + [c/ff0000:'Don't speak of your desires to the shadows, they listen.'] + ''' +} + FrostBarrier: { DisplayName: Frost Barrier Tooltip: @@ -860,6 +869,24 @@ FrostFlare: { ''' } +FrozenCube: { + DisplayName: Frozen Cube + Tooltip: + ''' + A frozen block of ice with something inside + Summons an Elumphant to sit atop your head and protect you + The Elumphant will cycle between shooting cold air that inflicts [cbuff:CalamityMod/WindChilled], and headbutting enemies + Elumphant's headbutts only target enemies inflicted with [cbuff:CalamityMod/WindChilled] + Reduces your defense by 33%, but uses that defense to boost the Elumphant's power and your cold debuff damage + [DAMAGELINE] + [c/7497ED:'What I wanna know is, where's the mammoth?'] + ''' + SalesPitch: "{$Common.SalesmanShrinePitch}" + EquippedDebuff: Current Cold Debuff boost: +{0}% + EquippedElumphant: Current Elumphant Power: {0}% + Unequipped: Equip this accessory to view its statistics +} + FungalClump: { DisplayName: Fungal Clump Tooltip: @@ -874,7 +901,7 @@ FungalSymbiote: { Tooltip: ''' You grow mushrooms on the grass beneath you - Consuming mushrooms provides [cbuffplr:CalamityMod/Mushy], granting 5 defense and +1 HP/s life regen + Consuming mushrooms provides [cbuffplr:CalamityMod/Mushy], granting 3 defense and +1 HP/s life regen 10% increased damage while you have [cbuffplr:CalamityMod/Mushy] ''' SalesPitch: "{$Common.SalesmanShrinePitch}" @@ -965,7 +992,7 @@ HallowedRune: { HarpyRing: { DisplayName: Harpy Ring - Tooltip: 10% increased movement speed and 20% increased flight time + Tooltip: 20% increased movement speed and flight time } HeartofDarkness: { @@ -983,6 +1010,7 @@ HeartoftheElements: { Tooltip: ''' Summons all elementals to protect you + The elementals have reduced opacity if visibility is disabled 'The heart of the world' ''' } @@ -1207,10 +1235,10 @@ NebulousCore: { DisplayName: Nebulous Core Tooltip: ''' - 10% increased damage + {0}% increased damage Summons floating nebula stars to protect you - Taking a fatal hit revives you to 100 HP - This effect has a 90 second cooldown + Taking a fatal hit revives you to {1} HP + This effect has a {2} second cooldown ''' } @@ -1248,6 +1276,16 @@ Nucleogenesis: { ''' } +OasisElementalinaBottle: { + DisplayName: Oasis Elemental in a Bottle + Tooltip: + ''' + Summons an oasis elemental to assist you + The elemental fires healing orbs that restore 10 health while you are damaged + The elemental has reduced opacity if visibility is disabled + ''' +} + OccultSkullCrown: { DisplayName: Occult Skull Crown Tooltip: @@ -1320,6 +1358,7 @@ PearlofEnthrallment: { ''' Summons a water elemental to fight for you The elemental stays above you, shooting water spears, ice mist, and treble clefs at nearby enemies + The elemental has reduced opacity if visibility is disabled ''' } @@ -1481,15 +1520,6 @@ RampartofDeities: { ToggleEffect: ", increases movement speed," } -OasisElementalinaBottle: { - DisplayName: Oasis Elemental in a Bottle - Tooltip: - ''' - Summons an oasis elemental to assist you - The elemental fires healing orbs that restore 10 health while you are damaged - ''' -} - ReaperToothNecklace: { DisplayName: Reaper Tooth Necklace Tooltip: @@ -1519,7 +1549,11 @@ RogueEmblem: { RoseStone: { DisplayName: Rose Stone - Tooltip: Summons a Brimstone Elemental to fight for you + Tooltip: + ''' + Summons a Brimstone Elemental to fight for you + The elemental has reduced opacity if visibility is disabled + ''' } RottenBrain: { @@ -1996,6 +2030,21 @@ TheFirstShadowflame: { ''' } +ThePact: { + DisplayName: The Pact + Tooltip: + ''' + Increases your max health by {0}x + Causes {1}% of hits you take to critically strike you + These crits deal {2}x damage and infict [cbuffplr:CalamityMod/FulfilledContract] + ''' + SalesPitch: + ''' + 'Money's a fickle thing, buddy. One slip, and next you know, you're livin' it up... in a dumpster!' + 'Gambling with life itself, that's where it's truly at. Just write my name in your will, would ya?' + ''' +} + ThePointer: { DisplayName: The Pointer Tooltip: @@ -2158,7 +2207,7 @@ WarbanneroftheRighteous: { Tooltip: ''' Multiplies all damage based on how close you are to enemies - Maximum damage boost is 15%, minimum damage boost is -15% + Maximum damage boost is 1.15x, minimum damage boost is 0.85x Emit a blazing aura that burns and repels nearby enemies with [cbuff:CalamityMod/HolyFlames] Enemies take increasing damage the closer they are to you and the longer they are near you Effects are transparent and silent if visibility is disabled @@ -2221,6 +2270,11 @@ GhostBracelet: { Tooltip: Wow.... It looks at me with its hollow eyes full of curiosity } +GlimmeringRibbon: { + DisplayName: Glimmering Ribbon + Tooltip: "'We are born colorless. It's the people we meet who give us color.'" +} + HapuFruit: { DisplayName: Ha-pu Fruit Tooltip: "'A fruit that calms your nerves (may have unintended side effects)'" @@ -2252,12 +2306,7 @@ Popo: { SharkyPlush: { DisplayName: Sharky Plush - Tooltip: "[c/696969:'Look out, for the force without form...']" -} - -GlimmeringRibbon: { - DisplayName: Glimmering Ribbon - Tooltip: "'We are born colorless. It's the people we meet who give us color.'" + Tooltip: "[c/696969:'Like lovers and heroes, and the restless part of everyone...']" } TheComb: { @@ -2297,21 +2346,3 @@ XyksBlessingOrange: { ArmorDisabled: "[c/D44748:DISABLED]" ArmorEnabled: "[c/58D447:ENABLED]" } - -FrozenCube: { - DisplayName: Frozen Cube - Tooltip: - ''' - A frozen block of ice with something inside - Summons an Elumphant to sit atop your head and protect you - The Elumphant will cycle between shooting cold air that inflicts [cbuff:CalamityMod/WindChilled], and headbutting enemies - Elumphant's headbutts only target enemies inflicted with [cbuff:CalamityMod/WindChilled] - Reduces your defense by 33%, but uses that defense to boost the Elumphant's power and your cold debuff damage - [DAMAGELINE] - [c/7497ED:'What I wanna know is, where's the mammoth?'] - ''' - SalesPitch: "{$Common.SalesmanShrinePitch}" - EquippedDebuff: Current Cold Debuff boost: +{0}% - EquippedElumphant: Current Elumphant Power: +{0}% - Unequipped: Equip this accessory to view its statistics -} diff --git a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson index a1531dea4b..6bfea394d9 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson @@ -12,7 +12,7 @@ BloodfireArrow: { Tooltip: ''' High-velocity arrows with a blood soaked tip - Firing these arrows will drain your health and boost the arrow damage by 30% + Firing these arrows will drain your health and boost the arrow damage by 20% Accelerates your natural life regen and heals you on hit ''' } @@ -59,7 +59,11 @@ DryadsTear: { ElysianArrow: { DisplayName: Elysian Arrow - Tooltip: On impact, summons purifying light from above and below at the nearest enemy + Tooltip: + ''' + On impact, summons purifying light from above and below at the nearest enemy + Purifying light ignores 15 points of enemy Defense + ''' } FlashRound: { @@ -85,7 +89,7 @@ HailstormBullet: { Tooltip: ''' Once shot, bullets rapidly decelerate - Critical hits cause a flash freeze, dealing additional damage and freezing non-boss enemies + Critical hits cause a flash freeze, dealing additional damage based on your crit chance and freezing enemies ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson index 7cd148e6f7..516919d0a1 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson @@ -306,7 +306,7 @@ LunicCorpsHelmet: { DisplayName: Lunic Corps Helmet Tooltip: ''' - Increases non-bow damage by {0}% + Increases non-bow ranged damage by {0}% Improves vision and shows the location of enemies ''' SetBonus: diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson index e7a6ec4fc8..366d580191 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson @@ -249,11 +249,7 @@ BloodflareHeadRogue: { {$Common.RogueStealth} {$BloodflareHeadRogue.SetBonusEffect@1} ''' - SetBonusEffect: - ''' - Grants {0} defense when above {1}% life - {$BloodflareBodyArmor.CommonSetBonus} - ''' + SetBonusEffect: "{$BloodflareBodyArmor.CommonSetBonus}" } BloodflareHeadSummon: { @@ -285,13 +281,17 @@ DemonshadeBreastplate: { {$CommonItemTooltip.PercentIncreasedDamageCritChance@1} {$CommonItemTooltip.PercentIncreasedMeleeSpeed@2} {$CommonItemTooltip.PercentChanceToSaveAmmo@3} - Standing still absorbs shadows to grant exponentially accelerating life regen + Standing still grants exponentially accelerating life regen ''' } DemonshadeGreaves: { DisplayName: Demonshade Greaves - Tooltip: Shadow speed + Tooltip: + ''' + {$CommonItemTooltip.PercentIncreasedMovementSpeed} and {1}% increased acceleration + [c/aaaaaa:Shift- in your inventory to toggle the increased acceleration] + ''' } DemonshadeHelm: { @@ -705,7 +705,6 @@ TarragonHeadRogue: { ''' After every {0} rogue critical hits you will gain {1} seconds of damage immunity This effect has a cooldown of {2} seconds - While under the effects of a debuff you gain {3}% increased rogue damage {$TarragonBreastplate.CommonSetBonus} ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson b/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson index 442de828f9..5ae7888174 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson @@ -58,11 +58,6 @@ Bloodstone: { Tooltip: "" } -BloodstoneCore: { - DisplayName: Bloodstone Core - Tooltip: "" -} - CoreofCalamity: { DisplayName: Core of Calamity Tooltip: "" @@ -218,7 +213,7 @@ PlagueCellCanister: { } PlasmaDriveCore: { - DisplayName: Prototype Plasma Drive Core + DisplayName: Prototype Plasma Drive Tooltip: Despite all the time it spent in storage, its furnace still burns strong } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index 18cd1593dd..d82a2f9688 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -140,7 +140,7 @@ ShadowPotion: { SoaringPotion: { DisplayName: Soaring Potion - Tooltip: "{0}% increased flight time and horizontal flight speed" + Tooltip: "{0}% increased flight time" } SulphurskinPotion: { @@ -164,7 +164,7 @@ TheConcoction: { Tooltip: ''' Restores 9999 life - Can even be used while you have potion sickness if Quick Heal is repeatedly pressed + Can even be used while you have [cbuffplr:PotionSickness] if Quick Heal is repeatedly pressed ''' SalesPitch: ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson index 3ae132b727..4e949f3dee 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson @@ -226,11 +226,11 @@ ProfanedCore: { DisplayName: Profaned Core Tooltip: ''' - Summons Providence when used in the Hallow or Underworld - Use again while Providence is at high health to unleash Her perfect fury + Summons Providence when used in the Hallow or Underworld[ENRAGE] {$Common.NotConsumable} 'The heart of Her Guardians, Her wicked wrath shall burn upon whoever now wields it.' ''' + EnrageText: "[c/64c8fa:The nature of this world will unleash Her perfect fury, beware!]" } ProfanedShard: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson index 589bc10f15..a6ef244292 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson @@ -17,8 +17,8 @@ AggressiveVoucher: { DisplayName: Aggressive Voucher Tooltip: ''' - Favorite this item in your inventory to increase the likelihood of obtaining a desirable reforge - This effect only applies when reforging accessories + Favorite this item in your inventory to change the result of your next accessory reforge + This will always either give the targeted reforge or a unique reforge Targeted Reforge: {0} Selectable Reforges: {1} [c/aaaaaa:Shift- in your inventory to cycle between targeted reforges] @@ -162,8 +162,8 @@ CombatVoucher: { DisplayName: Combat Voucher Tooltip: ''' - Favorite this item in your inventory to increase the likelihood of obtaining a desirable reforge - This effect only applies when reforging weapons + Favorite this item in your inventory to change the result of your next weapon reforge + This will always either give the best reforge based on class or a unique reforge ''' SalesPitch: ''' @@ -240,8 +240,8 @@ HurriedVoucher: { DisplayName: Hurried Voucher Tooltip: ''' - Favorite this item in your inventory to increase the likelihood of obtaining a desirable reforge - This effect only applies when reforging accessories + Favorite this item in your inventory to change the result of your next accessory reforge + This will always either give the targeted reforge or a unique reforge Targeted Reforge: {0} Selectable Reforges: {1} [c/aaaaaa:Shift- in your inventory to cycle between targeted reforges] @@ -320,8 +320,8 @@ OddVoucher: { DisplayName: Odd Voucher Tooltip: ''' - Favorite this item in your inventory to increase the likelihood of obtaining a desirable reforge - This effect only applies when reforging accessories + Favorite this item in your inventory to change the result of your next accessory reforge + This will always either give the targeted reforge or a unique reforge Targeted Reforge: {0} Selectable Reforges: {1} [c/aaaaaa:Shift- in your inventory to cycle between targeted reforges] @@ -454,8 +454,8 @@ UnbreakableVoucher: { DisplayName: Unbreakable Voucher Tooltip: ''' - Favorite this item in your inventory to increase the likelihood of obtaining a desirable reforge - This effect only applies when reforging accessories + Favorite this item in your inventory to change the result of your next accessory reforge + This will always either give the targeted reforge or a unique reforge Targeted Reforge: {0} Selectable Reforges: {1} [c/aaaaaa:Shift- in your inventory to cycle between targeted reforges] diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index dbe76d7dae..495b98d77a 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -23,11 +23,6 @@ AethersWhisper: { Tooltip: Fires void beams that gain damage as they travel and split on tile hits } -AlulaAustralis: { - DisplayName: Alula Australis - Tooltip: Fires a beautiful aurora that spreads the [cbuff:CalamityMod/AstralInfectionDebuff] and is trailed by a star shower -} - AlphaDraconis: { DisplayName: Alpha Draconis Tooltip: @@ -41,6 +36,11 @@ AlphaDraconis: { ''' } +AlulaAustralis: { + DisplayName: Alula Australis + Tooltip: Fires a beautiful aurora that spreads the [cbuff:CalamityMod/AstralInfectionDebuff] and is trailed by a star shower +} + AnahitasArpeggio: { DisplayName: Anahita's Arpeggio Tooltip: "[GFB]" @@ -493,7 +493,7 @@ LashesofChaos: { DisplayName: Lashes of Chaos Tooltip: ''' - Alternates between exploding hellfireballs and piercing hellblasts + Alternates between exploding hellfire bursts and piercing brimstone darts 'Watch the world burn...' ''' } @@ -919,6 +919,11 @@ TheSwarmer: { TheWand: { DisplayName: The Wand Tooltip: The ultimate wand + SalesPitch: + ''' + 'Hey buddy. I know we've had our differences, but you've been a real pal to me. This is a special offer, just for you!' + 'Apparently this stick is from the Dragon Aerie, and I've heard that even the tiniest branches there have unfathomable power! This is literally a steal!' + ''' } ThornBlossom: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 43d0904593..33a6e5a1a9 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -86,7 +86,8 @@ ArkoftheCosmos: { You can also parry projectiles to make them deal 120 less damage for a short period Parrying will empower the next 16 swings of the sword ''' - BlastInfo: Double with charges available to cause a Big Rip in spacetime and consume all charges + BlastInfo: with charges available to cause a Big Rip in spacetime and consume all charges + BlastInfoKeybind: Press [KEY] with charges available to cause a Big Rip in spacetime and consume all charges } ArkoftheElements: { @@ -918,8 +919,12 @@ Oblivion: { DisplayName: Oblivion Tooltip: ''' - {$Common.YoyoStatsInfinite} - Fires brimstone darts when enemies are near + {$Common.YoyoStats} + A hightly unstable yoyo that slowly releases homing brimstone hellblasts + Enemy hits with the yoyo charge its power, greatly increasing the fire rate of the hellblasts + At maximum charge, the yoyo bursts into brimstone darts and resets its flight duration + Striking an enemy at maximum charge will overload the yoyo, causing it to release all stored up power and shatter + Shattering the yoyo deals immense damage but leaves it unable to be used for several seconds ''' } @@ -1240,7 +1245,7 @@ StygianShield: { DisplayName: Stygian Shield Tooltip: ''' - Hold to charge an omni-directional dash which slams through enemies + Hold to charge an omni-directional dash which grants immunity to damage and can slam through enemies to throw a buckler which bounces towards a nearby foe upon collision Grants knockback immunity and {0} defense while held However, dashes are disabled until you stop holding this weapon for {1} seconds diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index d026b18452..0b3625e36e 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -65,6 +65,11 @@ AntiMaterielRifle: { ''' } +AquashardShotgun: { + DisplayName: Aquashard Shotgun + Tooltip: Converts musket balls into aquashards that split upon hitting an enemy +} + Arbalest: { DisplayName: Arbalest Tooltip: @@ -75,11 +80,6 @@ Arbalest: { ''' } -AquashardShotgun: { - DisplayName: Aquashard Shotgun - Tooltip: Converts musket balls into aquashards that split upon hitting an enemy -} - Archerfish: { DisplayName: Archerfish Tooltip: @@ -132,7 +132,7 @@ Auralis: { DisplayName: Auralis Tooltip: ''' - Fires a high speed glowing bullet that cause enemies to become [cbuff:CalamityMod/MarkedforDeath] + Fires a high speed glowing bullet that causes enemies to become [cbuff:CalamityMod/MarkedforDeath] Press to zoom out Standing still provides increasing damage bonuses up to 25% Standing still for 5 or more seconds while using the scope ability will summon an aurora @@ -547,6 +547,7 @@ HalleysInferno: { Fires a burst of intensely concentrated lunar fire jets to rapid-fire Starbursts that inflict [cbuff:CalamityMod/Voidfrost] Generates Starbursts when hitting enemies, depending on your accuracy + Press [KEY] to toggle long-range scope mode Uses gel for ammo 'Halley arrived sooner than expected' ''' @@ -819,6 +820,23 @@ NullificationPistol: { ''' } +OmniGun: { + DisplayName: The Omnigun + Tooltip: + ''' + A multipurpose weapon with several modes which are used in sequence + The first shot is a sniper round which gains damage over time and always critically strikes + The second shot is a burst of 10 standard bullets + The third shot is a devastating point blank spread + The fourth shot is a dangerous but powerful grenade which destroys everything, including you + ''' + SalesPitch: + ''' + 'Why carry four different guns when you can carry just one? That's what I used to ask myself!' + 'With this thing-a-beauty, even a bumbling moron can become invincible - and for the right price, it can be yours!' + ''' +} + OntologicalDespoiler: { DisplayName: Ontological Despoiler Tooltip: @@ -852,23 +870,6 @@ Onyxia: { ''' } -OmniGun: { - DisplayName: The Omnigun - Tooltip: - ''' - A multipurpose weapon with several modes which are used in sequence - The first shot is a sniper round which gains damage over time and always critically strikes - The second shot is a burst of 10 standard bullets - The third shot is a devastating point blank spread - The fourth shot is a dangerous but powerful grenade which destroys everything, including you - ''' - SalesPitch: - ''' - 'Why carry four different guns when you can carry just one? That's what I used to ask myself!' - 'With this thing-a-beauty, even a bumbling moron can become invincible - and for the right price, it can be yours!' - ''' -} - OpalStriker: { DisplayName: Opal Striker Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 4d9c18b3c1..f1b19bcf75 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -683,6 +683,19 @@ LeadTomahawk: { ''' } +LemonNade: { + DisplayName: Lemon 'nade + Tooltip: + ''' + Disables normal stealth generation + Hold to pull the pin and generate stealth, and release to throw + The longer it is held, the shorter the fuse once the 'nade is thrown + Will explode in your hand if the fuse is held too long + Stealth strikes explode into exploding lemon seeds + 'Burn their house down!' + ''' +} + LeonidProgenitor: { DisplayName: Leonid Progenitor Tooltip: @@ -890,6 +903,15 @@ ProfanedPartisan: { ''' } +Pumpkaboom: { + DisplayName: Pumpkaboom + Tooltip: + ''' + Throws a pumpkin which sticks to enemies and explodes after a delay + Stealth strikes throw larger pumpkins which pull enemies in before releasing a larger explosion + ''' +} + RadiantStar: { DisplayName: Radiant Star Tooltip: @@ -1069,17 +1091,6 @@ SkyfinBombers: { ''' } -SlickCane: { - DisplayName: Slick Cane - Tooltip: - ''' - Swipes a cane that steals money from enemies - Stealth strikes give a 1 in 20 chance for enemies to drop 1-2 gold coins when hit - Stealth strikes boost damage in proportion to money in the inventory, up to 1 Platinum - 'Economy at its finest' - ''' -} - SludgeSplotch: { DisplayName: Sludge Splotch Tooltip: Stealth strikes cause the main ball of sludge to split on hit, inflicting more damage @@ -1262,7 +1273,7 @@ TimeBolt: { ''' Throws a temporal knife that causes [cbuff:CalamityMod/TimeDistortion] around enemies Stealth strikes can hit more enemies and create a larger time field - 'There should be no boundary to human endeavor' + 'Every maid needs a knife, and every knife needs a cutting board' ''' } @@ -1359,6 +1370,17 @@ Vega: { ''' } +WalkingCane: { + DisplayName: Walking Cane + Tooltip: + ''' + Swipes a pointed walking cane + Stealth strikes drain the sanity of foes, causing shadow hands to be summoned when attacked + While held, increases movement speed by {0}% + 'Is it walking me, or am I walking it?' + ''' +} + WaveSkipper: { DisplayName: Wave Skipper Tooltip: @@ -1408,25 +1430,3 @@ WulfrumKnife: { Returning knives also temporarily allows using stealth strikes without rogue armor ''' } - -Pumpkaboom: { - DisplayName: Pumpkaboom - Tooltip: - ''' - Throws a pumpkin which sticks to enemies and explodes after a delay - Stealth strikes throw larger pumpkins which pull enemies in before releasing a larger explosion - ''' -} - -LemonNade: { - DisplayName: Lemon 'nade - Tooltip: - ''' - Disables normal stealth generation - Hold to pull the pin and generate stealth, and release to throw - The longer it is held, the shorter the fuse once the 'nade is thrown - Will explode in your hand if the fuse is held too long - Stealth strikes explode into exploding lemon seeds - 'Burn their house down!' - ''' -} diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson index ed0fa8eb78..edf3cfd303 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -85,6 +85,11 @@ BlackHawkRemote: { ''' } +BlightedSlimeStaff: { + DisplayName: Blighted Slime Staff + Tooltip: Summons a blighted slime to fight for you +} + BorealisBomber: { DisplayName: Borealis Bomber Tooltip: @@ -147,10 +152,10 @@ CausticStaff: { ''' HoldShiftTooltip: ''' - Always inflicts [cbuff:OnFire3] + Always inflicts [cbuff:OnFire3] and [cbuff:Venom] Inflicts [cbuff:CursedInferno] with 2 dragons summoned - Inflicts [cbuff:Venom] with 3 dragons summoned - Inflicts [cbuff:Ichor] and [cbuff:CalamityMod/MarkedforDeath] with 4 dragons summoned + Inflicts [cbuff:Ichor] with 3 dragons summoned + Inflicts [cbuff:CalamityMod/MarkedforDeath] with 4 dragons summoned ''' } @@ -191,11 +196,6 @@ Cnidarian: { ''' } -CorroslimeStaff: { - DisplayName: Corroslime Staff - Tooltip: Summons a corro slime to fight for you -} - CorvidHarbringerStaff: { DisplayName: Corvid Harbinger Staff Tooltip: @@ -233,11 +233,6 @@ Cosmilamp: { Tooltip: Summons a cosmic lantern above your head to fight for you } -CrimslimeStaff: { - DisplayName: Crimslime Staff - Tooltip: Summons a crim slime to fight for you -} - CryogenicStaff: { DisplayName: Cryogenic Staff Tooltip: @@ -496,7 +491,7 @@ IgneousExaltation: { Summons an Igneous blade that orbits around you When your minion slots are full, again to launch all blades towards the cursor This ability has a two-second cooldown that requires holding this item - Shift- this item in your inventory to change the rotation direction + Press [KEY] while holding this item to change the rotation direction ''' } @@ -736,11 +731,7 @@ SquirrelSquireStaff: { StaffOfNecrosteocytes: { DisplayName: Staff of Necrosteocytes - Tooltip: - ''' - Summons small skeletons to fight for you - The skeletons leave behind bone cells as they move - ''' + Tooltip: Summons small skeletons to fight for you } StarspawnHelixStaff: { @@ -856,7 +847,7 @@ ViridVanguard: { All weapons inflict [cbuff:CalamityMod/SagePoison], which becomes more powerful the more weapons are summoned When all minion slots are full, again to spin up a flurry of slashes aimed at your cursor This ability has a five-second cooldown that requires holding this item - Shift- this item in your inventory to change the rotation direction + Press [KEY] while holding this item to change the rotation direction ''' } @@ -864,7 +855,8 @@ VoidConcentrationStaff: { DisplayName: Void Concentration Staff Tooltip: ''' - Surrounds you with dark energy, which makes all attacks deal 15% less damage + Summons an endless darkness that surrounds you with orbiting dark energies + While the dark energies are orbiting you, you take 15% less damage from all attacks to condense the energy onto a target, focusing your minions on them and creating homing beams When the focused enemy takes damage from any source, they will be struck by additional dark energies These dark energy are twice as strong when the strike was from a minion or sentry @@ -880,8 +872,10 @@ VoidEaterMarionette: { Repeated summons increase the length and power of the Devourer The Devourer attacks with [ceffect/dog:Divinity Devourer], [ceffect/dog:Faith Incinerator] and [ceffect/dog:Ultracosmic Maelstrom] Can play fetch with dropped items - Shift- this item in your inventory when the Devourer has been spawned to prioritize fetching + Press [KEY] while holding this item when the Devourer has been spawned to prioritize fetching ''' + FetchStart: Go fetch! + FetchEnd: Get 'em! } WarloksMoonFist: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson index e2748e631c..4f65eb625d 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson @@ -31,7 +31,7 @@ EyeofMagnus: { Tooltip: ''' Fires seeking cosmic masses that restore health and mana on hit - Explodes into a nebula cloud that cause enemies to become [cbuff:CalamityMod/MarkedforDeath] + Explodes into a nebula cloud that causes enemies to become [cbuff:CalamityMod/MarkedforDeath] {$Common.AverageDamageInfo} ''' } @@ -49,14 +49,11 @@ RelicOfDeliverance: { DisplayName: Relic of Deliverance Tooltip: ''' - Using mounts you on the spear; holding revvs the spear, slowing you down - Release to launch yourself at high speeds, halved while a boss is alive - Losing too much speed while charging will bust the charge, resetting your speed - The dash allows you to ram through enemies and travel through tiles - Being inside tiles for too long will warp you back to where you entered + Hold to mount and charge the spear, dashing towards your mouse when the button is released + The speed of the dash depends on the charge amount, and is reduced while a boss is alive + The dash can ram through enemies and travel through tiles Press to dismount Holding out the spear heavily reduces the damage of all summons - {$Common.AverageDamageInfo} [c/FF8C00:Vengeance fueled me, I had no thought other than exactment.] [c/FF8C00:The dragon took everything from me, leaving my broken pieces strewn on the ground.] [c/FF8C00:But when I danced by Her side, I knew there was still something worth fighting for.] diff --git a/Localization/en-US/Mods.CalamityMod.Keybinds.hjson b/Localization/en-US/Mods.CalamityMod.Keybinds.hjson index b139893fdb..1d7f6b5baf 100644 --- a/Localization/en-US/Mods.CalamityMod.Keybinds.hjson +++ b/Localization/en-US/Mods.CalamityMod.Keybinds.hjson @@ -1,19 +1,17 @@ -ActivateAccessoryParry.DisplayName: Activate Accessory Parry AdrenalineMode.DisplayName: Adrenaline Mode -AmmoCycle.DisplayName: Ammo Cycle Hotkey -AngelicAllianceBlessing.DisplayName: Angelic Alliance Blessing ArmorSetBonus.DisplayName: Armor Set Bonus -AscendantInsigniaHotKey.DisplayName: Ascendant Insignia Flight -BoosterDash.DisplayName: Booster Dash DashDoubleTapOverride.DisplayName: Dash Double Tap Override ExoChairSlowDown.DisplayName: Exo Chair Slow Down GodSlayerDash.DisplayName: Dimensional Drive -GravistarSabatonHotkey.DisplayName: Interstellar Stompers Slam NormalityRelocator.DisplayName: Normality Relocator RageMode.DisplayName: Rage Mode -SpectralVeilTeleport.DisplayName: Spectral Veil Teleport -TransformerHotKey.DisplayName: Transformer Hot Key GravitySwapOverride.DisplayName: Gravity Swap Override ExpandDebuffInfo.DisplayName: See Debuff Information -ThePointerLock.DisplayName: The Pointer Lock On -SpringStoolJumpHotKey.DisplayName: Spring Stool Jump Hotkey +HeldItem.DisplayName: Held Item Ability +Accessory1.DisplayName: Accessory Ability 1 +Accessory2.DisplayName: Accessory Ability 2 +Accessory3.DisplayName: Accessory Ability 3 +Accessory4.DisplayName: Accessory Ability 4 +Accessory5.DisplayName: Accessory Ability 5 +Accessory6.DisplayName: Accessory Ability 6 +Accessory7.DisplayName: Accessory Ability 7 diff --git a/Localization/en-US/Mods.CalamityMod.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Misc.hjson index 873189767c..a7c5075c8c 100644 --- a/Localization/en-US/Mods.CalamityMod.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Misc.hjson @@ -128,3 +128,4 @@ GFBRougeUppercase: Rouge GFBRogueLowercase: rogue GFBRougeLowercase: rouge HotkeyNotBound: "[None]" +HotkeyNotEquipped: an Accessory Ability hotkey diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index 036bffd957..7e367e0507 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -284,6 +284,7 @@ SupremeCalamitas.DisplayName: Supreme Witch, Calamitas SupremePermafrost: Supreme Ultramage, Permafrost SupremeCataclysm.DisplayName: Cataclysm SupremeCatastrophe.DisplayName: Catastrophe +VolatileSlime.DisplayName: Volatile Slime Yharon.DisplayName: Yharon, Dragon of Rebirth YharonPhase2: Yharon, Resplendent Phoenix AndroombaFriendly.DisplayName: Androomba Pal @@ -336,7 +337,7 @@ Bandit: { Census.SpawnCondition: Have a {$ItemName.PlatinumCoin} [i:PlatinumCoin] in your inventory after defeating Skeletron Name: { - Laura: Laura + Taylor: Taylor Mie: Mie Bonnie: Bonnie Sarah: Sarah @@ -373,7 +374,7 @@ Bandit: { BrimstoneWitch: Hey, hey, has {0} seriously moved in here with us? Why??? Merchant: Don't tell {0}, but I took some of his stuff and replaced it with Angel Statues. NurseArmsDealer: Don't tell {0} that I was responsible for {1}'s injuries. - NamedLaura: The nice thing about maps is I can track anything that has fallen. + NamedTaylor: The nice thing about maps is I can track anything that has fallen. NamedPenelope: Imagine how fast you could throw if you just had more hands. NamedValerie: I also take food for currency. NamedRowan: Usually I only think of animals as food or target practice, but dragons are an exception. @@ -598,6 +599,7 @@ TownPiggy: { Techno: Techno JohnPork: John Pork Piglet: Piglet + Poogie: Poogie } Chat: { diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson index 4a28d5a5dc..a46f5fac1d 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson @@ -43,7 +43,9 @@ BloodRay.DisplayName: Blood Ray BlueBubble.DisplayName: Bubble BlushieStaffProj.DisplayName: Staff of Blushie BrimroseBeam.DisplayName: Brimrose Beam -BrimstoneHellfireballFriendly.DisplayName: Hellfireball +CalamitousDartFriendly.DisplayName: Calamitous Dart Friendly +CalamitousExplosionFriendly.DisplayName: Calamitous Explosion Friendly +CalamitousFireballFriendly.DisplayName: Calamitous Fireball Friendly CauldronProj.DisplayName: Smauldron CauldronProjSmall.DisplayName: Smaullerdron ChronoIcicleLarge.DisplayName: Chrono Icicle @@ -77,6 +79,8 @@ ExoVortex2.DisplayName: Subsuming Vortex FatesRevealFlame.DisplayName: Fate's Reveal FireImplosion.DisplayName: Swirling Backdraft FlareBoltProjectile.DisplayName: Flare Bolt +FleshTotemMinion.DisplayName: Flesh Totem Minion +FleshTotemSoul.DisplayName: Flesh Totem Soul ForbiddenAxeBlade.DisplayName: Ruin Blade ForbiddenSunburst.DisplayName: Sunburst ForbiddenSunProjectile.DisplayName: Forbidden Sun @@ -96,7 +100,6 @@ HadalUrnLamprey.DisplayName: Sea Lamprey HadalUrnStarfish.DisplayName: Marianan Starfish HadalUrnStarfishShard.DisplayName: Starfish Shard HeliumFlashBlast.DisplayName: Helium Flash -HellfireExplosionFriendly.DisplayName: Explosion HellwingBat.DisplayName: Ashen Hellwing HolyFlame.DisplayName: Holy Flame HolyLaser.DisplayName: Holy Laser @@ -149,6 +152,7 @@ MelterNote2.DisplayName: Melter Song MeteorStar.DisplayName: Meteor Star MeteorStarExplosion.DisplayName: Explosion MiasmaGas.DisplayName: Miasma Gas +MoonSigil.DisplayName: Moon Sigil NanoPurgeLaser.DisplayName: Nano Beam NebulaCloud.DisplayName: Nebula Cloud NebulaCloudCore.DisplayName: Nebula Cloud Core @@ -186,7 +190,6 @@ PrinceFlameSmall.DisplayName: Holy Fire RainbowComet.DisplayName: Comet RainbowRocket.DisplayName: Rainbow Rocket RancorArm.DisplayName: Vengeful Arm -RancorFog.DisplayName: The Fog Is Coming RancorLargeCinder.DisplayName: Lava Cinder RancorLaserbeam.DisplayName: The Angy Beam RancorMagicCircle.DisplayName: Magic Circle @@ -228,6 +231,7 @@ SoulPiercerBeam.DisplayName: Soul Piercer SoulPiercerBolt.DisplayName: Soul Piercer SparkInfernal.DisplayName: Spark SparklingLaser.DisplayName: Sparkling Laser +SpectralFeather.DisplayName: Spectral Feather SpiritCongregation.DisplayName: Spirit Monster SpiritDust.DisplayName: Spirit Dust Starblast.DisplayName: Star @@ -288,7 +292,3 @@ WyvernFeatherPurple.DisplayName: Feather WyvernProjectile.DisplayName: Wyvern YharimsCrystalBeam.DisplayName: Yharim's Beam YharimsCrystalPrism.DisplayName: Yermes Christal -FleshTotemMinion.DisplayName: Flesh Totem Minion -FleshTotemSoul.DisplayName: Flesh Totem Soul -SpectralFeather.DisplayName: Spectral Feather -MoonSigil.DisplayName: Moon Sigil diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index 1dd7bb9076..b3e4d3ef8c 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -105,6 +105,7 @@ EmpyreanKnife.DisplayName: Empyrean Knife EntropicFlechette.DisplayName: Entropic Flechette EonBolt.DisplayName: Eon Bolt EssenceScythe.DisplayName: Essence Scythe +EvilSmasherProjectile.DisplayName: Evil Smasher ExaltedOathbladeThrownBlade.DisplayName: Exalted Oathblade Thrown Blade MawOfInfinityHoldout.DisplayName: Maw of Infinity MawOfInfinityJaws.DisplayName: Divinity Devourer @@ -186,6 +187,8 @@ NeptuneOrb.DisplayName: Neptune's Trident NeptunesBountyProjectile.DisplayName: Neptune's Bounty NeptunesBountySplitProjectile.DisplayName: Neptune's Bounty Jet OathswordFlame.DisplayName: Oathsword Flame +OblivionFire.DisplayName: Oblivion Fire +OblivionBolt.DisplayName: Oblivion Bolt Orbacle.DisplayName: Auric Orb OrderbringerBeam.DisplayName: Orderbringer Beam OrderbringerWaveProj.DisplayName: Order-bringing Wave @@ -311,4 +314,3 @@ WulfrumScrew.DisplayName: Wulfrum Screw WulfrumScrewdriverProj.DisplayName: Wulfrum Screwdriver YinYoDark.DisplayName: Dark Shard YinYoLight.DisplayName: Light Shard -EvilSmasherProjectile.DisplayName: Evil Smasher diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index 6016a1e096..aef3579da9 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -1,3 +1,4 @@ +AbyssalFire.DisplayName: Abyssal Fire AcidRocket.DisplayName: Acid Rocket AdamAcceleratorBeam.DisplayName: Adamantite Particle Beam AMR2.DisplayName: AMR @@ -19,7 +20,9 @@ AuralisBullet.DisplayName: Auralis Bullet AuricBullet.DisplayName: Auric Bullet AuroraFire.DisplayName: Aurora Blaze BallistaGreatArrow.DisplayName: Ballista Great Arrow +BallistaShard.DisplayName: Ballista Shard BarinadeArrow.DisplayName: Fin Arrow +BlahajBlast.DisplayName: Blahaj Blast BlightFlames.DisplayName: Blight Flames BlissfulBombardierSplitProjectile.DisplayName: Profaned Mini-Rocket BloodBoilerFire.DisplayName: Blood Fire @@ -130,6 +133,7 @@ MagnomalyExplosion.DisplayName: Explosion MagnomalyRocket.DisplayName: Nuke MarksmanShot.DisplayName: Marksman Shot MechanicalBarracuda.DisplayName: Barracuda +MegalodonRocket.DisplayName: Megalodon Rocket MegalodonShot.DisplayName: Megalodon Shot MeowCreature.DisplayName: the creature :3 MeowFire.DisplayName: Purr Fire @@ -148,6 +152,9 @@ NovaShot.DisplayName: Nova Bolt NukeOfBliss.DisplayName: Profaned Nuke NullFlash.DisplayName: Null Flash NullShot.DisplayName: Null +OmniSniperShot.DisplayName: Omni Sniper Shot +OmniGrenade.DisplayName: Omni Grenade +OmniShotgunShot.DisplayName: Omni Shotgun Shot OntologicalDespoilerBeam.DisplayName: Null-Annihilation Beam OntoligicalDespoilerBurst.DisplayName: Disruption Blast OntologicalDespoilerGrenade.DisplayName: Disruption Sphere @@ -259,14 +266,8 @@ VanquisherArrowMain.DisplayName: Vanquisher Arrow VanquisherArrowProj.DisplayName: Vanquisher Arrow Proj VeriumBoltProj.DisplayName: Verium Bolt VernalBolt.DisplayName: Vernal Bolt +VoidBlast.DisplayName: Void Blast WaterSpout.DisplayName: Spout WildfireBloomFire.DisplayName: Wildfire Fire WildfireBloomFlare.DisplayName: Wildfire Flare WulfrumScrapBullet.DisplayName: High Speed Scrap -AbyssalFire.DisplayName: Abyssal Fire -BlahajBlast.DisplayName: Blahaj Blast -MegalodonRocket.DisplayName: Megalodon Rocket -VoidBlast.DisplayName: Void Blast -OmniSniperShot.DisplayName: Omni Sniper Shot -OmniGrenade.DisplayName: Omni Grenade -OmniShotgunShot.DisplayName: Omni Shotgun Shot diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson index 44c29118dc..9e6b2f9f51 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson @@ -159,6 +159,8 @@ Knife.DisplayName: Knife KylieBoomerang.DisplayName: Kylie LanceofDestiny.DisplayName: Holy Lance LeadTomahawkProj.DisplayName: Lead Tomahawk +LemonNadeHoldout.DisplayName: Lemon 'nade +LemonNadeProjectile.DisplayName: Lemon 'nade LeonidCometBig.DisplayName: Leonid Comet LeonidCometSmall.DisplayName: Leonid Comet LeonidProgenitorBombshell.DisplayName: Leonid Bombshell @@ -189,6 +191,7 @@ NanoblackLightspeedCarve: { Standard: Light-speed Carve } +NanoblackLightspeedCarveSlashVisual.DisplayName: Nanoblack Light-speed Carve Visuals NanoblackMain.DisplayName: Nanoblack Reaper NanoblackPiercingStrike.DisplayName: Zero-Point Energy Strike NanoblackStrike.DisplayName: Zero-Point Energy Strike @@ -196,6 +199,7 @@ NanoblackTesselation.DisplayName: Nanoblack Tesselation NastyChollaBol.DisplayName: Nasty Cholla NastyChollaNeedle.DisplayName: Cactus Needle OrichalcumSpikedGemstoneProjectile.DisplayName: Orichalcum Gemstone +PaleoShatterExplosion.DisplayName: Paleo Shatter Explosion PalladiumJavelinProjectile.DisplayName: Palladium Javelin PartisanExplosion.DisplayName: Profaned Explosion PenumbraBomb.DisplayName: Penumbra Bomb @@ -275,11 +279,12 @@ SludgeSplotchProj2.DisplayName: Sludge Splotch SmallCoral.DisplayName: Small Coral SnapClamProj.DisplayName: Snap Clam SnapClamStealth.DisplayName: Snap Clam +SpadefishHoldout.DisplayName: Spinfish +SpadefishThrown.DisplayName: Spadefish SpearofDestinyProjectile.DisplayName: Destiny Spear SpearofDestinyStealth.DisplayName: Empowered Holy Lance SpearofDestinyStealthExplosion.DisplayName: Strong Burst SpearofPaleolithProj.DisplayName: Paleolith Spear -PaleoShatterExplosion.DisplayName: Paleo Shatter Explosion SpentFuelContainerProjectile.DisplayName: Spent Fuel Container SphereBladed.DisplayName: Bladed Sphere SphereBlue.DisplayName: Blue Thruster Sphere @@ -343,8 +348,3 @@ WrathwingCinder.DisplayName: Wrathwing Eruption WrathwingFireball.DisplayName: Wrathwing Fireball WrathwingSpear.DisplayName: Wrathwing WulfrumKnifeProj.DisplayName: Wulfrum Knife -NanoblackLightspeedCarveSlashVisual.DisplayName: Nanoblack Light-speed Carve Visuals -LemonNadeHoldout.DisplayName: Lemon 'nade -LemonNadeProjectile.DisplayName: Lemon 'nade -SpadefishHoldout.DisplayName: Spinfish -SpadefishThrown.DisplayName: Spadefish diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson index 121827ff82..da54d5ac0c 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson @@ -35,11 +35,10 @@ BlackDragonHead.DisplayName: Black Celestial Dragon BlackDragonTail.DisplayName: Black Celestial Dragon BlackHawkBullet.DisplayName: Black Hawk Bullet BlackHawkSummon.DisplayName: Black Hawk +BlightedSlimeMinion.DisplayName: Blighted Slime BloodBreath.DisplayName: Blood Dragon Fire BloodRain.DisplayName: Blood Rain BloodSpit.DisplayName: Blood Spit -BoneMatter.DisplayName: Bone Matter -BoneMatter2.DisplayName: Bone Matter BrimseekerAuraBall.DisplayName: Seeker BrimstoneDartMinion.DisplayName: Brimfire BrimstoneDartSummon.DisplayName: Brimstone Dart @@ -47,7 +46,7 @@ BrimstoneElementalMinion.DisplayName: Brimstone Elemental BrimstoneExplosionMinion.DisplayName: Explosion BrimstoneFireballMinion.DisplayName: Brimstone Fireball BrimstoneFireSummon.DisplayName: Brimstone Fire -BrimstoneLaserSummon.DisplayName: Brimstone Laser +BrimstoneLaserSummon.DisplayName: Vigil Mini Fireball BrittleStarMinion.DisplayName: Brittle Star CalamarisLamentMinion.DisplayName: Calamari CalamarisLamentProjectile.DisplayName: Calamari Ink @@ -64,8 +63,6 @@ CinderBlossom.DisplayName: Cinder Blossom CloudElementalMinion.DisplayName: Cloud Elemental CnidarianJellyfishOnTheString.DisplayName: Cnidarian CnidarianSpark.DisplayName: Cnidarian Spark -CorroslimeMinion.DisplayName: Corroslime -CorruptionSlimeGodMinion.DisplayName: Slime God CosmicBlast.DisplayName: Cosmic Blast CosmicBlastBig.DisplayName: Cosmic Blast CosmicEnergySpiral.DisplayName: Cosmic Energy @@ -76,8 +73,6 @@ CosmicViperSplittingRocket.DisplayName: Splitting Rocket CosmicViperSummon.DisplayName: Cosmic Viper CosmilampBeam.DisplayName: Cosmic Beam CosmilampMinion.DisplayName: Cosmilamp -CrimslimeMinion.DisplayName: Crimslime -CrimsonSlimeGodMinion.DisplayName: Slime God DaedalusCrystal.DisplayName: Daedalus Crystal DaedalusCrystalShot.DisplayName: Crystal Shot DaedalusGolem.DisplayName: Daedalus Golem @@ -284,6 +279,7 @@ SquirrelSquireAcorn.DisplayName: Squirrel Acorn SquirrelSquireMinion.DisplayName: Squirrel Squire Starforge.DisplayName: Starforge StarforgeBlast.DisplayName: Starforge Blast +StatigelBlightedSlime.DisplayName: Blighted Paladin StellarTorusBeam.DisplayName: Stellar Torus Beam StellarTorusSummon.DisplayName: Stellar Torus Summon StormjawBaby.DisplayName: Stormjaw Baby diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index dfdadd18a3..dc6ed38dc6 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -47,6 +47,7 @@ DevourerofCodsBobber.DisplayName: Devourer of Cods Bobber DiamondOfTheDeepProjectile.DisplayName: Abyss Spirit DirectStrike.DisplayName: Nondescript Damaging Entity DragonDust.DisplayName: Dust +DryadsTearBurst.DisplayName: Teardrop Ripple DunesandBallFalling.DisplayName: Dunesand Ball DuneSandBallGun.DisplayName: Dunesand Ball EarlyBloomBobber.DisplayName: Early Bloom Bobber diff --git a/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson b/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson index e9a1183133..72771697c9 100644 --- a/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson +++ b/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson @@ -120,7 +120,7 @@ SCalDesparationText4Rematch: I can't imagine what your future holds now. PermafrostSummonText: Are you prepared for a task most Sisyphean? PermafrostBirbSwarmText: Those hearts were a bit too brutal for my taste. How about some lovely birds instead? PermafrostBH2Text: Getting tired from the battle, adventurer? Hungry? How does some Delicious Meat sound? -PermafrostBH3Text: Suprised at how I am holding my own again you? I did train Calamitas, after all! +PermafrostBH3Text: Surprised at how I am holding my own again you? I did train Calamitas, after all! PermafrostDoGText: The serpent!? How!? What is HE doing here!? Is he here to torment me further!? Kill it, adventurer! PermafrostPhase2Text: Ha! I suppose I can no longer be "chill" about this duel! Get it? PermafrostBH4Text: Need a break? Can you not even keep up with an old man? diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index bd0c8302a5..213982f7b2 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -129,6 +129,7 @@ Cooldowns: { MasterChefShieldDurability: MJOLNIR Shield Level MasterChefShieldRecharge: MJOLNIR Shield Recharge NebulousCore: Nebulous Core Cooldown + OblivionCooldown: Oblivion Cooldown OldDukeScalesFatigue: Stamina OmegaBlueActive: Abyssal Madness OmegaBlueCooldown: Abyssal Madness Cooldown diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson index c51e9e1dad..7992346408 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson @@ -16,7 +16,7 @@ SetBonus: { {0}% increased max speed and acceleration You gain a damage and critical strike chance boost relative to your current movement speed, up to {0}% ''' - Melee: 10% increased melee damage + Melee: 10% increased melee speed } Copper: Increases all damage by {0} @@ -48,11 +48,7 @@ SetBonus: { {0}% increased damage which scales based on how far the target is from you Closer range grants melee damage, while farther range grants ranged damage ''' - Gladiator: - ''' - +60 maximum stealth - 5% increased rogue damage and 10% increased velocity - ''' + Gladiator: +{0} maximum stealth Gold: ''' All enemies have a {0}% chance to drop 1 extra gold diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index 4ce439ea10..5298cbc8cb 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -128,11 +128,7 @@ EditedTooltip: { */ Campfires: Life regen is increased by 0.5 HP/s when near a campfire HeartLantern: Grants +1 HP/s life regeneration when placed nearby - BottledHoney: - ''' - Grants +1 HP/s life regen for a short time - Grants an additional +1 HP/s life regen while inflicted with a damaging debuff - ''' + BottledHoney: Grants the [cbuffplr:Honey] buff for 15 seconds ShinyStone: Grants +2 HP/s life regen and accelerates natural life regen when not moving BandofRegeneration: Grants +1 HP/s life regeneration CharmofMyths: Grants +1 HP/s life regeneration and reduces the cooldown of healing potions by 25% @@ -183,13 +179,13 @@ EditedTooltip: { ''' FrogLeg: Increases jump speed by {0}% and allows auto-jump // Soaring Insignia - EmpressFlightBooster1: Increases wing flight time by 33% + EmpressFlightBooster1: Grants 2.5 additional seconds of flight time EmpressFlightBooster2: Increases movement speed by 7.5%, jump speed by 10%, and acceleration by 1.25x GravityGlobe: ''' - Provides 32% increased jump speed and increased fall speed + Provides 40% increased jump speed and increased fall speed Provides a gravitational boost jump, which recharges whenever gravity is flipped - Slightly improves wingless air movement speed + Improves wingless air movement speed Press {$Key.UP} to change gravity Press {$Key.DOWN} to fall faster ''' @@ -199,6 +195,12 @@ EditedTooltip: { All attacks light enemies on fire 'Never get cold feet again' ''' + VolatileGelatin: + ''' + Every 5 volatile gelatins that hit, a winged Volatile Slime will spawn, up to a max of 6 + Each Volatile Slime provides 5% increased jump speed and 0.3 seconds of flight time + Running out of flight time will remove the Volatile Slime's wings and detach them from you + ''' /* Armor */ @@ -400,7 +402,7 @@ TavernkeepChat.FullMoon: Care for a little Moonshine? TaxCollectorChat: { DoGDefeated: Devourer of what, you said? Devourer of Funds, if its payroll is anything to go by! PreBrimmy: So those punks on Azafure think they can live for free on my lands? Tell you what, do my job there and I might give you a bonus. - HasSlickCane: Goodness! That cane has swagger! + HasWalkingCane: Goodness! That cane has swagger! Has100Plat: BAH! Doesn't seem like I'll ever be able to quarrel with the debts of the town again! Has500Plat: Where and how are you getting all of this money?! Scram, you have no need for me! } @@ -523,7 +525,7 @@ TownNPCMood: { PartyGirl: { Monument: Yeeesh, we're gonna have an ugly statue of big money around? That like, totally kills the party mood around here. GiftPositive: PARTY GIFTS? FOR ME? Oh just you wait, I'm gonna throw the BIGGEST party this town has ever seen, forever and always! - GiftNegative: I knew you were trouble when you walked in that suspicious looking box! It's too late now to say sorry! + GiftNegative: I knew you were trouble when you walked in with that suspicious looking box! It's too late now to say sorry! } Pirate: { diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index f8e3246eb3..237ee67bae 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -877,90 +877,6 @@ namespace CalamityMod public static bool DisableAllDodges(bool disable) => Main.LocalPlayer.Calamity().disableAllDodges = disable; #endregion - #region Amalgam Potion Buff List - public static bool SetAmalgamBuffList(int type, bool shouldBeListed) - { - if (shouldBeListed && !CalamityBuffSets.BuffedByAmalgam[type]) - { - CalamityBuffSets.BuffedByAmalgam[type] = true; - return true; - } - else if (!shouldBeListed) - { - CalamityBuffSets.BuffedByAmalgam[type] = false; - return false; - } - - return false; - } - public static bool SetPersistentBuffList(int type, bool isPersistent) - { - if (isPersistent && !CalamityBuffSets.IsPersistentBuff[type]) - { - CalamityBuffSets.IsPersistentBuff[type] = true; - return true; - } - else if (!isPersistent) - { - CalamityBuffSets.IsPersistentBuff[type] = false; - return false; - } - - return false; - } - - public static bool IsOnAmalgamBuffList(int type) => CalamityBuffSets.BuffedByAmalgam[type]; - public static bool IsOnPersistentBuffList(int type) => CalamityBuffSets.IsPersistentBuff[type]; - #endregion - - #region Venerated Locket Bans - public static bool AddToVeneratedLocketBanlist(int type) - { - if (!CalamityItemSets.DisablesVeneratedLocketEffect[type]) - { - CalamityItemSets.DisablesVeneratedLocketEffect[type] = true; - return true; - } - return false; - } - #endregion - - #region Summoner Cross Class Nerf Disabling - public static bool SetSummonerNerfDisabledByMinion(int type, bool disableNerf) - { - if (disableNerf && !CalamityProjectileSets.MinionWhichIgnoresSummonerNerf[type]) - { - CalamityProjectileSets.MinionWhichIgnoresSummonerNerf[type] = true; - return true; - } - else if (!disableNerf) - { - CalamityProjectileSets.MinionWhichIgnoresSummonerNerf[type] = false; - return false; - } - - return false; - } - public static bool SetSummonerNerfDisabledByItem(int type, bool disableNerf) - { - if (disableNerf && !CalamityItemSets.ItemWhichDisablesSummonerNerf[type]) - { - CalamityItemSets.ItemWhichDisablesSummonerNerf[type] = true; - return true; - } - else if (!disableNerf) - { - CalamityItemSets.ItemWhichDisablesSummonerNerf[type] = false; - return false; - } - - return false; - } - - public static bool GetSummonerNerfDisabledByMinion(int type) => CalamityProjectileSets.MinionWhichIgnoresSummonerNerf[type]; - public static bool GetSummonerNerfDisabledByItem(int type) => CalamityItemSets.ItemWhichDisablesSummonerNerf[type]; - #endregion - #region Debuff Display support public static void RegisterDebuff(string texturePath, Predicate debuffCheck) { @@ -1038,19 +954,6 @@ namespace CalamityMod } #endregion - #region Adding minions to boss hp scaling config - //This is to add minions to the hp scaling config - public static bool AddToHPScaling(int type) - { - if (!CalamityNPCSets.ScalesHealthLikeBoss[type]) - { - CalamityNPCSets.ScalesHealthLikeBoss[type] = true; - return true; - } - return false; - } - #endregion - #region Call public static object Call(params object[] args) @@ -2075,55 +1978,6 @@ namespace CalamityMod CalamityMod.Log.Warn("This mod call is deprecated. Calamity automatically registers cooldowns."); return null; - case "GetSummonerNerfDisabledByItem": - if (args.Length != 2 || !isValidItemArg(args[1])) - return new ArgumentException("ERROR: Must specify a valid item to check status of."); - return GetSummonerNerfDisabledByItem(castItem(args[1]).type); - - case "GetSummonerNerfDisabledByMinion": - if (args.Length != 2 || !isValidProjectileArg(args[1])) - return new ArgumentException("ERROR: Must specify a valid projectile to check status of."); - return GetSummonerNerfDisabledByMinion(castProjectile(args[1]).type); - - case "SetSummonerNerfDisabledByItem": - if (args.Length < 2 || !isValidItemArg(args[1])) - return new ArgumentException("ERROR: Must specify a valid item to set the status of."); - if (args.Length != 3 || args[2] is not bool disableNerf) - return new ArgumentException("ERROR: Must specify a bool that determines whether the summoner nerf is disabled."); - return SetSummonerNerfDisabledByItem(castItem(args[1]).type, disableNerf); - - case "SetSummonerNerfDisabledByMinion": - if (args.Length < 2 || !isValidItemArg(args[1])) - return new ArgumentException("ERROR: Must specify a valid projectile to set the status of."); - if (args.Length != 3 || args[2] is not bool disableNerf2) - return new ArgumentException("ERROR: Must specify a bool that determines whether the summoner nerf is disabled."); - return SetSummonerNerfDisabledByItem(castItem(args[1]).type, disableNerf2); - - case "IsOnAmalgamBuffList": - if (args.Length != 2 || !castID(args[1], out int buffType)) - return new ArgumentException("ERROR: Must specify a valid buff ID to check status of."); - return IsOnAmalgamBuffList(buffType); - - case "IsOnPersistentBuffList": - case "IsPersistentBuff": - if (args.Length != 2 || !castID(args[1], out int buffType2)) - return new ArgumentException("ERROR: Must specify a valid buff ID to check status of."); - return IsOnPersistentBuffList(buffType2); - - case "SetAmalgamBuffList": - if (args.Length < 2 || !castID(args[1], out int buffType3)) - return new ArgumentException("ERROR: Must specify a valid buff ID to set the status of."); - if (args.Length != 3 || args[2] is not bool shouldBeListed) - return new ArgumentException("ERROR: Must specify a bool that determines whether the amalgam should enable extend the duration of this buff."); - return SetAmalgamBuffList(buffType3, shouldBeListed); - - case "SetPersistentBuffList": - if (args.Length < 2 || !castID(args[1], out int buffType4)) - return new ArgumentException("ERROR: Must specify a valid buff ID to set the status of."); - if (args.Length != 3 || args[2] is not bool isPersistent) - return new ArgumentException("ERROR: Must specify a bool that determines whether the buff is persistent after death for the Amalgam to properly reset."); - return SetPersistentBuffList(buffType4, isPersistent); - case "CreateCodebreakerDialogOption": // NOTE: This is a legacy variant of this call. The variant with three arguments is the standard. if (args.Length == 4) @@ -2143,13 +1997,6 @@ namespace CalamityMod return null; - case "AddToVeneratedLocketBanlist": - if (args.Length < 2) - return new ArgumentException("ERROR: Not enough arguments!"); - if (args[1] is not int itemType) - return new ArgumentException("ERROR: Must specify a valid item type as an int index of the item."); - return AddToVeneratedLocketBanlist(itemType); - case "RegisterDebuff": case "AddToDebuffDisplay": case "AddDebuffDisplay": @@ -2247,16 +2094,6 @@ namespace CalamityMod AndroombaFriendly.customConversionTypes.Add((itemID, texturePath, NPCaction)); return null; } - case "AddMinibossToHPScalingConfig": - case "AddMinionToHPScalingConfig": - case "AddToBossHPScalingConfig": - { - if (args.Length < 2) - return new ArgumentNullException("ERROR: Must specify an NPC id/type as an int or short ID. Example: NPCType()"); - if (!castID(args[1], out int npcType6)) - return new ArgumentException("ERROR: The first argument to \"AddToBossHPScalingConfig\" must be an int or short ID."); - return AddToHPScaling(npcType6); - } case "GetDebuffDamage": { if (args.Length < 2) @@ -2268,7 +2105,10 @@ namespace CalamityMod case "GetDebuffDamageFunction": //This exists because Calamity's Mod Call lookup is slow due to this string switch, and this method may be called hundreds of times per frame by some addons. return (object)DebuffData.GetDebuffRegenValue; default: - return new ArgumentException("ERROR: Invalid method name."); + { + CalamityMod.Log.Warn($"{methodName} is an invalid method name for Calamity Mod. Are you calling a method which no longer exists?"); + return null; + } } } #endregion diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 6aec151c76..deff3f2114 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -1173,8 +1173,7 @@ namespace CalamityMod RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); - RegisterSummon(ItemType(), BuffType(), ProjectileType()); - RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); diff --git a/NPCs/AcidRain/BabyFlakCrab.cs b/NPCs/AcidRain/BabyFlakCrab.cs index 5fc75e32ee..58a3eca580 100644 --- a/NPCs/AcidRain/BabyFlakCrab.cs +++ b/NPCs/AcidRain/BabyFlakCrab.cs @@ -130,7 +130,7 @@ namespace CalamityMod.NPCs.AcidRain public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.PlayerSafe || !spawnInfo.Player.Calamity().ZoneSulphur || !DownedBossSystem.downedAquaticScourge) + if (spawnInfo.PlayerSafe || !spawnInfo.Player.Calamity().ZoneSulphur) { return 0f; } diff --git a/NPCs/AcidRain/Orthocera.cs b/NPCs/AcidRain/Orthocera.cs index 13eaba493e..c674e58cd9 100644 --- a/NPCs/AcidRain/Orthocera.cs +++ b/NPCs/AcidRain/Orthocera.cs @@ -7,6 +7,7 @@ using CalamityMod.Graphics.Metaballs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Particles; using CalamityMod.Projectiles.Enemy; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; @@ -208,7 +209,8 @@ namespace CalamityMod.NPCs.AcidRain NPC.Calamity().newAI[0]++; if (NPC.Calamity().newAI[0] % 5 == 0 && Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Bottom, Main.rand.NextVector2Circular(4f, 8f), ModContent.ProjectileType(), 0, 0f, Main.myPlayer); + RancorFog fog = new(NPC.Bottom, Main.rand.NextVector2Circular(4f, 8f), 180, Main.rand.NextFloat(1f, 1.7f), Main.rand.NextFloat(MathHelper.TwoPi)); + GeneralParticleHandler.SpawnParticle(fog, false, Enums.GeneralDrawLayer.BeforeNPCs); RancorLavaMetaball.SpawnParticle(NPC.Bottom + Main.rand.NextVector2Circular(10f, 10f), 135f); } if (NPC.Calamity().newAI[0] % 30 == 0 && Main.netMode != NetmodeID.MultiplayerClient) diff --git a/NPCs/AcidRain/Radiator.cs b/NPCs/AcidRain/Radiator.cs index 54e09b8fbb..3222aa67cf 100644 --- a/NPCs/AcidRain/Radiator.cs +++ b/NPCs/AcidRain/Radiator.cs @@ -8,6 +8,7 @@ using CalamityMod.Items.Placeables.Banners; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.GameContent.ItemDropRules; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -17,7 +18,7 @@ namespace CalamityMod.NPCs.AcidRain { public override void SetStaticDefaults() { - Main.npcFrameCount[Type] = 4; + Main.npcFrameCount[Type] = 8; } public override void SetDefaults() @@ -52,7 +53,6 @@ namespace CalamityMod.NPCs.AcidRain AIType = NPCID.GlowingSnail; Banner = NPC.type; BannerItem = ModContent.ItemType(); - NPC.catchItem = (short)ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; @@ -68,8 +68,24 @@ namespace CalamityMod.NPCs.AcidRain }); } + public override void OnSpawn(IEntitySource source) + { + if (Main.rand.NextBool(10)) + { + NPC.frame.Y = NPC.height * 4; + NPC.catchItem = (short)ModContent.ItemType(); + NPC.damage = 0; + } + } + public override void AI() { + if (NPC.damage == 0) + { + Lighting.AddLight(NPC.Center, 0.7f, 0.7f, 0.7f); + return; + } + Lighting.AddLight(NPC.Center, 0.3f, 1.5f, 0.3f); if (!Main.dedServ) @@ -96,7 +112,11 @@ namespace CalamityMod.NPCs.AcidRain { NPC.frameCounter = 0; NPC.frame.Y += frameHeight; - if (NPC.frame.Y > frameHeight * 2) + if (NPC.frame.Y > frameHeight * 6) + { + NPC.frame.Y = frameHeight * 4; + } + else if (NPC.frame.Y > frameHeight * 2 && NPC.frame.Y < frameHeight * 4) { NPC.frame.Y = 0; } diff --git a/NPCs/AcidRain/Radiator.png b/NPCs/AcidRain/Radiator.png index cab779ed68..e980f0ad82 100644 Binary files a/NPCs/AcidRain/Radiator.png and b/NPCs/AcidRain/Radiator.png differ diff --git a/NPCs/BaseWormNPC.cs b/NPCs/BaseWormNPC.cs index 94fd866295..15401cd837 100644 --- a/NPCs/BaseWormNPC.cs +++ b/NPCs/BaseWormNPC.cs @@ -645,6 +645,11 @@ namespace CalamityMod.NPCs //The segments near a player spawn a hitbox NPC to allow damaging players and taking damage public abstract class BaseWormHitboxNPC : ModNPC { + public override void SetStaticDefaults() + { + this.HideFromBestiary(); + } + public override void SetDefaults() { NPC.width = 200; @@ -652,6 +657,7 @@ namespace CalamityMod.NPCs NPC.lifeMax = 10000; NPC.knockBackResist = 0; NPC.noTileCollide = true; + NPC.dontCountMe = true; NPC.aiStyle = -1; } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index cd0624330d..732b8af651 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -288,6 +288,7 @@ namespace CalamityMod.NPCs public bool crumble = false; public int antlionCloudDebuffTimer = 0; + public int caneInsanityTimer = 0; public bool scionsCurioEffected = false; public bool abaddonEffected = false; public bool apollyonEffected = false; @@ -569,6 +570,7 @@ namespace CalamityMod.NPCs myClone.crumble = crumble; myClone.antlionCloudDebuffTimer = antlionCloudDebuffTimer; + myClone.caneInsanityTimer = caneInsanityTimer; myClone.scionsCurioEffected = scionsCurioEffected; myClone.abaddonEffected = abaddonEffected; myClone.apollyonEffected = apollyonEffected; @@ -799,6 +801,8 @@ namespace CalamityMod.NPCs if (antlionCloudDebuffTimer > 0) antlionCloudDebuffTimer--; + if (caneInsanityTimer > 0) + caneInsanityTimer--; if (cursorFocus > 0 && cursorFocus < cursorFocusMax) cursorFocus--; relicOfResilienceWeakness = false; @@ -3550,7 +3554,7 @@ namespace CalamityMod.NPCs modifiers.HideCombatText(); // Block natural falling stars from killing boss spawners randomly - if (projectile.type == ProjectileID.FallingStar && projectile.damage >= 1000 && (npc.type == NPCType() || npc.type == NPCType() || npc.type == NPCType())) + if (projectile.type == ProjectileID.FallingStar && projectile.damage >= 1000 && CalamityNPCSets.ProtectedHostileNPC[npc.type]) modifiers.SourceDamage *= 0f; // Supercrits @@ -4506,8 +4510,10 @@ namespace CalamityMod.NPCs if (ashesOnDeath > 0) { if (Main.rand.NextBool(4)) - Projectile.NewProjectile(npc.GetSource_FromThis(), npc.Center, Main.rand.NextVector2Circular(2.75f, 6.5f), ProjectileType(), 0, 0f, Main.myPlayer, 0f, 0.475f); - + { + RancorFog fog = new(npc.Center, Main.rand.NextVector2Circular(2.75f, 6.5f), 180, Main.rand.NextFloat(0.45f, 0.75f), Main.rand.NextFloat(MathHelper.TwoPi)); + GeneralParticleHandler.SpawnParticle(fog, false, Enums.GeneralDrawLayer.BeforeNPCs); + } if (Main.rand.NextBool(6)) { Vector2 randomPosition = new(npc.position.X + Main.rand.NextFloat(-10f, npc.width + 10f), npc.position.Y + Main.rand.NextFloat(-10f, npc.height + 10f)); @@ -4776,7 +4782,7 @@ namespace CalamityMod.NPCs if (npc.type == NPCID.VileSpit || npc.type == NPCID.VileSpitEaterOfWorlds) return new Color(150, 200, 0, npc.alpha); - if (npc.type == NPCID.AncientDoom || npc.type == NPCID.QueenSlimeMinionBlue || npc.type == NPCID.QueenSlimeMinionPink || npc.type == NPCID.QueenSlimeMinionPurple) + if (npc.type == NPCID.QueenSlimeMinionBlue || npc.type == NPCID.QueenSlimeMinionPink || npc.type == NPCID.QueenSlimeMinionPurple) return new Color(255, 255, 255, npc.alpha); return null; @@ -4865,6 +4871,29 @@ namespace CalamityMod.NPCs return DrawVanillaBestiaryWorms(spriteBatch, npc, drawColor); } } + + if (caneInsanityTimer > 0) + { + Texture2D tex = TextureAssets.Npc[npc.type].Value; + Rectangle frame = npc.frame; + float fadeInAmt = caneInsanityTimer > 570 ? Utils.GetLerpValue(600, 570, caneInsanityTimer) : caneInsanityTimer < 30 ? Utils.GetLerpValue(0, 30, caneInsanityTimer) : 1f; + Vector2 origin = new Vector2(tex.Width / 2, tex.Height / Main.npcFrameCount[npc.type] / 2); + SpriteEffects sp = npc.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Vector3 colorHSL = Main.rgbToHsl(Color.Violet); + + CalamityUtils.EnterShaderRegion(spriteBatch); + GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(1f); + GameShaders.Misc["CalamityMod:BasicTint"].UseSaturation(fadeInAmt * 0.35f); + GameShaders.Misc["CalamityMod:BasicTint"].UseColor(Main.hslToRgb(1f - colorHSL.X, colorHSL.Y, colorHSL.Z)); + GameShaders.Misc["CalamityMod:BasicTint"].Apply(); + for (int i = 0; i < 4; i++) + { + Vector2 offset = Vector2.UnitX.RotatedBy(Main.GlobalTimeWrappedHourly * MathHelper.TwoPi * 2f + (MathHelper.TwoPi * i / 4f)) * 6f * fadeInAmt; + Main.EntitySpriteDraw(tex, npc.Center - screenPos - Vector2.UnitY * (npc.gfxOffY) + offset, frame, Color.Violet, npc.rotation, origin, npc.scale, sp); + } + CalamityUtils.ExitShaderRegion(spriteBatch); + } + if (npc.type != NPCID.BrainofCthulhu && (npc.type != NPCID.DukeFishron || npc.ai[0] <= 9f) && npc.active) { if (CalamityClientConfig.Instance.DebuffDisplay && (npc.boss || BossHealthBarManager.MinibossHPBarList.Contains(npc.type) || BossHealthBarManager.OneToMany.ContainsKey(npc.type) || CalamityNPCSets.ForceDrawDebuffDisplay[npc.type])) diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index fc2a6c5711..a826f0b013 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -104,10 +104,10 @@ namespace CalamityMod.NPCs #region Sky / Space // Harpy - // Sky Glaze @ 3.33% IF Eye of Cthulhu dead + // Sky Glaze @ 3.33% // Essence of Sunlight @ 50% IF Hardmode and not statue spawned case NPCID.Harpy: - postEoC.Add(ModContent.ItemType(), 30); + npcLoot.Add(ModContent.ItemType(), 30); hardmode.AddIf(() => !npc.SpawnedFromStatue, ModContent.ItemType(), 2); break; @@ -444,12 +444,12 @@ namespace CalamityMod.NPCs break; // Chaos Elemental - // Rod of Discord @ 1% Normal, 2% Expert+ + // Rod of Discord @ 0.8% Normal, 1% Expert+ case NPCID.ChaosElemental: // Remove the vanilla loot rule for Rod of Discord. npcLoot.RemoveWhere((rule) => rule is CommonDrop conditionalRule && conditionalRule.itemId == ItemID.RodofDiscord); // Define a replacement rule which has an increased chance. - npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.RodofDiscord, 100, 50)); + npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.RodofDiscord, 125, 100)); break; // Illuminant Bat @@ -538,8 +538,6 @@ namespace CalamityMod.NPCs npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 15, 10)); break; - // The ectoplasm extra drops got moved to the list section; just like moss hornets - // Hardmode Dungeon Melee Skeletons // Wisp in a Bottle @ 0.5% INSTEAD OF 0.25% case NPCID.RustyArmoredBonesAxe: @@ -604,10 +602,10 @@ namespace CalamityMod.NPCs break; // Fire Imp - // Ashen Stalactite @ 4%, 14.28% after defeating EoW/BoC + // Ashen Stalactite @ 4%, 8.33% after defeating EoW/BoC case NPCID.FireImp: npcLoot.AddIf((info) => !NPC.downedBoss2, ModContent.ItemType(), 25); - npcLoot.AddIf((info) => NPC.downedBoss2, ModContent.ItemType(), 7); + npcLoot.AddIf((info) => NPC.downedBoss2, ModContent.ItemType(), 12); break; // Demon, Voodoo Demon @@ -621,10 +619,10 @@ namespace CalamityMod.NPCs break; // Bone Serpent - // Old Lord Oathsword @ 4% Normal, 14.29% after defeating EoW/BoC + // Old Lord Oathsword @ 4% Normal, 12.5% after defeating EoW/BoC case NPCID.BoneSerpentHead: npcLoot.AddIf((info) => !NPC.downedBoss2, ModContent.ItemType(), 25); - npcLoot.AddIf((info) => NPC.downedBoss2, ModContent.ItemType(), 4); + npcLoot.AddIf((info) => NPC.downedBoss2, ModContent.ItemType(), 8); break; // Red Devil @@ -1196,7 +1194,8 @@ namespace CalamityMod.NPCs ItemID.LucyTheAxe, ItemID.PewMaticHorn, ItemID.WeatherPain, - ItemID.HoundiusShootius + ItemID.HoundiusShootius, + ModContent.ItemType() }; LCR_NotExpert.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, deerWeapons)); } @@ -1832,11 +1831,6 @@ DukeEditFailed: // Ancient Bone Dust @ 20% Normal, 33.33% Expert+ if (CalamityNPCTypeSets.Skeleton[npc.type]) npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 5, 3)); - - // All Hardmode Dungeon Enemies - // Ectoplasm @ 20% - if (CalamityNPCSets.IsBuffedDungeonEnemy[npc.type]) - npcLoot.Add(ItemID.Ectoplasm, 5); #endregion } #endregion diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index e30698c3d6..9291babd92 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -145,6 +145,7 @@ namespace CalamityMod.NPCs "The Cooler Arthur", // <@!568263512523014154> (gokuartillery) "Shark", // <@!874464051697172492> (congratsistrash) "Sagi", // <@!508233115781693441> (sagittariod) + "Jongler", // <@!373778045317808129> (madnard) ]; private static readonly string[] ClothierNames = [ @@ -153,6 +154,8 @@ namespace CalamityMod.NPCs "Magorfis Splunt the Greater Finklejim", // <@!147490809334333440> (eidolbyssus) "Perrin", // <@!253764551139393537> (easyperrin) "Spud McGee", // <@!727111000658018326> (starchman) + "Lumen Lucille", // <@!529392083136413696> (raiden_ii) + "Soup", // <@!100329863541444608> (djsnj20) ]; private static readonly string[] CyborgNames = [ @@ -191,7 +194,6 @@ namespace CalamityMod.NPCs "Tooshiboots", // <@!333532730593771522> (ulmod) "Neesh", // <@!175803493464932352> (xjetty) "Bars Boldia", // <@!332989575708540939> (careless_imp) - "Basel Raiden John Clive Fantasy 16", // <@!529392083136413696> (raiden_ii) "Gobby, Destroyer of Wallets", // <@!429024941296582658> (bwlstorm) "Potential Man", // <@!320787277007552512> (veruze) "Donny G", // <@!308736236523225088> (donnyg66) @@ -219,6 +221,7 @@ namespace CalamityMod.NPCs "Baggute", // <@!535140564174110720> (thebaggutegamer) "Jacob Bryson", // <@!879794107218817026> (.melongun) "ImaShoe", // <@!926957605056819261> (imashoe.) + "Exatron", // <@!291342874497515531> (diamondnife) ]; private static readonly string[] MechanicNames = [ @@ -235,6 +238,7 @@ namespace CalamityMod.NPCs "Morshu", // <@!194931581826236416> (uberransy) "Spamton G. Spamton", // <@!497146350438318101> (j.u.n.e.s) "Goldluna", // <@!442449102857568257> (goldluna) + "Vegetable", // <@!1416248900385247344> (kiwisourlemons) ]; private static readonly string[] NurseNames = [ @@ -256,6 +260,7 @@ namespace CalamityMod.NPCs "Typhäne", // <@!222064016107896832> (typhane.) "Charlotte Linlin", // <@!563406464522125323> (vixcalibur) "Shmizzle Dizzle", // <@!1070551501283528724> (shmizzledizzle) + "Daitaku Helios", // <@!700900181872345121> (_ichigoism) ]; private static readonly string[] PirateNames = [ @@ -280,6 +285,7 @@ namespace CalamityMod.NPCs "Yumesaki Mirrin", // <@!100235144744415232> (milinen) "Vela", // <@!208719047146209281> (nyxxynightstar) "Misako Drevis", // <@!1103067115386323065> (threadsofmemory) + "Embrylix", // <@!909842922910937099> (_necrotix_) ]; private static readonly string[] SantaClausNames = [ @@ -295,6 +301,7 @@ namespace CalamityMod.NPCs "Bone Cold Steve Austin", // <@!282704860992897024> (raendrag_of_rovan) "Them Bones", // <@!322208584534589450> (dogvtf) "Deep-Vein Thrombonesis", // <@!557473830457704458> (thessyll) + "Wing Gaster", // <@!1504946198136750135> (tkktkash) ]; private static readonly string[] SteampunkerNames = [ @@ -359,6 +366,7 @@ namespace CalamityMod.NPCs "Tequila", // <@!889175547744239677> (thecrispistofnuggets) "Bee Movie Script", // <@!407949998173454341> (literally_jesuschrist) "Which Doctor", // <@!746103484017016832> (sepulchre0001) + "Zecro", // <@!823582273004896268> (zecroexe) ]; private static readonly string[] WizardNames = [ @@ -374,6 +382,8 @@ namespace CalamityMod.NPCs "Derin", // <@!466703979695308820> (god_15) "Umbara", // <@!450062421294579712> (umbaraeclipse) "Reyloth Grey", // <@!255043013116428298> (pantyslack) + "Jimbo Baggins", // <@!563358554388692992> (thekiller12325) + "Shaby Morbals", // <@!815237130401349632> (nogreatnameleft) ]; private static readonly string[] ZoologistNames = [ @@ -381,7 +391,6 @@ namespace CalamityMod.NPCs "Lacuna", // <@!790746689211203604> (_lacuna_) "Mae Borowski", //<@!219158690433990656> (justakkolite) "Fera", // <@!195850711567826945> (juneark_) - "Gwenhwyvar", // <@!291342874497515531> (diamondnife) "Daxie", // <@!465438861103988737> (daxie626) "Zora", // <@!752687500656640030> (oxytoxy365) "Summer", // <@!608455754093035521> (haefer) @@ -420,6 +429,7 @@ namespace CalamityMod.NPCs "Miss Throws a Lot", // <@!799345607847182400> (oakhamsam) "Brikwilla", // <@!543803736909414438> (lavendercobra) "Melody", // <@!1030635650963214446> (weisslerren) + "Lord Foog the 2st", // <@!564984607200641024> (dominusx165) ]; private static readonly string[] TownDogLabradorNames = [ @@ -464,6 +474,7 @@ namespace CalamityMod.NPCs "Octo", // <@!796112889353994281> (octolinggrimm) "Kreska", // <@!130037366852157440> (nuclearnecro) "Meokei", // <@!230839680076218378> (azurlia) + "Kyubey", // <@!899044218167771146> (thewetsock7) ]; private static readonly string[] TownCatSiameseNames = [ @@ -496,6 +507,9 @@ namespace CalamityMod.NPCs private static readonly string[] TownCatSilverNames = [ "Archie", // <@!303022375191183360> (jackshiz) + "Starkey", // <@!133327709236494337> (scraak) + "Cortana", // <@!336320956798599168> (sersupremo) + "Mario", // <@!1348497527359541248> (tsuki.hoshihime) ]; private static readonly string[] TownCatWhiteNames = null; @@ -509,6 +523,7 @@ namespace CalamityMod.NPCs [ "Poco", // <@!1192261996146593872> (tostitomuncher33) "Puffer", // <@!181103507711983616> (piky) + "W53 Nuclear Bomb", // <@!555779410788089861> (t_syrin_t) ]; private static readonly string[] TownBunnyWhiteNames = null; private static readonly string[] TownBunnyAngoraNames = null; @@ -1234,8 +1249,8 @@ namespace CalamityMod.NPCs chat = CalamityUtils.GetTextValue("Vanilla.TaxCollectorChat.DoGDefeated"); else if (Main.rand.NextBool(5) && !DownedBossSystem.downedBrimstoneElemental) chat = CalamityUtils.GetTextValue("Vanilla.TaxCollectorChat.PreBrimmy"); - else if (Main.rand.NextBool(10) && CalamityUtils.InventoryHas(Main.LocalPlayer, ItemType())) - chat = CalamityUtils.GetTextValue("Vanilla.TaxCollectorChat.HasSlickCane"); + else if (Main.rand.NextBool(10) && CalamityUtils.InventoryHas(Main.LocalPlayer, ItemType())) + chat = CalamityUtils.GetTextValue("Vanilla.TaxCollectorChat.HasWalkingCane"); else if (Main.rand.NextBool(5) && platinumCoins >= 500) chat = CalamityUtils.GetTextValue("Vanilla.TaxCollectorChat.Has500Plat"); else if (Main.rand.NextBool(5) && platinumCoins >= 100) @@ -1315,14 +1330,6 @@ namespace CalamityMod.NPCs defense += 20; } } - - public override bool? CanBeHitByProjectile(NPC npc, Projectile projectile) - { - // Not an axe but close enough - if (npc.type == NPCID.TaxCollector && projectile.type == ProjectileType()) - return true; - return base.CanBeHitByProjectile(npc, projectile); - } #endregion #region Shop Stuff @@ -1332,7 +1339,6 @@ namespace CalamityMod.NPCs Condition spelunkerGlowCondition = new(Language.GetText("Conditions.NightDayFullMoon"), () => !Main.dayTime || Main.GetMoonPhase() == MoonPhase.Full); // Identical to the one in NPCShopDatabase Condition hasFlareGunUpgrade = new(CalamityUtils.GetText("Condition.HasFlareGun"), () => (Main.LocalPlayer.HasItem(ItemType()) || Main.LocalPlayer.HasItem(ItemType())) && !Main.LocalPlayer.HasItem(ItemID.FlareGun)); - Condition bestiaryProgressLacewing = new(CalamityUtils.GetText("Condition.LacewingBestiary"), () => Main.GetBestiaryProgressReport().CompletionPercent >= 0.4f); Condition crescentMoons = new(CalamityUtils.GetText("Condition.CrescentMoons"), () => Main.GetMoonPhase() == MoonPhase.QuarterAtLeft || Main.GetMoonPhase() == MoonPhase.QuarterAtRight); // for Craw Carapace Condition gibbousMoons = new(CalamityUtils.GetText("Condition.GibbousMoons"), () => Main.GetMoonPhase() == MoonPhase.ThreeQuartersAtLeft || Main.GetMoonPhase() == MoonPhase.ThreeQuartersAtRight); // for Giant Shell @@ -1360,7 +1366,7 @@ namespace CalamityMod.NPCs { shop.Add(Condition.DownedSkeletron) .Add(Condition.Hardmode) - .AddWithCustomValue(ItemID.Boomstick, Item.buyPrice(gold: 25), Condition.DownedQueenBee) + .AddWithCustomValue(ItemID.Revolver, Item.buyPrice(gold: 35), Condition.Hardmode) .AddWithCustomValue(ItemID.Uzi, Item.buyPrice(gold: 50), Condition.DownedPlantera); } @@ -1438,10 +1444,10 @@ namespace CalamityMod.NPCs { shop.Add() .AddWithCustomValue(ItemID.MagicMissile, Item.buyPrice(gold: 25)) - .Add() - .Add() - .Add() - .Add(); + .Add(Condition.DownedMoonLord) + .Add(Condition.DownedMoonLord) + .Add(Condition.DownedMoonLord) + .Add(Condition.DownedMoonLord); } if (type == NPCID.WitchDoctor) @@ -1486,7 +1492,7 @@ namespace CalamityMod.NPCs if (type == NPCID.BestiaryGirl) { - shop.Add(ItemID.EmpressButterfly, bestiaryProgressLacewing); + shop.Add(ItemID.EmpressButterfly, Condition.BestiaryFilledPercent(40)); } if (type == NPCID.Truffle) diff --git a/NPCs/CalamityVanillaAIOverrideNPC.Global.cs b/NPCs/CalamityVanillaAIOverrideNPC.Global.cs index 33061a02d0..fd02cb8124 100644 --- a/NPCs/CalamityVanillaAIOverrideNPC.Global.cs +++ b/NPCs/CalamityVanillaAIOverrideNPC.Global.cs @@ -230,8 +230,8 @@ public sealed partial class CalamityVanillaAIOverrideNPC : GlobalNPC // Light colors int alpha = 192; - Color groundColor = new Color(150, 0, 0, alpha); - Color flightColor = revenge ? new Color(0, 0, 150, alpha) : groundColor; + Color groundColor = new Color(255, 125, 125, alpha); + Color flightColor = revenge ? new Color(125, 0, 255, alpha) : groundColor; Color segmentColor = Color.Lerp(groundColor, flightColor, phaseTransitionColorAmount); Color telegraphColor_Red = new Color(255, 125, 125, alpha); Color telegraphColor_Green = new Color(125, 255, 125, alpha); @@ -261,23 +261,17 @@ public sealed partial class CalamityVanillaAIOverrideNPC : GlobalNPC telegraphProgress = MathHelper.Clamp((calNPC.newAI[0] - telegraphGateValue) / DestroyerAI.LaserTelegraphTime, 0f, 1f); } } + Color finalColor = Color.Lerp(segmentColor, telegraphColor, telegraphProgress); + Vector3 teleHsl = Main.rgbToHsl(finalColor); - Texture2D glowTexture = CalamityClientConfig.Instance.EnableVanillaTextureEdits ? ExtraTextureRefs.DestroyerHeadGlowmask.Value : TextureAssets.Dest[0].Value; - switch (npc.type) - { - default: - case NPCID.TheDestroyer: - break; - case NPCID.TheDestroyerBody: - glowTexture = CalamityClientConfig.Instance.EnableVanillaTextureEdits ? ExtraTextureRefs.DestroyerBodyGlowmask.Value : TextureAssets.Dest[1].Value; - break; - case NPCID.TheDestroyerTail: - glowTexture = CalamityClientConfig.Instance.EnableVanillaTextureEdits ? ExtraTextureRefs.DestroyerTailGlowmask.Value : TextureAssets.Dest[2].Value; - break; - } + Texture2D glowTexture = TextureAssets.Dest[npc.type - 134].Value; - float alphaMultiplier = 1f - npc.alpha / 255f; - spriteBatch.Draw(glowTexture, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, Color.Lerp(segmentColor, telegraphColor, telegraphProgress) * alphaMultiplier, npc.rotation, halfSize, npc.scale, spriteEffects, 0f); + CalamityUtils.EnterShaderRegion(spriteBatch); + GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(1f); + GameShaders.Misc["CalamityMod:BasicTint"].UseColor(Main.hslToRgb(1f - teleHsl.X, teleHsl.Y, teleHsl.Z)); + GameShaders.Misc["CalamityMod:BasicTint"].Apply(); + spriteBatch.Draw(glowTexture, npc.Center - screenPos + Vector2.UnitY * npc.gfxOffY, npc.frame, Color.White * npc.Opacity, npc.rotation, halfSize, npc.scale, spriteEffects, 0f); + CalamityUtils.ExitShaderRegion(spriteBatch); } return false; } diff --git a/NPCs/Crabulon/Crabulon.cs b/NPCs/Crabulon/Crabulon.cs index 3ecd980cd7..b921f02609 100644 --- a/NPCs/Crabulon/Crabulon.cs +++ b/NPCs/Crabulon/Crabulon.cs @@ -178,40 +178,6 @@ namespace CalamityMod.NPCs.Crabulon else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; - if (NPC.ai[0] < 2f) - { - int mushBombAmt = phase4 ? 6 : phase3 ? 3 : phase2 ? 2 : 1; - float fireRate = phase4 ? 6f : phase3 ? 3f : phase2 ? 2f : 1f; - NPC.localAI[3] += fireRate; - if (NPC.ai[3] == 0f) - { - float shootMushroomsGateValue = revenge ? 120f : expertMode ? 200f : 300f; - if (NPC.localAI[3] > shootMushroomsGateValue) - { - NPC.ai[3] = 1f; - NPC.localAI[3] = 0f; - } - } - else if (NPC.localAI[3] > 30f) - { - NPC.localAI[3] = 0f; - NPC.ai[3] += 1f; - if (NPC.ai[3] >= mushBombAmt) - NPC.ai[3] = 0f; - - float mushBombSpeed = phase4 ? 16f : phase3 ? 14f : phase2 ? 12f : 10f; - int type = ModContent.ProjectileType(); - SoundEngine.PlaySound(SoundID.Item42, NPC.Center); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - float yVelocity = death ? 1f : expertMode ? 2.5f : 4f; - Vector2 projectileVelocity = (Vector2.Normalize(player.Center - NPC.Center) * mushBombSpeed) - Vector2.UnitY * yVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, MushroomShotDamage, 0f, Main.myPlayer, 0f, player.Center.Y); - } - } - } - if (NPC.ai[0] == 0f) { // Avoid cheap bullshit @@ -245,7 +211,40 @@ namespace CalamityMod.NPCs.Crabulon // Avoid cheap bullshit NPC.damage = 0; - float walkingVelocity = death ? (5f + 1f * (1f - lifeRatio)) : expertMode ? 5f : 3.5f; + // Fire mushroom projectiles at the player + int mushBombAmt = phase4 ? 6 : phase3 ? 3 : phase2 ? 2 : 1; + float fireRate = phase4 ? 6f : phase3 ? 3f : phase2 ? 2f : 1f; + NPC.localAI[3] += fireRate; + if (NPC.ai[3] == 0f) + { + float shootMushroomsGateValue = revenge ? 120f : expertMode ? 200f : 300f; + if (NPC.localAI[3] > shootMushroomsGateValue) + { + NPC.ai[3] = 1f; + NPC.localAI[3] = 0f; + } + } + else if (NPC.localAI[3] > 30f) + { + NPC.localAI[3] = 0f; + NPC.ai[3] += 1f; + if (NPC.ai[3] >= mushBombAmt) + NPC.ai[3] = 0f; + + float mushBombSpeed = phase4 ? 16f : phase3 ? 14f : phase2 ? 12f : 10f; + int type = ModContent.ProjectileType(); + SoundEngine.PlaySound(SoundID.Item42, NPC.Center); + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + float yVelocity = death ? 1f : expertMode ? 2.5f : 4f; + Vector2 projectileVelocity = (Vector2.Normalize(player.Center - NPC.Center) * mushBombSpeed) - Vector2.UnitY * yVelocity; + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, MushroomShotDamage, 0f, Main.myPlayer, 0f, player.Center.Y); + } + } + + // Walking + float walkingVelocity = expertMode ? 4.5f : 3.5f; if (phase2) walkingVelocity += 0.5f; if (phase3) @@ -330,6 +329,7 @@ namespace CalamityMod.NPCs.Crabulon NPC.noTileCollide = false; NPC.ai[0] = (Main.rand.NextBool() && revenge && phase2) ? 4f : 2f; NPC.ai[1] = 0f; + NPC.ai[3] = 0f; NPC.ForceNetUpdate(); } @@ -485,7 +485,7 @@ namespace CalamityMod.NPCs.Crabulon int type = ModContent.ProjectileType(); - if ((NPC.ai[2] % 2f == 0f || death) && ((phase2 && revenge) || (phase3 && expertMode))) + if (NPC.ai[2] % 2f == 0f && ((phase2 && revenge) || (phase3 && expertMode))) { SoundEngine.PlaySound(SoundID.Item42, NPC.Center); if (Main.netMode != NetmodeID.MultiplayerClient) @@ -495,8 +495,7 @@ namespace CalamityMod.NPCs.Crabulon destination.Normalize(); destination *= projectileVelocity; - // Less mushrooms in Death Mode phase 3 because otherwise it's an absolute shitshow. - int numProj = phase4 ? 14 : CalamityWorld.death ? (phase3 ? 10 : 16) : 12; + int numProj = phase4 ? 14 : CalamityWorld.death ? 16 : 12; float rotation = MathHelper.ToRadians(90); for (int i = 0; i < numProj; i++) { @@ -520,8 +519,7 @@ namespace CalamityMod.NPCs.Crabulon destination.Normalize(); destination *= projectileVelocity; - // Less mushrooms in Death Mode phase 3 because otherwise it's an absolute shitshow. - int numProj = phase4 ? 8 : (phase3 && death) ? 6 : 8; + int numProj = 8; float rotation = MathHelper.ToRadians(60); for (int i = 0; i < numProj; i++) { @@ -621,42 +619,19 @@ namespace CalamityMod.NPCs.Crabulon if (revenge) { float velocityXAdjustment = maxVelocityX; - - if (lifeRatio < 0.5f && death) + switch ((int)NPC.ai[3]) { - // Mega velocity - switch ((int)NPC.ai[3]) - { - case 0: // Normal - case 1: // High - case 2: // Low - maxVelocityX += velocityXAdjustment * 0.5f; - break; + case 0: // Normal + case 1: // High + case 2: // Low + break; - case 3: // Long and low - maxVelocityX += velocityXAdjustment * 1.5f; - break; + case 3: // Long and low + maxVelocityX += velocityXAdjustment * (lifeRatio < 0.5f && death ? 1.5f : 1f); + break; - default: - break; - } - } - else - { - switch ((int)NPC.ai[3]) - { - case 0: // Normal - case 1: // High - case 2: // Low - break; - - case 3: // Long and low - maxVelocityX += velocityXAdjustment; - break; - - default: - break; - } + default: + break; } } @@ -728,31 +703,30 @@ namespace CalamityMod.NPCs.Crabulon if (NPC.velocity.Y >= 0f && NPC.Bottom.Y >= NPC.ai[3] - NPC.height) NPC.noTileCollide = false; - // Impact and create lines of mushrooms that spread out along the ground (similar to an old Providence attack) if (NPC.Bottom.Y >= NPC.ai[3] || NPC.velocity.Y == 0f) { SoundEngine.PlaySound(SlamSound, NPC.Center); + NPC.velocity.X *= 0.5f; NPC.ai[0] = 0f; NPC.ai[1] = 0f; NPC.ai[2] = 0f; NPC.ai[3] = 0f; NPC.netUpdate = true; - int type = ModContent.ProjectileType(); - - if (Main.netMode != NetmodeID.MultiplayerClient) + // Create lines of mushrooms that spread out along the ground in Death Mode + if (death && Main.netMode != NetmodeID.MultiplayerClient) { - float xVelocity = death ? 2f : 1f; - int numProj = death ? 5 : 3; - Vector2 initialVelocity = Vector2.UnitX * xVelocity; + int numProj = 3; + int type = ModContent.ProjectileType(); + Vector2 initialVelocity = Vector2.UnitX; Vector2 initialSpawnLocation = NPC.Bottom - new Vector2(0f, 8f); - for (int i = 0; i < numProj; i++) - Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation + new Vector2(Main.rand.Next(0, 81), Main.rand.Next(-20, 1)), initialVelocity - (i / (float)numProj * initialVelocity), type, MushroomShotDamage, 0f, Main.myPlayer); + for (int i = 1; i <= numProj; i++) + Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation + new Vector2(Main.rand.Next(0, 81), Main.rand.Next(-20, 1)), initialVelocity * (i / (float)numProj), type, MushroomShotDamage, 0f, Main.myPlayer); - for (int i = 0; i < numProj; i++) - Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation + new Vector2(Main.rand.Next(-81, 0), Main.rand.Next(-20, 1)), -(initialVelocity - (i / (float)numProj * initialVelocity)), type, MushroomShotDamage, 0f, Main.myPlayer); + for (int i = 1; i <= numProj; i++) + Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation + new Vector2(Main.rand.Next(-81, 0), Main.rand.Next(-20, 1)), -(initialVelocity * (i / (float)numProj)), type, MushroomShotDamage, 0f, Main.myPlayer); } for (int j = (int)NPC.position.X - 20; j < (int)NPC.position.X + NPC.width + 40; j += 20) @@ -949,7 +923,7 @@ namespace CalamityMod.NPCs.Crabulon if ((NPC.life + crabShroomSpawnFreq) < NPC.localAI[0]) { NPC.localAI[0] = NPC.life; - int crabShroomAmt = death ? 4 : expertMode ? 3 : 2; + int crabShroomAmt = expertMode ? 3 : 2; for (int mush = 0; mush < crabShroomAmt; mush++) { int x = (int)(NPC.position.X + Main.rand.Next(NPC.width - 32)); diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index edea410818..1db1adb2cb 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -307,24 +307,24 @@ namespace CalamityMod.NPCs.Cryogen float chargeSlownDownPhaseGateValue = chargeGateValue + chargeSlowDownTime; bool chargePhase = NPC.ai[1] >= chargePhaseGateValue; + float iceBombDelay = phase5 ? 180f : 720f; + if (Main.getGoodWorld) + iceBombDelay *= 0.5f; if (expertMode && (NPC.ai[0] < 5f || !phase6) && !chargePhase) { calamityGlobalNPC.newAI[3] += 1f; - if (calamityGlobalNPC.newAI[3] >= 900f) + if (calamityGlobalNPC.newAI[3] >= iceBombDelay) { calamityGlobalNPC.newAI[3] = 0f; SoundEngine.PlaySound(Main.zenithWorld ? SoundID.NPCHit41 : HitSound, NPC.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalProjectiles = 3; + int totalProjectiles = phase5 ? 2 : 3; float radians = MathHelper.TwoPi / totalProjectiles; int type = iceBomb; float velocity = 2f + NPC.ai[0]; - double angleA = radians * 0.5; - double angleB = MathHelper.ToRadians(90f) - angleA; - float velocityX = (float)(velocity * Math.Sin(angleA) / Math.Sin(angleB)); - Vector2 spinningPoint = Main.rand.NextBool() ? new Vector2(0f, -velocity) : new Vector2(-velocityX, -velocity); + Vector2 spinningPoint = Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * -velocity; for (int k = 0; k < totalProjectiles; k++) { Vector2 projSpreadRotation = spinningPoint.RotatedBy(radians * k); @@ -1064,7 +1064,7 @@ namespace CalamityMod.NPCs.Cryogen calamityGlobalNPC.newAI[2] -= 1f; float chargeStartDistance = 300f; - float chargeCooldown = 30f; + float chargeCooldown = 25f; if (playerDistance < chargeStartDistance || calamityGlobalNPC.newAI[2] > 0f) { diff --git a/NPCs/Deconstructors/Burrower.cs b/NPCs/Deconstructors/Burrower.cs index 17fc2c7c3c..cedac1aebe 100644 --- a/NPCs/Deconstructors/Burrower.cs +++ b/NPCs/Deconstructors/Burrower.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Effects; @@ -23,6 +24,7 @@ using Terraria.ModLoader; using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.Deconstructors { + [LongDistanceNetSync(SyncWith = typeof(Burrower))] public class BurrowerHitbox : BaseWormHitboxNPC { public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.Burrower.DisplayName"); @@ -58,13 +60,19 @@ namespace CalamityMod.NPCs.Deconstructors public override void AI() { base.AI(); - var headNPC = Main.npc[(int)NPC.ai[0]]; - NPC.Calamity().DR = headNPC.Calamity().DR; - NPC.HitSound = headNPC.HitSound; + if (Main.npc.IndexInRange((int)NPC.ai[0])) + { + NPC headNPC = Main.npc[(int)NPC.ai[0]]; + NPC.Calamity().DR = headNPC.Calamity().DR; + NPC.HitSound = headNPC.HitSound; + } + NPC.width = 38; NPC.height = 38; } } + + [LongDistanceNetSync] public class Burrower : BaseWormNPC { public override string Texture => "CalamityMod/NPCs/Deconstructors/DeconstructorMK1Head"; @@ -110,8 +118,6 @@ namespace CalamityMod.NPCs.Deconstructors } public override void SetDefaults() { - - NPC.Calamity().canBreakPlayerDefense = true; NPC.damage = 0; NPC.width = 38; NPC.height = 38; @@ -176,23 +182,22 @@ namespace CalamityMod.NPCs.Deconstructors set { NPC.ai[2] = value; } } - public float StateChangeCounter - { - get { return NPC.ai[3]; } - set { NPC.ai[3] = value; } - } - public float VelocityRotation - { - - get { return NPC.velocity.ToRotation(); } - set { NPC.velocity = value.ToRotationVector2() * NPC.velocity.Length(); } - } - public Vector2 TargetVector = Vector2.Zero; public Vector2 SecondaryVector = Vector2.Zero; - public float StoredValue = 0; #endregion + public override void SendExtraAI(BinaryWriter writer) + { + writer.WriteVector2(TargetVector); + writer.WriteVector2(SecondaryVector); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + TargetVector = reader.ReadVector2(); + SecondaryVector = reader.ReadVector2(); + } + public void SwitchAttackState(AttackState State, float Substate = 0, bool resetVector = true) { ActiveAttackState = State; @@ -200,15 +205,11 @@ namespace CalamityMod.NPCs.Deconstructors MainTimer = 0; if (resetVector) TargetVector = Vector2.Zero; + NPC.ForceNetUpdate(); } public override void AI() { - //Force burrower bestiary to unlock - if (Main.netMode != NetmodeID.MultiplayerClient && Main.BestiaryTracker.Kills.GetKillCount(NPC) <= 0) - { - Main.BestiaryTracker.Kills.RegisterKill(NPC); - } HandleAIStates(); MainTimer++; UpdateSegments(); @@ -318,9 +319,12 @@ namespace CalamityMod.NPCs.Deconstructors public void HandleAIStates() { - NPC.CalamityTargeting(CalamityTargetingParameters.BossDefaults); if (!NPC.HasValidTarget) + { + NPC.CalamityTargeting(CalamityTargetingParameters.BossDefaults); return; + } + Player player = Main.player[NPC.target]; SegmentMaxRotation = 0.65f; SegmentRigidity = 0.2f; @@ -358,9 +362,11 @@ namespace CalamityMod.NPCs.Deconstructors veins.Remove(targetVein); } } + TargetVector = player.Center + Main.rand.NextVector2Circular(800, 800); LowerTargetToGround(); MainTimer = 0; + NPC.netUpdate = true; } if (AttackSubstate <= 0 && noGravity) { diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 2d45fb0d1d..ce811e5e71 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -306,10 +306,13 @@ namespace CalamityMod.NPCs.DevourerofGods public override void OnSpawn(IEntitySource source) { + // Don't display the dialogue in Boss Rush + if (BossRushEvent.BossRushActive) + return; + string key = "Mods.CalamityMod.Status.Boss.DoGSpawn"; Color messageColor = Color.Cyan; CalamityUtils.BroadcastLocalizedText(key, messageColor); - DialogueDisplaySystem.StartDialogue("Mods.CalamityMod.DevourerOfGods.Phases", NPC, 0, 120, false, new BossText()); } @@ -637,12 +640,6 @@ namespace CalamityMod.NPCs.DevourerofGods string key = "Mods.CalamityMod.Status.Boss.DoGPhase2"; Color messageColor = Color.Cyan; CalamityUtils.BroadcastLocalizedText(key, messageColor); - /* - var ctid = CombatText.NewText(NPC.Hitbox, messageColor, Language.GetTextValue(key), true); - if (ctid < Main.maxCombatText) - player.Calamity().subtitletext = Main.combatText[ctid]; - player.Calamity().subtitleColors = new Color[] { Color.Cyan, Color.Fuchsia }; - */ DialogueDisplaySystem.StartDialogue("Mods.CalamityMod.DevourerOfGods.Phases", NPC, 2, 120, false, new BossText()); } } @@ -1474,13 +1471,6 @@ namespace CalamityMod.NPCs.DevourerofGods string key = "Mods.CalamityMod.Status.Boss.DoGSubphase1"; Color messageColor = Color.Cyan; CalamityUtils.BroadcastLocalizedText(key, messageColor); - - /* - int ctid = CombatText.NewText(NPC.Hitbox, messageColor, Language.GetTextValue(key), true); - if (ctid < Main.maxCombatText) - player.Calamity().subtitletext = Main.combatText[ctid]; - player.Calamity().subtitleColors = new Color[] { Color.Cyan, Color.Fuchsia }; - */ DialogueDisplaySystem.StartDialogue("Mods.CalamityMod.DevourerOfGods.Phases", NPC, 1, 120, false, new BossText()); } diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index 76374999e1..6da831b412 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -82,10 +82,10 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.dontCountMe = true; if (Main.zenithWorld) + { NPC.scale *= 1.5f; - - if (Main.getGoodWorld) NPC.takenDamageMultiplier = 2; + } } public override void BossHeadSlot(ref int index) diff --git a/NPCs/DraedonLabThings/Androomba.cs b/NPCs/DraedonLabThings/Androomba.cs index 09230077a7..4d4db9b7c9 100644 --- a/NPCs/DraedonLabThings/Androomba.cs +++ b/NPCs/DraedonLabThings/Androomba.cs @@ -151,12 +151,6 @@ namespace CalamityMod.NPCs.DraedonLabThings } break; } - - // Force bestiary unlock - if (Main.netMode != NetmodeID.MultiplayerClient && Main.BestiaryTracker.Kills.GetKillCount(NPC) <= 0) - { - Main.BestiaryTracker.Kills.RegisterKill(NPC); - } } public void ChangeAI(int phase) @@ -196,7 +190,7 @@ namespace CalamityMod.NPCs.DraedonLabThings NPC.frame.Y = 1; } } - // Suprise! + // Surprise! else if (NPC.ai[0] == 1) { if (NPC.frame.Y < frameHeight * 5) diff --git a/NPCs/DraedonLabThings/RepairUnitCritter.cs b/NPCs/DraedonLabThings/RepairUnitCritter.cs index a3c7bcb9c1..cbd39311c1 100644 --- a/NPCs/DraedonLabThings/RepairUnitCritter.cs +++ b/NPCs/DraedonLabThings/RepairUnitCritter.cs @@ -137,13 +137,8 @@ namespace CalamityMod.NPCs.DraedonLabThings break; } Time++; - - // Force bestiary unlock - if (Main.netMode != NetmodeID.MultiplayerClient && Main.BestiaryTracker.Kills.GetKillCount(NPC) <= 0) - { - Main.BestiaryTracker.Kills.RegisterKill(NPC); - } } + public override bool? CanFallThroughPlatforms() => CurrentState == BehaviorState.WalkOnWalls; public void WalkAroundOnGround() diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index a254f33078..724c6f8fa0 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -504,14 +504,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares draedonAlive = true; } - // Prevent mechs from being respawned - // CIT 08JUN2025: This code is pointless and makes me unable to work swapping the laser arm position. Commenting it out. - /*if (otherExoMechWasFirst) - { - if (NPC.ai[3] < 1f) - NPC.ai[3] = 1f; - }*/ - // Phases bool spawnOtherExoMechs = lifeRatio < 0.7f && NPC.ai[3] == 0f; bool berserk = lifeRatio < 0.4f || (otherExoMechsAlive == 0 && lifeRatio < 0.7f); diff --git a/NPCs/Leviathan/Anahita.cs b/NPCs/Leviathan/Anahita.cs index 5069afc176..48597bbc6d 100644 --- a/NPCs/Leviathan/Anahita.cs +++ b/NPCs/Leviathan/Anahita.cs @@ -10,6 +10,7 @@ using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; using Terraria.Audio; +using Terraria.DataStructures; using Terraria.GameContent; using Terraria.GameContent.Bestiary; using Terraria.ID; @@ -117,6 +118,7 @@ namespace CalamityMod.NPCs.Leviathan writer.Write(NPC.Calamity().newAI[0]); writer.Write(HasBegunSummoningLeviathan); writer.Write(DrawProjectileTelegraphTimer); + writer.Write(NPC.wet); } public override void ReceiveExtraAI(BinaryReader reader) @@ -132,6 +134,13 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().newAI[0] = reader.ReadSingle(); HasBegunSummoningLeviathan = reader.ReadBoolean(); DrawProjectileTelegraphTimer = reader.ReadInt32(); + NPC.wet = reader.ReadBoolean(); + } + + public override void OnSpawn(IEntitySource source) + { + // Fix weird case where NewNPC sets NPC.wet based on position regardless of noTileCollide + NPC.wet = false; } public override void AI() diff --git a/NPCs/NormalNPCs/DivineSwine.cs b/NPCs/NormalNPCs/DivineSwine.cs index 931bab8b93..9dfea10249 100644 --- a/NPCs/NormalNPCs/DivineSwine.cs +++ b/NPCs/NormalNPCs/DivineSwine.cs @@ -59,6 +59,12 @@ namespace CalamityMod.NPCs.NormalNPCs PauseBehavior = PauseBehavior.PauseWithGame, MaxInstances = 0, }; + private static SoundStyle MisophoniaSwineSpeakLoopingSound = new("CalamityMod/Sounds/Custom/SCalSounds/BrimstoneMonsterDrone") + { + IsLooped = true, + PauseBehavior = PauseBehavior.PauseWithGame, + MaxInstances = 0, + }; public int FrameY; @@ -68,7 +74,7 @@ namespace CalamityMod.NPCs.NormalNPCs public Vector2 IdleMovementVector; - public SlotId SwineSpeakSoundSlot; + public SlotId SwineSpeakSoundSlot = SlotId.Invalid; public static float MaxSpeed => 0.38f; public static float MaxAcceleration => 0.06f; @@ -112,7 +118,9 @@ namespace CalamityMod.NPCs.NormalNPCs Main.npcFrameCount[Type] = 14; NPCID.Sets.CountsAsCritter[Type] = true; NPCID.Sets.CantTakeLunchMoney[Type] = true; - NPCID.Sets.NormalGoldCritterBestiaryPriority.Insert(NPCID.Sets.NormalGoldCritterBestiaryPriority.IndexOf(NPCID.GoldBunny) + 3, Type); + NPCID.Sets.NormalGoldCritterBestiaryPriority.Add(Type); + NPCID.Sets.ImmuneToAllBuffs[Type] = true; + NPCID.Sets.ShimmerImmunity[Type] = true; } public override void SetDefaults() @@ -120,7 +128,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = 0; NPC.width = 32; NPC.height = 34; - NPC.lifeMax = 5; + NPC.lifeMax = 99999999; NPC.defense = 99999999; NPC.rarity = 5; NPC.aiStyle = -1; @@ -129,9 +137,12 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.DeathSound = SoundID.NPCDeath1; NPC.immortal = true; NPC.noGravity = true; - NPC.Calamity().VulnerableToHeat = true; - NPC.Calamity().VulnerableToCold = true; - NPC.Calamity().VulnerableToSickness = true; + + NPC.Calamity().VulnerableToCold = false; + NPC.Calamity().VulnerableToElectricity = false; + NPC.Calamity().VulnerableToHeat = false; + NPC.Calamity().VulnerableToSickness = false; + NPC.Calamity().VulnerableToWater = false; } public override void OnSpawn(IEntitySource source) @@ -289,15 +300,15 @@ namespace CalamityMod.NPCs.NormalNPCs } SoundEngine.PlaySound(SoundID.Item29 with { Volume = 0.1f }, NPC.Center); - SoundEngine.PlaySound(IdleSound, NPC.Center); - if (SoundEngine.TryGetActiveSound(SwineSpeakSoundSlot, out var activeSound)) - activeSound.Stop(); + if (!CalamityClientConfig.Instance.MisophoniaSupport) + SoundEngine.PlaySound(IdleSound, NPC.Center); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.Transform(ModContent.NPCType()); - NPC.netUpdate = true; - } + if (SoundEngine.TryGetActiveSound(SwineSpeakSoundSlot, out ActiveSound swineSpeakInstance)) + swineSpeakInstance.Stop(); + if (SwineSpeakSoundSlot.IsValid) + SwineSpeakSoundSlot = SlotId.Invalid; + + NPC.Transform(ModContent.NPCType()); } } @@ -432,6 +443,11 @@ namespace CalamityMod.NPCs.NormalNPCs GeneralParticleHandler.SpawnParticle(Main.rand.NextBool() ? meatSparkle : meatLight, true, Enums.GeneralDrawLayer.AfterNPCs); } + if (SoundEngine.TryGetActiveSound(SwineSpeakSoundSlot, out ActiveSound swineSpeakInstance)) + swineSpeakInstance.Stop(); + if (SwineSpeakSoundSlot.IsValid) + SwineSpeakSoundSlot = SlotId.Invalid; + // Despawn immediately afterwards. NPC.checkDead(); NPC.active = false; @@ -464,7 +480,14 @@ namespace CalamityMod.NPCs.NormalNPCs } SoundEngine.PlaySound(SoundID.Item29 with { Volume = 0.1f }, NPC.Center); - SoundEngine.PlaySound(IdleSound, NPC.Center); + + if (!CalamityClientConfig.Instance.MisophoniaSupport) + SoundEngine.PlaySound(IdleSound, NPC.Center); + + if (SoundEngine.TryGetActiveSound(SwineSpeakSoundSlot, out ActiveSound swineSpeakInstance)) + swineSpeakInstance.Stop(); + if (SwineSpeakSoundSlot.IsValid) + SwineSpeakSoundSlot = SlotId.Invalid; NPC.checkDead(); NPC.active = false; @@ -580,7 +603,9 @@ namespace CalamityMod.NPCs.NormalNPCs { if (NPC.soundDelay == 0 && Main.rand.NextBool(200) && AIState == (int)BehaviorState.IdleAndFly) { - SoundEngine.PlaySound(IdleSound, NPC.Center); + if (!CalamityClientConfig.Instance.MisophoniaSupport) + SoundEngine.PlaySound(IdleSound, NPC.Center); + SquashVector = Utils.SelectRandom(Main.rand, new Vector2(1.4f, 0.7f), new Vector2(0.7f, 1.4f)); AdditionalBrightness = Main.rand.NextFloat(0.3f, 0.4f); NPC.soundDelay = Main.rand.Next(60, 120); @@ -588,7 +613,22 @@ namespace CalamityMod.NPCs.NormalNPCs } if (!SoundEngine.TryGetActiveSound(SwineSpeakSoundSlot, out _)) - SwineSpeakSoundSlot = SoundEngine.PlaySound(SwineSpeakLoopingSound, NPC.Center, SoundCallbackMethod); + { + if (!CalamityClientConfig.Instance.MisophoniaSupport) + { + SwineSpeakSoundSlot = SoundEngine.PlaySound(SwineSpeakLoopingSound, NPC.Center, SoundCallbackMethod); + } + else + SwineSpeakSoundSlot = SoundEngine.PlaySound(MisophoniaSwineSpeakLoopingSound, NPC.Center, SoundCallbackMethod); + } + + if (!NPC.active) + { + if (SoundEngine.TryGetActiveSound(SwineSpeakSoundSlot, out ActiveSound swineSpeakInstance)) + swineSpeakInstance.Stop(); + if (SwineSpeakSoundSlot.IsValid) + SwineSpeakSoundSlot = SlotId.Invalid; + } // Fade the music depending on the distance between the player and Divine Swine. float musicVolumeInterpolant = Utils.Remap(NPC.Distance(Main.LocalPlayer.Center), 600f, 100f, 1f, 0.2f, true); @@ -786,6 +826,7 @@ namespace CalamityMod.NPCs.NormalNPCs Effect tintShader = CalamityShaders.BasicTintShader.Value; tintShader.Parameters["uColor"].SetValue(Color.White.ToVector3()); tintShader.Parameters["uOpacity"].SetValue(DivineSwineTintStrength); + tintShader.Parameters["uSaturation"].SetValue(NPC.Opacity); spriteBatch.EnterShaderRegion(effect: tintShader); spriteBatch.Draw(baseTexture, drawPosition, NPC.frame, NPC.GetAlpha(Color.White), NPC.rotation, NPC.frame.Size() * 0.5f, SquashVector * NPC.scale, spriteEffects, 0f); diff --git a/NPCs/NormalNPCs/HorribleHog/HorribleHog.AI.Transitionals.cs b/NPCs/NormalNPCs/HorribleHog/HorribleHog.AI.Transitionals.cs index 5d8522b4fe..b32b03a445 100644 --- a/NPCs/NormalNPCs/HorribleHog/HorribleHog.AI.Transitionals.cs +++ b/NPCs/NormalNPCs/HorribleHog/HorribleHog.AI.Transitionals.cs @@ -104,11 +104,7 @@ namespace CalamityMod.NPCs.NormalNPCs.HorribleHog if (SoundEngine.TryGetActiveSound(DevilsTongueSlot, out var activeSound)) activeSound.Stop(); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.Transform(ModContent.NPCType()); - NPC.netUpdate = true; - } + NPC.Transform(ModContent.NPCType()); } Animate(IdleFrame, IdleFrame, 0, false, dynamicChanges: true); @@ -357,7 +353,10 @@ namespace CalamityMod.NPCs.NormalNPCs.HorribleHog if (NPC.soundDelay == 0f && Main.rand.NextBool(250)) { SetSquashVectors(squashVector: new Vector2(1.24f, 0.84f)); - SoundEngine.PlaySound(IdleSound, NPC.Center); + + if (!CalamityClientConfig.Instance.MisophoniaSupport) + SoundEngine.PlaySound(IdleSound, NPC.Center); + NPC.soundDelay = Main.rand.Next(30, 45); } diff --git a/NPCs/NormalNPCs/HorribleHog/HorribleHog.Drawing.cs b/NPCs/NormalNPCs/HorribleHog/HorribleHog.Drawing.cs index 5235c05262..7388ebba0a 100644 --- a/NPCs/NormalNPCs/HorribleHog/HorribleHog.Drawing.cs +++ b/NPCs/NormalNPCs/HorribleHog/HorribleHog.Drawing.cs @@ -149,6 +149,8 @@ namespace CalamityMod.NPCs.NormalNPCs.HorribleHog Effect tintShader = CalamityShaders.BasicTintShader.Value; tintShader.Parameters["uColor"].SetValue(TintColor.ToVector3()); tintShader.Parameters["uOpacity"].SetValue(TintStrength); + tintShader.Parameters["uSaturation"].SetValue(NPC.Opacity); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, tintShader, Main.GameViewMatrix.TransformationMatrix); spriteBatch.Draw(lease.Target, Vector2.Zero, Color.White); spriteBatch.End(); diff --git a/NPCs/NormalNPCs/HorribleHog/HorribleHog.cs b/NPCs/NormalNPCs/HorribleHog/HorribleHog.cs index a91458e006..3abb8efdd0 100644 --- a/NPCs/NormalNPCs/HorribleHog/HorribleHog.cs +++ b/NPCs/NormalNPCs/HorribleHog/HorribleHog.cs @@ -81,6 +81,12 @@ namespace CalamityMod.NPCs.NormalNPCs.HorribleHog PauseBehavior = PauseBehavior.PauseWithGame, MaxInstances = 0 }; + private static SoundStyle MisophoniaDevilsTongueLoopingSound = new("CalamityMod/Sounds/Custom/SCalSounds/BrimstoneMonsterDrone") + { + IsLooped = true, + PauseBehavior = PauseBehavior.PauseWithGame, + MaxInstances = 0 + }; public Dictionary PreviousAttackCounters = []; @@ -122,11 +128,11 @@ namespace CalamityMod.NPCs.NormalNPCs.HorribleHog public Color TintColorTarget; - public SlotId DeathLaughSoundSlot; + public SlotId DeathLaughSoundSlot = SlotId.Invalid; - public SlotId DiggingSoundSlot; + public SlotId DiggingSoundSlot = SlotId.Invalid; - public SlotId DevilsTongueSlot; + public SlotId DevilsTongueSlot = SlotId.Invalid; #region Static Behavior Properties public static int MaxAttacks_ChasePlayer => 2; @@ -431,6 +437,25 @@ namespace CalamityMod.NPCs.NormalNPCs.HorribleHog break; } + // Disable all active sounds if Hog despawns. + if (!NPC.active) + { + if (SoundEngine.TryGetActiveSound(DevilsTongueSlot, out ActiveSound devilsTongue)) + devilsTongue.Stop(); + if (DevilsTongueSlot.IsValid) + DevilsTongueSlot = SlotId.Invalid; + + if (SoundEngine.TryGetActiveSound(DiggingSoundSlot, out ActiveSound digging)) + digging.Stop(); + if (DiggingSoundSlot.IsValid) + DiggingSoundSlot = SlotId.Invalid; + + if (SoundEngine.TryGetActiveSound(DeathLaughSoundSlot, out ActiveSound deathLaugh)) + deathLaugh.Stop(); + if (DeathLaughSoundSlot.IsValid) + DeathLaughSoundSlot = SlotId.Invalid; + } + SquashVector = Vector2.Lerp(SquashVector, SquashVectorTarget, 0.125f); EyeGlintScale = MathHelper.Lerp(EyeGlintScale, 0f, 0.125f); TintColor = Color.Lerp(TintColor, TintColorTarget, 0.125f); @@ -641,13 +666,22 @@ namespace CalamityMod.NPCs.NormalNPCs.HorribleHog { if (SoundEngine.TryGetActiveSound(DevilsTongueSlot, out ActiveSound sound)) sound.Stop(); + DevilsTongueSlot = SlotId.Invalid; return; } // "Devil's Tongue" looping sound. // Similar to Divine Swine; gets louder and lowers music volume based on proximity. + if (!SoundEngine.TryGetActiveSound(DevilsTongueSlot, out _)) - DevilsTongueSlot = SoundEngine.PlaySound(DevilsTongueLoopingSound, NPC.Center, DevilsTongueLoopCallback); + { + if (!CalamityClientConfig.Instance.MisophoniaSupport) + { + DevilsTongueSlot = SoundEngine.PlaySound(DevilsTongueLoopingSound, NPC.Center, DevilsTongueLoopCallback); + } + else + DevilsTongueSlot = SoundEngine.PlaySound(MisophoniaDevilsTongueLoopingSound, NPC.Center, DevilsTongueLoopCallback); + } float idealVolume = Utils.Remap(NPC.Distance(Main.LocalPlayer.Center), 800f, 400f, 1f, 0.05f, true); Main.musicFade[Main.curMusic] = MathHelper.Lerp(1f, idealVolume, DevilsTongueVolumeMultiplier); @@ -761,11 +795,17 @@ namespace CalamityMod.NPCs.NormalNPCs.HorribleHog private void SpawnFloorMist(int x, int y) { + //the particles are all just visual + //also, calling lighting check on a server breaks + if (Main.netMode == NetmodeID.Server) + return; + int textureIndex = Main.rand.Next(GoreID.AmbientFloorCloud1, GoreID.AmbientFloorCloud4 + 1); Vector2 position = new Point(x, y - 1).ToWorldCoordinates(); Vector2 velocity = Vector2.UnitX * Main.rand.NextFloat(0.2f, 0.4f) * Main.WindForVisuals; Color mistColor = Color.Lerp(new(30, 30, 30), Color.Crimson, Main.rand.NextBool(3) ? Main.rand.NextFloat(0.2f, 0.8f) : Main.rand.Next(2)); + var point = new Point(x, y); Color color = Color.Lerp(Lighting.GetColor(new Point(x, y)), mistColor, 0.5f); float yOffset = 16f * Main.rand.NextFloat(); diff --git a/NPCs/NormalNPCs/IceClasper.cs b/NPCs/NormalNPCs/IceClasper.cs index eb0e0d1005..a75873716b 100644 --- a/NPCs/NormalNPCs/IceClasper.cs +++ b/NPCs/NormalNPCs/IceClasper.cs @@ -321,7 +321,7 @@ namespace CalamityMod.NPCs.NormalNPCs { npcLoot.Add(ModContent.ItemType()); npcLoot.Add(ModContent.ItemType(), 5); - npcLoot.Add(ModContent.ItemType(), 3); + npcLoot.Add(ModContent.ItemType(), 5); } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) diff --git a/NPCs/NormalNPCs/Piggy.cs b/NPCs/NormalNPCs/Piggy.cs index 86fc4b4116..d6b6b79140 100644 --- a/NPCs/NormalNPCs/Piggy.cs +++ b/NPCs/NormalNPCs/Piggy.cs @@ -1,9 +1,6 @@ using System; -using System.Security.Policy; -using CalamityMod.Effects; using CalamityMod.Items.Critters; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.NPCs.NormalNPCs.HorribleHog; using CalamityMod.Particles; using CalamityMod.Systems.Graphic.PixelationSystem; using CalamityMod.Utilities.Daybreak; @@ -14,7 +11,6 @@ using ReLogic.Content; using ReLogic.Utilities; using Terraria; using Terraria.Audio; -using Terraria.DataStructures; using Terraria.GameContent; using Terraria.GameContent.Bestiary; using Terraria.ID; @@ -51,6 +47,13 @@ namespace CalamityMod.NPCs.NormalNPCs MaxInstances = 0, }; + private static SoundStyle DivineSwine_MisophoniaSwineSpeakLoopingSound = new("CalamityMod/Sounds/Custom/SCalSounds/BrimstoneMonsterDrone") + { + IsLooped = true, + PauseBehavior = PauseBehavior.PauseWithGame, + MaxInstances = 0, + }; + private static SoundStyle HorribleHog_CackleSound = new("CalamityMod/Sounds/Custom/HorribleHog/HorribleHogCackle"); private static SoundStyle HorribleHog_IdleSound = new("CalamityMod/Sounds/Custom/HorribleHog/HorribleHogIdle", 2) { @@ -63,9 +66,16 @@ namespace CalamityMod.NPCs.NormalNPCs MaxInstances = 0 }; + private static SoundStyle HorribleHog_MisophoniaDevilsTongueLoopingSound = new("CalamityMod/Sounds/Custom/SCalSounds/BrimstoneMonsterDrone") + { + IsLooped = true, + PauseBehavior = PauseBehavior.PauseWithGame, + MaxInstances = 0 + }; + public Vector2 SquashVector; - public SlotId NearbySoundSlot; + public SlotId NearbySoundSlot = SlotId.Invalid; public static float MaxAcceleration_Walking => 0.035f; public static float MaxAcceleration_Running => 0.085f; @@ -96,7 +106,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPCID.Sets.CountsAsCritter[Type] = true; NPCID.Sets.CantTakeLunchMoney[Type] = true; NPCID.Sets.TakesDamageFromHostilesWithoutBeingFriendly[Type] = true; - NPCID.Sets.NormalGoldCritterBestiaryPriority.Insert(NPCID.Sets.NormalGoldCritterBestiaryPriority.IndexOf(NPCID.GoldBunny) + 1, Type); + NPCID.Sets.NormalGoldCritterBestiaryPriority.Add(Type); } public override void SetDefaults() @@ -132,10 +142,6 @@ namespace CalamityMod.NPCs.NormalNPCs public override void AI() { - // Force bestiary cause this doesn't count as Vanilla's definition of a critter for the Bestiary. - if (Main.netMode != NetmodeID.MultiplayerClient && Main.BestiaryTracker.Kills.GetKillCount(NPC) <= 0) - Main.BestiaryTracker.Kills.SetKillCountDirectly(NPC.GetBestiaryCreditId(), 100); - if (NPC.direction == 0) NPC.direction = Utils.SelectRandom(Main.rand, -1, 1); @@ -159,7 +165,6 @@ namespace CalamityMod.NPCs.NormalNPCs } NPC.StepUpBlocks(); - SquashVector = Vector2.Lerp(SquashVector, Vector2.One, 0.125f); Timer++; } @@ -168,8 +173,14 @@ namespace CalamityMod.NPCs.NormalNPCs { NPC.velocity.X *= 0.9f; NPC.rotation = 0f; - if (!SoundEngine.TryGetActiveSound(NearbySoundSlot, out _)) - NearbySoundSlot = SoundEngine.PlaySound(DivineSwine_SwineSpeakLoopingSound, NPC.Center, NearbySoundCallbackMethod); + + if (Timer < 2 && !SoundEngine.TryGetActiveSound(NearbySoundSlot, out _)) + { + if (!CalamityClientConfig.Instance.MisophoniaSupport) + NearbySoundSlot = SoundEngine.PlaySound(DivineSwine_SwineSpeakLoopingSound, NPC.Center, NearbySoundCallbackMethod); + else + NearbySoundSlot = SoundEngine.PlaySound(DivineSwine_MisophoniaSwineSpeakLoopingSound, NPC.Center, NearbySoundCallbackMethod); + } float lightSpawnDistance = MathHelper.Lerp(52f, 84f, Timer / 180f); int lightAmt = Main.rand.Next(1, 2); @@ -211,7 +222,7 @@ namespace CalamityMod.NPCs.NormalNPCs GeneralParticleHandler.SpawnParticle(feather, manualDrawLayerOverride: Enums.GeneralDrawLayer.BeforeNPCs); } - if (Timer >= 180f && Main.netMode != NetmodeID.MultiplayerClient) + if (Timer >= 180f) { CustomPulse lightRing = new(NPC.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomRing", Vector2.One, 0f, 0f, 2f, 75); GeneralParticleHandler.SpawnParticle(lightRing); @@ -230,9 +241,10 @@ namespace CalamityMod.NPCs.NormalNPCs SoundEngine.PlaySound(DivineSwine_CoinFailSound, NPC.Center); if (SoundEngine.TryGetActiveSound(NearbySoundSlot, out var activeSound)) activeSound.Stop(); + if (NearbySoundSlot.IsValid) + NearbySoundSlot = SlotId.Invalid; NPC.Transform(ModContent.NPCType()); - NPC.netUpdate = true; } } @@ -240,8 +252,14 @@ namespace CalamityMod.NPCs.NormalNPCs { NPC.velocity.X *= 0.9f; NPC.rotation = 0f; - if (!SoundEngine.TryGetActiveSound(NearbySoundSlot, out _)) - NearbySoundSlot = SoundEngine.PlaySound(HorribleHog_DevilsTongueLoopingSound, NPC.Center, NearbySoundCallbackMethod); + + if (Timer < 2 && !SoundEngine.TryGetActiveSound(NearbySoundSlot, out _)) + { + if (!CalamityClientConfig.Instance.MisophoniaSupport) + NearbySoundSlot = SoundEngine.PlaySound(HorribleHog_DevilsTongueLoopingSound, NPC.Center, NearbySoundCallbackMethod); + else + NearbySoundSlot = SoundEngine.PlaySound(HorribleHog_MisophoniaDevilsTongueLoopingSound, NPC.Center, NearbySoundCallbackMethod); + } float smokeOpacity = Utils.GetLerpValue(0f, 45f, Timer, true); int circlingSmokeAmount = Main.rand.Next(2, 5); @@ -263,17 +281,25 @@ namespace CalamityMod.NPCs.NormalNPCs SoundEngine.PlaySound(HorribleHog_CackleSound, NPC.Center); if (SoundEngine.TryGetActiveSound(NearbySoundSlot, out var activeSound)) activeSound.Stop(); + if (NearbySoundSlot.IsValid) + NearbySoundSlot = SlotId.Invalid; - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.Transform(ModContent.NPCType()); - NPC.netUpdate = true; - } + NPC.Transform(ModContent.NPCType()); } } public void MainBehavior_IdleAndWalk() { + // Run away when damaged. + if (NPC.justHit && Main.rand.NextBool(3)) + { + AIState = (int)BehaviorState.Running; + Timer = 0f; + LocalAIState = 0f; + NPC.netUpdate = true; + return; + } + // Idling. if (LocalAIState == 0f) { @@ -314,8 +340,9 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.netUpdate = true; } - if (MathF.Abs(NPC.velocity.X) < MaxSpeed_Walking) - NPC.velocity.X += MaxAcceleration_Walking * NPC.direction; + NPC.velocity.X += MaxAcceleration_Walking * NPC.direction; + NPC.velocity.X = MathHelper.Clamp(NPC.velocity.X, -MaxSpeed_Walking, MaxSpeed_Walking); + NPC.direction = NPC.velocity.X.DirectionalSign(); if (NPC.collideX && NPC.velocity.Y == 0f) NPC.velocity.Y -= 6f; @@ -332,14 +359,17 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.netUpdate = true; } - var chosenSoundStyle = Utils.SelectRandom(Main.rand, IdleSound_Grunt, IdleSound_SnortYip, IdleSound_Yip); - SoundEngine.PlaySound(chosenSoundStyle, NPC.Center); + if (!CalamityClientConfig.Instance.MisophoniaSupport) + { + var chosenSoundStyle = Utils.SelectRandom(Main.rand, IdleSound_Grunt, IdleSound_SnortYip, IdleSound_Yip); + SoundEngine.PlaySound(chosenSoundStyle, NPC.Center); + } NPC.soundDelay = Main.rand.Next(60, 120); } NPC.spriteDirection = NPC.direction; float targetAngle = (NPC.velocity.Y != 0f) ? NPC.velocity.X * 0.085f * (NPC.velocity.Y < 0).ToDirectionInt() : 0f; - NPC.rotation = NPC.rotation.AngleLerp(targetAngle, 0.075f); + NPC.rotation = NPC.rotation.AngleLerp(targetAngle, 0.125f); } public void MainBehavior_Running() @@ -347,8 +377,9 @@ namespace CalamityMod.NPCs.NormalNPCs // Run in a random direction until collision with a wall is made. if (LocalAIState == 0f) { - if (MathF.Abs(NPC.velocity.X) < MaxSpeed_Running) - NPC.velocity.X += MaxAcceleration_Running * NPC.direction; + NPC.velocity.X += MaxAcceleration_Running * NPC.direction; + NPC.velocity.X = MathHelper.Clamp(NPC.velocity.X, -MaxSpeed_Running, MaxSpeed_Running); + NPC.direction = NPC.velocity.X.DirectionalSign(); NPC.spriteDirection = NPC.direction; // Spawn particles when running at max speed. @@ -367,7 +398,9 @@ namespace CalamityMod.NPCs.NormalNPCs if (NPC.collideX) { SoundEngine.PlaySound(SoundID.Dig with { Volume = 0.7f }, NPC.Center); - SoundEngine.PlaySound(IdleSound_Grunt with { Volume = 1.2f }, NPC.Center); + if (!CalamityClientConfig.Instance.MisophoniaSupport) + SoundEngine.PlaySound(IdleSound_Grunt with { Volume = 1.2f }, NPC.Center); + SquashVector = new Vector2(0.6f, 1f); NPC.velocity.X = NPC.oldVelocity.X * -0.86f; @@ -398,7 +431,8 @@ namespace CalamityMod.NPCs.NormalNPCs { NPC.velocity.Y = -4f; var soundStyle = Utils.SelectRandom(Main.rand, IdleSound_SnortYip, IdleSound_Yip); - SoundEngine.PlaySound(soundStyle.WithPitchOffset(0.35f), NPC.Center); + if (!CalamityClientConfig.Instance.MisophoniaSupport) + SoundEngine.PlaySound(soundStyle.WithPitchOffset(0.35f), NPC.Center); } } diff --git a/NPCs/NormalNPCs/PiggyGold.cs b/NPCs/NormalNPCs/PiggyGold.cs index de5acee1b0..32043e3c04 100644 --- a/NPCs/NormalNPCs/PiggyGold.cs +++ b/NPCs/NormalNPCs/PiggyGold.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using CalamityMod.Items.Critters; using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; +using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; @@ -16,9 +17,13 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { + Main.npcFrameCount[Type] = 8; + Main.npcCatchable[Type] = true; + NPCID.Sets.CountsAsCritter[Type] = true; + NPCID.Sets.CantTakeLunchMoney[Type] = true; + NPCID.Sets.TakesDamageFromHostilesWithoutBeingFriendly[Type] = true; NPCID.Sets.GoldCrittersCollection.Add(Type); - NPCID.Sets.NormalGoldCritterBestiaryPriority.Insert(NPCID.Sets.NormalGoldCritterBestiaryPriority.IndexOf(NPCID.GoldBunny) + 2, Type); - base.SetStaticDefaults(); + NPCID.Sets.NormalGoldCritterBestiaryPriority.Add(Type); } public override void SetDefaults() @@ -27,16 +32,18 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.rarity = 3; NPC.catchItem = (short)ModContent.ItemType(); Banner = 0; + BannerItem = 0; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) { // All gold critters have the same Bestiary entry. - var flavorText = database.FindEntryByNPCID(NPCID.GoldBunny).Info.Where(info => info is FlavorTextBestiaryInfoElement).FirstOrDefault(); + string key = Lang.GetNPCName(NPCID.GoldBunny).Key.Replace("NPCName.", ""); + string flavorText = "Bestiary_FlavorText.npc_" + key; bestiaryEntry.AddTags( BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime, - BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - flavorText); + BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, + new FlavorTextBestiaryInfoElement(flavorText)); } public override void AI() diff --git a/NPCs/NormalNPCs/Shroomble.cs b/NPCs/NormalNPCs/Shroomble.cs index 3dd653a19f..676fbd882e 100644 --- a/NPCs/NormalNPCs/Shroomble.cs +++ b/NPCs/NormalNPCs/Shroomble.cs @@ -49,12 +49,6 @@ namespace CalamityMod.NPCs.NormalNPCs public override void AI() { - // Force bestiary unlock - if (Main.netMode != NetmodeID.MultiplayerClient && Main.BestiaryTracker.Kills.GetKillCount(NPC) <= 0) - { - Main.BestiaryTracker.Kills.RegisterKill(NPC); - } - bool walking = NPC.ai[0] == 1; // Do a cute lil' hop randomly int jumpChance = walking ? 600 : 100; diff --git a/NPCs/NormalNPCs/WulfrumRover.cs b/NPCs/NormalNPCs/WulfrumRover.cs index 592183f14f..3d2a46c076 100644 --- a/NPCs/NormalNPCs/WulfrumRover.cs +++ b/NPCs/NormalNPCs/WulfrumRover.cs @@ -194,21 +194,6 @@ namespace CalamityMod.NPCs.NormalNPCs { if (Supercharged) { - //old - /* - Texture2D shieldTexture = ModContent.Request("CalamityMod/NPCs/NormalNPCs/WulfrumRoverShield").Value; - Rectangle frame = shieldTexture.Frame(1, 11, 0, (int)(Main.GlobalTimeWrappedHourly * 8) % 11); - spriteBatch.Draw(shieldTexture, - NPC.Center - screenPos + Vector2.UnitY * (NPC.gfxOffY + 6f), - frame, - Color.White * 0.625f, - NPC.rotation, - shieldTexture.Size() * 0.5f / new Vector2(1f, 11f), - NPC.scale + (float)Math.Cos(Main.GlobalTimeWrappedHourly) * 0.1f, - SpriteEffects.None, - 0f); - */ - //0.6 : The noise upscale //0.15 the scale its drawn at usually, 0.2 on Zenith float scale = (Main.zenithWorld ? 0.2f : 0.15f) + 0.03f * (0.5f + 0.5f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 0.5f + NPC.whoAmI * 0.2f)); diff --git a/NPCs/OldDuke/OldDuke.cs b/NPCs/OldDuke/OldDuke.cs index 9b57b63963..2fba4d1161 100644 --- a/NPCs/OldDuke/OldDuke.cs +++ b/NPCs/OldDuke/OldDuke.cs @@ -1405,26 +1405,25 @@ namespace CalamityMod.NPCs.OldDuke if (NPC.ai[2] >= idlePhaseTimer) { int phase3AttackPicker = 0; - switch ((int)NPC.ai[3]) + switch ((int)NPC.ai[3] % 11) { case 0: case 2: case 3: - case 5: case 6: case 7: + case 8: phase3AttackPicker = 1; break; case 1: - case 8: + case 5: + case 10: phase3AttackPicker = 2; break; case 4: - NPC.ai[3] = 1f; phase3AttackPicker = 3; break; case 9: - NPC.ai[3] = 6f; phase3AttackPicker = 4; break; } @@ -1549,7 +1548,7 @@ namespace CalamityMod.NPCs.OldDuke NPC.ai[0] = 10f; NPC.ai[1] = 0f; NPC.ai[2] = 0f; - NPC.ai[3] += 2f; + NPC.ai[3]++; NPC.TargetClosest(); NPC.netUpdate = true; } @@ -1611,11 +1610,7 @@ namespace CalamityMod.NPCs.OldDuke NPC.ai[0] = 10f; NPC.ai[1] = 0f; NPC.ai[2] = 0f; - - NPC.ai[3] += 2f; - if (NPC.ai[3] >= 9f) - NPC.ai[3] = 0f; - + NPC.ai[3]++; NPC.netUpdate = true; } } @@ -1682,6 +1677,7 @@ namespace CalamityMod.NPCs.OldDuke NPC.ai[0] = 10f; NPC.ai[1] = 0f; NPC.ai[2] = 0f; + NPC.ai[3]++; NPC.TargetClosest(); NPC.netUpdate = true; } @@ -1762,6 +1758,7 @@ namespace CalamityMod.NPCs.OldDuke NPC.ai[0] = 10f; NPC.ai[1] = 0f; NPC.ai[2] = 0f; + NPC.ai[3]++; NPC.TargetClosest(); NPC.netUpdate = true; } diff --git a/NPCs/Other/VolatileChain.png b/NPCs/Other/VolatileChain.png new file mode 100644 index 0000000000..32644e4fce Binary files /dev/null and b/NPCs/Other/VolatileChain.png differ diff --git a/NPCs/Other/VolatileSlime.cs b/NPCs/Other/VolatileSlime.cs new file mode 100644 index 0000000000..62bc630d5c --- /dev/null +++ b/NPCs/Other/VolatileSlime.cs @@ -0,0 +1,309 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Security.Principal; +using CalamityMod.DataStructures; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Typeless; +using CalamityMod.Systems.Graphic.PixelationSystem; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.NPCs.Other +{ + public class VolatileSlime : ModNPC + { + public override string Texture => $"Terraria/Images/NPC_{NPCID.QueenSlimeMinionPurple}"; + public ref float time => ref NPC.ai[0]; + public ref float playerID => ref NPC.ai[1]; + public Player owner => Main.player[(int)playerID]; + public bool released => NPC.ai[3] != 0; + public bool doOnSpawnEffects = true; + public Color effectColor = Color.BlueViolet; + public List oldVelocities = new List(); + public Vector2 randPos = Vector2.Zero; + public Vector2 goalPositionRand = Vector2.Zero; + public float travelSpeed = 25; + public float glowScale = 1; + public bool drawChains = true; + public float gravIntensity = 1; + public override void SetStaticDefaults() + { + this.HideFromBestiary(); + Main.npcFrameCount[Type] = 4; + } + public override void SetDefaults() + { + NPC.width = NPC.height = 40; + NPC.damage = 0; + NPC.defense = 0; + NPC.lifeMax = 75; + NPC.noGravity = true; + NPC.noTileCollide = true; + NPC.knockBackResist = 0.8f; + NPC.netAlways = true; + NPC.aiStyle = -1; + NPC.Opacity = 0; + NPC.dontTakeDamage = true; + NPC.chaseable = false; + NPC.lavaImmune = true; + NPC.noGravity = true; + NPC.HitSound = SoundID.NPCHit1; + NPC.DeathSound = SoundID.NPCDeath1; + + NPC.Calamity().ProvidesProximityRage = false; + NPC.Calamity().DoesNotDisappearInBossRush = true; + NPC.Calamity().VulnerableToHeat = true; + NPC.Calamity().VulnerableToSickness = false; + } + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(travelSpeed); + writer.Write(gravIntensity); + writer.WriteVector2(goalPositionRand); + } + public override void ReceiveExtraAI(BinaryReader reader) + { + travelSpeed = reader.ReadSingle(); + gravIntensity = reader.ReadSingle(); + goalPositionRand = reader.ReadVector2(); + } + public override void FindFrame(int frameHeight) + { + NPC.frameCounter += 1.0; + if (NPC.frameCounter >= 6.0) + { + NPC.frame.Y += 1; + NPC.frameCounter = 0.0; + } + if (NPC.frame.Y >= (released ? Main.npcFrameCount[Type] / 2 : Main.npcFrameCount[Type])) + NPC.frame.Y = 0; + } + public override void AI() + { + if (doOnSpawnEffects) + { + // In multiplayer, the spawned npc won't spawn with the proper owner, so it just sets it to be the player it spawns on top of + int player = NPC.FindClosestPlayer(); + NPC.ai[1] = player; + + NPC.Opacity = 1; + NPC.scale = 0; + doOnSpawnEffects = false; + NPC.netUpdate = true; + } + float rate = (time * 0.05f); + List eColors = new List() + { + Color.SlateBlue, + Color.BlueViolet + }; + int colorIndex = (int)(rate / 2 % eColors.Count); + Color currentColor = eColors[colorIndex]; + Color nextColor = eColors[(colorIndex + 1) % eColors.Count]; + effectColor = Color.Lerp(currentColor, nextColor, rate % 2f >= 1f ? 1f : rate % 1f); + glowScale = MathHelper.Lerp(glowScale, 1, 0.13f); + + + if (owner.wingTime <= 0 && !released) + { + SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact with { pitch = Main.rand.NextFloat(-0.1f, 0.1f), MaxInstances = 10 }, NPC.Center); + time = 0; + NPC.dontTakeDamage = false; + NPC.noTileCollide = false; + NPC.lavaImmune = false; + NPC.frame.Y = 0; + glowScale = 5f; + gravIntensity = Main.rand.NextFloat(0.8f, 1.3f); + + NPC.ai[3] = 1; // release the slimes + NPC.netUpdate = true; + NPC.SyncMotionToServer(); + } + + if (released) + { + float sine = (float)Math.Sin(time * 0.6f / MathHelper.Pi); + if (NPC.velocity.Y < 12 * gravIntensity) + NPC.velocity.Y += 0.4f * gravIntensity; + if (Math.Abs(NPC.velocity.X) < 5 && time < 120) + NPC.velocity.X *= 1.03f; + else + NPC.velocity.X *= 0.987f; + } + else + { + if (time % 120 == 0) + { + goalPositionRand = Main.rand.NextVector2Circular(90, 90); + NPC.netUpdate = true; + } + randPos = Vector2.Lerp(randPos, goalPositionRand, 0.04f); + + float sineX = (float)Math.Sin(time * 0.4f / MathHelper.Pi); + float sineY = (float)Math.Sin(time * 0.6f / MathHelper.Pi); + + NPC.velocity += owner.velocity; + Vector2 destination = owner.Center - Vector2.UnitY * 120 + randPos + new Vector2(10 * sineX, 15 * sineY); + + // Anticlump + int npcType = ModContent.NPCType(); + for (int x = 0; x < Main.maxNPCs; x++) + { + NPC npc = Main.npc[x]; + float distFromNPC = Vector2.Distance(NPC.Center, npc.Center); + if (npc != NPC && npc.active && npc.type == npcType && npc.ai[1] == owner.whoAmI && npc.ai[3] == 0 && distFromNPC < 150) + destination += Utils.DirectionFrom(NPC.Center, npc.Center) * Utils.GetLerpValue(150, 0, distFromNPC) * 25; + } + travelSpeed = MathHelper.Lerp(travelSpeed, (owner.controlJump ? 2 : 25), 0.03f); + + NPC.velocity = (destination - NPC.Center) / travelSpeed; + + if (owner.controlJump && time % 3 == 0) + NPC.netUpdate = true; + } + if (NPC.velocity.X > 0 || NPC.velocity.X < 0) + NPC.spriteDirection = Math.Sign(NPC.velocity.X); + + if (NPC.scale < 1) + NPC.scale += 0.05f; + + if (NPC.collideX) + { + NPC.velocity.X *= -1.2f; + NPC.netUpdate = true; + } + if (NPC.collideY) + { + NPC.velocity.Y += -5.5f * gravIntensity - NPC.velocity.Y; + NPC.netUpdate = true; + } + + // Kill slime after enough time freed + if (Main.netMode != NetmodeID.MultiplayerClient && ((time >= 600f && released) || (!owner.volatileGelatin) || (owner.dead && !released))) + { + NPC.StrikeInstantKill(); + NPC.netUpdate = true; + } + + time++; + + oldVelocities.Add(NPC.velocity); + int maxSaves = 18; + if (oldVelocities.Count > maxSaves) + oldVelocities.RemoveAt(0); + } + public override void OnKill() + { + if (owner.Calamity().volatileGelatinVisuals) + { + for (int i = 0; i <= 22; i++) + { + Vector2 vel = Vector2.One.RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(3f, 8f); + + Dust dust2 = Dust.NewDustPerfect(NPC.Center, ModContent.DustType(), vel); + dust2.scale = Main.rand.NextFloat(0.8f, 1.7f); + bool gravity = !Main.rand.NextBool(5); + dust2.noGravity = gravity; + if (!gravity) + dust2.velocity /= 2; + dust2.alpha = Main.rand.Next(70, 150 + 1); + dust2.color = Main.rand.NextBool() ? Color.BlueViolet : Color.SlateBlue; + dust2.noLight = true; + dust2.noLightEmittence = true; + } + } + NPC.netUpdate = true; + } + public override bool CanHitPlayer(Player target, ref int cooldownSlot) + { + return false; + } + public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) + { + Texture2D texture = released ? Terraria.GameContent.TextureAssets.Npc[NPCID.QueenSlimeMinionBlue].Value : Terraria.GameContent.TextureAssets.Npc[NPCID.QueenSlimeMinionPurple].Value; + Vector2 drawPosition = NPC.Center - screenPos + (Vector2.UnitY * (released ? 8 : 0)); + Rectangle frame = Utils.Frame(texture, verticalFrames: (released ? Main.npcFrameCount[Type] / 2 : Main.npcFrameCount[Type]), frameY: NPC.frame.Y); + Vector2 origin = frame.Size() * 0.5f; + + if (drawChains) + { + Texture2D chain = ModContent.Request("CalamityMod/NPCs/Other/VolatileChain").Value; + Vector2 end = NPC.Center; + + Vector2 drawStart = owner.Center; + List controlPoints = new List + { + drawStart + }; + for (int i = 0; i < oldVelocities.Count; i++) + { + float swayResponsiveness = Utils.GetLerpValue(0f, 18f, i, true) * Utils.GetLerpValue(oldVelocities.Count, oldVelocities.Count - 18f, i, true) * Utils.GetLerpValue(5, 20, Utils.Distance(drawStart, end), true); + Vector2 swayTotalOffset = oldVelocities.ElementAt(i) * swayResponsiveness * -15; + controlPoints.Add(Vector2.Lerp(drawStart, end, i / (float)oldVelocities.Count) + swayTotalOffset); + } + controlPoints.Add(end); + + int chainPointCount = (int)(Vector2.Distance(controlPoints.First(), controlPoints.Last()) / 11f); + if (chainPointCount < 14) + chainPointCount = 14; + + + BezierCurve bezierCurve = new BezierCurve(controlPoints.ToArray()); + List chainPoints = bezierCurve.GetPoints(chainPointCount); + + for (int i = 0; i < chainPoints.Count; i++) + { + float completion = Utils.GetLerpValue(chainPoints.Count * 0.2f, chainPoints.Count, i, true); + Vector2 positionAtPoint = chainPoints[i]; + Color color = Color.Lerp(Lighting.GetColor(positionAtPoint.ToTileCoordinates()), effectColor with { A = 0 }, completion); + + if (Vector2.Distance(owner.Center, positionAtPoint) > 1400) + continue; + if (Vector2.Distance(positionAtPoint, NPC.Center) < 10f) + continue; + float angleAtPoint = i == chainPoints.Count - 1 ? (end - chainPoints[i]).ToRotation() : (chainPoints[i + 1] - chainPoints[i]).ToRotation(); + angleAtPoint += MathHelper.PiOver2; + + SpriteEffects sprfx = (i % 2 == 0 ? SpriteEffects.FlipHorizontally : SpriteEffects.None); + if (i % 4 < 2) + sprfx |= SpriteEffects.FlipVertically; + + if (released) + { + Vector2 vel = Main.rand.NextVector2Circular(2, 2) + NPC.velocity; + if (owner.Calamity().volatileGelatinVisuals) + { + Particle chainfx = new CustomSpark(positionAtPoint, vel, "CalamityMod/NPCs/Other/VolatileChain", Main.rand.NextBool(3), Main.rand.Next(30, 65), 1f, color, Vector2.One, false, false, -vel.ToRotation() + angleAtPoint, false, false, noShrink: false, spin: Main.rand.NextFloat(0, 0.08f) * Math.Sign(vel.X)); + GeneralParticleHandler.SpawnParticle(chainfx); + } + + drawChains = false; + } + + Main.EntitySpriteDraw(chain, positionAtPoint - Main.screenPosition, null, color * (owner.Calamity().volatileGelatinVisuals ? 1 : 0.05f), angleAtPoint, chain.Size() / 2f, 1.1f - (0.3f * (1 - completion)), sprfx, 0); + } + } + + float sine = (float)Math.Sin(time * 0.2f / MathHelper.Pi); + int draws = 12; + for (int i = 0; i < draws; i++) + { + float rotPoint = MathHelper.TwoPi / draws * i; + float dist = (2.5f + sine) * glowScale; + if (owner.Calamity().volatileGelatinVisuals) + spriteBatch.Draw(texture, drawPosition + rotPoint.ToRotationVector2().RotatedBy(Main.GlobalTimeWrappedHourly * 0.2f) * dist, frame, effectColor with { A = 0 } * NPC.Opacity * 0.6f, NPC.rotation, origin, NPC.scale, NPC.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0f); + } + spriteBatch.Draw(texture, drawPosition, frame, Color.Lerp(drawColor, effectColor with { A = 0 }, Utils.GetLerpValue(1, 3, glowScale)) * NPC.Opacity * (owner.Calamity().volatileGelatinVisuals ? 1f : 0.6f), NPC.rotation, origin, NPC.scale, NPC.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0f); + return false; + } + } +} diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 7bbc1a0e1c..e751c0a2b2 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -111,10 +111,14 @@ namespace CalamityMod.NPCs.Providence public static readonly SoundStyle NearBurnSound = new("CalamityMod/Sounds/Custom/Providence/ProvidenceSizzle"); public static readonly SoundStyle BurnStartSound = new("CalamityMod/Sounds/Custom/Providence/ProvidenceBurn"); - public static readonly SoundStyle BurnLoopSound = new SoundStyle("CalamityMod/Sounds/Custom/Providence/ProvidenceBurnLoop") with { IsLooped = true }; + public static readonly SoundStyle BurnLoopSound = new SoundStyle("CalamityMod/Sounds/Custom/Providence/ProvidenceBurnLoop") + { + IsLooped = true, + PauseBehavior = PauseBehavior.PauseWithGame, + }; // Sound slot for the burning damage over time effect - public SlotId BurningSoundSlot; + public SlotId BurningSoundSlot = SlotId.Invalid; // Level of sound playing public float SoundWarningLevel = -1f; @@ -290,7 +294,7 @@ namespace CalamityMod.NPCs.Providence NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - if (Main.getGoodWorld) + if (Main.zenithWorld) NPC.scale *= 0.25f; } @@ -374,7 +378,10 @@ namespace CalamityMod.NPCs.Providence { //ensure projectiles all despawn when she does if (NPC.timeLeft == 1) + { DespawnSpecificProjectiles(true); + StopHolyInfernoSounds(); + } // Set the border drawing to true if it isn't set to true // Can happen when another mod sets to false for a difficulty and that difficulty is then toggled off. @@ -400,8 +407,7 @@ namespace CalamityMod.NPCs.Providence Player player = Main.player[NPC.target]; // Enraged bool and Color shifting - bool getFuckedAI = Main.zenithWorld; - if (getFuckedAI) + if (Main.zenithWorld) NPC.localAI[1] = (float)BossMode.Rainbow; else if (hasBeenGivenFullPower) // Enraged behavior NPC.localAI[1] = (float)BossMode.Enraged; @@ -426,29 +432,15 @@ namespace CalamityMod.NPCs.Providence // Is in spawning animation float spawnAnimationTime = 180f; bool spawnAnimation = calamityGlobalNPC.newAI[3] < spawnAnimationTime; - if (!spawnAnimation) - { NPC.Opacity = 1f; - } // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; - // Play enrage animation if she gets angy - if (!getFuckedAI && fullPowerAI && calamityGlobalNPC.newAI[3] == spawnAnimationTime) + // Sync "enrage" status in FTW + if (NPC.localAI[1] == (float)BossMode.Enraged && calamityGlobalNPC.newAI[3] == 0f) { - AIState = (int)Phase.HolyBlast; - NPC.ai[1] = 0f; - NPC.ai[2] = 0f; - NPC.ai[3] = 0f; - calamityGlobalNPC.newAI[1] = 0f; - calamityGlobalNPC.newAI[2] = 0f; - calamityGlobalNPC.newAI[3] = 0f; - - // Despawn existing projectiles and summon the aura again - DespawnSpecificProjectiles(true); - Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, -1); if (Main.netMode != NetmodeID.SinglePlayer) ProvidenceDyeConditionSyncPacket.Send(this); NPC.ForceNetUpdate(false); @@ -508,7 +500,8 @@ namespace CalamityMod.NPCs.Providence { // Initialize sound SoundEngine.PlaySound(BurnStartSound, player.Center); - BurningSoundSlot = SoundEngine.PlaySound(BurnLoopSound, player.Center); + if (!SoundEngine.TryGetActiveSound(BurningSoundSlot, out _)) + BurningSoundSlot = SoundEngine.PlaySound(BurnLoopSound, player.Center, HolyInfernoSoundCallback); SoundWarningLevel = 2f; } player.AddBuff(ModContent.BuffType(), 2); @@ -540,17 +533,12 @@ namespace CalamityMod.NPCs.Providence SoundWarningLevel -= 1 / 50f; // Updating the looping sound - if (SoundEngine.TryGetActiveSound(BurningSoundSlot, out var burningSound) && burningSound.IsPlaying) + if (SoundEngine.TryGetActiveSound(BurningSoundSlot, out var burningSound)) burningSound.Position = player.Center; - // Adjust the volume or break the loop accordingly - if (burningSound is not null) - { - if (SoundWarningLevel <= 1f) - burningSound?.Stop(); - else if (SoundWarningLevel <= 2f) - burningSound.Volume = SoundWarningLevel - 1f; - } + // Stop the sounds when necessary. + if (!NPC.active || SoundWarningLevel <= 1f) + StopHolyInfernoSounds(); // Count the remaining Guardians, healer especially because it allows the boss to heal int guardianAmt = 0; @@ -810,11 +798,8 @@ namespace CalamityMod.NPCs.Providence calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = AIState == (int)Phase.FlameCocoon || AIState == (int)Phase.SpearCocoon || AIState == (int)Phase.Laser || spawnAnimation; - // Providence fires predictive holy/molten blasts if she is ahead of her target's movement - bool predictiveShots = false; - // Movement - if (getFuckedAI || (AIState != (int)Phase.FlameCocoon && AIState != (int)Phase.SpearCocoon)) + if (Main.zenithWorld || (AIState != (int)Phase.FlameCocoon && AIState != (int)Phase.SpearCocoon)) { // Slowly drift down when spawning if (spawnAnimation) @@ -868,11 +853,6 @@ namespace CalamityMod.NPCs.Providence } } - - // Predictive shot checks - if ((NPC.velocity.X > 0f && (NPC.Center.X - player.Center.X) > 0f && player.velocity.X > 0f) || (NPC.velocity.X < 0f && (NPC.Center.X - player.Center.X) < 0f && player.velocity.X < 0f)) - predictiveShots = true; - // Velocity and acceleration float speedIncreaseTimer = fullPowerAI ? 75f : death ? 120f : 150f; float accelerationBoost = death ? 0.3f * (1f - lifeRatio) : 0.2f * (1f - lifeRatio); @@ -886,14 +866,8 @@ namespace CalamityMod.NPCs.Providence } if (laserPhaseSlow) { - acceleration *= getFuckedAI ? 0.6f : 0.2f; - velocity *= getFuckedAI ? 0.6f : 0.2f; - } - - if (Main.getGoodWorld) - { - velocity *= 1.2f; - acceleration *= 1.2f; + acceleration *= Main.zenithWorld ? 0.6f : 0.2f; + velocity *= Main.zenithWorld ? 0.6f : 0.2f; } if (!targetDead) @@ -906,14 +880,11 @@ namespace CalamityMod.NPCs.Providence float moveUpThreshold = player.position.Y - (NPC.position.Y + NPC.height); if (moveUpThreshold < (laserPhaseSlow ? 150f : 200f)) // 150 - NPC.velocity.Y -= Main.getGoodWorld ? 0.4f : 0.2f; + NPC.velocity.Y -= fullPowerAI ? 0.4f : 0.2f; if (moveUpThreshold > (laserPhaseSlow ? 200f : 250f)) // 200 - NPC.velocity.Y += Main.getGoodWorld ? 0.4f : 0.2f; + NPC.velocity.Y += fullPowerAI ? 0.4f : 0.2f; float speedCap = laserPhaseSlow ? 2f : 6f; - if (Main.getGoodWorld) - speedCap *= 1.5f; - if (NPC.velocity.Y > speedCap) NPC.velocity.Y = speedCap; if (NPC.velocity.Y < -speedCap) @@ -1129,29 +1100,7 @@ namespace CalamityMod.NPCs.Providence GeneralParticleHandler.SpawnParticle(new SparkParticle(startPos, startPos.DirectionTo(destination) * (startPos.Distance(destination) / 10), false, 10, Main.rand.NextFloat(0.2f, 0.5f) * (sc * 2), medColor)); } - // Used to heal her back to full HP during enrage animation - if (fullPowerAI && calamityGlobalNPC.newAI[3] % 9f == 0f) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int healAmt = NPC.lifeMax / 400; - if (healAmt > NPC.lifeMax - NPC.life) - healAmt = NPC.lifeMax - NPC.life; - - if (healAmt > 0) - { - NPC.life += healAmt; - NPC.HealEffect(healAmt, true); - NPC.ForceNetUpdate(false); - } - } - } - calamityGlobalNPC.newAI[3] += 1f; - - if (fullPowerAI && calamityGlobalNPC.newAI[3] >= spawnAnimationTime) - calamityGlobalNPC.newAI[3] += 1f; - return; } @@ -1179,10 +1128,8 @@ namespace CalamityMod.NPCs.Providence Vector2 projectileFirePosition = new Vector2(NPC.Center.X + NPC.velocity.SafeNormalize(Vector2.UnitX).X * 120f, NPC.Center.Y); float velocityBoost = death ? 4f * (1f - lifeRatio) : 2.5f * (1f - lifeRatio); float projSpeed = (revenge ? 12f : expertMode ? 10.5f : 9f) + velocityBoost; - Vector2 predictionAmount = player.velocity * 100f; - Vector2 projectileVelocity = (player.Center + (predictiveShots ? predictionAmount : Vector2.Zero) - projectileFirePosition).SafeNormalize(Vector2.UnitY) * projSpeed * 0.1f; - Vector2 explodePosition = predictiveShots ? (player.position + predictionAmount) : player.position; - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileFirePosition, projectileVelocity, ModContent.ProjectileType(), HolyBlastDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, explodePosition.X, explodePosition.Y); + Vector2 projectileVelocity = (player.Center - projectileFirePosition).SafeNormalize(Vector2.UnitY) * projSpeed * 0.1f; + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileFirePosition, projectileVelocity, ModContent.ProjectileType(), HolyBlastDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, player.position.X, player.position.Y); } } else if (NPC.ai[3] < 0f) @@ -1248,7 +1195,7 @@ namespace CalamityMod.NPCs.Providence borderPosition ??= NPC.Center; borderPosition = Vector2.Lerp(borderPosition.Value, NPC.Center, 0.02f); Vector2 fireSparklesFrom = fireFrom + new Vector2(0, -30); - if (!targetDead && !getFuckedAI) + if (!targetDead && !Main.zenithWorld) { if (NPC.velocity.Length() <= 2f) NPC.velocity = Vector2.Zero; @@ -1454,10 +1401,8 @@ namespace CalamityMod.NPCs.Providence Vector2 projectileFirePosition = new Vector2(NPC.Center.X + NPC.velocity.SafeNormalize(Vector2.UnitX).X * 120f, NPC.Center.Y); float velocityBoost = death ? 4f * (1f - lifeRatio) : 2.5f * (1f - lifeRatio); float projSpeed = (revenge ? 12f : expertMode ? 10.5f : 9f) + velocityBoost; - Vector2 predictionAmount = player.velocity * 100f; - Vector2 projectileVelocity = (player.Center + (predictiveShots ? predictionAmount : Vector2.Zero) - projectileFirePosition).SafeNormalize(Vector2.UnitY) * projSpeed * 0.1f; - Vector2 explodePosition = predictiveShots ? (player.position + predictionAmount) : player.position; - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileFirePosition, projectileVelocity, ModContent.ProjectileType(), MoltenBlastDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, explodePosition.X, explodePosition.Y); + Vector2 projectileVelocity = (player.Center - projectileFirePosition).SafeNormalize(Vector2.UnitY) * projSpeed * 0.1f; + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileFirePosition, projectileVelocity, ModContent.ProjectileType(), MoltenBlastDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, player.position.X, player.position.Y); } } else if (NPC.ai[3] < 0f) @@ -1521,7 +1466,7 @@ namespace CalamityMod.NPCs.Providence borderPosition ??= NPC.Center; borderPosition = Vector2.Lerp(borderPosition.Value, NPC.Center, 0.02f); - if (!targetDead && !getFuckedAI) + if (!targetDead && !Main.zenithWorld) { if (NPC.velocity.Length() <= 2f) NPC.velocity = Vector2.Zero; @@ -1566,9 +1511,6 @@ namespace CalamityMod.NPCs.Providence if (Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, vector2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); - - if (Main.getGoodWorld) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -vector2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); } } @@ -1593,9 +1535,6 @@ namespace CalamityMod.NPCs.Providence if (Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, velocity2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, 1f, 0f); - - if (Main.getGoodWorld) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -velocity2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, 1f, 0f); } } @@ -1613,7 +1552,7 @@ namespace CalamityMod.NPCs.Providence case (int)Phase.Crystal: - if (!targetDead && !getFuckedAI) + if (!targetDead && !Main.zenithWorld) NPC.velocity *= 0.9f; NPC.ai[1] += 1f; @@ -1685,7 +1624,7 @@ namespace CalamityMod.NPCs.Providence if (Main.netMode != NetmodeID.MultiplayerClient) { - float timeLeft = fullPowerAI ? (float)(getFuckedAI ? gfbCrystalTime : enragedCrystalTime) : 0f; + float timeLeft = fullPowerAI ? (float)(Main.zenithWorld ? gfbCrystalTime : enragedCrystalTime) : 0f; Projectile.NewProjectile(NPC.GetSource_FromAI(), crystalSpawnPos, Vector2.Zero, ModContent.ProjectileType(), CrystalDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, lifeRatio, 0f, timeLeft); } } @@ -1956,10 +1895,26 @@ namespace CalamityMod.NPCs.Providence } } + private void StopHolyInfernoSounds() + { + if (SoundEngine.TryGetActiveSound(BurningSoundSlot, out ActiveSound infernoSound)) + infernoSound.Stop(); + if (BurningSoundSlot.IsValid) + BurningSoundSlot = SlotId.Invalid; + } + + private bool HolyInfernoSoundCallback(ActiveSound sound) + { + if (SoundWarningLevel <= 2f) + sound.Volume = SoundWarningLevel - 1f; + return NPC.active; + } + public override bool CheckDead() { NPC.life = 1; DespawnSpecificProjectiles(true); + StopHolyInfernoSounds(); Dying = true; NPC.active = true; NPC.dontTakeDamage = true; @@ -2041,12 +1996,6 @@ namespace CalamityMod.NPCs.Providence return prov.challenge; }, () => Main.expertMode, DropHelper.ProvidenceChallengeText)).Add(ModContent.ItemType()); - npcLoot.AddIf(info => - { - Providence prov = info.npc.ModNPC(); - return prov.hasBeenGivenFullPower; - }, ModContent.ItemType(), 1, 4, 4, desc: DropHelper.ProvidenceEnragedText); - npcLoot.AddIf(info => { Providence prov = info.npc.ModNPC(); @@ -2072,7 +2021,7 @@ namespace CalamityMod.NPCs.Providence // Equipment // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss - // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); // Materials normalOnly.Add(ModContent.ItemType(), 1, 50, 60); @@ -2106,7 +2055,7 @@ namespace CalamityMod.NPCs.Providence public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - bool offColor = NPC.localAI[1] != (float)BossMode.Normal && (NPC.Calamity().newAI[3] >= 180f || Main.zenithWorld); + bool offColor = NPC.localAI[1] != (float)BossMode.Normal; Texture2D texture = offColor ? TextureNight.Value : TextureAssets.Npc[Type].Value; Texture2D textureGlow = offColor ? TextureNight_Glow.Value : Texture_Glow.Value; @@ -2745,7 +2694,7 @@ namespace CalamityMod.NPCs.Providence // Equipment ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType(), // Vanity @@ -2873,14 +2822,6 @@ namespace CalamityMod.NPCs.Providence // These will be used for almost every single one of her projectiles, so it's useful to have. public static class ProvUtils { - /// - /// This lease should be used to draw all of a projectile's effects onto directly, then be drawn onto the screen as one. This is for opacity reasons - /// - public static RenderTargetLease PrimaryLease { get => field ??= ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice); set; } - /// - /// This should be used for secondary effects like trails, then drawn to PrimaryLease. This is for opacity reasons. - /// - public static RenderTargetLease SecondaryLease { get => field ??= ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice); set; } public static bool StandardAI() => (CalamityGlobalNPC.holyBoss == -1 || !Main.npc[CalamityGlobalNPC.holyBoss].Calamity().CurrentlyEnraged) && !Main.zenithWorld; public static int CalculateProvidenceDamage(this int damage) diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index 4981b94c3f..2674daac13 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -50,6 +50,7 @@ namespace CalamityMod.NPCs.SlimeGod { NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.MPAllowedEnemies[Type] = true; + NPCID.Sets.NeedsExpertScaling[Type] = true; NPCID.Sets.TrailCacheLength[Type] = 8; NPCID.Sets.TrailingMode[Type] = 1; if (!Main.dedServ) @@ -63,7 +64,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = 40; // 80 + NPC.damage = 0; NPC.npcSlots = 10f; NPC.width = 44; NPC.height = 44; @@ -195,17 +196,17 @@ namespace CalamityMod.NPCs.SlimeGod // Vanish phase if ((!purpleSlimeAlive && !redSlimeAlive) || calamityGlobalNPC.newAI[3] == 1f || NPC.ai[3] == 1f) { - // Avoid cheap bullshit - NPC.damage = 0; - // Make sure Opacity is set to 0.8f if it's below that when the vanish phase starts if (NPC.ai[3] == 0f) { - if (!NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType())) + if (!NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType()) && + !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType())) { NPC.ai[3] = 1f; NPC.Opacity = 0.8f; } + else + NPC.Opacity = 0.01f; // This line ensures the core doesn't immediately explode into loot if it's currently possessing a paladin } // Emit dust @@ -351,9 +352,6 @@ namespace CalamityMod.NPCs.SlimeGod calamityGlobalNPC.newAI[2] += 1f; if (calamityGlobalNPC.newAI[2] >= hideInsideLargeSlimePhaseGateValue) { - // Avoid cheap bullshit - NPC.damage = 0; - NPC.rotation += NPC.direction * 0.3f; if (buffedSlime == 0) @@ -424,9 +422,6 @@ namespace CalamityMod.NPCs.SlimeGod return; } - // Avoid cheap bullshit - NPC.damage = 0; - if (expertMode) { float divisor = death ? 180f : revenge ? 240f : 300f; @@ -479,9 +474,6 @@ namespace CalamityMod.NPCs.SlimeGod NPC.ai[0] -= 1f; if (distanceFromFlyDestination < 200f || NPC.ai[0] > 0f) { - // Set damage - NPC.damage = NPC.defDamage; - if (distanceFromFlyDestination < 200f) NPC.ai[0] = 20f; @@ -652,8 +644,7 @@ IL_6899: ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType() + ModContent.ItemType() }; normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, weapons)); diff --git a/NPCs/SlimeGod/SplitCrimulanPaladin.cs b/NPCs/SlimeGod/SplitCrimulanPaladin.cs index 7d30a48077..af132c16ec 100644 --- a/NPCs/SlimeGod/SplitCrimulanPaladin.cs +++ b/NPCs/SlimeGod/SplitCrimulanPaladin.cs @@ -712,6 +712,8 @@ namespace CalamityMod.NPCs.SlimeGod } } + public override bool CheckActive() => false; + public override Color? GetAlpha(Color drawColor) { Color lightColor = new Color(Main.DiscoR, 100, 150, NPC.alpha); diff --git a/NPCs/SlimeGod/SplitEbonianPaladin.cs b/NPCs/SlimeGod/SplitEbonianPaladin.cs index 20e145acd2..880c170ceb 100644 --- a/NPCs/SlimeGod/SplitEbonianPaladin.cs +++ b/NPCs/SlimeGod/SplitEbonianPaladin.cs @@ -753,6 +753,8 @@ namespace CalamityMod.NPCs.SlimeGod } } + public override bool CheckActive() => false; + public override Color? GetAlpha(Color drawColor) { Color lightColor = new Color(200, 150, Main.DiscoB, NPC.alpha); diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 01165da0e4..7712d363c3 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -876,27 +876,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas rumbleSound.Stop(); canDespawn = true; - for (int x = 0; x < Main.maxProjectiles; x++) - { - Projectile projectile = Main.projectile[x]; - if (projectile.active) - { - if (projectile.type == bulletHellblast || - projectile.type == barrage || - projectile.type == wave) - { - if (projectile.timeLeft > 60) - projectile.timeLeft = 60; - } - else if (projectile.type == fireblast || projectile.type == gigablast) - { - projectile.ai[2] = 1f; - - if (projectile.timeLeft > 15) - projectile.timeLeft = 15; - } - } - } + DespawnProjectiles(); NPC.Opacity = MathHelper.Lerp(NPC.Opacity, 0f, 0.065f); NPC.velocity = Vector2.Lerp(Vector2.UnitY * -4f, Vector2.Zero, (float)Math.Sin(MathHelper.Pi * NPC.Opacity)); @@ -1805,83 +1785,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.noTileCollide = false; NPC.noGravity = false; NPC.damage = 0; - - /* - // Teleport back to the arena on defeat - if (giveUpCounter == GiveUpCounterMax) - { - Dust.QuickDustLine(NPC.Center, initialRitualPosition + new Vector2(0, -30), 500f, permafrost ? Color.Cyan : Color.Red); - NPC.Center = initialRitualPosition + new Vector2(0, -30); - NPC.noTileCollide = false; - NPC.noGravity = false; - NPC.damage = 0; - SoundEngine.PlaySound(GiveUpSound with { Volume = 1.7f }, NPC.Center); - } - if (giveUpCounter == 1010) - { - Particle pulse2 = new StaticPulseRing(NPC.Center, Vector2.Zero, Color.Red * 0.55f, new Vector2(1f, 1f), 0f, 5f, 0f, 47); - GeneralParticleHandler.SpawnParticle(pulse2); - } - - if (shieldOpacity > 0f) - shieldOpacity = 0; - if (giveUpCounter > 1000) - forcefieldScale = MathHelper.Lerp(forcefieldScale, 1.55f, 0.045f); - else if (giveUpCounter > 960) - forcefieldScale = MathHelper.Lerp(forcefieldScale, 0.4f, 0.085f); - - if (giveUpCounter > 960) - { - for (int i = 0; i < 2; i++) - { - Vector2 sparkVel = new Vector2(15, 15).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1.1f); - GlowOrbParticle orb = new GlowOrbParticle(NPC.Center + sparkVel * (8 * forcefieldScale), sparkVel * Utils.GetLerpValue(1200, 960, giveUpCounter, true), false, 60, Main.rand.NextFloat(0.7f, 1.7f) * Utils.GetLerpValue(1200, 960, giveUpCounter), Main.rand.NextBool() ? Color.Red : Color.Lerp(Color.Red, Color.Magenta, 0.5f), true, true); - GeneralParticleHandler.SpawnParticle(orb); - } - - float vibrate = 15 * Utils.GetLerpValue(1200, 960, giveUpCounter, true); - NPC.Center = (initialRitualPosition + new Vector2(0, -30)) + Main.rand.NextVector2Circular(vibrate, vibrate); - } - else - { - if (giveUpCounter == 960) - { - NPC.Center = initialRitualPosition + new Vector2(0, -30); - - Vector2 BurstFXDirection = new Vector2(0, 15); - for (int i = 0; i < 4; i++) - { - SparkParticle spark = new SparkParticle(NPC.Center, (BurstFXDirection) * (i + 1), false, 11, (5f - i * 0.6f) * 3, Color.Lerp(Color.Red, Color.Magenta, Utils.GetLerpValue(-3, 3, i)) * 0.8f); - GeneralParticleHandler.SpawnParticle(spark); - } - for (int i = 0; i < 4; i++) - { - SparkParticle spark = new SparkParticle(NPC.Center, (-BurstFXDirection) * (i + 1), false, 11, (5f - i * 0.6f) * 3, Color.Lerp(Color.Red, Color.Magenta, Utils.GetLerpValue(-3, 3, i)) * 0.8f); - GeneralParticleHandler.SpawnParticle(spark); - } - - Particle orb = new CustomPulse(NPC.Center, Vector2.Zero, Color.Red, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 1.2f, 1.1f, 13); - GeneralParticleHandler.SpawnParticle(orb); - Particle orb2 = new CustomPulse(NPC.Center, Vector2.Zero, Color.Lerp(Color.Red, Color.Magenta, 0.5f), "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 1f, 0.9f, 13); - GeneralParticleHandler.SpawnParticle(orb2); - for (int i = 0; i < 4; i++) - { - Particle orb3 = new CustomPulse(NPC.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.9f, 0.8f, 13); - GeneralParticleHandler.SpawnParticle(orb3); - } - - for (int i = 0; i < 30; i++) - { - GlowOrbParticle burst = new GlowOrbParticle(NPC.Center, (new Vector2(30, 30).RotatedByRandom(100) + new Vector2(0, -2)) * Main.rand.NextFloat(0.1f, 1.2f), true, 120, Main.rand.NextFloat(1.7f, 2.7f), Main.rand.NextBool() ? Color.Red : Color.Lerp(Color.Red, Color.Magenta, 0.5f), true, true); - GeneralParticleHandler.SpawnParticle(burst); - } - - NPC.velocity = new Vector2(18 * NPC.spriteDirection, -12); - giveUpCounter = GiveUpCounterMax; - hasDoneDeathAnim = true; - } - } - */ } else { @@ -1960,32 +1863,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!gettingTired5 && IsAtHp_Acceptance) { - for (int x = 0; x < Main.maxProjectiles; x++) - { - Projectile projectile = Main.projectile[x]; - if (projectile.active) - { - if (projectile.type == ModContent.ProjectileType()) - { - if (projectile.timeLeft > 90) - projectile.timeLeft = 90; - } - if (projectile.type == bulletHellblast || - projectile.type == barrage || - projectile.type == wave) - { - if (projectile.timeLeft > 60) - projectile.timeLeft = 60; - } - else if (projectile.type == fireblast || projectile.type == gigablast) - { - projectile.ai[2] = 1f; - - if (projectile.timeLeft > 15) - projectile.timeLeft = 15; - } - } - } + DespawnProjectiles(true); if (!BossRushEvent.BossRushActive) { @@ -2066,6 +1944,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas castFire.noGravity = true; } + DespawnProjectiles(); SoundEngine.PlaySound(SoundID.DD2_DarkMageCastHeal, player.Center); gettingTired = true; return; @@ -2075,27 +1954,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas #region DespawnProjectiles if (bulletHellCounter2 % BulletHellDuration == 0 && despawnProj) { - for (int x = 0; x < Main.maxProjectiles; x++) - { - Projectile projectile = Main.projectile[x]; - if (projectile.active) - { - if (projectile.type == bulletHellblast || - projectile.type == barrage || - projectile.type == wave) - { - if (projectile.timeLeft > 60) - projectile.timeLeft = 60; - } - else if (projectile.type == fireblast || projectile.type == gigablast) - { - projectile.ai[2] = 1f; - - if (projectile.timeLeft > 15) - projectile.timeLeft = 15; - } - } - } + DespawnProjectiles(); despawnProj = false; } #endregion @@ -3263,6 +3122,30 @@ namespace CalamityMod.NPCs.SupremeCalamitas #endregion } + private static void DespawnProjectiles(bool despawnMaelstrom = false) + { + foreach (Projectile p in Main.ActiveProjectiles) + { + if (despawnMaelstrom && p.type == ModContent.ProjectileType()) + { + if (p.timeLeft > 90) + p.timeLeft = 90; + } + if (p.type == ModContent.ProjectileType() || p.type == ModContent.ProjectileType() || p.type == ModContent.ProjectileType()) + { + if (p.timeLeft > 60) + p.timeLeft = 60; + } + else if (p.type == ModContent.ProjectileType() || p.type == ModContent.ProjectileType()) + { + p.ai[2] = 1f; + + if (p.timeLeft > 15) + p.timeLeft = 15; + } + } + } + public void DoHeartsSpawningCastAnimation(Player target, bool death) { int tempSpawnY = spawnY; diff --git a/NPCs/TownNPCs/Bandit.cs b/NPCs/TownNPCs/Bandit.cs index 8c0d370419..2bd76663aa 100644 --- a/NPCs/TownNPCs/Bandit.cs +++ b/NPCs/TownNPCs/Bandit.cs @@ -124,7 +124,7 @@ namespace CalamityMod.NPCs.TownNPCs "Yuhru", // <@!194276252452913154> (yuhru_) // Original names - this.GetLocalizedValue("Name.Laura"), + this.GetLocalizedValue("Name.Taylor"), this.GetLocalizedValue("Name.Mie"), this.GetLocalizedValue("Name.Bonnie"), this.GetLocalizedValue("Name.Sarah"), @@ -178,8 +178,8 @@ namespace CalamityMod.NPCs.TownNPCs if (armsDealerIndex != -1 && nurseIndex != -1) dialogue.Add(this.GetLocalization("Chat.NurseArmsDealer").Format(Main.npc[nurseIndex].GivenName, Main.npc[armsDealerIndex].GivenName)); - if (NPC.GivenName == this.GetLocalizedValue("Name.Laura")) - dialogue.Add(this.GetLocalizedValue("Chat.NamedLaura")); + if (NPC.GivenName == this.GetLocalizedValue("Name.Taylor")) + dialogue.Add(this.GetLocalizedValue("Chat.NamedTaylor")); if (NPC.GivenName == this.GetLocalizedValue("Name.Penelope")) dialogue.Add(this.GetLocalizedValue("Chat.NamedPenelope")); @@ -307,7 +307,6 @@ namespace CalamityMod.NPCs.TownNPCs NPCShop shop = new(Type); shop.Add() .Add() - .Add() .Add() .Add(ItemID.TigerClimbingGear) .Add(Condition.DownedPirates) @@ -315,7 +314,7 @@ namespace CalamityMod.NPCs.TownNPCs .Add(CalamityConditions.DownedCalamitasClone) .Add(Condition.DownedPlantera) .Add(Condition.DownedPlantera) - .Add(Condition.DownedPlantera, Condition.NpcIsPresent(NPCID.Nurse)) + .Add(Condition.NpcIsPresent(NPCID.Nurse)) .Add(Condition.DownedGolem) .Add(Condition.DownedMoonLord) .Add(CalamityConditions.DownedDevourerOfGods) diff --git a/NPCs/TownNPCs/ShadySalesman.cs b/NPCs/TownNPCs/ShadySalesman.cs index 3168cdbd5b..f98a2eb3ea 100644 --- a/NPCs/TownNPCs/ShadySalesman.cs +++ b/NPCs/TownNPCs/ShadySalesman.cs @@ -30,6 +30,7 @@ using Terraria.Chat; using Terraria.GameContent.Bestiary; using Terraria.UI.Chat; using Terraria.Utilities; +using CalamityMod.Items.Weapons.Magic; namespace CalamityMod.NPCs.TownNPCs { @@ -76,6 +77,7 @@ namespace CalamityMod.NPCs.TownNPCs NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = true; + NPC.housingCategory = 1; // Prevent the Salesman from being instantly evicted when housed with existing Town NPCs as Town Piggy } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -111,9 +113,24 @@ namespace CalamityMod.NPCs.TownNPCs { if (CalamityWorld.unlockedTownPig) { + int oldHomeTileX = -1; + int oldHomeTileY = -1; + if (NPC.homeTileX != -1 && NPC.homeTileY != -1 && !NPC.homeless) + { + oldHomeTileX = NPC.homeTileX; + oldHomeTileY = NPC.homeTileY; + } + string name = NPC.GivenName; NPC.Transform(ModContent.NPCType()); NPC.GivenName = name; + // Transform will force all these back to their unset values, so we need to set them back + if (oldHomeTileX != -1 && oldHomeTileY != -1) + { + NPC.homeTileX = oldHomeTileX; + NPC.homeTileY = oldHomeTileY; + NPC.homeless = false; + } } else { @@ -276,20 +293,22 @@ namespace CalamityMod.NPCs.TownNPCs .Add(Condition.MoonPhasesOdd) .Add(Condition.MoonPhasesHalf0) .Add(Condition.MoonPhasesHalf1) - .Add() + .Add(Condition.MoonPhasesEven) + .Add(Condition.MoonPhasesOdd) .Add(Condition.DownedGoblinArmy) - .Add(Condition.DownedGoblinArmy, Condition.MoonPhases04) - .Add(Condition.DownedGoblinArmy, Condition.MoonPhases15) - .Add(Condition.DownedGoblinArmy, Condition.MoonPhases26) - .Add(Condition.DownedGoblinArmy, Condition.MoonPhases37) - .Add() + .Add(Condition.DownedGoblinArmy, Condition.MoonPhasesOdd) + .Add(Condition.DownedGoblinArmy, Condition.MoonPhasesOdd) + .Add(Condition.DownedGoblinArmy, Condition.MoonPhasesEven) + .Add(Condition.DownedGoblinArmy, Condition.MoonPhasesEven) .Add() .Add() .Add() .Add() + .Add(CalamityConditions.DownedDreadnautilus, Condition.BloodMoon) .Add(Condition.Hardmode) .Add(Condition.Hardmode) .Add(Condition.DownedGolem) + .Add(CalamityConditions.DownedYharon) .Add(new Condition(CalamityUtils.GetText("Condition.HasFoundGladiatorsLocket"), () => RecipeUnlockHandler.HasFoundGladiatorsLocket && Main.moonPhase == 0)) .Add(new Condition(CalamityUtils.GetText("Condition.HasFoundLuxorsGift"), () => RecipeUnlockHandler.HasFoundLuxorsGift && Main.moonPhase == 1)) .Add(new Condition(CalamityUtils.GetText("Condition.HasFoundCrimsonEffigy"), () => RecipeUnlockHandler.HasFoundCrimsonEffigy && Main.moonPhase == 2)) @@ -595,11 +614,25 @@ namespace CalamityMod.NPCs.TownNPCs } else { - string name = Main.npc[petPig].GivenName; - Main.npc[petPig].Transform(ModContent.NPCType()); - Main.npc[petPig].GivenName = name; + NPC pig = Main.npc[petPig]; + int oldHomeTileX = -1; + int oldHomeTileY = -1; + if (pig.homeTileX != -1 && pig.homeTileY != -1 && !pig.homeless) + { + oldHomeTileX = pig.homeTileX; + oldHomeTileY = pig.homeTileY; + } - string fullName = Main.npc[petPig].FullName; + string name = pig.GivenName; + pig.Transform(ModContent.NPCType()); + pig.GivenName = name; + // Transform will force all these back to their unset values, so we need to set them back + if (oldHomeTileX != -1 && oldHomeTileY != -1) + { + pig.homeTileX = oldHomeTileX; + pig.homeTileY = oldHomeTileY; + pig.homeless = false; + } } CanSpawnTonight = false; } @@ -668,7 +701,7 @@ namespace CalamityMod.NPCs.TownNPCs for (var i = 0; i < tooltips.Count; i++) { var line = tooltips[i]; - if (!ExemptFromSmall.Contains(line.Name)) + if (!ExemptFromSmall.Contains(line.Name) && line.Visible) { if (placetoMove < 0) placetoMove = i; @@ -679,6 +712,15 @@ namespace CalamityMod.NPCs.TownNPCs for (int i2 = 0; i2 < snippets.Length; i2++) { lineText += snippets[i2].Text; + + if (snippets[i2] is BuffTagPlayerEffectHandler.Snippet snip) + { + lineText += Lang.GetBuffName(snip.BuffId); + } + else if (snippets[i2] is BuffTagEnemyEffectHandler.Snippet snip2) + { + lineText += Lang.GetBuffName(snip2.BuffId); + } } if (string.IsNullOrWhiteSpace(lineText)) diff --git a/NPCs/TownNPCs/TownPiggy.cs b/NPCs/TownNPCs/TownPiggy.cs index 703316cea4..fe50e24b6d 100644 --- a/NPCs/TownNPCs/TownPiggy.cs +++ b/NPCs/TownNPCs/TownPiggy.cs @@ -35,9 +35,6 @@ namespace CalamityMod.NPCs.TownNPCs NPCID.Sets.TownNPCBestiaryPriority.Add(Type); NPCID.Sets.PlayerDistanceWhilePetting[Type] = 32; NPCID.Sets.IsPetSmallForPetting[Type] = true; - NPC.Calamity().VulnerableToHeat = true; - NPC.Calamity().VulnerableToCold = true; - NPC.Calamity().VulnerableToSickness = true; NPCID.Sets.NPCBestiaryDrawModifiers drawModifiers = new() { @@ -63,6 +60,9 @@ namespace CalamityMod.NPCs.TownNPCs NPC.knockBackResist = 0.5f; NPC.housingCategory = 1; DrawOffsetY = -4; + NPC.Calamity().VulnerableToHeat = true; + NPC.Calamity().VulnerableToCold = true; + NPC.Calamity().VulnerableToSickness = true; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) { @@ -184,6 +184,7 @@ namespace CalamityMod.NPCs.TownNPCs this.GetLocalizedValue("Name.Techno"), // Technoblade this.GetLocalizedValue("Name.JohnPork"), // John Pork this.GetLocalizedValue("Name.Piglet"), // Winnie-the-Pooh + this.GetLocalizedValue("Name.Poogie"), // Monster Hunter // Dedicated names }; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/BrainOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/BrainOfCthulhuAI.cs index a41c9c6511..675782e8c2 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/BrainOfCthulhuAI.cs @@ -2,27 +2,19 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using CalamityMod.Buffs.DamageOverTime; using CalamityMod.DataStructures; using CalamityMod.Enums; using CalamityMod.Events; -using CalamityMod.NPCs; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss.BrainOfCthulhu; -using CalamityMod.Utilities.Daybreak; using CalamityMod.World; using Microsoft.CodeAnalysis; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Microsoft.Xna.Framework.Graphics.PackedVector; -using ReLogic.Content; using Terraria; using Terraria.Audio; using Terraria.Chat; -using Terraria.DataStructures; using Terraria.GameContent; -using Terraria.Graphics.Effects; -using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -67,7 +59,8 @@ public class BrainOfCthulhuAI : VanillaAIOverride #region Health Gates internal static float DesperateOnslaughtCreeperHealthGate => 0.1f; //When the cumulative health % of all creepers falls below this value, BoC will begin its pre-stun attack upon entering its idle phase. - internal static float Phase2HealthGate => 0.5f; //When BoC's health % falls below this value, it will begin entering Phase 2 + internal static float Phase2HealthGate => 0.7f; //When BoC's health % falls below this value, it will begin entering Phase 2 + internal static float ForcedIllusionHealthGate => 0.25f; //When BoC's health % falls below this value, the next attack is forced to be the Illusion Trick #endregion internal static float DespawnRangeSQ => 36000000f; @@ -83,7 +76,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride internal static int CreeperChargeWindUpTime => 22; #endregion - internal static int StunDuration => 480; + internal static int StunDuration => 360; #region Creeper Swipes internal static int SwipesStartupDuration => 120; @@ -253,6 +246,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride internal float SpawnTime = 0; internal int SpawnDelay = 0; internal bool OnSecondCreeperPhase = false; + internal bool ForcedIllusionAttack = false; private bool isNegative = false; internal int AttackSign { get => isNegative ? -1 : 1; set => isNegative = value == -1; } @@ -1672,12 +1666,15 @@ public class BrainOfCthulhuAI : VanillaAIOverride float angleChange = MathHelper.Lerp(MathHelper.Pi / 24f, 0f, MathHelper.Clamp(Time / (ChaseTime * 0.666f), 0f, 1f)); NPC.velocity = NPC.velocity.RotateDirectionTowards(NPC.DirectionTo(Target.Center).ToRotation(), angleChange) * (MathHelper.Lerp(ChaseMinSpeed, ChaseMaxSpeed, Time / ChaseTime) * speedUp * slowDown); + // Teleport ahead of the player's movement if (Time == ChaseTime) { if (Main.netMode != NetmodeID.SinglePlayer) SelectNewTarget(); - Vector2 direction = Target.velocity.SafeNormalize(Vector2.UnitX * Target.direction).RotatedBy(Main.rand.NextFloat(-MathHelper.Pi / 3f, MathHelper.Pi / 3f)); - AttackPosition = Target.Center + (direction * DefaultTeleportDistance); + Vector2 direction = Target.velocity.RotatedByRandom(MathHelper.Pi * 0.1f); + if (direction.Length() < 3.5f) + direction = direction.SafeNormalize(Vector2.UnitX * Target.direction) * 3.5f; + AttackPosition = Target.Center + (direction * IdleTeleportDuration * 1.8f); BoCAfterImages = []; NPC.damage = 0; NPC.netUpdate = true; @@ -1741,26 +1738,35 @@ public class BrainOfCthulhuAI : VanillaAIOverride NPC.rotation = 0; ResetAttackValues(); - if (availableAttacks.Count == 0) + if (!ForcedIllusionAttack && (NPC.life / (float)NPC.lifeMax) <= ForcedIllusionHealthGate) { - bool quickChoice = Main.rand.NextBool(); - availableAttacks = [ - BrainAIState.Bloodletting, + ForcedIllusionAttack = true; + AIState = BrainAIState.IllusionTrick; + PreviousAttack = AIState; + } + else + { + if (availableAttacks.Count == 0) + { + bool quickChoice = Main.rand.NextBool(); + availableAttacks = [ + BrainAIState.Bloodletting, quickChoice ? BrainAIState.SanguineScythes : BrainAIState.IllusionDash, Main.rand.NextBool() ? BrainAIState.Phase2Idle : BrainAIState.Bloodletting, quickChoice ? BrainAIState.IllusionDash : BrainAIState.SanguineScythes, BrainAIState.IllusionTrick - ]; - } + ]; + } - AIState = availableAttacks[0]; - availableAttacks.RemoveAt(0); - PreviousAttack = AIState; + AIState = availableAttacks[0]; + availableAttacks.RemoveAt(0); + PreviousAttack = AIState; - if (AIState == BrainAIState.SanguineScythes) - { - Time = -31; - BoCAfterImages = []; + if (AIState == BrainAIState.SanguineScythes) + { + Time = -31; + BoCAfterImages = []; + } } NPC.netUpdate = true; @@ -2855,7 +2861,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride binaryWriter.Write(SpawnDelay); } - binaryWriter.WriteFlags(OnSecondCreeperPhase, isNegative, AttackFlag); + binaryWriter.WriteFlags(OnSecondCreeperPhase, ForcedIllusionAttack, isNegative, AttackFlag); binaryWriter.Write(AttackRotation); binaryWriter.Write(AttackTime); @@ -2887,7 +2893,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride SpawnDelay = binaryReader.ReadInt32(); } - binaryReader.ReadFlags(out OnSecondCreeperPhase, out isNegative, out AttackFlag); + binaryReader.ReadFlags(out OnSecondCreeperPhase, out ForcedIllusionAttack, out isNegative, out AttackFlag); AttackRotation = binaryReader.ReadSingle(); AttackTime = binaryReader.ReadSingle(); diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs index e5ffa7b8ab..00969c8e2e 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs @@ -190,7 +190,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.getGoodWorld) NPC.ai[1] += 100f; - if (enrage || death) + if (enrage) { NPC.ai[1] += 18f; } @@ -239,8 +239,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!jump) return; - float velocityBoost = (death ? 5f : 3.8f) * (1f - (lifeRatio / 2)); - float velocityX = (death ? 6f : 4f) + velocityBoost; + float velocityBoost = (death ? 3f : 2f) * (1f - (lifeRatio / 2)); + float velocityX = 4f + velocityBoost; if (enrage) velocityX *= 1.5f; @@ -280,7 +280,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses NPC.noTileCollide = true; NPC.ai[2] += 1f; - float jumpVelocity = death ? 26f : 21f; + float jumpVelocity = death ? 21f : 18f; if (enrage) jumpVelocity *= 1.25f; if (turboEnrage) @@ -393,7 +393,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Main.dust[fiery2].velocity.X *= 2f; } - float projectileVelocity = death ? 7.5f : 4.75f; + float projectileVelocity = 4.75f; if (enrage) projectileVelocity *= 1.5f; if (turboEnrage) @@ -1060,7 +1060,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (NPC.ai[1] % 10f == 0f) SoundEngine.PlaySound(SoundID.Item33, spawnLocation); - float laserFireAngle = MathHelper.ToRadians((NPC.ai[1] - telegraphTime + 20) * (death ? 2.45f : 2f)); + float laserFireAngle = MathHelper.ToRadians((NPC.ai[1] - telegraphTime + 20) * (death ? 2.35f : 2f)); Vector2 laserVelocity = Vector2.UnitY.RotatedBy(laserFireAngle * -NPC.localAI[1]) * (death ? 15f : 12f); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -1300,7 +1300,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int i = -1; i <= 1; i += 2) { Vector2 spawnLocation = new Vector2(NPC.Center.X + 14f * NPC.scale * i, NPC.Center.Y - 20f * NPC.scale); - float laserFireAngle = MathHelper.ToRadians((NPC.ai[1] - telegraphTime + 20) * (death ? 2.1f : 2f)); + float laserFireAngle = MathHelper.ToRadians((NPC.ai[1] - telegraphTime + 20) * 2f); Vector2 laserVelocity = -Vector2.UnitY.RotatedBy(laserFireAngle * i) * (death ? 15f : 12f); if (Main.netMode != NetmodeID.MultiplayerClient) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs index 437d1b4969..eb39b7dd28 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs @@ -189,7 +189,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int phase; - int maxRandom = phase4 ? (death ? 5 : 4) : 4; + int maxRandom = phase4 ? 5 : 4; do phase = Main.rand.Next(maxRandom); while (phase == NPC.ai[1] || phase == 1 || (phase == 2 && phase4) || (death && phase6 && phase == 3)); @@ -200,7 +200,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (stingerArcs) phase = 5; - CalamityUtils.CalamityTargeting(NPC, CalamityTargetingParameters.BossDefaults); NPC.ai[0] = phase; NPC.ai[1] = 0f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs index 0dca2a085f..9d7c19f24d 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs @@ -892,7 +892,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float eyeTelegraphGateValue = LaserShootGateValue - LaserShootTelegraphTime; if (NPC.localAI[1] > eyeTelegraphGateValue || NPC.localAI[2] > 0f || enraged) { - Texture2D glowTexture = CalamityClientConfig.Instance.EnableVanillaTextureEdits ? ExtraTextureRefs.WallOfFleshEyeGlowmask.Value : TextureAssets.Npc[NPC.type].Value; var halfSize = NPC.frame.Size() / 2; SpriteEffects spriteEffects = NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; @@ -900,12 +899,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses NPC.localAI[2] > 0f ? 1f - ((NPC.localAI[2] - 1f) / TotalLasersPerBarrage) : MathHelper.Clamp((NPC.localAI[1] - eyeTelegraphGateValue) / LaserShootTelegraphTime, 0f, 1f); - Color drawColor2 = new Color(100, 0, 200, 192) * colorScale; - for (int i = 0; i < 2; i++) - { - spriteBatch.Draw(glowTexture, NPC.Center - screenPos + new Vector2(0, NPC.gfxOffY), NPC.frame, - drawColor2, NPC.rotation, halfSize, NPC.scale, spriteEffects, 0f); - } + Color drawColor2 = new Color(128, 0, 255) * colorScale; + spriteBatch.Draw(TextureAssets.Npc[NPC.type].Value, NPC.Center - screenPos + new Vector2(0, NPC.gfxOffY), NPC.frame, + drawColor2, NPC.rotation, halfSize, NPC.scale, spriteEffects, 0f); } } } diff --git a/Particles/EmoteExpressionParticle.cs b/Particles/EmoteExpressionParticle.cs index 4e9de2e4e0..8f3ff7e080 100644 --- a/Particles/EmoteExpressionParticle.cs +++ b/Particles/EmoteExpressionParticle.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Particles BigSmile } - private Rectangle Frame; + private EmoteType Emote; public EmoteExpressionParticle(Vector2 position, Vector2 velocity, float scale, Color color, int lifeTime, EmoteType emote) { @@ -35,7 +35,7 @@ namespace CalamityMod.Particles Velocity = velocity; Color = color; Lifetime = lifeTime; - Frame = ModContent.Request(Texture).Value.Frame(horizontalFrames: 8, verticalFrames: 1, frameX: (int)emote); + Emote = emote; Rotation = velocity.ToRotation() + MathHelper.PiOver2; } @@ -48,10 +48,11 @@ namespace CalamityMod.Particles public override void CustomDraw(SpriteBatch spriteBatch) { Texture2D emoteTexture = ModContent.Request(Texture).Value; - Vector2 origin = new Vector2(Frame.Width / 2f, Frame.Height); float opacity = 1 - (float)Math.Pow(LifetimeCompletion, 4f); + Rectangle frame = emoteTexture.Frame(horizontalFrames: 8, verticalFrames: 1, frameX: (int)Emote); + Vector2 origin = new Vector2(frame.Width / 2f, frame.Height); - spriteBatch.Draw(emoteTexture, Position - Main.screenPosition, Frame, Color * opacity, Rotation, origin, Scale, SpriteEffects.None, 0); + spriteBatch.Draw(emoteTexture, Position - Main.screenPosition, frame, Color * opacity, Rotation, origin, Scale, SpriteEffects.None, 0); } } } diff --git a/Particles/RancorFog.cs b/Particles/RancorFog.cs new file mode 100644 index 0000000000..924ea7d408 --- /dev/null +++ b/Particles/RancorFog.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; + +namespace CalamityMod.Particles +{ + public class RancorFog : Particle + { + private float Opacity = 0f; + public override bool UseAdditiveBlend => true; + public override bool SetLifetime => true; + public override bool UseCustomDraw => true; + public RancorFog(Vector2 position, Vector2 velocity, int lifetime, float scale, float rotation) + { + Position = position; + Velocity = velocity; + Lifetime = lifetime; + Scale = scale; + Rotation = rotation; + } + + public override void Update() + { + Rotation += Velocity.X * 0.004f; + Velocity *= 0.985f; + Opacity = Utils.GetLerpValue(0f, 15f, Time, true) * Utils.GetLerpValue(Lifetime, Lifetime - 90f, Time, true); + } + + public override void CustomDraw(SpriteBatch spriteBatch) + { + Texture2D texture = GeneralParticleHandler.GetTexture(Type); + float opacity = Opacity * 0.5f; + Color drawColor = new Color(236, 0, 68) * opacity; + Main.EntitySpriteDraw(texture, Position - Main.screenPosition, null, drawColor, Rotation, texture.Size() * 0.5f, Scale, SpriteEffects.None); + } + } +} diff --git a/Projectiles/Magic/RancorFog.png b/Particles/RancorFog.png similarity index 100% rename from Projectiles/Magic/RancorFog.png rename to Particles/RancorFog.png diff --git a/Prefixes/HorribleWeaponPrefix.cs b/Prefixes/HorribleWeaponPrefix.cs index 8484b58f4f..101edf2f21 100644 --- a/Prefixes/HorribleWeaponPrefix.cs +++ b/Prefixes/HorribleWeaponPrefix.cs @@ -10,7 +10,8 @@ namespace CalamityMod.Prefixes public class Horrible : HorribleWeaponPrefix { public override float damageMult => 0.66f; - public override float sizeMult => 2f; + public override float sizeMult => 1.66f; + public override float knockbackMult => 0.01f; } public abstract class HorribleWeaponPrefix : ModPrefix, ILocalizedModType { @@ -19,6 +20,7 @@ namespace CalamityMod.Prefixes // Stats public virtual float damageMult => 1f; public virtual float sizeMult => 1f; + public virtual float knockbackMult => 1f; public override PrefixCategory Category => PrefixCategory.AnyWeapon; public override float RollChance(Item item) => 0; // Is manually applied by an item, can't be rerolled normally @@ -31,6 +33,7 @@ namespace CalamityMod.Prefixes { damageMult = this.damageMult; scaleMult = this.sizeMult; + knockbackMult = this.knockbackMult; } public override void ModifyValue(ref float valueMult) { diff --git a/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs b/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs index 81a55e025a..5b92d10539 100644 --- a/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs @@ -200,7 +200,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles /// /// Internal timer for the projectile's swing animation /// - internal int swingTimer = 0; + public int swingTimer = 0; public static Asset TrailTexture; @@ -212,7 +212,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles List oldProjectileRot = new List { }; List oldProjectilePos = new List { }; - internal int ExistsTime = 20; + public int ExistsTime = 20; public bool inStartup => timer < StartupTime; public bool inCooldown => timer > CooldownStartFrame; diff --git a/Projectiles/Boss/BrainOfCthulhu/BloodBomb.cs b/Projectiles/Boss/BrainOfCthulhu/BloodBomb.cs index 9caa3a9e92..cdcfeee813 100644 --- a/Projectiles/Boss/BrainOfCthulhu/BloodBomb.cs +++ b/Projectiles/Boss/BrainOfCthulhu/BloodBomb.cs @@ -127,7 +127,7 @@ public class BloodBomb : ModNPC, ILocalizedModType public override void ModifyHitByItem(Player player, Item item, ref NPC.HitModifiers modifiers) { - if (modifiers.DamageType == TrueMeleeDamageClass.Instance) + if (modifiers.DamageType.CountsAsClass(TrueMeleeDamageClass.Instance)) { modifiers.FinalDamage *= 1.5f; return; @@ -143,7 +143,7 @@ public class BloodBomb : ModNPC, ILocalizedModType public override void ModifyHitByProjectile(Projectile projectile, ref NPC.HitModifiers modifiers) { - if (modifiers.DamageType == TrueMeleeDamageClass.Instance) + if (modifiers.DamageType.CountsAsClass(TrueMeleeDamageClass.Instance)) { modifiers.FinalDamage *= 1.5f; return; diff --git a/Projectiles/Boss/BrainOfCthulhu/CrimsonEye.cs b/Projectiles/Boss/BrainOfCthulhu/CrimsonEye.cs index 59747e4788..5459c7f056 100644 --- a/Projectiles/Boss/BrainOfCthulhu/CrimsonEye.cs +++ b/Projectiles/Boss/BrainOfCthulhu/CrimsonEye.cs @@ -158,22 +158,6 @@ public class CrimsonEye : ModProjectile, ILocalizedModType if (DistanceRatio > 0) { - /* - Main.spriteBatch.SetBlendState(BlendState.Additive); - - Texture2D tex = ModContent.Request("CalamityMod/Particles/HollowCircleHardEdge").Value; - Color color = Color.Red * DistanceRatio; - if (Time <= 65) - color *= (Time - 45) / 20f; - - if (Projectile.timeLeft <= 20) - color *= Projectile.timeLeft / 20f; - - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, color, 0f, tex.Size() * 0.5f, 1.75f, 0); - - Main.spriteBatch.SetBlendState(BlendState.AlphaBlend); - */ - float opacity = DistanceRatio; if (Time <= 65) opacity *= (Time - 45) / 20f; diff --git a/Projectiles/Boss/CalamitousFireball.cs b/Projectiles/Boss/CalamitousFireball.cs index 03c0f5dcb0..3de7c71ac7 100644 --- a/Projectiles/Boss/CalamitousFireball.cs +++ b/Projectiles/Boss/CalamitousFireball.cs @@ -91,14 +91,6 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(ModContent.BuffType(), 240); } - public override bool PreDraw(ref Color lightColor) - { - return false; - - /* - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); - return false; - */ - } + public override bool PreDraw(ref Color lightColor) => false; } } diff --git a/Projectiles/Boss/CataclysmicFlame.cs b/Projectiles/Boss/CataclysmicFlame.cs index 60179713e4..59ecbb93b0 100644 --- a/Projectiles/Boss/CataclysmicFlame.cs +++ b/Projectiles/Boss/CataclysmicFlame.cs @@ -106,60 +106,6 @@ namespace CalamityMod.Projectiles.Boss } } - public override bool PreDraw(ref Color lightColor) - { - return false; - - /* - Texture2D fire = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Texture2D mist = ModContent.Request("CalamityMod/Particles/MediumMist").Value; - - // The conga line of colors to sift through - Color color1 = new Color(255, 110, 100, 200); - Color color2 = new Color(255, 50, 50, 70); - Color color3 = new Color(255, 100, 100, 100); - Color color4 = new Color(200, 35, 30, 100); - float length = ((Time > Fadetime - 10f) ? 0.1f : 0.15f); - float vOffset = Math.Min(Time, 20f); - float timeRatio = Utils.GetLerpValue(0f, Lifetime, Time); - float fireSize = Utils.Remap(timeRatio, 0.2f, 0.5f, 0.25f, 1f); - - if (timeRatio >= 1f) - return false; - - for (float j = 1f; j >= 0f; j -= length) - { - // Color - Color fireColor = ((timeRatio < 0.1f) ? Color.Lerp(Color.Transparent, color1, Utils.GetLerpValue(0f, 0.1f, timeRatio)) : - ((timeRatio < 0.2f) ? Color.Lerp(color1, color2, Utils.GetLerpValue(0.1f, 0.2f, timeRatio)) : - ((timeRatio < 0.35f) ? color2 : - ((timeRatio < 0.7f) ? Color.Lerp(color2, color3, Utils.GetLerpValue(0.35f, 0.7f, timeRatio)) : - ((timeRatio < 0.85f) ? Color.Lerp(color3, color4, Utils.GetLerpValue(0.7f, 0.85f, timeRatio)) : - Color.Lerp(color4, Color.Transparent, Utils.GetLerpValue(0.85f, 1f, timeRatio))))))); - fireColor *= (1f - j) * Utils.GetLerpValue(0f, 0.2f, timeRatio, true); - Color innerColor = Color.Lerp(fireColor, Color.Black, 0.3f); - - // Positions and rotations - Vector2 firePos = Projectile.Center - Main.screenPosition - Projectile.velocity * vOffset * j; - float mainRot = -j * MathHelper.PiOver2 - Main.GlobalTimeWrappedHourly * (j + 1f) * 2f / length; - float trailRot = MathHelper.PiOver4 - mainRot; - - // Draw one backtrail - Vector2 trailOffset = Projectile.velocity * vOffset * length * 0.5f; - Main.EntitySpriteDraw(fire, firePos - trailOffset, null, innerColor * 0.25f, trailRot, fire.Size() * 0.5f, fireSize, SpriteEffects.None); - - // Draw the main fire - Main.EntitySpriteDraw(fire, firePos, null, innerColor, mainRot, fire.Size() * 0.5f, fireSize, SpriteEffects.None); - - // Draw the masking smoke - Main.spriteBatch.SetBlendState(BlendState.Additive); - Rectangle frame = mist.Frame(1, 3, 0, MistType); - Main.EntitySpriteDraw(mist, firePos, frame, Color.Lerp(fireColor, Color.White, 0.3f), mainRot, frame.Size() * 0.5f, fireSize, SpriteEffects.None); - Main.EntitySpriteDraw(mist, firePos, frame, fireColor, mainRot, frame.Size() * 0.5f, fireSize * 3f, SpriteEffects.None); - Main.spriteBatch.SetBlendState(BlendState.AlphaBlend); - } - return false; - */ - } + public override bool PreDraw(ref Color lightColor) => false; } } diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index 3abbfc578f..c70af794b1 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -161,9 +161,6 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { int totalProjectiles = !ProvUtils.StandardAI() ? 8 : 6; - if (Main.getGoodWorld) - totalProjectiles *= 2; - float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); float velocity = 5f; diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index 36404593ba..4dd4882761 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -1,18 +1,18 @@ using System; using System.Collections.Generic; -using System.Linq; using CalamityMod.Dusts; +using CalamityMod.Effects; using CalamityMod.Graphics.Primitives; using CalamityMod.NPCs.Providence; using CalamityMod.Particles; +using CalamityMod.Systems.Graphic; using CalamityMod.Utilities.Daybreak; using CalamityMod.Utilities.Daybreak.Buffers; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Newtonsoft.Json.Serialization; +using ReLogic.Content; using Terraria; using Terraria.Audio; -using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -20,14 +20,29 @@ namespace CalamityMod.Projectiles.Boss { public class HolyBurnOrb : ModProjectile, ILocalizedModType { + private static Asset TrailNoiseTexture; + private static Asset TrailDistortionTexture; + private static Asset GlowOrbTexture; + bool started = false; + public new string LocalizationCategory => "Projectiles.Boss"; public override string Texture => "CalamityMod/Projectiles/StarProj"; + public override void Load() + { + if (!Main.dedServ) + { + TrailNoiseTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/HarshNoise"); + TrailDistortionTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/Neurons2"); + GlowOrbTexture = ModContent.Request("CalamityMod/Particles/GlowOrbParticle"); + } + } + public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Type] = 32; - ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 12; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() { @@ -66,7 +81,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.timeLeft = 160; } - if (Main.getGoodWorld) + if (!ProvUtils.StandardAI()) { if (Projectile.velocity.Length() < 12f && Projectile.ai[1] == 0f) { @@ -74,8 +89,8 @@ namespace CalamityMod.Projectiles.Boss } else { - Projectile.ai[1] += 0.05f; - Projectile.velocity *= MathHelper.Lerp(0.95f, 1.05f, (float)Math.Abs(Math.Sin(Projectile.ai[1]))); + Projectile.ai[1] += 0.075f; + Projectile.velocity *= MathHelper.Lerp(0.95f, 1.05f, MathF.Abs(MathF.Sin(Projectile.ai[1]))); } } else if (Projectile.velocity.Length() < 16f) @@ -87,59 +102,6 @@ namespace CalamityMod.Projectiles.Boss Projectile.position -= (Projectile.velocity / Projectile.MaxUpdates) * (Projectile.MaxUpdates - 1); } - public override bool PreDraw(ref Color lightColor) - { - //drawn by the HolyBurnOrbDrawer system - return false; - } - public float FireWidthFunction(float completion, Vector2 pos) - { - float width; - float maxBodyWidth = 32f * Projectile.scale; - float curveRatio = 0.2f; - var positions = Projectile.oldPos.ToList(); - positions.RemoveAll(x => x == Vector2.Zero); - // Crop the tip of the trail into a conic shape. - if (completion < curveRatio) - width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; - else - width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); - - // Pulse inwards and outwards over time. - float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f; - float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant); - return (width + additionalPulseWidth) * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; - } - - public Color FireColorFunction(float completion, Vector2 pos) - { - Color mainColor = ProvUtils.GetProjectileColor(255) * 1.3f; - Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); - return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; - } - - public float FireCoreWidthFunction(float completion, Vector2 pos) - { - float width; - float maxBodyWidth = Projectile.scale * 24; - float curveRatio = 0.25f; - var positions = Projectile.oldPos.ToList(); - positions.RemoveAll(x => x == Vector2.Zero); - - if (completion < curveRatio) - width = MathF.Sin(completion / curveRatio * MathHelper.PiOver2) * maxBodyWidth + curveRatio; - else - width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); - return width * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; - } - - public Color FireCoreColorFunction(float completion, Vector2 pos) - { - Color mainColor = ProvUtils.GetProjectileColor(255); - Color tipColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); - Color fullBodyColor = Color.Lerp(mainColor, tipColor, completion); - return Color.Lerp(fullBodyColor, Color.White, 0.175f) * Projectile.Opacity; - } public override void OnKill(int timeLeft) { @@ -173,191 +135,171 @@ namespace CalamityMod.Projectiles.Boss ProvUtils.ApplyDebuffs(target, 120); } - } - - public class HolyBurnOrbDrawer : ModSystem - { - public override void Load() + public float FireWidthFunction(float completion) { - On_Main.DrawProjectiles += DrawAll; + float width; + float maxBodyWidth = 36f * Projectile.scale; + float curveRatio = 0.2f; + + // Crop the tip of the trail into a conic shape. + if (completion < curveRatio) + width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + + // Pulse inwards and outwards over time. + float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 12f) * 0.5f + 0.5f; + float additionalPulseWidth = MathHelper.Lerp(0f, 6f, pulseInterpolant); + return (width + additionalPulseWidth); } - private void DrawAll(On_Main.orig_DrawProjectiles orig, Main self) + public Color FireColorFunction(float completion) { - orig(self); + Color mainColor = Color.Lerp(ProvUtils.GetProjectileColor(255, true) * 2f, ProvUtils.GetProjectileColor(255), 0.75f); + Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; + } - var device = Main.instance.GraphicsDevice; - - List burnToDraw = []; - List healToDraw = []; - - - foreach (var item in Main.ActiveProjectiles) - { - if (item.type == ModContent.ProjectileType()) - burnToDraw.Add(item); - - if (item.type == ModContent.ProjectileType()) - healToDraw.Add(item); - } - - if ((healToDraw.Count() + burnToDraw.Count()) < 1) + public void DrawTrail() + { + if (Projectile.oldPos.Length <= 0) return; - using (Main.spriteBatch.Scope()) + Matrix projection = Matrix.CreateOrthographicOffCenter(0, Main.screenWidth, Main.screenHeight, 0, -200f, 200f); + Vector2 basePosition = Projectile.Center - Main.screenPosition; + Rectangle screenBounds = new Rectangle(-40, -40, Main.screenWidth + 40, Main.screenHeight + 40); + if (screenBounds.Contains(basePosition.ToPoint())) { - - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - - //Burn trails - using (ProvUtils.PrimaryLease.Scope(clearColor: Color.Transparent)) + List path = []; + for (var i = 0; i < Projectile.oldPos.Length; i++) { - foreach (var item in burnToDraw) - DrawBurnOrbTrail(item); - + Vector2 trailDrawPosition = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition; + path.Add(new Vector3(trailDrawPosition.X, trailDrawPosition.Y, 0f)); } - Main.spriteBatch.Draw(ProvUtils.PrimaryLease.Target, Vector2.Zero, null, Color.White * 0.75f, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - //Heal trail - using (ProvUtils.SecondaryLease.Scope(clearColor: Color.Transparent)) + if (path.Count > 2 && Projectile.ai[0] > 6) { - foreach (var item in healToDraw) - DrawHealOrbTrail(item); + Effect shader = CalamityShaders.ProvidenceHolyOrbTrailShader.Value; + shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly); + shader.Parameters["glowPower"].SetValue(1.48f); + Main.graphics.GraphicsDevice.Textures[0] = TrailNoiseTexture.Value; + Main.graphics.GraphicsDevice.SamplerStates[0] = SamplerState.PointWrap; + Main.graphics.GraphicsDevice.Textures[1] = TrailDistortionTexture.Value; + Main.graphics.GraphicsDevice.SamplerStates[1] = SamplerState.LinearWrap; + + using var shaderScope = SanePrimitiveRenderer.BeginShaderScope(shader, Matrix.Identity, Matrix.Identity, projection); + using var trailMesh = TriangleStripBuilder.BuildStripPooled(path, progress => FireWidthFunction(progress), progress => FireColorFunction(progress), PrimitiveMeshCache.Shared, textured: true, smoothingCurve: StripCurveType.Hermite); + shaderScope.Draw(trailMesh.View); } - Main.spriteBatch.Draw(ProvUtils.SecondaryLease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - - //Main orb - foreach (var item in burnToDraw) - DrawBurnOrb(item); - foreach (var item in healToDraw) - DrawHealOrb(item); - - //Additive orb - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - foreach (var item in burnToDraw) - DrawBurnOrbAdditive(item); - foreach (var item in healToDraw) - DrawHealOrbAdditive(item); - Main.spriteBatch.End(); } } - void DrawBurnOrbTrail(Projectile Projectile) + public override bool PreDraw(ref Color lightColor) { - if (Projectile.ModProjectile is HolyBurnOrb M) - { - var tex = GeneralParticleHandler.GetTexture(GeneralParticleHandler.particleIDsByTypes[typeof(BloomParticle)]); - var len = Math.Min(Projectile.oldPos.Length, 32); - for (var i = 0; i < len; i++) - { - Vector2 drawPos = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - Color color = M.FireColorFunction(i / (float)len, Projectile.oldPos[i]); - var color2 = ProvUtils.GetProjectileColor(255, true); - float width = M.FireWidthFunction(i / (float)len, Projectile.oldPos[i]); - Main.spriteBatch.Draw(tex, drawPos, null, (color2 with { A = 0 }) * (1 - i / (float)len), 0f, tex.Size() * 0.5f, new Vector2(width) / tex.Width, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(tex, drawPos, null, (color with { A = 0 }) * (1 - i / (float)len), 0f, tex.Size() * 0.5f, new Vector2(width) / tex.Width * 0.25f, SpriteEffects.None, 0f); - } - } - } - void DrawBurnOrb(Projectile Projectile) - { - float lerpMult = MathHelper.Lerp(0.5f, 1.5f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f))); - - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - Color baseColor = ProvUtils.GetProjectileColor(255, true) * 4; - Color baseColor2 = ProvUtils.GetProjectileColor(255); - baseColor.A = 0; - baseColor *= lerpMult; - baseColor2 *= lerpMult; - Vector2 origin = texture.Size() / 2f; - Vector2 scale = new Vector2(0.5f, 1f) * ((lerpMult - 1) * 0.5f + 1f); - - SpriteEffects spriteEffects = SpriteEffects.None; - if (Projectile.spriteDirection == -1) - spriteEffects = SpriteEffects.FlipHorizontally; - - Projectile.rotation += MathHelper.ToRadians(lerpMult * 2f); - - float upRight = MathHelper.PiOver4; - float up = MathHelper.PiOver2; - float upLeft = 3f * MathHelper.PiOver4; - float left = MathHelper.Pi; - Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upLeft + Projectile.rotation, origin, scale, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upRight - Projectile.rotation, origin, scale, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upLeft + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upRight - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor, up + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor, left - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, up + Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, left - Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); + // Trail drawn by the HolyBurnOrbDrawer system. + DrawBurnOrb(); + DrawBurnOrbAdditive(); + return false; } - void DrawBurnOrbAdditive(Projectile Projectile) + private void DrawBurnOrb() { - var texture = ModContent.Request("CalamityMod/Particles/GlowOrbParticle").Value; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, ProvUtils.GetProjectileColor(255), 0, texture.Size() * 0.5f, 1f, 0, 0f); - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, Color.White, 0, texture.Size() * 0.5f, 0.5f, 0, 0f); - } - void DrawHealOrbTrail(Projectile Projectile) - { - if (Projectile.ModProjectile is HolyLight M) - { - var tex = GeneralParticleHandler.GetTexture(GeneralParticleHandler.particleIDsByTypes[typeof(BloomParticle)]); - var len = Math.Min(Projectile.oldPos.Length, 32); - for (var i = 0; i < len; i++) - { - Vector2 drawPos = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - Color color = M.FireCoreColorFunction(i / (float)len, Projectile.oldPos[i]); - var color2 = new Color(0, 25, 0); - float width = M.FireWidthFunction(i / (float)len, Projectile.oldPos[i]); - Main.spriteBatch.Draw(tex, drawPos, null, (color2 with { A = 0 }) * (1 - i / (float)len), 0f, tex.Size() * 0.5f, new Vector2(width) / tex.Width, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(tex, drawPos, null, (color with { A = 0 }) * (1 - i / (float)len), 0f, tex.Size() * 0.5f, new Vector2(width) / tex.Width * 0.25f, SpriteEffects.None, 0f); - } - } - } - void DrawHealOrb(Projectile Projectile) - { - float vel = Projectile.velocity.Length() / 8; - Projectile.localAI[1] += vel; + float lerpMult = MathHelper.Lerp(0.5f, 1.5f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f))); - Texture2D drawTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Color brightGreen = new Color(54, 209, 54, 0); - Vector2 projDirection = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - Vector2 halfTextureSize = drawTexture.Size() / 2f; - Color halfBrightGreen = brightGreen * 0.5f; - float timeLeftColorScale = MathHelper.Lerp(0.5f, 1.5f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f))); - Projectile.rotation += MathHelper.ToRadians(timeLeftColorScale * 2f); - Vector2 timeLeftDrawEffect = new Vector2(0.5f, 1f) * timeLeftColorScale; - Vector2 timeLeftDrawEffect2 = new Vector2(0.5f, 1f) * timeLeftColorScale; - brightGreen *= timeLeftColorScale; - halfBrightGreen *= timeLeftColorScale; - - Vector2 position3 = projDirection + Projectile.velocity.SafeNormalize(Vector2.Zero) * Utils.GetLerpValue(0.5f, 1f, Projectile.localAI[0] / 60f, clamped: true) * 0; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + Color baseColor = ProvUtils.GetProjectileColor(255, true) * 4; + Color baseColor2 = ProvUtils.GetProjectileColor(255); + baseColor.A = 0; + baseColor *= lerpMult; + baseColor2 *= lerpMult; + Vector2 origin = texture.Size() * 0.5f; + Vector2 scale = new Vector2(0.5f, 1f) * ((lerpMult - 1) * 0.5f + 1f); SpriteEffects spriteEffects = SpriteEffects.None; if (Projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; - Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver2 - Projectile.rotation, halfTextureSize, timeLeftDrawEffect, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, 0f - Projectile.rotation, halfTextureSize, timeLeftDrawEffect2, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver2 - Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, 0f - Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0); + Projectile.rotation += MathHelper.ToRadians(lerpMult * 2f); - Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.36f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.36f, spriteEffects, 0); + float upRight = MathHelper.PiOver4; + float up = MathHelper.PiOver2; + float upLeft = 3f * MathHelper.PiOver4; + float left = MathHelper.Pi; + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upLeft + Projectile.rotation, origin, scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upRight - Projectile.rotation, origin, scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upLeft + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upRight - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, up + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, left - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, up + Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, left - Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); } - void DrawHealOrbAdditive(Projectile Projectile) + private void DrawBurnOrbAdditive() { - var texture = ModContent.Request("CalamityMod/Particles/GlowOrbParticle").Value; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, new Color(54, 209, 54), 0, texture.Size() * 0.5f, 1f, 0, 0f); - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, Color.White, 0, texture.Size() * 0.5f, 0.5f, 0, 0f); + Main.EntitySpriteDraw(GlowOrbTexture.Value, Projectile.Center - Main.screenPosition, null, ProvUtils.GetProjectileColor(255) with { A = 0 }, 0, GlowOrbTexture.Size() * 0.5f, 1f, 0, 0f); + Main.EntitySpriteDraw(GlowOrbTexture.Value, Projectile.Center - Main.screenPosition, null, Color.White with { A = 0 }, 0, GlowOrbTexture.Size() * 0.5f, 0.5f, 0, 0f); + } + } + + public class HolyBurnOrbDrawer : ModSystem + { + public static RenderTargetLease TrailPixelationLease { get; private set; } + + private List HolyBurnOrbs = []; + private List HolyLights = []; + + public override void Load() + { + GeneralDrawLayerSystem.OnBeforeProjectiles += DrawOrbTrails; + if (!Main.dedServ) + { + Main.QueueMainThreadAction(() => TrailPixelationLease = ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice, (w, h) => (w / 2, h / 2))); + } + } + + public override void PostUpdateProjectiles() + { + foreach (var item in Main.ActiveProjectiles) + { + if (item.type == ModContent.ProjectileType() && !HolyBurnOrbs.Contains(item)) + HolyBurnOrbs.Add(item); + if (item.type == ModContent.ProjectileType() && !HolyLights.Contains(item)) + HolyLights.Add(item); + } + + HolyBurnOrbs.RemoveAll(p => !p.active || p.timeLeft <= 1); + HolyLights.RemoveAll(p => !p.active || p.timeLeft <= 1); + } + + private void DrawOrbTrails() + { + if ((HolyBurnOrbs.Count + HolyLights.Count) > 0) + { + using (Main.spriteBatch.Scope()) + { + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + using (TrailPixelationLease.Scope(clearColor: Color.Transparent)) + { + foreach (var item in HolyBurnOrbs) + item.ModProjectile().DrawTrail(); + + foreach (var item in HolyLights) + item.ModProjectile().DrawTrail(); + } + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + + // Redraw at double scale to pixelate the trails. + Main.spriteBatch.Draw(TrailPixelationLease.Target, Vector2.Zero, null, Color.White with { A = 0 }, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); + + Main.spriteBatch.End(); + } + } } } } diff --git a/Projectiles/Boss/HolyFire.cs b/Projectiles/Boss/HolyFire.cs index a25b4d1497..5347d93748 100644 --- a/Projectiles/Boss/HolyFire.cs +++ b/Projectiles/Boss/HolyFire.cs @@ -90,12 +90,12 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { Vector2 velocity = new Vector2(0.01f, 0f); - if (Main.getGoodWorld) + if (!ProvUtils.StandardAI()) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); - if (Main.getGoodWorld) + if (!ProvUtils.StandardAI()) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); @@ -106,12 +106,12 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { Vector2 velocity = new Vector2(0.05f, 0f); - if (Main.getGoodWorld) + if (!ProvUtils.StandardAI()) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); - if (Main.getGoodWorld) + if (!ProvUtils.StandardAI()) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); diff --git a/Projectiles/Boss/HolyLight.cs b/Projectiles/Boss/HolyLight.cs index 71fcbfaa70..935ce48c29 100644 --- a/Projectiles/Boss/HolyLight.cs +++ b/Projectiles/Boss/HolyLight.cs @@ -1,13 +1,13 @@ using System; -using System.Linq; +using System.Collections.Generic; using CalamityMod.Dusts; +using CalamityMod.Effects; using CalamityMod.Enums; -using CalamityMod.NPCs.Providence; +using CalamityMod.Graphics.Primitives; using CalamityMod.Particles; -using CalamityMod.Utilities.Daybreak; -using CalamityMod.Utilities.Daybreak.Buffers; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.Audio; using Terraria.DataStructures; @@ -18,13 +18,29 @@ namespace CalamityMod.Projectiles.Boss { public class HolyLight : ModProjectile, ILocalizedModType { + private static Asset TrailNoiseTexture; + private static Asset TrailDistortionTexture; + private static Asset GlowOrbTexture; + public new string LocalizationCategory => "Projectiles.Boss"; public override string Texture => "CalamityMod/Projectiles/StarProj"; + + public override void Load() + { + if (!Main.dedServ) + { + TrailNoiseTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/EternityStreak"); + TrailDistortionTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/HarshNoise"); + GlowOrbTexture = ModContent.Request("CalamityMod/Particles/GlowOrbParticle"); + } + } + public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Type] = 32; - ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 16; + ProjectileID.Sets.TrailingMode[Type] = 0; } + public override void SetDefaults() { Projectile.localAI[1] = Main.rand.NextFloat(30f); @@ -85,60 +101,6 @@ namespace CalamityMod.Projectiles.Boss } } - public override bool PreDraw(ref Color lightColor) - { - //drawn by the HolyBurnOrbDrawer system - return false; - } - public float FireWidthFunction(float completion, Vector2 pos) - { - float width; - float maxBodyWidth = 32f * Projectile.scale; - float curveRatio = 0.2f; - var positions = Projectile.oldPos.ToList(); - positions.RemoveAll(x => x == Vector2.Zero); - // Crop the tip of the trail into a conic shape. - if (completion < curveRatio) - width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; - else - width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); - - // Pulse inwards and outwards over time. - float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f; - float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant); - return (width + additionalPulseWidth) * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; - } - - public Color FireColorFunction(float completion, Vector2 pos) - { - Color mainColor = new Color(54, 209, 54) * 1.3f; - Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); - return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; - } - - public float FireCoreWidthFunction(float completion, Vector2 pos) - { - float width; - float maxBodyWidth = Projectile.scale * 24; - float curveRatio = 0.25f; - var positions = Projectile.oldPos.ToList(); - positions.RemoveAll(x => x == Vector2.Zero); - - if (completion < curveRatio) - width = MathF.Sin(completion / curveRatio * MathHelper.PiOver2) * maxBodyWidth + curveRatio; - else - width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); - return width * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; - } - - public Color FireCoreColorFunction(float completion, Vector2 pos) - { - Color mainColor = new Color(54, 209, 54); - Color tipColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); - Color fullBodyColor = Color.Lerp(mainColor, tipColor, completion); - return Color.Lerp(fullBodyColor, Color.White, 0.175f) * Projectile.Opacity; - } - public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item14 with { Pitch = -0.3f, Volume = 0.7f }, Projectile.Center); @@ -162,5 +124,113 @@ namespace CalamityMod.Projectiles.Boss dust.noLightEmittence = true; } } + + public float FireWidthFunction(float completion) + { + float width; + float maxBodyWidth = 56f * Projectile.scale; + float curveRatio = 0.2f; + + // Crop the tip of the trail into a conic shape. + if (completion < curveRatio) + width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + + // Pulse inwards and outwards over time. + float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f; + float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant); + return (width + additionalPulseWidth); + } + + public Color FireColorFunction(float completion) + { + Color mainColor = new Color(54, 209, 54) * 1.3f; + Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; + } + + public void DrawTrail() + { + if (Projectile.oldPos.Length <= 0) + return; + + Matrix projection = Matrix.CreateOrthographicOffCenter(0, Main.screenWidth, Main.screenHeight, 0, -200f, 200f); + Vector2 basePosition = Projectile.Center - Main.screenPosition; + Rectangle screenBounds = new Rectangle(-40, -40, Main.screenWidth + 40, Main.screenHeight + 40); + if (screenBounds.Contains(basePosition.ToPoint())) + { + List path = []; + for (var i = 0; i < Projectile.oldPos.Length; i++) + { + Vector2 trailDrawPosition = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition; + path.Add(new Vector3(trailDrawPosition.X, trailDrawPosition.Y, 0f)); + } + + if (path.Count > 2 && Projectile.ai[0] > 6) + { + Effect shader = CalamityShaders.ProvidenceHolyOrbTrailShader.Value; + shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly); + shader.Parameters["glowPower"].SetValue(1.48f); + + Main.graphics.GraphicsDevice.Textures[0] = TrailNoiseTexture.Value; + Main.graphics.GraphicsDevice.SamplerStates[0] = SamplerState.PointWrap; + Main.graphics.GraphicsDevice.Textures[1] = TrailDistortionTexture.Value; + Main.graphics.GraphicsDevice.SamplerStates[1] = SamplerState.LinearWrap; + + using var shaderScope = SanePrimitiveRenderer.BeginShaderScope(shader, Matrix.Identity, Matrix.Identity, projection); + using var trailMesh = TriangleStripBuilder.BuildStripPooled(path, progress => FireWidthFunction(progress), progress => FireColorFunction(progress), PrimitiveMeshCache.Shared, textured: true, smoothingCurve: StripCurveType.Hermite); + shaderScope.Draw(trailMesh.View); + } + } + } + + public override bool PreDraw(ref Color lightColor) + { + // Trail drawn by the HolyBurnOrbDrawer system. + DrawHealOrb(); + DrawHealOrbAdditive(); + return false; + } + + private void DrawHealOrb() + { + float vel = Projectile.velocity.Length() / 8; + Projectile.localAI[1] += vel; + + Texture2D drawTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Color brightGreen = new Color(54, 209, 54, 0); + Vector2 projDirection = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + Vector2 halfTextureSize = drawTexture.Size() / 2f; + Color halfBrightGreen = brightGreen * 0.5f; + float timeLeftColorScale = MathHelper.Lerp(0.5f, 1.5f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f))); + Projectile.rotation += MathHelper.ToRadians(timeLeftColorScale * 2f); + Vector2 timeLeftDrawEffect = new Vector2(0.5f, 1f) * timeLeftColorScale; + Vector2 timeLeftDrawEffect2 = new Vector2(0.5f, 1f) * timeLeftColorScale; + brightGreen *= timeLeftColorScale; + halfBrightGreen *= timeLeftColorScale; + + Vector2 position3 = projDirection + Projectile.velocity.SafeNormalize(Vector2.Zero) * Utils.GetLerpValue(0.5f, 1f, Projectile.localAI[0] / 60f, clamped: true) * 0; + + SpriteEffects spriteEffects = SpriteEffects.None; + if (Projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + + Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver2 - Projectile.rotation, halfTextureSize, timeLeftDrawEffect, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, 0f - Projectile.rotation, halfTextureSize, timeLeftDrawEffect2, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver2 - Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, 0f - Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0); + + Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.36f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.36f, spriteEffects, 0); + } + + private void DrawHealOrbAdditive() + { + Main.spriteBatch.Draw(GlowOrbTexture.Value, Projectile.Center - Main.screenPosition, null, new Color(54, 209, 54) with { A = 0 }, 0, GlowOrbTexture.Size() * 0.5f, 1f, 0, 0f); + Main.spriteBatch.Draw(GlowOrbTexture.Value, Projectile.Center - Main.screenPosition, null, Color.White with { A = 0 }, 0, GlowOrbTexture.Size() * 0.5f, 0.5f, 0, 0f); + } } } diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index c5a137939a..1a972a6df7 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -166,7 +166,7 @@ namespace CalamityMod.Projectiles.Boss { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f) + additionalBlobVelocity; velocity.Y = -Math.Abs(velocity.Y); - if (Main.getGoodWorld) + if (!ProvUtils.StandardAI()) velocity *= 2f; Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), BlobDamage, 0f, Projectile.owner); diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 30d8eb0a3b..6a5aa23037 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -24,8 +24,10 @@ using CalamityMod.Items.SummonItems; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.NPCs; using CalamityMod.NPCs.OldDuke; +using CalamityMod.NPCs.Other; using CalamityMod.NPCs.PlagueEnemies; using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses; +using CalamityMod.Packets; using CalamityMod.Packets.Entities; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; @@ -211,6 +213,11 @@ namespace CalamityMod.Projectiles /// public bool grapeBeer = false; + /// + /// If this proj was spawned from the Volatile Gelatin accessory + /// + public bool volatileGelatinSpawned = false; + /// /// How strong grape beer homing is on this. It speeds up the longer the target is targeted. /// @@ -350,9 +357,33 @@ namespace CalamityMod.Projectiles // Whenever the player has Daawnlight Spirit Origin, any ranged projectile will have the capacity to infintely supercrit. if (Main.player[projectile.owner].Calamity().spiritOrigin && projectile.CountsAsClass()) - { - projectile.CritChance += Main.player[projectile.owner].Calamity().spiritOriginCritBoost; projectile.Calamity().supercritHits = -1; + + IEntitySource sourceItemAcc = source as EntitySource_ItemUse; + + + if (projectile.type == ProjectileID.VolatileGelatinBall && source is EntitySource_ItemUse { Item: Item acc }) + { + if (acc == Main.player[projectile.owner].Calamity().FindAccessory(ItemID.VolatileGelatin)) + { + projectile.DamageType = AverageDamageClass.Instance; + projectile.usesIDStaticNPCImmunity = false; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = -1; + if (projectile.extraUpdates == 0) + projectile.extraUpdates = 1; + if (projectile.timeLeft > 700) + projectile.timeLeft = 700; + projectile.damage = (int)(projectile.damage * 0.60f); // 40% damage nerf + NPC closeTarget = projectile.Center.ClosestNPCAt(640); + Vector2 velocity = (projectile.Center.DirectionTo(closeTarget.Center) + closeTarget.velocity * 0.03f).SafeNormalize(Vector2.UnitX); + projectile.velocity = velocity * 12; + projectile.penetrate = 6; // this is for bounces, actually has pierce 4 + Player player = Main.player[projectile.owner]; + projectile.ApplyStatsFromSource(player.GetSource_FromThis()); + projectile.netUpdate = true; + volatileGelatinSpawned = true; // Mark them as Volatile Gelatin origin + } } void ApplyGrapeBeer() @@ -488,7 +519,7 @@ namespace CalamityMod.Projectiles EnhancedDarknessSystem.lights.Add(new() { center = projectile.Center, scale = 1 }); // 24DEC2025: Ozzatron: victide bobber culled with SSO - if (projectile.bobber /*&& projectile.type != ProjectileType()*/ && RunFishingMinigames(projectile) && !Main.LocalPlayer.dead) + if (projectile.bobber /*&& projectile.type != ProjectileType()*/ && RunFishingChanges(projectile) && !Main.LocalPlayer.dead) return false; //Reset the Homing Target immediately before AI can re-set it on applicable projectiles @@ -577,6 +608,47 @@ namespace CalamityMod.Projectiles } } + if (volatileGelatinSpawned) + { + Player player = Main.player[projectile.owner]; + if (projectile.timeLeft == 699 && projectile.FinalExtraUpdate() && player.Calamity().volatileGelatinVisuals) + { + for (int i = 0; i <= 14; i++) + { + float variance = Main.rand.NextFloat(-0.4f, 0.4f); + Vector2 vel = projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(variance) * Main.rand.NextFloat(12f, 17f) * (1 - Math.Abs(variance * 1.5f)); + + Dust dust2 = Dust.NewDustPerfect(player.Center, ModContent.DustType(), vel); + dust2.scale = Main.rand.NextFloat(1.7f, 2.5f) * (1 - Math.Abs(variance * 1.5f)); + bool gravity = !Main.rand.NextBool(5); + dust2.noGravity = gravity; + if (!gravity) + dust2.velocity /= 2; + dust2.alpha = Main.rand.Next(70, 150 + 1); + dust2.color = Main.rand.NextBool() ? Color.BlueViolet : Color.SlateBlue; + dust2.noLight = true; + dust2.noLightEmittence = true; + } + + } + if (projectile.timeLeft > 600 && projectile.numHits == 0) + projectile.velocity.Y -= 0.065f; + else if (projectile.velocity.Y < 14) + projectile.velocity.Y += 0.15f; + + float fade = Utils.GetLerpValue(600, 700, projectile.timeLeft, true); + if (fade > 0 && projectile.timeLeft < 695 && Main.player[projectile.owner].Calamity().volatileGelatinVisuals) + { + Particle spark = new CustomSpark(projectile.Center, -projectile.velocity * 0.05f, "CalamityMod/Particles/BloomCircle", false, 11, 0.52f, Color.BlueViolet * 0.5f * fade, new Vector2(0.7f, 1.2f), true, true, glowCenterScale: 0.7f, glowOpacity: 0.5f * fade, shrinkSpeed: 0.14f); + GeneralParticleHandler.SpawnParticle(spark, false, GeneralDrawLayer.BeforeProjectiles); + } + + if (projectile.numHits > 4) + projectile.Kill(); + if (projectile.timeLeft % 5 == 0) + projectile.netUpdate = true; + } + if (projectile.type == ProjectileID.Skull) { bool fromRevSkeletron = projectile.ai[0] < 0f; @@ -2961,7 +3033,7 @@ namespace CalamityMod.Projectiles /// public Vector2 PersistentFishingDataVector2 = Vector2.Zero; - public bool RunFishingMinigames(Projectile projectile) + public bool RunFishingChanges(Projectile projectile) { var owner = Main.player[projectile.owner]; var cplayer = owner.Calamity(); @@ -2969,6 +3041,28 @@ namespace CalamityMod.Projectiles bool reelingIn = projectile.ai[0] == 1; bool lineSnapped = projectile.ai[0] == 2; + // When using rage bait, gives a chance that your items turn to junk + bool alreadyJunk = projectile.ai[1] == ItemID.OldShoe || projectile.ai[1] == ItemID.FishingSeaweed || projectile.ai[1] == ItemID.TinCan; + bool canRageBaitThePlayer = Main.rand.NextBool(RageBait.junkChance.Item1, RageBait.junkChance.Item2); + if (baitItem?.type == ModContent.ItemType() && reelingIn && !alreadyJunk && canRageBaitThePlayer && projectile.localAI[1] != 0) + { + Fishing_DoRageBaitEffects(projectile, owner); + return false; + } + + // Trusty Old Rod functionality. + bool pulledNPC = Main.rand.NextBool(TrustyOldRod.enemyChance.Item1, TrustyOldRod.enemyChance.Item2); + if (owner.HeldItem.type == ModContent.ItemType() && reelingIn && projectile.ai[1] != 0 && projectile.localAI[1] != 0 && pulledNPC) + { + Fishing_DoTrustyOldRodEffects(projectile, owner); + return false; + } + + // For allowing Rage Bait and TOR to function correctly while using custom bobbers. + // See the ReelTheBobberChecks function. + bool canLetRageBaitRunForMinigame = baitItem?.type == ModContent.ItemType() && !alreadyJunk && canRageBaitThePlayer; + bool canLetTrustyOldRodRunForMinigame = owner.HeldItem.type == ModContent.ItemType() && pulledNPC; + #region Utilities void SmallSplashAtOffset(Vector2 offset) { @@ -3004,7 +3098,15 @@ namespace CalamityMod.Projectiles } void ReelTheBobberChecks() { - if (projectile.localAI[1] == 1) + if (canLetRageBaitRunForMinigame) + { + Fishing_DoRageBaitEffects(projectile, owner); + } + else if (canLetTrustyOldRodRunForMinigame) + { + Fishing_DoTrustyOldRodEffects(projectile, owner); + } + else if (projectile.localAI[1] == 1) { if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -3738,62 +3840,60 @@ namespace CalamityMod.Projectiles } - bool alreadyJunk = projectile.ai[1] == ItemID.OldShoe || projectile.ai[1] == ItemID.FishingSeaweed || projectile.ai[1] == ItemID.TinCan; - // When using rage bait, gives a chance that your items turn to junk - if (baitItem?.type == ModContent.ItemType() && reelingIn && !alreadyJunk && Main.rand.NextBool(RageBait.junkChance.Item1, RageBait.junkChance.Item2) && projectile.localAI[1] != 0) - { - var junk = Main.rand.Next(3) switch - { - 0 => ItemID.OldShoe, - 1 => ItemID.FishingSeaweed, - _ => ItemID.TinCan, - }; - - SoundStyle epicFail = new("CalamityMod/Sounds/Item/Swine", 2); - SoundEngine.PlaySound(epicFail with { Volume = 0.9f, Pitch = 0.3f }, projectile.Center); - if (CalamityWorld.revenge) - owner.Calamity().rage += 25; - - for (int i = 0; i < 12; i++) - { - Particle spray = new CustomSpark(projectile.Center + Vector2.UnitX * Main.rand.NextFloat(-10, 10), -Vector2.UnitY * Main.rand.NextFloat(3, 8), "CalamityMod/Particles/BloomCircle", true, Main.rand.Next(18, 24) * 5, Main.rand.NextFloat(0.3f, 0.5f), Color.Lerp(Color.Gray, Color.White, Main.rand.NextFloat(0, 0.7f)) * 0.3f, new Vector2(0.8f, 1f), true, false, 0, false, false); - GeneralParticleHandler.SpawnParticle(spray); - - if (i % 2 == 0) - { - Particle rage = new CustomSpark(owner.Center + Vector2.UnitX * Main.rand.NextFloat(-10, 10) + -Vector2.UnitY * 7.5f, -Vector2.UnitY * Main.rand.NextFloat(0.5f, 2f), "CalamityMod/Particles/BloomCircle", false, Main.rand.Next(12, 18) * 4, Main.rand.NextFloat(0.3f, 0.5f), Color.Lerp(Color.Crimson, Color.Red, Main.rand.NextFloat(0, 0.7f)) * 0.7f, new Vector2(0.7f, 1f), true, false, 0, false, false); - GeneralParticleHandler.SpawnParticle(rage); - } - } - - projectile.ai[1] = junk; - return false; - } - - bool pulledNPC = Main.rand.NextBool(TrustyOldRod.enemyChance.Item1, TrustyOldRod.enemyChance.Item2); - - if (owner.HeldItem.type == ModContent.ItemType() && reelingIn && projectile.ai[1] != 0 && projectile.localAI[1] != 0 && pulledNPC) - { - // Remove any item you would have fished up - projectile.ai[1] = 0; - // Get rarity of pull - int rarity; - int roll = Main.rand.Next(1, 100 + 1); - if (roll == 1) rarity = 3; // UltraRare (1/100) - else if (roll <= 21) rarity = 2; // Rare ~(1/5) - else rarity = 1; // Common ~(4/5) - - if (Main.netMode == NetmodeID.MultiplayerClient && Main.myPlayer == owner.whoAmI) - TrustyOldRodEnemyPacket.Send(owner, projectile.identity, rarity, projectile.lavaWet, projectile.honeyWet); - else if(Main.netMode == NetmodeID.SinglePlayer) - TrustyOldRodEnemySystem.SpawnTrustyOldRodNPC(owner, projectile.identity, rarity, projectile.lavaWet, projectile.honeyWet); - - TrustyOldRodEnemySystem.DoTrustyOldRodVFX(owner, projectile.identity, rarity, projectile.lavaWet, projectile.honeyWet); - projectile.ai[0] = 2; // snap line - return false; - } return false; } + + private void Fishing_DoRageBaitEffects(Projectile projectile, Player owner) + { + var junk = Main.rand.Next(3) switch + { + 0 => ItemID.OldShoe, + 1 => ItemID.FishingSeaweed, + _ => ItemID.TinCan, + }; + + SoundStyle epicFail = new("CalamityMod/Sounds/Item/Swine", 2); + SoundEngine.PlaySound(epicFail with { Volume = 0.9f, Pitch = 0.3f }, projectile.Center); + if (CalamityWorld.revenge) + owner.Calamity().rage += 25; + + for (int i = 0; i < 12; i++) + { + Particle spray = new CustomSpark(projectile.Center + Vector2.UnitX * Main.rand.NextFloat(-10, 10), -Vector2.UnitY * Main.rand.NextFloat(3, 8), "CalamityMod/Particles/BloomCircle", true, Main.rand.Next(18, 24) * 5, Main.rand.NextFloat(0.3f, 0.5f), Color.Lerp(Color.Gray, Color.White, Main.rand.NextFloat(0, 0.7f)) * 0.3f, new Vector2(0.8f, 1f), true, false, 0, false, false); + GeneralParticleHandler.SpawnParticle(spray); + + if (i % 2 == 0) + { + Particle rage = new CustomSpark(owner.Center + Vector2.UnitX * Main.rand.NextFloat(-10, 10) + -Vector2.UnitY * 7.5f, -Vector2.UnitY * Main.rand.NextFloat(0.5f, 2f), "CalamityMod/Particles/BloomCircle", false, Main.rand.Next(12, 18) * 4, Main.rand.NextFloat(0.3f, 0.5f), Color.Lerp(Color.Crimson, Color.Red, Main.rand.NextFloat(0, 0.7f)) * 0.7f, new Vector2(0.7f, 1f), true, false, 0, false, false); + GeneralParticleHandler.SpawnParticle(rage); + } + } + + projectile.ai[1] = junk; + CaughtItemID = junk; + } + + private void Fishing_DoTrustyOldRodEffects(Projectile projectile, Player owner) + { + // Remove any item you would have fished up + projectile.ai[1] = 0; + CaughtItemID = 0; + + // Get rarity of pull + int rarity; + int roll = Main.rand.Next(1, 100 + 1); + if (roll == 1) rarity = 3; // UltraRare (1/100) + else if (roll <= 21) rarity = 2; // Rare ~(1/5) + else rarity = 1; // Common ~(4/5) + + if (Main.netMode == NetmodeID.MultiplayerClient && Main.myPlayer == owner.whoAmI) + TrustyOldRodEnemyPacket.Send(owner, projectile.identity, rarity, projectile.lavaWet, projectile.honeyWet); + else if (Main.netMode == NetmodeID.SinglePlayer) + TrustyOldRodEnemySystem.SpawnTrustyOldRodNPC(owner, projectile.identity, rarity, projectile.lavaWet, projectile.honeyWet); + + TrustyOldRodEnemySystem.DoTrustyOldRodVFX(owner, projectile.identity, rarity, projectile.lavaWet, projectile.honeyWet); + projectile.ai[0] = 2; // snap line + } #endregion #region AI @@ -3934,6 +4034,12 @@ namespace CalamityMod.Projectiles if (projectile.aiStyle == ProjAIStyleID.Flare && projectile.ai[2] == 1f && projectile.localAI[0] == 0f) projectile.localAI[1]--; + if (projectile.type == ProjectileID.BoneArrowFromMerchant) // Bone arrow no gravity before hitting tile + { + if (projectile.ai[2] != 1) + projectile.ai[0] = 0; + } + // Hack to allow Desert Tiger minion to fall through platforms while attacking if (projectile.type >= ProjectileID.StormTigerTier1 && projectile.type <= ProjectileID.StormTigerTier3) { @@ -4720,6 +4826,22 @@ namespace CalamityMod.Projectiles modifiers.SourceDamage *= calamityVelocityDamageMultiplier / vanillaVelocityDamageMultiplier; } + if (projectile.type == ProjectileID.UnholyArrow) // damage falloff + { + if (projectile.numHits > 0) + projectile.damage = (int)(projectile.damage * 0.75f / 0.95f); // Vanilla gives it 5% falloff, this cancels that out + if (projectile.damage < 1) + projectile.damage = 1; + } + + if (projectile.type == ProjectileID.HellfireArrow) // damage falloff + { + if (projectile.numHits > 0) + projectile.damage = (int)(projectile.damage * 0.8f); + if (projectile.damage < 1) + projectile.damage = 1; + } + // Adamantite Throwing Axe's lightning has damage falloff if (projectile.type == ProjectileID.CultistBossLightningOrbArc && projectile.ai[2] == 1f) { @@ -4750,6 +4872,48 @@ namespace CalamityMod.Projectiles if (forcedCrit) modifiers.SetCrit(); + if (volatileGelatinSpawned) + { + target.AddBuff(BuffID.GelBalloonBuff, 180); + + float minMult = 0.2f; + int hitsToMinMult = 5; + float damageMult = Utils.Remap(projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + modifiers.SourceDamage *= damageMult; + + if (projectile.numHits == 0) + player.Calamity().volatileGelHits++; + if (player.Calamity().volatileGelHits == 5) + { + player.Calamity().volatileGelHits = 0; + Vector2 spawnPosition = player.Center; + int npcType = ModContent.NPCType(); + + int slimeCap = 6; + int npcCount = 0; + for (int x = 0; x < Main.maxNPCs; x++) + { + NPC npc = Main.npc[x]; + if (npc.active && npc.type == npcType && npc.ai[1] == player.whoAmI && npc.ai[3] == 0) + npcCount++; + } + + if (npcCount < slimeCap && player.wingTime > 0) + { + if (Main.netMode == NetmodeID.MultiplayerClient) + { + SpawnNPCOnPlayerPacket.Send(player, (int)spawnPosition.X, (int)spawnPosition.Y, npcType); + } + else if (Main.netMode == NetmodeID.SinglePlayer) + { + NPC slime = NPC.NewNPCDirect(player.GetSource_FromThis(), (int)spawnPosition.X, (int)spawnPosition.Y, npcType, ai1: player.whoAmI, ai2: npcCount); + } + } + } + + projectile.netUpdate = true; + } + if (modPlayer.rottenDogTooth && projectile.Calamity().stealthStrike && !modPlayer.vampiricTalisman) target.AddBuff(BuffType(), RottenDogtooth.ArmorCrunchDebuffTime); else if (modPlayer.vampiricTalisman && projectile.Calamity().stealthStrike) @@ -5009,6 +5173,26 @@ namespace CalamityMod.Projectiles #region TileCollide public override bool OnTileCollide(Projectile projectile, Vector2 oldVelocity) { + if (projectile.type == ProjectileID.BoneArrowFromMerchant) // Bone arrow bounce + { + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + projectile.timeLeft -= 120; + if (projectile.timeLeft < 1) + projectile.timeLeft = 1; + + if (projectile.ai[2] != 1) + SoundEngine.PlaySound(SoundID.NPCHit2 with { Volume = 0.5f, Pitch = Main.rand.NextFloat(-0.3f, 0.3f), MaxInstances = 10 }, projectile.Center); + projectile.ai[2] = 1; + + return false; + } //Crystal Darts use -1 local that needs to reset whenever they bounce if (projectile.type == ProjectileID.CrystalDart) { @@ -5094,8 +5278,7 @@ namespace CalamityMod.Projectiles return initialColor; } - if (projectile.type == ProjectileID.SeedPlantera || projectile.type == ProjectileID.PoisonSeedPlantera || - projectile.type == ProjectileID.CultistBossFireBallClone || projectile.type == ProjectileID.AncientDoomProjectile) + if (projectile.type == ProjectileID.SeedPlantera || projectile.type == ProjectileID.PoisonSeedPlantera) { if (projectile.timeLeft < 85) { @@ -5126,6 +5309,37 @@ namespace CalamityMod.Projectiles } #endregion + if (volatileGelatinSpawned) + { + Texture2D texture = TextureAssets.Projectile[projectile.type].Value; + float rate = (projectile.timeLeft * 0.05f); + List eColors = new List() + { + Color.SlateBlue, + Color.BlueViolet + }; + int colorIndex = (int)(rate / 2 % eColors.Count); + Color currentColor = eColors[colorIndex]; + Color nextColor = eColors[(colorIndex + 1) % eColors.Count]; + Color finalColor = Color.Lerp(currentColor, nextColor, rate % 2f >= 1f ? 1f : rate % 1f); + + float fade = Utils.GetLerpValue(600, 700, projectile.timeLeft, true); + int draws = 12; + if (Main.player[projectile.owner].Calamity().volatileGelatinVisuals) + { + for (int i = 0; i < draws; i++) + { + float rotPoint = MathHelper.TwoPi / draws * i; + float dist = 1.5f * fade; + Main.EntitySpriteDraw(texture, projectile.Center - Main.screenPosition + rotPoint.ToRotationVector2().RotatedBy(Main.GlobalTimeWrappedHourly) * dist, null, finalColor with { A = 0 } * 0.6f * fade, MathF.Pow(projectile.rotation, 2), texture.Size() / 2f, projectile.scale * 1.2f, SpriteEffects.None); + } + } + + Main.EntitySpriteDraw(texture, projectile.Center - Main.screenPosition, null, Color.Lerp(lightColor, Color.White, fade), projectile.rotation, texture.Size() / 2f, projectile.scale, SpriteEffects.None); + + shouldDrawBool = false; + } + if (projectile.type == ProjectileID.DeerclopsIceSpike && (CalamityWorld.revenge || BossRushEvent.BossRushActive)) { bool death = CalamityWorld.death || BossRushEvent.BossRushActive; diff --git a/Projectiles/CalamityGlobalProjectileTweaks.cs b/Projectiles/CalamityGlobalProjectileTweaks.cs index 072e1ddb65..3a6f1fa8dd 100644 --- a/Projectiles/CalamityGlobalProjectileTweaks.cs +++ b/Projectiles/CalamityGlobalProjectileTweaks.cs @@ -159,7 +159,7 @@ namespace CalamityMod.Projectiles { ProjectileID.GoldenShowerFriendly, Do(PiercingExact(2), DefaultIDStaticIFrames) }, { ProjectileID.GreenCounterweight, counterweightTweaks }, { ProjectileID.Hamdrax, standardDrillTweaks }, // Drax (never internally renamed since 1.1) - { ProjectileID.HellfireArrow, Do(ExtraUpdatesDelta(+2)) }, + { ProjectileID.HellfireArrow, Do(ExtraUpdatesDelta(+2), LocalIFrames(-1)) }, { ProjectileID.IceBoomerang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.IceSickle, Do(ExtraUpdatesExact(1)) }, { ProjectileID.IchorBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, @@ -300,7 +300,7 @@ namespace CalamityMod.Projectiles { ProjectileID.BombFish, defaultIFrames }, { ProjectileID.Bone, defaultIFrames }, { ProjectileID.BoneArrow, defaultIFrames }, - { ProjectileID.BoneArrowFromMerchant, defaultIFrames }, + { ProjectileID.BoneArrowFromMerchant, Do(ExtraUpdatesExact(2), LocalIFrames(-1)) }, { ProjectileID.BoneDagger, defaultIFrames }, { ProjectileID.BookOfSkullsSkull, defaultIFrames }, { ProjectileID.BookStaffShot, defaultIFrames }, @@ -413,7 +413,7 @@ namespace CalamityMod.Projectiles { ProjectileID.IchorDart, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.JackOLantern, defaultIFrames }, { ProjectileID.JavelinFriendly, defaultIFrames }, - { ProjectileID.JestersArrow, defaultIFrames }, + { ProjectileID.JestersArrow, Do(LocalIFrames(-1)) }, { ProjectileID.Landmine, defaultIFrames }, { ProjectileID.LaserMachinegun, defaultIFrames }, { ProjectileID.LaserMachinegunLaser, defaultIFrames }, @@ -580,7 +580,7 @@ namespace CalamityMod.Projectiles { ProjectileID.TruffleSpore, defaultIFrames }, { ProjectileID.UFOLaser, defaultIFrames }, { ProjectileID.UFOMinion, defaultIFrames }, - { ProjectileID.UnholyArrow, defaultIFrames }, + { ProjectileID.UnholyArrow, Do(LocalIFrames(-1)) }, { ProjectileID.UnholyTridentFriendly, defaultIFrames }, { ProjectileID.UnholyWater, defaultIFrames }, { ProjectileID.VampireKnife, defaultIFrames }, diff --git a/Projectiles/DraedonsArsenal/AerialTrackerLaser.cs b/Projectiles/DraedonsArsenal/AerialTrackerLaser.cs index 22e3b48d87..e3b3d53418 100644 --- a/Projectiles/DraedonsArsenal/AerialTrackerLaser.cs +++ b/Projectiles/DraedonsArsenal/AerialTrackerLaser.cs @@ -88,19 +88,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal modifiers.HideCombatText(); } - public override void OnKill(int timeLeft) - { - /* - for (int i = 0; i < 7; i++) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center, 267); - dust.velocity = (Projectile.velocity * 3 * Projectile.scale).RotatedByRandom(0.3f) * Main.rand.NextFloat(0.3f, 1f); - dust.scale = Main.rand.NextFloat(0.4f, 0.7f) * Projectile.scale; - dust.noGravity = true; - dust.color = Color.Red; - } - */ - } public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) { overPlayers.Add(index); diff --git a/Projectiles/DraedonsArsenal/AugerSlash.cs b/Projectiles/DraedonsArsenal/AugerSlash.cs index 4010a6be88..10660af22a 100644 --- a/Projectiles/DraedonsArsenal/AugerSlash.cs +++ b/Projectiles/DraedonsArsenal/AugerSlash.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); float launchPower = (Projectile.ai[2] == 5 ? 35 : 14); - target.MoveNPC(launchVel, launchPower, true, Owner); + target.MoveNPC(launchVel, launchPower, Projectile.ai[2] == 5, Owner); if (Projectile.ai[2] == 5) modifiers.ApplyScalingForcedCrit(Projectile); diff --git a/Projectiles/DraedonsArsenal/PulsePistolShot.cs b/Projectiles/DraedonsArsenal/PulsePistolShot.cs index cb2d3a8c00..0bb3b5f3ba 100644 --- a/Projectiles/DraedonsArsenal/PulsePistolShot.cs +++ b/Projectiles/DraedonsArsenal/PulsePistolShot.cs @@ -38,6 +38,9 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void AI() { + if (timesItCanHit <= 0) + return; + Lighting.AddLight(Projectile.Center, Effects.ArsenalEffects.ArsenalPulseColor.ToVector3() * 0.5f); Player Owner = Main.player[Projectile.owner]; float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); @@ -194,7 +197,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal pulseOrb2.penetrate = 1; pulseOrb2.scale = 0.7f; } - Projectile.Kill(); + Projectile.timeLeft = 1; // Stagger the kill to allow band accessories to work. There's a separate check that prevents AI from running while timesItCanHit is 0 } } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/DraedonsArsenal/PulseRifleShot.cs b/Projectiles/DraedonsArsenal/PulseRifleShot.cs index c6653e218c..b18550ab26 100644 --- a/Projectiles/DraedonsArsenal/PulseRifleShot.cs +++ b/Projectiles/DraedonsArsenal/PulseRifleShot.cs @@ -44,6 +44,9 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void AI() { + if (timesItCanHit <= 0) + return; + Player Owner = Main.player[Projectile.owner]; float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); @@ -247,7 +250,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } // If it's hit targeted enemies enough, kill it if (timesItCanHit <= 0) - Projectile.Kill(); + Projectile.timeLeft = 1; // Stagger the kill to allow band accessories to work. There's a separate check that prevents AI from running while timesItCanHit is 0 } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Enemy/JellyghoulBolt.cs b/Projectiles/Enemy/JellyghoulBolt.cs index d023799517..b9d14552b4 100644 --- a/Projectiles/Enemy/JellyghoulBolt.cs +++ b/Projectiles/Enemy/JellyghoulBolt.cs @@ -89,17 +89,6 @@ namespace CalamityMod.Projectiles.Enemy Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; int projFrame = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = projFrame * Projectile.frame; - - /*Main.spriteBatch.EnterShaderRegion(BlendState.Additive); - Texture2D ring = ModContent.Request("CalamityMod/Particles/HollowCircleHardEdge").Value; - for (int j = 0; j < 2; j++) - { - for (int i = 2; i < 7; i += 2) - { - Main.spriteBatch.Draw(ring, Projectile.oldPos[i] + Projectile.Size / 2 - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), null, Color.Red * Projectile.Opacity, Projectile.velocity.ToRotation(), ring.Size() / 2, new Vector2(0.5f, 1) * 0.2f * MathHelper.Lerp(1f, 0.5f, (i - 2) / 3f), SpriteEffects.None, 0); - } - } - Main.spriteBatch.ExitShaderRegion();*/ return false; } public float SlashWidthFunction(float _, Vector2 vertexPos) => 16 * Utils.GetLerpValue(0f, 0.1f, _, true); diff --git a/Projectiles/Magic/CalamitousDartFriendly.cs b/Projectiles/Magic/CalamitousDartFriendly.cs new file mode 100644 index 0000000000..df3c1d95d7 --- /dev/null +++ b/Projectiles/Magic/CalamitousDartFriendly.cs @@ -0,0 +1,104 @@ +using System; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using CalamityMod.Graphics.Metaballs; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class CalamitousDartFriendly : ModProjectile, ILocalizedModType + { + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public new string LocalizationCategory => "Projectiles.Magic"; + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; + } + + public override void SetDefaults() + { + Projectile.width = 40; + Projectile.height = 40; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.DamageType = DamageClass.Magic; + Projectile.tileCollide = false; + Projectile.penetrate = 3; + Projectile.timeLeft = 300; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 20; + } + + public override void AI() + { + if (Projectile.extraUpdates == 0) + { + Projectile.extraUpdates = 1; + Projectile.velocity *= 0.5f; + } + Projectile.frameCounter++; + if (Projectile.frameCounter >= 10) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + if (Projectile.frame > 3) + Projectile.frame = 0; + + Lighting.AddLight(Projectile.Center, 0.9f * Projectile.Opacity, 0f, 0f); + + + if (Projectile.timeLeft < 51) + Projectile.Opacity -= 0.02f; + + if (Projectile.velocity.X < 0f) + { + Projectile.spriteDirection = -1; + Projectile.rotation = (float)Math.Atan2(-Projectile.velocity.Y, -Projectile.velocity.X); + } + else + { + Projectile.spriteDirection = 1; + Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X); + } + Projectile.rotation = Projectile.velocity.ToRotation(); + Projectile.spriteDirection = 1; + var dir = Projectile.rotation.ToRotationVector2(); + if (Projectile.spriteDirection == -1) + dir = dir.RotatedBy(MathHelper.Pi); + var spot = Vector2.Lerp(Projectile.Center + dir.RotatedBy(MathHelper.PiOver2) * 26, Projectile.Center + dir.RotatedBy(-MathHelper.PiOver2) * 26, Main.rand.NextFloat()); + for (var i = 0; i < 1; i++) + { + var p = CalamitasMetaball.SpawnParticle(Projectile.Center + Projectile.velocity * 2, Vector2.Zero, 40); + p.rotation = Projectile.rotation + MathHelper.PiOver2; + p.TextureToUse = ModContent.Request("CalamityMod/Particles/PointParticle").Value; + p.SizeScaling = 0.65f; + p = CalamitasMetaball.SpawnParticle(Projectile.Center, Main.rand.NextVector2Circular(3, 3), 24f); + p.SizeScaling = 0.8f; + } + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); + + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); + + public override bool PreDraw(ref Color lightColor) + { + return false; + } + + public override void OnKill(int timeLeft) + { + for (int dust = 0; dust <= 5; dust++) + { + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f); + } + } + } +} diff --git a/Projectiles/Magic/CalamitousExplosionFriendly.cs b/Projectiles/Magic/CalamitousExplosionFriendly.cs new file mode 100644 index 0000000000..1bee87c6ab --- /dev/null +++ b/Projectiles/Magic/CalamitousExplosionFriendly.cs @@ -0,0 +1,94 @@ +using System.IO; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Graphics.Metaballs; +using CalamityMod.NPCs.CalClone; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class CalamitousExplosionFriendly : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Magic"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void SetDefaults() + { + Projectile.width = 130; + Projectile.height = 130; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.penetrate = -1; + Projectile.timeLeft = 120; + Projectile.DamageType = DamageClass.Magic; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 20; + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(Projectile.localAI[0]); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + Projectile.localAI[0] = reader.ReadSingle(); + } + + public override void AI() + { + Lighting.AddLight(Projectile.Center, 0.75f, 0f, 0f); + if (Projectile.localAI[0] == 0f) + { + SoundEngine.PlaySound(CalamitasClone.CalamitousExplosionSound, Projectile.Center); + Projectile.localAI[0] += 1f; + } + bool xflag = false; + bool yflag = false; + if (Projectile.velocity.X < 0f && Projectile.position.X < Projectile.ai[0]) + { + xflag = true; + } + if (Projectile.velocity.X > 0f && Projectile.position.X > Projectile.ai[0]) + { + xflag = true; + } + if (Projectile.velocity.Y < 0f && Projectile.position.Y < Projectile.ai[1]) + { + yflag = true; + } + if (Projectile.velocity.Y > 0f && Projectile.position.Y > Projectile.ai[1]) + { + yflag = true; + } + if (xflag && yflag) + { + Projectile.Kill(); + } + float projTimer = 25f; + if (Projectile.ai[0] > 180f) + { + projTimer -= (Projectile.ai[0] - 180f) / 2f; + } + if (projTimer <= 0f) + { + projTimer = 0f; + Projectile.Kill(); + } + projTimer *= 0.7f; + Projectile.ai[0] += 4f; + var p = CalamitasMetaball.SpawnParticle(Projectile.Center, Main.rand.NextVector2CircularEdge(4, 4), 32f); + p.SizeScaling = 0.96f; + + p = CalamitasMetaball.SpawnParticle(Projectile.Center, Main.rand.NextVector2CircularEdge(3, 3), 40f); + p.SizeScaling = 0.96f; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); + + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); + } +} diff --git a/Projectiles/Magic/BrimstoneHellfireballFriendly.cs b/Projectiles/Magic/CalamitousFireballFriendly.cs similarity index 51% rename from Projectiles/Magic/BrimstoneHellfireballFriendly.cs rename to Projectiles/Magic/CalamitousFireballFriendly.cs index d19ac4ede9..736d4ab02e 100644 --- a/Projectiles/Magic/BrimstoneHellfireballFriendly.cs +++ b/Projectiles/Magic/CalamitousFireballFriendly.cs @@ -1,18 +1,17 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; -using CalamityMod.NPCs.BrimstoneElemental; +using CalamityMod.Graphics.Metaballs; using Microsoft.Xna.Framework; using Terraria; -using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class BrimstoneHellfireballFriendly : ModProjectile, ILocalizedModType + public class CalamitousFireballFriendly : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; - public override string Texture => "CalamityMod/Projectiles/Boss/BrimstoneHellfireball"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public override void SetStaticDefaults() { Main.projFrames[Type] = 6; @@ -22,19 +21,20 @@ namespace CalamityMod.Projectiles.Magic public override void SetDefaults() { - Projectile.width = 12; - Projectile.height = 12; + Projectile.width = 48; + Projectile.height = 48; Projectile.friendly = true; Projectile.ignoreWater = true; - Projectile.timeLeft = 300; - Projectile.penetrate = 1; - Projectile.MaxUpdates = 2; + Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; + Projectile.penetrate = 1; + Projectile.timeLeft = 300; + Projectile.alpha = 255; } public override void AI() { - //Animation + // Animation Projectile.frameCounter++; if (Projectile.frameCounter > 9) { @@ -42,52 +42,50 @@ namespace CalamityMod.Projectiles.Magic Projectile.frameCounter = 0; } if (Projectile.frame >= 6) - { Projectile.frame = 0; - } - //Fade in + // Fade in if (Projectile.alpha > 5) Projectile.alpha -= 15; if (Projectile.alpha < 5) Projectile.alpha = 5; - //Rotation + // Rotation Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); - Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) - MathHelper.ToRadians(90) * Projectile.direction; + Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) - MathHelper.ToRadians(90f) * Projectile.direction; - int brimDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 170, default, 1.1f); - Main.dust[brimDust].noGravity = true; - Main.dust[brimDust].velocity *= 0.5f; - Main.dust[brimDust].velocity += Projectile.velocity * 0.1f; - Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0.05f / 255f, (255 - Projectile.alpha) * 0.05f / 255f); + if (Projectile.velocity.Length() < 16f) + Projectile.velocity *= 1.01f; - if (Projectile.localAI[0] == 0f) + Lighting.AddLight(Projectile.Center, 0.5f, 0f, 0f); + + var brimDust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(32, 32), (int)CalamityDusts.Brimstone, null, 170, default, 1.1f); + brimDust.noGravity = true; + brimDust.velocity *= 0.5f; + brimDust.velocity += Projectile.velocity * 0.1f; + for (var i = 0; i < 1; i++) { - SoundEngine.PlaySound(BrimstoneElemental.HellfireballSound, Projectile.Center); - Projectile.localAI[0] += 1f; + CalamitasMetaball.SpawnParticle(Projectile.Center + Projectile.velocity, Main.rand.NextVector2Circular(2, 2), 64f); } + } - // Speed up as time goes on - Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * (Projectile.velocity.Length() + 0.25f); + public override Color? GetAlpha(Color lightColor) + { + return new Color(250, 50, 50, Projectile.alpha); } public override void OnKill(int timeLeft) { if (Projectile.owner == Main.myPlayer) - { - int fire = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.66f), Projectile.knockBack, Projectile.owner); - } + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 240); - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); + + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Magic/ClimaxBeam.cs b/Projectiles/Magic/ClimaxBeam.cs index aec84744d8..3c11255b6c 100644 --- a/Projectiles/Magic/ClimaxBeam.cs +++ b/Projectiles/Magic/ClimaxBeam.cs @@ -29,15 +29,6 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - /* - Vector2 projPos = Projectile.position; - projPos -= Projectile.velocity * 0.25f; - int boltDust = Dust.NewDust(projPos, 1, 1, DustID.UnusedWhiteBluePurple, 0f, 0f, 0, default, 1.25f); - Main.dust[boltDust].position = projPos; - Main.dust[boltDust].scale = (float)Main.rand.Next(70, 110) * 0.013f; - Main.dust[boltDust].velocity *= 0.1f; - */ - if (Projectile.timeLeft == 500) { Particle orb = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Aqua, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.2f, 0.2f, 3); diff --git a/Projectiles/Magic/HellfireExplosionFriendly.cs b/Projectiles/Magic/HellfireExplosionFriendly.cs deleted file mode 100644 index 7b73558e5a..0000000000 --- a/Projectiles/Magic/HellfireExplosionFriendly.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Magic -{ - public class HellfireExplosionFriendly : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Magic"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 130; - Projectile.height = 130; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.tileCollide = false; - Projectile.penetrate = -1; - Projectile.timeLeft = 120; - Projectile.DamageType = DamageClass.Magic; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 20; - } - - public override void AI() - { - Lighting.AddLight(Projectile.Center, 0.9f, 0f, 0f); - if (Projectile.localAI[0] == 0f) - { - SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); - Projectile.localAI[0] += 1f; - } - float projTimer = 25f; - if (Projectile.ai[0] > 180f) - { - projTimer -= (Projectile.ai[0] - 180f) / 2f; - } - if (projTimer <= 0f) - { - projTimer = 0f; - Projectile.Kill(); - } - projTimer *= 0.7f; - Projectile.ai[0] += 4f; - int timerCounter = 0; - while ((float)timerCounter < projTimer) - { - float rando1 = (float)Main.rand.Next(-10, 11); - float rando2 = (float)Main.rand.Next(-10, 11); - float rando3 = (float)Main.rand.Next(3, 9); - float randoAdjuster = (float)Math.Sqrt((double)(rando1 * rando1 + rando2 * rando2)); - randoAdjuster = rando3 / randoAdjuster; - rando1 *= randoAdjuster; - rando2 *= randoAdjuster; - int brimDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1.5f); - Dust dust = Main.dust[brimDust]; - dust.noGravity = true; - dust.position.X = Projectile.Center.X; - dust.position.Y = Projectile.Center.Y; - dust.position.X += (float)Main.rand.Next(-10, 11); - dust.position.Y += (float)Main.rand.Next(-10, 11); - dust.velocity.X = rando1; - dust.velocity.Y = rando2; - timerCounter++; - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 240); - } - } -} diff --git a/Projectiles/Magic/LightningArc.cs b/Projectiles/Magic/LightningArc.cs index 8f43f46666..9c367924a7 100644 --- a/Projectiles/Magic/LightningArc.cs +++ b/Projectiles/Magic/LightningArc.cs @@ -85,7 +85,6 @@ namespace CalamityMod.Projectiles.Magic } } - // Main.dust[dust].velocity /= 2f; Vector2 current = Projectile.Center; if (target) { @@ -115,33 +114,6 @@ namespace CalamityMod.Projectiles.Magic } Projectile.position = current; - - /*int tx = (int)(projectile.position.X / 16f); - int ty = (int)(projectile.position.Y / 16f); - - if (tx < 0) - { - tx = 0; - } - if (tx > Main.maxTilesX) - { - tx = Main.maxTilesX; - } - if (ty < 0) - { - ty = 0; - } - if (ty > Main.maxTilesY) - { - ty = Main.maxTilesY; - } - - if (Main.tile[tx, ty] != null && Main.tileSolid[(int)Main.tile[tx,ty].type] && Main.tile[tx, ty].wall == 0) - { - projectile.timeLeft -= 12; - }*/ - - } public override bool OnTileCollide(Vector2 oldVelocity) { diff --git a/Projectiles/Magic/LuxorsGiftMagic.cs b/Projectiles/Magic/LuxorsGiftMagic.cs index 53d96f1139..8056df5a3e 100644 --- a/Projectiles/Magic/LuxorsGiftMagic.cs +++ b/Projectiles/Magic/LuxorsGiftMagic.cs @@ -39,14 +39,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.velocity *= 0.1f; if (Projectile.velocity.Length() < 8) Projectile.velocity *= 1.01f; - /* - Vector2 dustVel = (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2().RotatedByRandom(0.5f) * Main.rand.NextFloat(0.8f, 1.3f); - Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(4, 4), ModContent.DustType(), dustVel * Main.rand.NextFloat(0.5f, 1.2f)); - dust.noGravity = !Main.rand.NextBool(3); - dust.scale = Main.rand.NextFloat(0.45f, 0.6f); - dust.color = Color.Gold; - dust.noLightEmittence = true; - */ + if (Projectile.timeLeft > 30) { for (int i = 0; i < 2; i++) diff --git a/Projectiles/Magic/NightOrb.cs b/Projectiles/Magic/NightOrb.cs index 0bfd8ae7cc..906529f68b 100644 --- a/Projectiles/Magic/NightOrb.cs +++ b/Projectiles/Magic/NightOrb.cs @@ -24,5 +24,6 @@ namespace CalamityMod.Projectiles.Magic { CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, 24f, 5, ModContent.ProjectileType()); } + public override bool? CanDamage() => false; } } diff --git a/Projectiles/Magic/RancorFog.cs b/Projectiles/Magic/RancorFog.cs deleted file mode 100644 index bc4ee599e4..0000000000 --- a/Projectiles/Magic/RancorFog.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Magic -{ - public class RancorFog : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Magic"; - public ref float LightPower => ref Projectile.ai[0]; - - public override void SetDefaults() - { - Projectile.width = Projectile.height = 184; - Projectile.penetrate = -1; - Projectile.tileCollide = false; - Projectile.DamageType = DamageClass.Magic; - Projectile.timeLeft = 210; - Projectile.hide = true; - Projectile.ignoreWater = true; - } - - public override void AI() - { - // Decide scale and initial rotation on the first frame this projectile exists. - if (Projectile.localAI[0] == 0f) - { - Projectile.scale = Main.rand.NextFloat(1f, 1.7f) * Projectile.ai[1]; - Projectile.rotation = Main.rand.NextFloat(MathHelper.TwoPi); - Projectile.localAI[0] = 1f; - } - - Projectile.rotation += Projectile.velocity.X * 0.004f; - Projectile.velocity *= 0.985f; - - // 08DEC2023: Ozzatron: All below code does not run on dedicated servers as it requires clientside lighting information. - if (Main.dedServ) - return; - - // Calculate light power. This checks below the position of the fog to check if this fog is underground. - // Without this, it may render over the fullblack that the game renders for obscured tiles. - float lightPowerBelow = Lighting.GetColor((int)Projectile.Center.X / 16, (int)Projectile.Center.Y / 16 + 6).ToVector3().Length() / (float)Math.Sqrt(3D); - LightPower = MathHelper.Lerp(LightPower, lightPowerBelow, 0.15f); - Projectile.Opacity = Utils.GetLerpValue(210f, 195f, Projectile.timeLeft, true) * Utils.GetLerpValue(0f, 90f, Projectile.timeLeft, true); - } - - public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) - { - behindNPCsAndTiles.Add(index); - } - - public override bool PreDraw(ref Color lightColor) - { - Main.spriteBatch.SetBlendState(BlendState.Additive); - - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Vector2 origin = texture.Size() * 0.5f; - Vector2 drawPosition = Projectile.Center - Main.screenPosition; - float opacity = Utils.GetLerpValue(0f, 0.08f, LightPower, true) * Projectile.Opacity * 0.5f; - Color drawColor = new Color(236, 0, 68) * opacity; - Vector2 scale = Projectile.Size / texture.Size() * Projectile.scale; - Main.EntitySpriteDraw(texture, drawPosition, null, drawColor, Projectile.rotation, origin, scale, SpriteEffects.None, 0); - - Main.spriteBatch.SetBlendState(BlendState.AlphaBlend); - return false; - } - } -} diff --git a/Projectiles/Magic/RancorHoldout.cs b/Projectiles/Magic/RancorHoldout.cs index 8091e26805..0b1e159ae2 100644 --- a/Projectiles/Magic/RancorHoldout.cs +++ b/Projectiles/Magic/RancorHoldout.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Magic // Cast the magic circle on the first frame. if (Main.myPlayer == Projectile.owner && Time == 1f) - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.originalDamage, Projectile.knockBack, Projectile.owner); // Handle frames. Projectile.frameCounter++; diff --git a/Projectiles/Magic/RancorLaserbeam.cs b/Projectiles/Magic/RancorLaserbeam.cs index c79eea665f..be82b4092d 100644 --- a/Projectiles/Magic/RancorLaserbeam.cs +++ b/Projectiles/Magic/RancorLaserbeam.cs @@ -4,6 +4,7 @@ using System.Linq; using CalamityMod.Graphics.Metaballs; using CalamityMod.Graphics.Primitives; using CalamityMod.NPCs; +using CalamityMod.Particles; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; @@ -128,7 +129,8 @@ namespace CalamityMod.Projectiles.Magic public void CreateTileHitEffects() { Vector2 endOfLaser = Projectile.Center + Projectile.velocity * (LaserLength - Main.rand.NextFloat(12f, 72f)); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), endOfLaser, Main.rand.NextVector2Circular(4f, 8f), ModContent.ProjectileType(), 0, 0f, Projectile.owner, 0f, 1f); + RancorFog fog = new(endOfLaser, Main.rand.NextVector2Circular(4f, 8f), 180, Main.rand.NextFloat(1f, 1.7f), Main.rand.NextFloat(MathHelper.TwoPi)); + GeneralParticleHandler.SpawnParticle(fog, false, Enums.GeneralDrawLayer.BeforeNPCs); if (Main.rand.NextBool()) { diff --git a/Projectiles/Magic/RancorMagicCircle.cs b/Projectiles/Magic/RancorMagicCircle.cs index 908e460f4d..33ecd8b802 100644 --- a/Projectiles/Magic/RancorMagicCircle.cs +++ b/Projectiles/Magic/RancorMagicCircle.cs @@ -184,7 +184,7 @@ namespace CalamityMod.Projectiles.Magic SoundEngine.PlaySound(SoundID.Zombie104, Projectile.Center); if (Main.myPlayer == Projectile.owner) - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, Projectile.identity); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity, ModContent.ProjectileType(), Projectile.originalDamage, Projectile.knockBack, Projectile.owner, Projectile.identity); } } diff --git a/Projectiles/Magic/ValkyrieRayStaff.cs b/Projectiles/Magic/ValkyrieRayStaff.cs index dfc485f8d0..17aa6cc88a 100644 --- a/Projectiles/Magic/ValkyrieRayStaff.cs +++ b/Projectiles/Magic/ValkyrieRayStaff.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Magic // Compute the gem position, which is needed for visual effects float angle = Projectile.rotation - MathHelper.PiOver2; - Vector2 gemOffset = Vector2.One * ValkyrieRay.GemDistance * 1.4142f; // distance to gem on staff + Vector2 gemOffset = Vector2.One * ValkyrieRay.GemDistance; // distance to gem on staff Vector2 gemPos = Projectile.Center + gemOffset.RotatedBy(angle); // Firing or charging? diff --git a/Projectiles/Melee/AmidiasWhirlpool.cs b/Projectiles/Melee/AmidiasWhirlpool.cs index dc4167d4af..e4bbcfa42f 100644 --- a/Projectiles/Melee/AmidiasWhirlpool.cs +++ b/Projectiles/Melee/AmidiasWhirlpool.cs @@ -69,7 +69,6 @@ namespace CalamityMod.Projectiles.Melee } else if (homeTracker == 1) { - int inc; Projectile.rotation -= MathHelper.Pi / 30f; Vector2 projCenter = Projectile.Center; float homingRange = 150f; diff --git a/Projectiles/Melee/AtaraxiaBoom.cs b/Projectiles/Melee/AtaraxiaBoom.cs index e8a9209d6c..b7ccf781d0 100644 --- a/Projectiles/Melee/AtaraxiaBoom.cs +++ b/Projectiles/Melee/AtaraxiaBoom.cs @@ -69,10 +69,8 @@ namespace CalamityMod.Projectiles.Melee } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - if (Projectile.numHits > 0) - Projectile.damage = (int)(Projectile.damage * 0.88f); - if (Projectile.damage < 1) - Projectile.damage = 1; + float damageMult = MathHelper.Clamp(Utils.GetLerpValue(4, 0, Projectile.numHits), 0.2f, 1); + modifiers.SourceDamage *= damageMult; } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.ai[0] == 1 ? 130 : 200, targetHitbox); } diff --git a/Projectiles/Melee/BalefulHarvesterProjectile.cs b/Projectiles/Melee/BalefulHarvesterProjectile.cs index f5d68cea54..a6f4ef8cec 100644 --- a/Projectiles/Melee/BalefulHarvesterProjectile.cs +++ b/Projectiles/Melee/BalefulHarvesterProjectile.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Projectiles.Melee ProjectileID.Sets.CultistIsResistantTo[Type] = true; ProjectileID.Sets.TrailCacheLength[Type] = 5; ProjectileID.Sets.TrailingMode[Type] = 0; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -33,16 +34,19 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { if (Projectile.ai[0] < 0f) - { Projectile.alpha = 0; - } if (Projectile.alpha > 0) - { Projectile.alpha -= 50; - } if (Projectile.alpha < 0) - { Projectile.alpha = 0; + + Projectile.frameCounter++; + if (Projectile.frameCounter >= 5) + { + Projectile.frameCounter = 0; + Projectile.frame++; + if (Projectile.frame >= Main.projFrames[Type]) + Projectile.frame = 0; } if (Projectile.ai[0] >= 0f && Projectile.ai[0] < 200f) @@ -104,8 +108,6 @@ namespace CalamityMod.Projectiles.Melee Projectile.Kill(); } - public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, Main.rand.Next(0, 128)); - public override bool PreDraw(ref Color lightColor) { CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); diff --git a/Projectiles/Melee/BalefulHarvesterProjectile.png b/Projectiles/Melee/BalefulHarvesterProjectile.png index ed73d2a5f7..f585ef78fb 100644 Binary files a/Projectiles/Melee/BalefulHarvesterProjectile.png and b/Projectiles/Melee/BalefulHarvesterProjectile.png differ diff --git a/Projectiles/Melee/BlazingPhantomBlade.cs b/Projectiles/Melee/BlazingPhantomBlade.cs index 3c316d190c..da772a6a64 100644 --- a/Projectiles/Melee/BlazingPhantomBlade.cs +++ b/Projectiles/Melee/BlazingPhantomBlade.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; Projectile.tileCollide = false; - Projectile.penetrate = -1; // Blazing blades and hyper blades hit four times, sunlight blades hit ten times. + Projectile.penetrate = -1; // Blazing blades and hyper blades hit four times, sunlight blades hit eleven times. Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 20; @@ -158,8 +158,8 @@ namespace CalamityMod.Projectiles.Melee bool hyperBlade = fullyVisibleDuration == DefiledGreatsword.ProjectileFullyVisibleDuration + DefiledGreatsword.ProjectileFullyVisibleDurationIncreasePerAdditionalProjectile; bool sunlightBlade = fullyVisibleDuration == DefiledGreatsword.ProjectileFullyVisibleDuration + DefiledGreatsword.ProjectileFullyVisibleDurationIncreasePerAdditionalProjectile * 2f; - Texture2D asset = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Microsoft.Xna.Framework.Rectangle rectangle = asset.Frame(1, 4); + Texture2D asset = TextureAssets.Projectile[Type].Value; + Rectangle rectangle = asset.Frame(1, 4); Vector2 origin = rectangle.Size() / 2f; float num = Projectile.scale * 1.1f; SpriteEffects effects = ((!(Projectile.ai[0] >= 0f)) ? SpriteEffects.FlipVertically : SpriteEffects.None); diff --git a/Projectiles/Melee/CometQuasherMeteor.cs b/Projectiles/Melee/CometQuasherMeteor.cs index c5ed0d8f22..7c7101a961 100644 --- a/Projectiles/Melee/CometQuasherMeteor.cs +++ b/Projectiles/Melee/CometQuasherMeteor.cs @@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.owner == Main.myPlayer) { - Projectile.damage = (int)(Projectile.damage * 0.7f); + Projectile.damage = (int)(Projectile.damage * 0.5f); Projectile.ExpandHitboxBy((int)(128f * Projectile.scale)); Projectile.penetrate = -1; Projectile.Damage(); diff --git a/Projectiles/Melee/CosmicIceBurst.cs b/Projectiles/Melee/CosmicIceBurst.cs index 379f8d6c13..6318cf0643 100644 --- a/Projectiles/Melee/CosmicIceBurst.cs +++ b/Projectiles/Melee/CosmicIceBurst.cs @@ -110,11 +110,6 @@ namespace CalamityMod.Projectiles.Melee return true; } - /*public override Color? GetAlpha(Color lightColor) - { - return new Color(150, Main.DiscoG, 255, 127); - }*/ - // Only inflict Nightwither if not spawned from Icebreaker public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { diff --git a/Projectiles/Melee/CrystylCrusherRay.cs b/Projectiles/Melee/CrystylCrusherRay.cs index 9e308d1d6f..65c0577e3d 100644 --- a/Projectiles/Melee/CrystylCrusherRay.cs +++ b/Projectiles/Melee/CrystylCrusherRay.cs @@ -144,9 +144,7 @@ namespace CalamityMod.Projectiles.Melee DestroyTiles(); } - /* - * Sets the end of the laser position based on where it collides with something - */ + // Sets the end of the laser position based on where it collides with something private void SetLaserPosition(Player player) { Distance = MathHelper.Max(player.Distance(player.ClampedMouseWorld()) - 20f, MOVE_DISTANCE + 5f); @@ -228,9 +226,7 @@ namespace CalamityMod.Projectiles.Melee public override bool ShouldUpdatePosition() => false; - /* - * Update CutTiles so the laser will cut tiles (like grass) - */ + // Update CutTiles so the laser will cut tiles (like grass) public override bool? CanCutTiles() => IsAtMaxCharge ? null : false; public override void CutTiles() { diff --git a/Projectiles/Melee/DarkBeam.cs b/Projectiles/Melee/DarkBeam.cs index 8f22487732..3c3c5694d7 100644 --- a/Projectiles/Melee/DarkBeam.cs +++ b/Projectiles/Melee/DarkBeam.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Projectiles.Melee private const float MaxVelocity = DarklightGreatsword.ShootSpeed * 12f; - private const int FadeOutTime = 85; + private const int FadeOutTime = 30; - private const int TimeLeft = 215 + FadeOutTime; + private const int TimeLeft = 150 + FadeOutTime; private const int Alpha = 100; diff --git a/Projectiles/Melee/DeathsAscensionProjectile.cs b/Projectiles/Melee/DeathsAscensionProjectile.cs index 9492d93041..aa3fedfaa3 100644 --- a/Projectiles/Melee/DeathsAscensionProjectile.cs +++ b/Projectiles/Melee/DeathsAscensionProjectile.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Melee // Player scythes just home if (Projectile.ai[2] <= 0) { - CalamityUtils.HomeInOnNPC(Projectile, true, 900f, 18f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 900f, 21f, 20f); Projectile.velocity *= 0.96f; } // Rift scythes have orbital motion diff --git a/Projectiles/Melee/DeathsAscensionRift.cs b/Projectiles/Melee/DeathsAscensionRift.cs index fc66e3383a..5ca9df9a21 100644 --- a/Projectiles/Melee/DeathsAscensionRift.cs +++ b/Projectiles/Melee/DeathsAscensionRift.cs @@ -96,6 +96,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.ai[0]--; } } + public override bool? CanDamage() => false; public override void OnKill(int timeLeft) { diff --git a/Projectiles/Melee/DevilsDevastationHoldout.cs b/Projectiles/Melee/DevilsDevastationHoldout.cs index acb46b317d..891f073e4b 100644 --- a/Projectiles/Melee/DevilsDevastationHoldout.cs +++ b/Projectiles/Melee/DevilsDevastationHoldout.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Melee // This is needed because EntitySource_ItemUse always sets Projectile.originalDamage to the item's damage, // regardless of the value passed into the damage argument of NewProjectile. // This results in continuous updating damage resetting the damage. - Projectile.originalDamage *= 15; + Projectile.originalDamage *= DevilsDevastation.BigSlashDamageMult; } public override void WhenSpawned() { @@ -117,7 +117,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 vel = (MathHelper.TwoPi * i / 4f).ToRotationVector2() * 2; Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), lastHitTarget.Center, vel.RotatedBy(MathHelper.ToRadians(45)), ModContent.ProjectileType(), 0, 0f, Owner.whoAmI, 1, 0); } - Projectile strike = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), lastHitTarget.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 1.666f), 0f, Owner.whoAmI, lastHitTarget.whoAmI, 0); + Projectile strike = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), lastHitTarget.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * DevilsDevastation.MarkDamageMult), 0f, Owner.whoAmI, lastHitTarget.whoAmI, 0); strike.DamageType = DamageClass.Melee; SoundStyle dieSound = new("CalamityMod/Sounds/Item/LanceofDestinyStrong"); SoundEngine.PlaySound(dieSound with { Volume = 0.9f, Pitch = 0.3f }, lastHitTarget.Center); diff --git a/Projectiles/Melee/DraconicSpark.cs b/Projectiles/Melee/DraconicSpark.cs index 94db48ae6e..18053a462e 100644 --- a/Projectiles/Melee/DraconicSpark.cs +++ b/Projectiles/Melee/DraconicSpark.cs @@ -30,9 +30,9 @@ namespace CalamityMod.Projectiles.Melee } // ai[0] controls what type of Draconic Spark this is. - // 0 = Orange spark (inflicts Daybroken) - // 1 = Red spark (inflicts Abyssal Flames) - // 2 = Yellow spark (inflicts Holy Flames) + // 0 = Orange spark + // 1 = Red spark + // 2 = Yellow spark public override void AI() { DrawProjectile(); diff --git a/Projectiles/Melee/DragonPowFlail.cs b/Projectiles/Melee/DragonPowFlail.cs index 708d4bba92..6ead67d9bf 100644 --- a/Projectiles/Melee/DragonPowFlail.cs +++ b/Projectiles/Melee/DragonPowFlail.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.ai[1] % 4 == 0) { int type = ModContent.ProjectileType(); - int damage = Projectile.damage / 8; + int damage = Projectile.damage / 2; float kb = 3f; float speed = DragonPow.SparkSpeed; Vector2 vel = new Vector2(speed, 0f).RotatedByRandom(MathHelper.TwoPi); @@ -196,7 +196,7 @@ namespace CalamityMod.Projectiles.Melee { int type = ModContent.ProjectileType(); int numWaterfalls = 12; - int waterfallDamage = Projectile.damage / 6; + int waterfallDamage = Projectile.damage / 4; float waterfallKB = 0f; for (int i = 0; i < numWaterfalls; ++i) { diff --git a/Projectiles/Melee/EmpyreanKnife.cs b/Projectiles/Melee/EmpyreanKnife.cs index 2f788e4530..46fa338742 100644 --- a/Projectiles/Melee/EmpyreanKnife.cs +++ b/Projectiles/Melee/EmpyreanKnife.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Melee } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.015), 0.75f); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.01), 0.75f); public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Melee/EvilSmasherProjectile.cs b/Projectiles/Melee/EvilSmasherProjectile.cs index d7708dd214..958db0e7f4 100644 --- a/Projectiles/Melee/EvilSmasherProjectile.cs +++ b/Projectiles/Melee/EvilSmasherProjectile.cs @@ -41,6 +41,7 @@ namespace CalamityMod.Projectiles.Melee RotateInStartup = 0; Projectile.width = 64; Projectile.height = 66; + Projectile.DamageType = AllClassDamageClass.Instance; } public override void Spawn() @@ -61,7 +62,7 @@ namespace CalamityMod.Projectiles.Melee if (inStartup) { CurrentChargeMult = timer / (float)(StartupTime-1); - Owner.velocity.X *= 0.97f; + Owner.velocity.X *= CurrentChargeMult < 1 ? 0.98f : 0.995f; } if (inStartup && !Owner.channel && timer > 30) { @@ -99,7 +100,7 @@ namespace CalamityMod.Projectiles.Melee { Owner.velocity *= 0.15f; - Owner.velocity -= adjustedAngle.RotatedBy(MathHelper.PiOver2) * angle.X * MathHelper.Lerp(7.5f,16f, CurrentChargeMult); + Owner.velocity -= adjustedAngle.RotatedBy(MathHelper.PiOver2) * angle.X * MathHelper.Lerp(7.5f,16f, CurrentChargeMult) * (Projectile.scale / 1.25f); float ringRot = SwingCompletion < 0.5f ? 0 : MathHelper.PiOver2; GeneralParticleHandler.SpawnParticle(new CustomPulse(HammerFrontPos, Vector2.Zero, Color.Red, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloatDirection(), 0.03f, 0.04f * (2 + CurrentChargeMult), 15)); GeneralParticleHandler.SpawnParticle(new DirectionalPulseRing(HammerFrontPos, Vector2.Zero, Color.Purple, new Vector2(0.2f, 1f), ringRot, 0.2f, 0.75f * (2 + CurrentChargeMult), 30)); @@ -124,6 +125,8 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(SoundID.DD2_MonkStaffGroundImpact); } } + if (CooldownTimer == 1) + Owner.Calamity().ConsumeStealthByAttacking(); Owner.heldProj = Projectile.whoAmI; } @@ -186,8 +189,8 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(SoundID.Item69 with { Volume = 1f, LimitsArePerVariant = false, MaxInstances = 1 }); } - target.AddBuff(ModContent.BuffType(), (int)MathHelper.Lerp(60, 900, CurrentChargeMult)); - Owner.AddBuff(ModContent.BuffType(), (int)MathHelper.Lerp(60, 900, CurrentChargeMult)); + target.AddBuff(ModContent.BuffType(), (int)MathHelper.Lerp(60, 1200, CurrentChargeMult)); + Owner.AddBuff(ModContent.BuffType(), (int)MathHelper.Lerp(60, 1200, CurrentChargeMult)); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Melee/ExaltedOathbladeThrownBlade.cs b/Projectiles/Melee/ExaltedOathbladeThrownBlade.cs index b50aac643e..becc25a285 100644 --- a/Projectiles/Melee/ExaltedOathbladeThrownBlade.cs +++ b/Projectiles/Melee/ExaltedOathbladeThrownBlade.cs @@ -368,25 +368,5 @@ namespace CalamityMod.Projectiles.Melee return false; } - /* - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(Projectile.timeLeft); - writer.Write(Projectile.rotation); - writer.Write(Projectile.localAI[2]); - writer.Write(Projectile.localAI[0]); - - writer.WriteFlags(stuckInTarget, thrown); - } - public override void ReceiveExtraAI(BinaryReader reader) - { - Projectile.timeLeft = reader.Read(); - Projectile.rotation = reader.ReadSingle(); - Projectile.localAI[2] = reader.ReadSingle(); - Projectile.localAI[0] = reader.ReadSingle(); - - reader.ReadFlags(out stuckInTarget, out thrown); - } - */ } } diff --git a/Projectiles/Melee/ExobladeProj.cs b/Projectiles/Melee/ExobladeProj.cs index 4eeb944925..5f55b2ea97 100644 --- a/Projectiles/Melee/ExobladeProj.cs +++ b/Projectiles/Melee/ExobladeProj.cs @@ -530,23 +530,6 @@ namespace CalamityMod.Projectiles.Melee Main.EntitySpriteDraw(texture, Owner.MountedCenter - Main.screenPosition, null, Color.White, BaseRotation, texture.Size() / 2f, SquishVector * 3f * Projectile.scale, direction, 0); - /* - if (PerformingPowerfulSlash) - { - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, swingFX, Main.GameViewMatrix.TransformationMatrix); - - float bouncyProgression = (float)Math.Sin(Progression * MathHelper.Pi); - swingFX.Parameters["color"].SetValue(Color.MediumSpringGreen.ToVector4() with { W = bouncyProgression * 0.5f }); - - for (int i = 0; i < 4; i++) - { - Vector2 offset = (i / 4f * MathHelper.TwoPi + SwingAngleShift + MathHelper.PiOver4).ToRotationVector2() * 2f * Projectile.scale; - Main.EntitySpriteDraw(texture, Owner.MountedCenter - Main.screenPosition + offset, null, Color.White, BaseRotation, texture.Size() / 2f, SquishVector * 3f * Projectile.scale, direction, 0); - } - } - */ - Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); diff --git a/Projectiles/Melee/HellionSpike.cs b/Projectiles/Melee/HellionSpike.cs index bae234c799..988ab29af4 100644 --- a/Projectiles/Melee/HellionSpike.cs +++ b/Projectiles/Melee/HellionSpike.cs @@ -21,12 +21,9 @@ namespace CalamityMod.Projectiles.Melee Projectile.aiStyle = ProjAIStyleID.Beam; Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; - Projectile.penetrate = 2; Projectile.MaxUpdates = 2; - Projectile.timeLeft = 600; + Projectile.timeLeft = 180; AIType = ProjectileID.SporeCloud; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 8 * Projectile.MaxUpdates; } public override void AI() @@ -48,7 +45,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - if (Projectile.timeLeft > 595) + if (Projectile.timeLeft > 175) return false; CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); diff --git a/Projectiles/Melee/HellkiteHoldout.cs b/Projectiles/Melee/HellkiteHoldout.cs index 7b5e9eb869..11d051bd9f 100644 --- a/Projectiles/Melee/HellkiteHoldout.cs +++ b/Projectiles/Melee/HellkiteHoldout.cs @@ -399,7 +399,7 @@ namespace CalamityMod.Projectiles.Melee float minMult = 0.25f; int hitsToMinMult = 10; float damageMult = Utils.Remap(pierceReduction, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= (chargedSwing ? 2.9f : 1) * damageMult; + modifiers.SourceDamage *= (chargedSwing ? 2.5f : 1) * damageMult; } public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Melee/LightBeam.cs b/Projectiles/Melee/LightBeam.cs index 68a27275bc..8a285a2d6e 100644 --- a/Projectiles/Melee/LightBeam.cs +++ b/Projectiles/Melee/LightBeam.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Melee private const float MaxVelocity = DarklightGreatsword.ShootSpeed * 12f; - private const int FadeOutTime = 85; + private const int FadeOutTime = 30; - private const int TimeLeft = 215 + FadeOutTime; + private const int TimeLeft = 150 + FadeOutTime; private const int Alpha = 100; diff --git a/Projectiles/Melee/LightspeedDashHitbox.cs b/Projectiles/Melee/LightspeedDashHitbox.cs index f7a5b243a0..7a8a30cd34 100644 --- a/Projectiles/Melee/LightspeedDashHitbox.cs +++ b/Projectiles/Melee/LightspeedDashHitbox.cs @@ -6,6 +6,7 @@ using CalamityMod.Sounds; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee @@ -16,6 +17,11 @@ namespace CalamityMod.Projectiles.Melee public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public Player Owner => Main.player[Projectile.owner]; + public override void SetStaticDefaults() + { + ProjectileID.Sets.AllowsContactDamageFromJellyfish[Type] = true; + } + public override void SetDefaults() { Projectile.width = 150; diff --git a/Projectiles/Melee/LightspeedHoldout.cs b/Projectiles/Melee/LightspeedHoldout.cs index 4560a28a28..4bc74155ad 100644 --- a/Projectiles/Melee/LightspeedHoldout.cs +++ b/Projectiles/Melee/LightspeedHoldout.cs @@ -84,90 +84,61 @@ namespace CalamityMod.Projectiles.Melee public void Positioning(Vector2 toMouse) // Hand and holdout positioning { - if (DashState == 2) + Owner.heldProj = Projectile.whoAmI; + Owner.itemTime = Owner.itemAnimation = 2; + + bool isDashing = DashState == 2; + Vector2 baseDir = isDashing ? Projectile.velocity.SafeNormalize(Vector2.UnitX * Owner.direction) : toMouse; + Owner.ChangeDir(Math.Sign(baseDir.X)); + + float playerArmRotation = new Vector2(baseDir.X, baseDir.Y * Owner.gravDir).ToRotation(); + float worldArmRotation = baseDir.ToRotation(); // The absolute world angle to point the projectile + + float compositeArmRotation; + + if (isDashing) { - Vector2 dashDirection = Projectile.velocity.SafeNormalize(Vector2.UnitX * Owner.direction); - Owner.ChangeDir(Math.Sign(dashDirection.X)); - - float dashArmRotation = dashDirection.ToRotation(); - float dashCompositeArmRotation = dashArmRotation + (MathHelper.TwoPi * 0.75f); - - Owner.SetCompositeArmFront(true, CompositeArmStretchAmount.Full, dashCompositeArmRotation); - Owner.SetCompositeArmBack(true, CompositeArmStretchAmount.Full, 0f); - bladeRot = 0; - - handPos = Owner.GetFrontHandPosition(CompositeArmStretchAmount.Full, dashCompositeArmRotation); + compositeArmRotation = playerArmRotation + (MathHelper.TwoPi * 0.75f); + handPos = Owner.GetFrontHandPosition(CompositeArmStretchAmount.Full, compositeArmRotation); Projectile.Center = handPos; - Owner.heldProj = Projectile.whoAmI; - Owner.itemTime = Owner.itemAnimation = 2; + // Keep projectile rotation in world space, but invert the offset direction when flipped + Projectile.rotation = worldArmRotation + (Owner.direction == 1 ? MathHelper.PiOver4 : MathHelper.Pi * 0.75f) * Owner.gravDir; - // Visual rotation - Projectile.rotation = dashArmRotation; - Projectile.rotation = Projectile.velocity.ToRotation() + (Owner.direction == 1 ? MathHelper.PiOver4 : MathHelper.Pi * 0.75f); - Projectile.rotation += 0.15f * Owner.direction; // Adjustment to make the tip look like its more directly pointing at cursor - - // Item rotation (for arm positioning) - Owner.itemRotation = dashArmRotation + MathHelper.PiOver4; - - if (Owner.direction != 1) - { - Owner.itemRotation -= MathHelper.TwoPi * 0.75f; - } - - Owner.itemRotation = MathHelper.WrapAngle(Owner.itemRotation); + Owner.itemRotation = playerArmRotation + MathHelper.PiOver4 - (Owner.direction != 1 ? MathHelper.TwoPi * 0.75f : 0f); } - else // If not in dash { - Owner.ChangeDir(Math.Sign(toMouse.X)); + compositeArmRotation = playerArmRotation + bladeRot - MathHelper.PiOver2; - float baseArmRotation = toMouse.ToRotation(); - float compositeArmRotation = baseArmRotation + bladeRot - MathHelper.PiOver2; - - Owner.SetCompositeArmFront(true, CompositeArmStretchAmount.Full, compositeArmRotation); - Owner.SetCompositeArmBack(true, CompositeArmStretchAmount.Full, 0f); - - Vector2 actualInnateOffset = innateOffset; + Vector2 actualOffset = innateOffset; if (Owner.direction == -1) { - actualInnateOffset.X += 1f; - actualInnateOffset.Y += 2f; + actualOffset.X += 1f; + actualOffset.Y += 2f; } - handPos = Owner.GetFrontHandPosition(CompositeArmStretchAmount.Full, compositeArmRotation) + actualInnateOffset.RotatedBy(baseArmRotation); - + actualOffset.Y *= Owner.gravDir; + handPos = Owner.GetFrontHandPosition(CompositeArmStretchAmount.Full, compositeArmRotation) + actualOffset.RotatedBy(worldArmRotation); Projectile.velocity = toMouse; - Projectile.rotation = toMouse.ToRotation() + bladeRot; - Projectile.rotation += MathHelper.PiOver2 * 0.5f; // Adjustment made so texture actually faces cursor - Projectile.rotation += 0.15f * Owner.direction; // Another to make the tip look like its more directly pointing at cursor + // Adjust sprite rotation logic to compensate for the vertical flip applied in PreDraw + float rotOffset = MathHelper.PiOver4 * Owner.gravDir; if (Owner.direction == -1) - { - Projectile.rotation -= MathHelper.TwoPi * 0.75f; - } + rotOffset -= (Owner.gravDir == 1f ? MathHelper.TwoPi * 0.75f : MathHelper.PiOver2); + Projectile.rotation = worldArmRotation + bladeRot + rotOffset; Projectile.Center = handPos + toMouse * Projectile.scale; - Owner.heldProj = Projectile.whoAmI; - Owner.itemTime = Owner.itemAnimation = 2; - - // Item rotation (for arm positioning) - Owner.itemRotation = Projectile.rotation - MathHelper.PiOver4; // Adjustment undone for arm pos - if (Owner.direction == -1) - { - Owner.itemRotation -= MathHelper.Pi; - } - else - { - Owner.itemRotation -= MathHelper.PiOver2; - } - - Owner.itemRotation = MathHelper.WrapAngle(Owner.itemRotation); - + // Simplified: The messy itemRotation calculation mathematically reduces to just this! + Owner.itemRotation = compositeArmRotation; } + + Owner.SetCompositeArmFront(true, CompositeArmStretchAmount.Full, compositeArmRotation); + Owner.SetCompositeArmBack(true, CompositeArmStretchAmount.Full, 0f); + Owner.itemRotation = MathHelper.WrapAngle(Owner.itemRotation); } public override void AI() @@ -206,7 +177,7 @@ namespace CalamityMod.Projectiles.Melee if (Owner.altFunctionUse == 0 && DashState == 0) { - Projectile.Center += (Utils.DirectionTo(Owner.MountedCenter, Owner.ClampedMouseWorld()) * Main.rand.NextFloat(-5f, 8f)); + Projectile.Center += (Utils.DirectionTo(Owner.MountedCenter, Owner.ClampedMouseWorld()) * Main.rand.NextFloat(-5f, 8f)); // When using M1, randomly offset position UsePrimary(toMouse); } @@ -228,6 +199,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 stabOrigin = Projectile.Center; Vector2 stabTip = stabOrigin + stabDir * 62f * Projectile.scale; + // Spawn spawks extending out of the blade which represent the hitbox for (int i = 0; i < 4; i++) { Vector2 spawnPos = stabTip + Main.rand.NextVector2Circular(18f, 12f) * Projectile.scale; @@ -237,10 +209,27 @@ namespace CalamityMod.Projectiles.Melee GeneralParticleHandler.SpawnParticle(spark); } - Particle afterImage = new CustomSpark(Projectile.Center + (stabDir * 10f) + Main.rand.NextVector2Circular(4f, 11f), (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2(), new("CalamityMod/Items/Weapons/Melee/Lightspeed"), false, Main.rand.Next(5,9), 0.6f * Main.rand.NextFloat(0.9f, 1.02f), Color.White * Main.rand.NextFloat(0.66f, 0.825f), new Vector2(1, 1), true, false, flipHorizontal: Owner.direction == -1 ? true : false); + bool flipParticle = Owner.gravDir == -1 ? Owner.direction == 1 : Owner.direction == -1; + + float rotOffset = Owner.gravDir == -1 ? -MathHelper.PiOver4 : MathHelper.PiOver4; + Vector2 afterImageDir = Owner.direction == -1 ? stabDir.RotatedBy(rotOffset) : stabDir.RotatedBy(-rotOffset); + + Particle afterImage = new CustomSpark( + Projectile.Center + (stabDir * 10f) + Main.rand.NextVector2Circular(4f, 11f), + afterImageDir, + new("CalamityMod/Items/Weapons/Melee/Lightspeed"), + false, + Main.rand.Next(5, 9), + 0.6f * Main.rand.NextFloat(0.9f, 1.02f), + Color.White * Main.rand.NextFloat(0.66f, 0.825f), + new Vector2(1, 1), + true, + false, + flipHorizontal: flipParticle + ); GeneralParticleHandler.SpawnParticle(afterImage); - // Make blade randomly vibrate + // Make blade randomly vibrate and draw with quirks bladeRot = Main.rand.NextFloat(-0.12f, 0.3f) * Owner.direction; Projectile.scale *= Main.rand.NextFloat(0.75f, 1f); Projectile.Center += stabDir + Main.rand.NextVector2Circular(7f, 1.5f); @@ -249,9 +238,7 @@ namespace CalamityMod.Projectiles.Melee Owner.itemRotation += bladeRot * 0.1f; // Make arm randomly vibrate if (Main.rand.NextBool()) - { Owner.SetCompositeArmFront(true, Main.rand.NextBool() ? CompositeArmStretchAmount.ThreeQuarters : CompositeArmStretchAmount.Quarter, Owner.itemRotation); - } stabSoundTimer++; if (stabSoundTimer % 3 == 0) @@ -297,26 +284,27 @@ namespace CalamityMod.Projectiles.Melee float eased = MathF.Pow(t, 1.2f); AltSpinRotation = eased * (4f * MathHelper.Pi * 0.7175f); - float orbitalAngle = AltSpinRotation * initialDirectionForThisAnim + (initialDirectionForThisAnim == -1 ? MathHelper.Pi : 0); + + float orbitalAngle = (AltSpinRotation * initialDirectionForThisAnim + (initialDirectionForThisAnim == -1 ? MathHelper.Pi : 0)) * Owner.gravDir; float orbitRadius = 40f; Projectile.Center = Owner.MountedCenter + orbitalAngle.ToRotationVector2() * orbitRadius; - float tangentAngle = orbitalAngle + (initialDirectionForThisAnim == 1 ? MathHelper.PiOver4 : -MathHelper.PiOver4 + MathHelper.Pi); - Projectile.rotation = tangentAngle; // Proper arm positioning - Vector2 armDirection = Projectile.Center - Owner.MountedCenter; - float baseArmRotation = armDirection.ToRotation(); + float rotOffset = MathHelper.PiOver4 * Owner.gravDir; + if (initialDirectionForThisAnim == -1) + rotOffset -= (Owner.gravDir == 1f ? MathHelper.TwoPi * 0.75f : MathHelper.PiOver2); - float compositeArmRotation = baseArmRotation + (initialDirectionForThisAnim == 1 ? MathHelper.TwoPi * 0.75f : -MathHelper.PiOver2); + Projectile.rotation = orbitalAngle + rotOffset; + + Vector2 armDirection = Projectile.Center - Owner.MountedCenter; + float playerArmRotation = new Vector2(armDirection.X, armDirection.Y * Owner.gravDir).ToRotation(); + + float compositeArmRotation = playerArmRotation + (initialDirectionForThisAnim == 1 ? MathHelper.TwoPi * 0.75f : -MathHelper.PiOver2); Owner.SetCompositeArmFront(true, CompositeArmStretchAmount.Full, compositeArmRotation); Owner.SetCompositeArmBack(true, CompositeArmStretchAmount.Full, 0f); - Owner.itemRotation = baseArmRotation; - if (Owner.direction == -1) - Owner.itemRotation += MathHelper.Pi; - - Owner.itemRotation = MathHelper.WrapAngle(Owner.itemRotation); + Owner.itemRotation = MathHelper.WrapAngle(compositeArmRotation); } // Mid-spin VFX @@ -390,7 +378,7 @@ namespace CalamityMod.Projectiles.Melee public float PierceWidthFunction(float completionRatio, Vector2 vertexPos) { float width = Utils.GetLerpValue(0f, 0.2f, completionRatio, true) * Projectile.scale * 24f; - //Fade it out starkly near the end of the lunge + // Fade it out starkly near the end of the lunge width *= (1 - (float)Math.Pow(LungeProgression, 4)); return width; } @@ -400,15 +388,21 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { Texture2D texture = ModContent.Request(Texture).Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; - Rectangle frame = new Rectangle(0, Projectile.frame * frameHeight, texture.Width, frameHeight); - Vector2 origin = new Vector2(texture.Width / 2f, frameHeight / 2f); + Rectangle frame = texture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Vector2 origin = frame.Size() / 2f; - SpriteEffects spriteEffects = Owner.direction == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - lightColor = Color.White; // Fullbright - Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, frame, lightColor * Projectile.Opacity, Projectile.rotation, origin, 0.6f, spriteEffects, 0); + SpriteEffects spriteEffects = SpriteEffects.None; + if (Owner.direction == -1) + spriteEffects |= SpriteEffects.FlipHorizontally; - DrawPierceTrail(); + // Account for inverse gravity + if (Owner.gravDir == -1f) + spriteEffects |= SpriteEffects.FlipVertically; + + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, frame, Color.White * Projectile.Opacity, Projectile.rotation, origin, 0.6f, spriteEffects, 0); + + if (DashState == 2) + DrawPierceTrail(); return false; } diff --git a/Projectiles/Melee/LightspeedM1Hitbox.cs b/Projectiles/Melee/LightspeedM1Hitbox.cs index aad114d70e..42639269a0 100644 --- a/Projectiles/Melee/LightspeedM1Hitbox.cs +++ b/Projectiles/Melee/LightspeedM1Hitbox.cs @@ -5,6 +5,7 @@ using CalamityMod.NPCs; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee @@ -15,9 +16,13 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public Player Owner => Main.player[Projectile.owner]; - public bool gotEnergyThisSwing = false; + public override void SetStaticDefaults() + { + ProjectileID.Sets.AllowsContactDamageFromJellyfish[Type] = true; + } + public override void SetDefaults() { Projectile.width = 25; diff --git a/Projectiles/Melee/MawOfInfinityHoldout.cs b/Projectiles/Melee/MawOfInfinityHoldout.cs index 48323eefee..4cc5afab86 100644 --- a/Projectiles/Melee/MawOfInfinityHoldout.cs +++ b/Projectiles/Melee/MawOfInfinityHoldout.cs @@ -149,7 +149,7 @@ namespace CalamityMod.Projectiles.Melee jawScaleMult = 1-CooldownCompletion; jawScaleMult = MathF.Pow(jawScaleMult, 3); float rotation = Projectile.rotation - (Projectile.spriteDirection == -1 ? MathHelper.PiOver2: 0); - Vector2 DrawPos = Projectile.Center + Projectile.scale * new Vector2(50,10 * Projectile.spriteDirection).RotatedBy(Projectile.rotation - MathHelper.PiOver2 + (Projectile.spriteDirection == -1 ? -MathHelper.PiOver4 : MathHelper.PiOver4)); + Vector2 DrawPos = Projectile.Center + Projectile.scale * new Vector2(50,-10 * Projectile.spriteDirection).RotatedBy(Projectile.rotation - MathHelper.PiOver2 + (Projectile.spriteDirection == -1 ? -MathHelper.PiOver4 : MathHelper.PiOver4)); Main.spriteBatch.SetBlendState(BlendState.Additive); Main.spriteBatch.Draw(tex, DrawPos - Main.screenPosition, tex.Frame(2,1,0,0), modplayer.swingNum == 1 ? Color.Fuchsia : Color.Cyan, rotation + MathHelper.PiOver4, new Vector2(tex.Width * 0.25f,tex.Height * 0.5f), Projectile.scale * jawScaleMult, Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); diff --git a/Projectiles/Melee/OblivionBolt.cs b/Projectiles/Melee/OblivionBolt.cs new file mode 100644 index 0000000000..966ee0bca9 --- /dev/null +++ b/Projectiles/Melee/OblivionBolt.cs @@ -0,0 +1,99 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Graphics.Metaballs; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class OblivionBolt : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "CalamityMod/Projectiles/Boss/BurningBolt"; + public int time = 0; + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; + } + + public override void SetDefaults() + { + Projectile.width = 18; + Projectile.height = 44; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.DamageType = DamageClass.MeleeNoSpeed; + Projectile.ArmorPenetration = 20; + Projectile.penetrate = 3; + Projectile.timeLeft = 690; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + Projectile.noEnchantmentVisuals = true; + } + + public override void AI() + { + if (Projectile.velocity.Length() < Projectile.ai[2]) + { + Projectile.velocity *= 1.01f; + if (Projectile.velocity.Length() > Projectile.ai[2]) + { + Projectile.velocity.Normalize(); + Projectile.velocity *= Projectile.ai[2]; + } + } + + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + + Projectile.frameCounter++; + if (Projectile.frameCounter > 4) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + if (Projectile.frame > 3) + Projectile.frame = 0; + + if (Projectile.timeLeft < 60) + Projectile.Opacity = MathHelper.Clamp(Projectile.timeLeft / 60f, 0f, 1f); + + if (Projectile.ai[0] == 2f) + { + if (Projectile.timeLeft > 570) + { + int player = Player.FindClosest(Projectile.Center, 1, 1); + Vector2 vector = Main.player[player].Center - Projectile.Center; + float scaleFactor = Projectile.velocity.Length(); + vector.Normalize(); + vector *= scaleFactor; + Projectile.velocity = (Projectile.velocity * 15f + vector) / 16f; + Projectile.velocity.Normalize(); + Projectile.velocity *= scaleFactor; + } + } + + Lighting.AddLight(Projectile.Center, 0.75f * Projectile.Opacity, 0f, 0f); + time++; + + var p = SeekersMetaball.SpawnParticle(Projectile.Center + Projectile.velocity * Projectile.MaxUpdates, Vector2.Zero, Terraria.GameContent.TextureAssets.Projectile[Type].Width() * Projectile.scale); + p.rotation = Projectile.rotation; + p.CurrentFrame = Projectile.frame; + p.MaxFrames = Main.projFrames[Type]; + p.TextureToUse = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + p.SizeScaling = 0f; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 300); + + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 300); + + public override bool PreDraw(ref Color lightColor) + { + return false; + } + } +} diff --git a/Projectiles/Melee/OblivionFire.cs b/Projectiles/Melee/OblivionFire.cs new file mode 100644 index 0000000000..5d0da2e33e --- /dev/null +++ b/Projectiles/Melee/OblivionFire.cs @@ -0,0 +1,49 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Graphics.Metaballs; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class OblivionFire : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public ref float Time => ref Projectile.ai[0]; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.CultistIsResistantTo[Type] = true; + } + + public override void SetDefaults() + { + Projectile.width = 8; + Projectile.height = 8; + Projectile.friendly = true; + Projectile.penetrate = 1; + Projectile.timeLeft = 240; + Projectile.MaxUpdates = 4; + Projectile.tileCollide = false; + Projectile.DamageType = DamageClass.MeleeNoSpeed; + Projectile.noEnchantmentVisuals = true; + } + + public override void AI() + { + Time++; + if (Time >= 100f) + CalamityUtils.HomeInOnNPC(Projectile, false, 300, 2.5f, 20f, true); + CalamitasMetaball.SpawnParticle(Projectile.Center + Projectile.velocity, Main.rand.NextVector2Circular(2, 2), 16f); + } + + public override bool? CanDamage() => Time >= 45f; + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); + + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); + } +} diff --git a/Projectiles/Melee/OrderbringerBeam.cs b/Projectiles/Melee/OrderbringerBeam.cs index 96fa3fea63..f546630e46 100644 --- a/Projectiles/Melee/OrderbringerBeam.cs +++ b/Projectiles/Melee/OrderbringerBeam.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Melee Player Owner = Main.player[Projectile.owner]; float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); - if (Projectile.timeLeft % 12 == 0 && targetDist < 1400f) + if (!CalamityClientConfig.Instance.Photosensitivity && Projectile.timeLeft % 12 == 0 && targetDist < 1400f) { Particle spark = new CustomSpark(Projectile.Center, Projectile.velocity * 0.2f, "CalamityMod/Particles/BloomCircle", false, 23, 0.25f * Projectile.scale, mainColor * 0.75f, new Vector2(1f, 7.35f), true, true, shrinkSpeed: 0.2f, glowOpacity: 0.7f); GeneralParticleHandler.SpawnParticle(spark); diff --git a/Projectiles/Melee/PrismaticBreakerHoldout.cs b/Projectiles/Melee/PrismaticBreakerHoldout.cs index 8fb31ba0a0..695b97e58b 100644 --- a/Projectiles/Melee/PrismaticBreakerHoldout.cs +++ b/Projectiles/Melee/PrismaticBreakerHoldout.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(CrystylCrusher.ChargeSound, Projectile.Center, _ => new ProjectileAudioTracker(Projectile).IsActiveAndInGame()); if (Timer == LaserChargeTime && Main.myPlayer == Projectile.owner) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity, ModContent.ProjectileType(), (int)(Projectile.damage * LaserDamageMult), Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity, ModContent.ProjectileType(), (int)(Projectile.originalDamage * LaserDamageMult), Projectile.knockBack, Projectile.owner); } } diff --git a/Projectiles/Melee/PrismaticMagicCircle.cs b/Projectiles/Melee/PrismaticMagicCircle.cs index 66d896bd66..c6fa14f957 100644 --- a/Projectiles/Melee/PrismaticMagicCircle.cs +++ b/Projectiles/Melee/PrismaticMagicCircle.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(SoundID.Item68, Projectile.Center); SoundEngine.PlaySound(Items.Weapons.DraedonsArsenal.TeslaCannon.FireSound with { Pitch = 1f }); Vector2 spawnPos = Vector2.Lerp(Projectile.Center, Owner.Center, 0.5f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos, Projectile.velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos, Projectile.velocity, ModContent.ProjectileType(), Projectile.originalDamage, Projectile.knockBack, Projectile.owner); } } diff --git a/Projectiles/Melee/RemsRevengeExplosion.cs b/Projectiles/Melee/RemsRevengeExplosion.cs index 6289b62d1e..adc02309a1 100644 --- a/Projectiles/Melee/RemsRevengeExplosion.cs +++ b/Projectiles/Melee/RemsRevengeExplosion.cs @@ -66,7 +66,12 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 60); - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.HitDirectionOverride = (Owner.Center.X < target.Center.X).ToDirectionInt(); + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + float damageMult = MathHelper.Clamp(Utils.GetLerpValue(3, 0, Projectile.numHits), 0.1f, 1); + modifiers.SourceDamage *= damageMult; + modifiers.HitDirectionOverride = (Owner.Center.X < target.Center.X).ToDirectionInt(); + } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CircularHitboxCollision(Projectile.Center, Projectile.width * Projectile.scale, targetHitbox); } diff --git a/Projectiles/Melee/RoxcaliburProj.cs b/Projectiles/Melee/RoxcaliburProj.cs index 3b9034c5f4..e68a091c84 100644 --- a/Projectiles/Melee/RoxcaliburProj.cs +++ b/Projectiles/Melee/RoxcaliburProj.cs @@ -55,18 +55,18 @@ namespace CalamityMod.Projectiles.Melee //more precise hitbox. makes the weapon harder to use but looks visually better: use it if you want. /* - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) - { - if (HitTimer <= 0) - { - float size = Projectile.Size.Length(); - Vector2 hiltPos = Projectile.Center - Projectile.velocity * size / 2; - Vector2 endPos = Projectile.Center + Projectile.velocity * size / 2; - float useless = 0f; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), hiltPos, endPos, size / 2, ref useless); - } - return base.Colliding(projHitbox, targetHitbox); - } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (HitTimer <= 0) + { + float size = Projectile.Size.Length(); + Vector2 hiltPos = Projectile.Center - Projectile.velocity * size / 2; + Vector2 endPos = Projectile.Center + Projectile.velocity * size / 2; + float useless = 0f; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), hiltPos, endPos, size / 2, ref useless); + } + return base.Colliding(projHitbox, targetHitbox); + } */ public override void AI() diff --git a/Projectiles/Melee/SandBlade.cs b/Projectiles/Melee/SandBlade.cs index 1ff0f70ab3..184bb4b4dc 100644 --- a/Projectiles/Melee/SandBlade.cs +++ b/Projectiles/Melee/SandBlade.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { - Projectile.width = 20; - Projectile.height = 20; + Projectile.width = 26; + Projectile.height = 26; Projectile.friendly = true; Projectile.penetrate = 1; Projectile.timeLeft = 300; diff --git a/Projectiles/Melee/SandBlade.png b/Projectiles/Melee/SandBlade.png index fccc308168..69b4d66e1a 100644 Binary files a/Projectiles/Melee/SandBlade.png and b/Projectiles/Melee/SandBlade.png differ diff --git a/Projectiles/Melee/ScorpiusConstellation.cs b/Projectiles/Melee/ScorpiusConstellation.cs index b7bc4ae366..08c3f54aa1 100644 --- a/Projectiles/Melee/ScorpiusConstellation.cs +++ b/Projectiles/Melee/ScorpiusConstellation.cs @@ -6,7 +6,6 @@ using CalamityMod.Utilities.Daybreak; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -50,7 +49,6 @@ namespace CalamityMod.Projectiles.Melee var StarScale = 0.2f; Projectile.scale = 0.75f*MathF.Min(MathF.Pow((lifetime- Projectile.timeLeft)/ 20f,2f), 1f); Projectile.Opacity = MathF.Min(Projectile.timeLeft / 20f, 1f); - Vector2 ada = default; void SpawnStar(Vector2 offset, float intensity, int flashOffset = 0, int flashMod = 60) { offset += new Vector2(5, 49.25f); //this centers the constellation diff --git a/Projectiles/Melee/SeashineSwordProj.cs b/Projectiles/Melee/SeashineSwordProj.cs index e779042974..c493bcb217 100644 --- a/Projectiles/Melee/SeashineSwordProj.cs +++ b/Projectiles/Melee/SeashineSwordProj.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Melee { public new string LocalizationCategory => "Projectiles.Melee"; - private const int TimeLeft = 600; + private const int TimeLeft = 120; private const int MaxAlpha = 255; diff --git a/Projectiles/Melee/SkytideDragoonHoldout.cs b/Projectiles/Melee/SkytideDragoonHoldout.cs index 43171a0be7..5fc0e0be7b 100644 --- a/Projectiles/Melee/SkytideDragoonHoldout.cs +++ b/Projectiles/Melee/SkytideDragoonHoldout.cs @@ -221,7 +221,7 @@ namespace CalamityMod.Projectiles.Melee Owner.SetScreenshake(3f); SoundStyle sound = new("CalamityMod/Sounds/Item/SkytideBolt"); SoundEngine.PlaySound(sound with { Volume = 0.8f }, Projectile.Center); - Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center + new Vector2(0, -600), new Vector2(0, 10), ModContent.ProjectileType(), (int)(Projectile.damage * 10), Projectile.knockBack, Projectile.owner, 0, 0.5f); + Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center + new Vector2(0, -600), new Vector2(0, 10), ModContent.ProjectileType(), Projectile.damage * 8, Projectile.knockBack, Projectile.owner, 0, 0.5f); proj.timeLeft = (int)(45 / Projectile.scale); proj.scale = Projectile.scale; swingCount = 0; @@ -234,7 +234,7 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(fire with { Volume = 1f, Pitch = -0.2f }, Projectile.Center); SoundStyle fire2 = new("CalamityMod/Sounds/Item/AuricBulletHit"); SoundEngine.PlaySound(fire2 with { Volume = 0.5f, Pitch = 0.2f }, Projectile.Center); - Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center - aimVel * 2 * Projectile.scale, aimVel.SafeNormalize(Vector2.UnitX) * -10, ModContent.ProjectileType(), (int)(Projectile.damage * 10), Projectile.knockBack, Projectile.owner, 0, 1f); + Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center - aimVel * 2 * Projectile.scale, aimVel.SafeNormalize(Vector2.UnitX) * -10, ModContent.ProjectileType(), Projectile.damage * 8, Projectile.knockBack, Projectile.owner, 0, 1f); proj.scale = Projectile.scale; swingCount = -1; attackPower = 0; diff --git a/Projectiles/Melee/Spears/BotanicPiercerProjectile.cs b/Projectiles/Melee/Spears/BotanicPiercerProjectile.cs index 3960a33083..1f3ca8a45c 100644 --- a/Projectiles/Melee/Spears/BotanicPiercerProjectile.cs +++ b/Projectiles/Melee/Spears/BotanicPiercerProjectile.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.penetrate = -1; Projectile.ownerHitCheck = true; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 8; + Projectile.localNPCHitCooldown = 10; } public override float InitialSpeed => 3f; @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override Action EffectBeforeReelback => (proj) => { Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center - Projectile.velocity * 4f, Projectile.velocity * 1.4f, - ModContent.ProjectileType(), (int)(Projectile.damage * 0.7), Projectile.knockBack * 0.7f, Projectile.owner); + ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); }; public override void ExtraBehavior() diff --git a/Projectiles/Melee/Spears/GildedProboscisProj.cs b/Projectiles/Melee/Spears/GildedProboscisProj.cs index 1293a2915c..96b783ab1d 100644 --- a/Projectiles/Melee/Spears/GildedProboscisProj.cs +++ b/Projectiles/Melee/Spears/GildedProboscisProj.cs @@ -1,12 +1,20 @@ using System; +using System.Linq; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Graphics.Primitives; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Summon; using CalamityMod.Utilities; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -85,7 +93,20 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.timeLeft++; } if (Projectile.FinalExtraUpdate() && channelCharge < CalamityUtils.SecondsToFrames(5)) + { channelCharge++; + + + if (channelCharge == 300) + { + + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/ChainLightning1") with { Volume = 1f, Pitch = 0.5f }); + } + else if (channelCharge % 10 == 0 && channelCharge < 2000) + { + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/ElectricHit") with { Volume = channelCharge/300f * 0.25f, Pitch = -1 + channelCharge/300f}); + } + } } //Once not channeling, set the damage at the end of the startup else @@ -195,6 +216,12 @@ namespace CalamityMod.Projectiles.Melee.Spears } else { + + if (swingTimer == 1) + { + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/ChainLightning1") with { Volume = 0.2f, Pitch = -0.25f }); + } + //scale & offset for the damaging swing part of the anim //This keeps "am" (short for animation) at 0 or 1 most of the time, with a quick but smooth transition float am = MathHelper.Clamp(MathF.Pow((SwingCompletion - (0.5f - (1 / 3f))) * 3f, 3f), 0, 1); @@ -267,8 +294,77 @@ namespace CalamityMod.Projectiles.Melee.Spears Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.0015), 0.5f); Projectile.originalDamage = (int)(Projectile.originalDamage * 0.925f); Projectile.damage = (int)(Projectile.damage * 0.925f); //Both are needed as it doesn't recalculate till next frame + + + if (!isChannelable) + { + + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/ElectricBurst") with { Volume = 0.25f, Pitch = 0 }); + } + else + { + + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/ElectricBurst") with { Volume = channelCharge / 300f * 0.25f, Pitch = -1 + channelCharge / 300f }); + if (channelCharge >= CalamityUtils.SecondsToFrames(5)) + { + SoundEngine.PlaySound(SoundID.Item172 with { Volume = 1 }); + } + } } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.ApplyScalingForcedCrit(Projectile); + + public override bool PreDraw(ref Color lightColor) + { + + var player = Main.player[Projectile.owner]; + var modplayer = player.GetModPlayer(); + var tex = TextureAssets.Projectile[Type]; + var frame = tex.Frame(); + + float intensity = MathF.Pow(Math.Clamp((channelCharge-150) / 150f,0,1),2); + + if (!isChannelable) + { + intensity = Math.Clamp(StartupCompletion*2 - 1,0,1) - Math.Clamp(CooldownCompletion*2, 0, 1); + } + if (isChannelable && SwingCompletion >= 1) + intensity = 0; + + Color color = isChannelable ? Color.Crimson : Color.Goldenrod; + if (intensity > 0) + for (float i = 0; i < MathHelper.TwoPi; i += MathHelper.PiOver2) + { + Main.EntitySpriteDraw(OutlineTex, Projectile.Center - Main.screenPosition + new Vector2(2 * intensity, 0).RotatedBy(i), frame, color, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : 0); + } + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : 0); + + return false; + } + + private static Texture2D OutlineTex + { + get + { + + if (field == null) + { + var texture = TextureAssets.Projectile[ModContent.ProjectileType()].Value; + field = new Texture2D(Main.graphics.GraphicsDevice, texture.Width, texture.Height); + + var BaseArray = new Color[field.Width * field.Height]; + var ColorArray = new Color[field.Width * field.Height]; + texture.GetData(BaseArray); + for (var i = 0; i < BaseArray.Length; i++) + { + ColorArray[i] = new Color(255, 255, 255) * (((float)BaseArray[i].A) / 255f); + } + field.SetData(ColorArray); + } + return field; + } + } + + } } diff --git a/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs b/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs index 3dbc16e3d9..94f0eca909 100644 --- a/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs +++ b/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Melee.Spears { for (int i = 0; i < 3; i++) { - Vector2 featherVel = Projectile.velocity.RotatedByRandom(MathHelper.Pi / 40f) * Main.rand.NextFloat(1.55f, 1.85f); + Vector2 featherVel = Projectile.velocity.RotatedByRandom(MathHelper.Pi / 40f) * Main.rand.NextFloat(1f, 1.2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center - Projectile.velocity * 4f, featherVel, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5), 0f, Projectile.owner); } } diff --git a/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs b/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs index 8d20e38bb7..f6fe1cbd57 100644 --- a/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs +++ b/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.penetrate = -1; Projectile.ownerHitCheck = true; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 8; + Projectile.localNPCHitCooldown = 10; } public override float InitialSpeed => 3f; @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override float ForwardSpeed => 0.8f; public override Action EffectBeforeReelback => (proj) => { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 2f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * 0.85f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 2f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); }; public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) diff --git a/Projectiles/Melee/Spears/StarnightLanceProjectile.cs b/Projectiles/Melee/Spears/StarnightLanceProjectile.cs index 8c49023cac..9c6e0cd2a0 100644 --- a/Projectiles/Melee/Spears/StarnightLanceProjectile.cs +++ b/Projectiles/Melee/Spears/StarnightLanceProjectile.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.penetrate = -1; Projectile.ownerHitCheck = true; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 8; + Projectile.localNPCHitCooldown = 10; } public override float InitialSpeed => 3f; @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override Action EffectBeforeReelback => (proj) => { Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center - Projectile.velocity * 4f, Projectile.velocity * 2.4f, - ModContent.ProjectileType(), (int)(Projectile.damage * 0.8), Projectile.knockBack * 0.85f, Projectile.owner); + ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); }; public override void ExtraBehavior() diff --git a/Projectiles/Melee/Spears/VanishingPointProjectile.png b/Projectiles/Melee/Spears/VanishingPointProjectile.png index 254188b871..6d383712d8 100644 Binary files a/Projectiles/Melee/Spears/VanishingPointProjectile.png and b/Projectiles/Melee/Spears/VanishingPointProjectile.png differ diff --git a/Projectiles/Melee/StarnightBeam.cs b/Projectiles/Melee/StarnightBeam.cs index 69151c2493..29bb27a473 100644 --- a/Projectiles/Melee/StarnightBeam.cs +++ b/Projectiles/Melee/StarnightBeam.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; Projectile.penetrate = 3; - Projectile.timeLeft = 600; + Projectile.timeLeft = 120; AIType = ProjectileID.LightBeam; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 10; @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - if (Projectile.timeLeft > 595) + if (Projectile.timeLeft > 115) return false; CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); diff --git a/Projectiles/Melee/StellarStrikerMeteor.cs b/Projectiles/Melee/StellarStrikerMeteor.cs index e187bb142b..893487755b 100644 --- a/Projectiles/Melee/StellarStrikerMeteor.cs +++ b/Projectiles/Melee/StellarStrikerMeteor.cs @@ -131,7 +131,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.owner == Main.myPlayer) { - Projectile.damage = (int)(Projectile.damage * 0.3f); + Projectile.damage = (int)(Projectile.damage * 0.25f); Projectile.ExpandHitboxBy((int)(285f * Projectile.scale)); Projectile.penetrate = -1; Projectile.Damage(); diff --git a/Projectiles/Melee/TerratomereHoldoutProj.cs b/Projectiles/Melee/TerratomereHoldoutProj.cs index 6152096f2e..d8edaab018 100644 --- a/Projectiles/Melee/TerratomereHoldoutProj.cs +++ b/Projectiles/Melee/TerratomereHoldoutProj.cs @@ -138,8 +138,8 @@ namespace CalamityMod.Projectiles.Melee public void StickToOwner() { // Glue the sword to its owner. This applies a handful of offsets to make the blade look like it's roughly inside of the owner's hand. - Projectile.Center = Owner.RotatedRelativePoint(Owner.MountedCenter, true) + SwordDirection * new Vector2(7f, 16f) * Projectile.scale; - Projectile.Center -= Projectile.velocity.SafeNormalize(Vector2.UnitY) * new Vector2(66f, 54f + Projectile.scale * 8f); + Projectile.Center = Owner.RotatedRelativePoint(Owner.MountedCenter, true) + SwordDirection * new Vector2(7f, 7f) * Projectile.scale; + Projectile.Center -= Projectile.velocity.SafeNormalize(Vector2.UnitY) * new Vector2(44f, 54f + Projectile.scale * 8f); // Set the owner's held projectile to this and register a false item time calculation. Owner.heldProj = Projectile.whoAmI; diff --git a/Projectiles/Melee/TrueBiomeBlade_ChainedMeatHook.cs b/Projectiles/Melee/TrueBiomeBlade_ChainedMeatHook.cs index 49f6e7f207..13cf62a01b 100644 --- a/Projectiles/Melee/TrueBiomeBlade_ChainedMeatHook.cs +++ b/Projectiles/Melee/TrueBiomeBlade_ChainedMeatHook.cs @@ -30,6 +30,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 66; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/TrueBiomeBlade_EarthenTides.cs b/Projectiles/Melee/TrueBiomeBlade_EarthenTides.cs index 48137f78b4..f8f5373825 100644 --- a/Projectiles/Melee/TrueBiomeBlade_EarthenTides.cs +++ b/Projectiles/Melee/TrueBiomeBlade_EarthenTides.cs @@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Melee Charge++; OverCharge--; Projectile.timeLeft = 2; - if ((Charge / MaxCharge >= 0.25f && CurrentIndicator == 0f) || (Charge / MaxCharge >= 0.5f && CurrentIndicator == 1f) || (Charge / MaxCharge >= 0.75f && CurrentIndicator == 2f) && Owner.whoAmI == Main.myPlayer) + if ((Charge / MaxCharge >= 0.2f && CurrentIndicator == 0f) || (Charge / MaxCharge >= 0.4f && CurrentIndicator == 1f) || (Charge / MaxCharge >= 0.6f && CurrentIndicator == 2f) || (Charge / MaxCharge >= 0.8f && CurrentIndicator == 3f) && Owner.whoAmI == Main.myPlayer) { for (int s = 0; s < 2; s++) { @@ -127,7 +127,7 @@ namespace CalamityMod.Projectiles.Melee if (Charge >= MaxCharge) { Charge = MaxCharge; - if (Owner.whoAmI == Main.myPlayer && CurrentIndicator < 4f) + if (Owner.whoAmI == Main.myPlayer && CurrentIndicator < 5f) { for (int s = 0; s < 5; s++) { diff --git a/Projectiles/Melee/Yoyos/BurningRevelationYoyo.cs b/Projectiles/Melee/Yoyos/BurningRevelationYoyo.cs index c88f451f81..a20df2e91d 100644 --- a/Projectiles/Melee/Yoyos/BurningRevelationYoyo.cs +++ b/Projectiles/Melee/Yoyos/BurningRevelationYoyo.cs @@ -108,18 +108,6 @@ namespace CalamityMod.Projectiles.Melee.Yoyos SoundEngine.PlaySound(fire with { Volume = 0.6f, PitchVariance = 0.2f }, Projectile.Center); } - // Technically scrapped because the weapon is complex enough, but we might want to use this in the future - /* - if (timer % 60 == 0) // Fire Heal Stars at player (slightly predictive) - { - Vector2 vel = ((Projectile.Center - Owner.Center) - Owner.velocity * 8).SafeNormalize(Vector2.UnitX) * -10; - Projectile healStar = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, vel, ModContent.ProjectileType(), 0, Projectile.knockBack, Projectile.owner, 0, cloneYoyo ? 3 : 10, 5); - healStar.extraUpdates = 2; - SoundStyle fireHeal = new("CalamityMod/Sounds/Custom/ProfanedGuardians/GuardianDash"); - SoundEngine.PlaySound(fireHeal with { Volume = 0.9f, Pitch = 0.3f }, Projectile.Center); - } - */ - if (timer > 0) { timer--; diff --git a/Projectiles/Melee/Yoyos/OblivionYoyo.cs b/Projectiles/Melee/Yoyos/OblivionYoyo.cs index 257a5f2c41..9be08ffd19 100644 --- a/Projectiles/Melee/Yoyos/OblivionYoyo.cs +++ b/Projectiles/Melee/Yoyos/OblivionYoyo.cs @@ -1,8 +1,15 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Cooldowns; +using CalamityMod.Dusts; +using CalamityMod.Enums; using CalamityMod.Items.Weapons.Melee; -using CalamityMod.Projectiles.Magic; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -13,6 +20,19 @@ namespace CalamityMod.Projectiles.Melee.Yoyos { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public const int MaxUpdates = 2; + //How many hits the yoyo has gotten. Starts at 1 to avoid a dividing by zero error + public int hitCounter = 1; + //20 hits to maximum + public int hitCountMax = 21; + public int time = 0; + //Used for visual intensity rising as the yoyo gets more hits + public float power = 0; + public float powerMax = 1; + //The grace period after the yoyo reaches max power to avoid insta-shattering + public int graceTimer = 0; + public bool shatter = false; + //Yoyo bag behavior + public bool cloneYoyo = false; public override void SetStaticDefaults() { @@ -33,21 +53,328 @@ namespace CalamityMod.Projectiles.Melee.Yoyos Projectile.penetrate = -1; Projectile.MaxUpdates = MaxUpdates; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10 * MaxUpdates; + Projectile.localNPCHitCooldown = 15 * MaxUpdates; } public override void AI() { - CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 9f, 48f, 5, ModContent.ProjectileType(), 0.5, damageType: Projectile.DamageType); - if ((Projectile.position - Main.player[Projectile.owner].position).Length() > 3200f) //200 blocks + var player = Main.player[Projectile.owner]; + //Using yoyo glove or yoyo bag makes yoyos run out of air time 2-4x faster (randomized) when the second yoyo is out + //Therefore, we set the flight to infinite, but manually set it to recall after 15 seconds and update it across both yoyos + if (time >= 1800) + { + if (!cloneYoyo) + { + for (int i = 0; i < Main.maxProjectiles; i++) + { + Projectile p = Main.projectile[i]; + if (p.active && p.type == Type && p.owner == Projectile.owner) + { + if (p.ModProjectile is OblivionYoyo oblivion) + { + oblivion.Projectile.ai[0] = -1f; + } + } + } + } + } + // Determine if the yoyo is a yoyo bag/yoyo glove clone + if (!cloneYoyo) + { + int MainYoyo = -1; + for (int x = 0; x < Main.maxProjectiles; x++) + { + Projectile proj = Main.projectile[x]; + if (proj.active && proj.type == Type && proj.owner == Projectile.owner) + { + MainYoyo = x; + break; + } + } + if (Projectile.whoAmI != MainYoyo) + cloneYoyo = true; + //Yoyo behavior. Nothing will trigger on yoyos from yoyo bag + + //Fireball spawning. Fire rate increases with how many hits the yoyo has gotten + if (time % (120 / hitCounter) == 0 && !shatter && Projectile.owner == Main.myPlayer) + { + float randRot = Main.rand.NextFloat(0, MathHelper.TwoPi); + Vector2 spawnVel = randRot.ToRotationVector2() * 2f; + Projectile flames = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, spawnVel, ModContent.ProjectileType(), (int)(Projectile.damage * 0.85f), Projectile.knockBack, Projectile.owner); + } + if (graceTimer > 0) + graceTimer--; + if (shatter) + { + //Constantly keep the yoyo out, even if the player lets go of the mouse + Projectile.ai[0] = 0f; + Projectile.Center = player.Calamity().mouseWorld; + //Charge up visuals + power += 0.01f; + float fade = Utils.GetLerpValue(powerMax + 2, 0, power); + float numberOfDusts = 2f; + float rotFactor = 360f / numberOfDusts; + for (int i = 0; i < numberOfDusts; i++) + { + float rot = MathHelper.ToRadians(i * rotFactor); + Vector2 velOffset = CalamityUtils.RandomVelocity(100f, 70f, 250f, 0.04f); + velOffset *= Main.rand.NextFloat(25, 45) * fade; + Particle energy = new GlowOrbParticle(Projectile.Center + velOffset * 2.5f, -velOffset * Main.rand.NextFloat(0.08f, 0.12f) * 1.5f, false, (int)(14 - (5 * fade)), Main.rand.NextFloat(1.1f, 1.25f) - 0.5f * fade, Main.rand.NextBool() ? Color.Red : Color.MediumVioletRed); + GeneralParticleHandler.SpawnParticle(energy); + Dust dust = Dust.NewDustPerfect(Projectile.Center + velOffset * 2.5f, DustID.FireworksRGB, -velOffset * Main.rand.NextFloat(0.08f, 0.12f) * 1.5f, 0, default, Main.rand.NextFloat(0.6f, 0.8f)); + dust.noGravity = true; + dust.color = Color.DarkRed; + } + if (time == 240) + { + #region Visuals and Sounds + Player Owner = Main.player[Projectile.owner]; + for (int i = 0; i < 2; i++) + { + Particle centerVoid = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Black, "CalamityMod/Particles/SmallBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), (2.2f + i * 0.5f), 0f, 80, false); + GeneralParticleHandler.SpawnParticle(centerVoid); + } + for (int i = 0; i < 2; i++) + { + Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Red, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 1f, 3f, 25, true); + GeneralParticleHandler.SpawnParticle(blastRing); + Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.MediumVioletRed, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.5f, 1.5f, 25, true); + GeneralParticleHandler.SpawnParticle(blastRing2); + } + Particle backBlast1 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.MediumVioletRed, "CalamityMod/Particles/BloomRing", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 2.56f * 1.3f, 18); + GeneralParticleHandler.SpawnParticle(backBlast1, false, GeneralDrawLayer.AfterEverything); + + Particle backBlast2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.MediumVioletRed, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.3f, 30); + GeneralParticleHandler.SpawnParticle(backBlast2, false, GeneralDrawLayer.AfterEverything); + + Particle backBlast3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.DarkRed * 0.55f, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.3f * 1.35f, 30); + GeneralParticleHandler.SpawnParticle(backBlast3, false, GeneralDrawLayer.AfterEverything); + + Particle ring1 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Red, "CalamityMod/Particles/FlameExplosion2", new Vector2(0.01f, 0.085f), MathHelper.PiOver2, -4f, 4f, 30); + GeneralParticleHandler.SpawnParticle(ring1); + + Particle ring2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Red, "CalamityMod/Particles/FlameExplosion", new Vector2(0.02f, 0.07f), 0f, -4f, 4f, 25); + GeneralParticleHandler.SpawnParticle(ring2); + + Particle ring3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Red, "CalamityMod/Particles/FlameExplosion", new Vector2(0.02f, 0.07f), MathHelper.PiOver4, -4f, 4f, 25); + GeneralParticleHandler.SpawnParticle(ring3); + + Particle ring4 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Red, "CalamityMod/Particles/FlameExplosion", new Vector2(0.02f, 0.07f), -MathHelper.PiOver4, -4f, 4f, 25); + GeneralParticleHandler.SpawnParticle(ring4); + + for (int i = 0; i < 19; i++) + { + int dustStyle = ModContent.DustType(); + Dust dust = Dust.NewDustPerfect(Projectile.Center, dustStyle); + dust.scale = Main.rand.NextFloat(1.4f, 2.2f); + dust.velocity = new Vector2(21, 21).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 1f); + dust.noGravity = true; + dust.color = Color.MediumVioletRed; + } + for (int i = 0; i < (25); i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.FireworksRGB); + dust.noGravity = false; + dust.velocity = new Vector2(18, 18).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1f); + dust.scale = Main.rand.NextFloat(0.8f, 1.2f); + dust.color = Color.DarkRed; + } + Owner.SetScreenshake(6f); + SoundStyle boom = new("CalamityMod/Sounds/Custom/CalamitasClone/BulletHellEnd"); + SoundEngine.PlaySound(boom with { Volume = 1.5f }, Projectile.Center); + #endregion + if (Projectile.owner == Main.myPlayer) + { + float blastSize = 240; + float minMultiplier = 0.25f; + int hitsToMinMult = 3; + int debuff1 = ModContent.BuffType(); + int debufftime = 180; + //I promise this is balanced + Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 50f), Projectile.knockBack, Projectile.owner, blastSize, minMultiplier, hitsToMinMult); + blast.localAI[0] = debuff1; + blast.localAI[1] = debufftime; + blast.timeLeft = 2; + blast.DamageType = Projectile.DamageType; + blast.CritChance = 100; + } + + //Set cooldown + player.Calamity().oblivionCooldown = 300; + int duration = CalamityUtils.SecondsToFrames(5); + player.AddCooldown(OblivionCooldown.ID, duration, true); + + //We manually kill the projectile to skip the retracting, to make it look like the yoyo is destroyed + //This needs to happen for both the main and secondary yoyo + for (int i = 0; i < Main.maxProjectiles; i++) + { + Projectile p = Main.projectile[i]; + if (p.active && p.type == Type && p.owner == Projectile.owner) + { + p.Kill(); + } + } + } + } + } + //If the player gets more than 200 blocks away, kill the yoyo + if ((Projectile.position - Main.player[Projectile.owner].position).Length() > 3200f) Projectile.Kill(); + time++; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 240); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 300); + //Only applies to the main yoyo + if (!cloneYoyo) + { + hitCounter++; + if (!shatter) + { + power += 0.05f; + SoundStyle onHit = new("CalamityMod/Sounds/Item/TearsOfHeavenUse"); + SoundEngine.PlaySound(onHit, Projectile.Center); + if (power > powerMax) + { + power = powerMax; + } + } + if (hitCounter == hitCountMax) + { + //Refresh duration on both yoyos + for (int i = 0; i < Main.maxProjectiles; i++) + { + Projectile p = Main.projectile[i]; + if (p.active && p.type == Type && p.owner == Projectile.owner) + { + if (p.ModProjectile is OblivionYoyo oblivion) + { + oblivion.time = 0; + } + } + } + //Start a 1.5 second grace period where the yoyo cannot damage enemies. This is to avoid instant shattering after reaching max power + graceTimer = 90; + //Small burst and a ring of darts + if (Projectile.owner == Main.myPlayer) + { + int totalProjectiles = 18; + float radians = MathHelper.TwoPi / totalProjectiles; + float velocity = 8f; + Vector2 spinningPoint = new Vector2(0f, -velocity); + for (int k = 0; k < totalProjectiles; k++) + { + Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, ModContent.ProjectileType(), Projectile.damage, 0f, Projectile.owner, 0f, Projectile.ai[1], velocity * 1.5f); + } + float blastSize = 120; + float minMultiplier = 0.25f; + int hitsToMinMult = -1; + int debuff1 = ModContent.BuffType(); + int debufftime = 180; + Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 5f), Projectile.knockBack, Projectile.owner, blastSize, minMultiplier, hitsToMinMult); + blast.localAI[0] = debuff1; + blast.localAI[1] = debufftime; + blast.timeLeft = 2; + blast.DamageType = Projectile.DamageType; + } + #region Visuals and Sounds + SoundStyle boom = new("CalamityMod/Sounds/Custom/CalamitasClone/CalClone_BigFireballBit", 4); + SoundEngine.PlaySound(boom with { Volume = 1.5f }, Projectile.Center); + SoundEngine.PlaySound(SoundID.DD2_ExplosiveTrapExplode with { Volume = 1f, Pitch = -0.5f }, Projectile.Center); + SoundEngine.PlaySound(SoundID.Item74 with { Volume = 0.7f, Pitch = 1f }, Projectile.Center); + for (int i = 0; i < 5; i++) + { + Particle explosion = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Lerp(Color.Red, Color.MediumVioletRed, Utils.GetLerpValue(0, 5, i, true)), "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0f, 0.12f + 0.005f * i, (int)(20 - i * 1.5f)); + GeneralParticleHandler.SpawnParticle(explosion); + } + for (int i = 0; i < 3; i++) + { + Particle explosion = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Lerp(Color.DarkRed, Color.DarkOrchid, Utils.GetLerpValue(0, 3, i, true)), "CalamityMod/Particles/FlameExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0f, 0.12f + 0.01f * i, (int)(20 - i * 2f)); + GeneralParticleHandler.SpawnParticle(explosion); + } + Particle outerGlow = new CustomPulse(Projectile.Center, Vector2.Zero, Color.DarkRed, "CalamityMod/Particles/BloomCircle", Vector2.One, 0f, 0.2f, 2f, 24); + GeneralParticleHandler.SpawnParticle(outerGlow); + Particle innerGlow = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Red, "CalamityMod/Particles/BloomCircle", Vector2.One, 0f, 0.1f, 1f, 24); + GeneralParticleHandler.SpawnParticle(innerGlow); + #endregion + } + //If the yoyo hits while at maximum, reset the duration of both yoyos and trigger shattering + if (hitCounter > hitCountMax && !shatter) + { + Player Owner = Main.player[Projectile.owner]; + SoundEngine.PlaySound(SoundID.DD2_EtherianPortalDryadTouch with { Volume = 4f }, Projectile.Center); + Owner.SetScreenshake(3f); + shatter = true; + for (int i = 0; i < Main.maxProjectiles; i++) + { + Projectile p = Main.projectile[i]; + if (p.active && p.type == Type && p.owner == Projectile.owner) + { + if (p.ModProjectile is OblivionYoyo oblivion) + { + oblivion.time = 0; + } + } + } + } + } + } + + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 300); + + //During the grace period after reaching max power, the yoyo cannot hit enemies for 1.5s to avoid unfair shattering + public override bool? CanDamage() => graceTimer == 0; + + //Avoids instantly spawning a fireball + public override void OnSpawn(IEntitySource source) + { + time = 1; + } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); + Texture2D bloomTexture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + Texture2D shineTexture = ModContent.Request("CalamityMod/Particles/HalfStar").Value; + + float randSize = Main.rand.NextFloat(0.9f, 1.1f); + float rotationAngle = MathHelper.PiOver4; + Vector2 drawPos = Projectile.Center - Main.screenPosition; + + //Only applies to the main yoyo + if (!cloneYoyo) + { + //Red backglow, scales in size with power + Main.EntitySpriteDraw(bloomTexture, drawPos, null, Color.Red with { A = 0 }, Projectile.rotation, bloomTexture.Size() * 0.5f, 0.3f * randSize * power, SpriteEffects.None, 0); + Main.EntitySpriteDraw(bloomTexture, drawPos, null, Color.MediumVioletRed with { A = 0 } * 0.65f, Projectile.rotation, bloomTexture.Size() * 0.5f, 0.2f * randSize * power, SpriteEffects.None, 0); + + //X, scales in size with power + Main.EntitySpriteDraw(shineTexture, drawPos, null, Color.Red with { A = 0 }, rotationAngle, shineTexture.Size() * 0.5f, new Vector2(0.4f, 1f) * 2.75f * randSize * power, SpriteEffects.None, 0); + Main.EntitySpriteDraw(shineTexture, drawPos, null, Color.Purple with { A = 0 } * 0.65f, rotationAngle, shineTexture.Size() * 0.5f, new Vector2(0.4f, 1f) * 2.25f * randSize * power, SpriteEffects.None, 0); + Main.EntitySpriteDraw(shineTexture, drawPos, null, Color.Red with { A = 0 }, rotationAngle + MathHelper.PiOver2, shineTexture.Size() * 0.5f, new Vector2(0.4f, 1f) * 2.75f * randSize * power, SpriteEffects.None, 0); + Main.EntitySpriteDraw(shineTexture, drawPos, null, Color.Purple with { A = 0 } * 0.65f, rotationAngle + MathHelper.PiOver2, shineTexture.Size() * 0.5f, new Vector2(0.4f, 1f) * 2.25f * randSize * power, SpriteEffects.None, 0); + + //Yoyo drawing + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); + + //Red cross, doesn't scale in size unless shattering + Main.EntitySpriteDraw(shineTexture, drawPos, null, Color.DarkRed with { A = 0 }, 0, shineTexture.Size() * 0.5f, new Vector2(0.4f, 1f) * 1.35f * randSize * (shatter ? power : 1f), SpriteEffects.None, 0); + Main.EntitySpriteDraw(shineTexture, drawPos, null, Color.Purple with { A = 0 } * 0.65f, 0, shineTexture.Size() * 0.5f, new Vector2(0.4f, 1f) * 1.35f * randSize * (shatter ? power : 1f), SpriteEffects.None, 0); + Main.EntitySpriteDraw(shineTexture, drawPos, null, Color.DarkRed with { A = 0 }, MathHelper.PiOver2, shineTexture.Size() * 0.5f, new Vector2(0.4f, 1f) * 1.35f * randSize * (shatter ? power : 1f), SpriteEffects.None, 0); + Main.EntitySpriteDraw(shineTexture, drawPos, null, Color.Purple with { A = 0 } * 0.65f, MathHelper.PiOver2, shineTexture.Size() * 0.5f, new Vector2(0.4f, 1f) * 1.35f * randSize * (shatter ? power : 1f), SpriteEffects.None, 0); + + //Black backglow, scales in size with power + for (int i = 0; i < 2; i++) + { + Particle backglow = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Black, "CalamityMod/Particles/SmallBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.25f * (power * 2), 0f, 10, false); + GeneralParticleHandler.SpawnParticle(backglow); + backglow.DrawLayer = Enums.GeneralDrawLayer.BeforeProjectiles; + backglow.DrawLayer = Enums.GeneralDrawLayer.BeforeNPCs; + } + } + else + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Pets/ChibiiDoggo.cs b/Projectiles/Pets/ChibiiDoggo.cs index 9bcfc40ee6..87cca66150 100644 --- a/Projectiles/Pets/ChibiiDoggo.cs +++ b/Projectiles/Pets/ChibiiDoggo.cs @@ -153,21 +153,11 @@ IL_6899: if (Projectile.tileCollide) { Projectile.hide = false; - - //if (projectile.extraUpdates == 1) PreventFastfall(); - - /*Vector2 distance = Main.player[projectile.owner].Center - projectile.Center; - if (distance.Length() < 100) - projectile.extraUpdates = 0; - else - projectile.extraUpdates = 1;*/ } else { Projectile.hide = true; - //projectile.extraUpdates = 1; - if (player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0) Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.position.X, Projectile.position.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Projectile.owner, (float)Projectile.identity); } diff --git a/Projectiles/Pets/DannyDevitoPet.cs b/Projectiles/Pets/DannyDevitoPet.cs index a57bd3e2d5..5a0fd9662a 100644 --- a/Projectiles/Pets/DannyDevitoPet.cs +++ b/Projectiles/Pets/DannyDevitoPet.cs @@ -249,53 +249,6 @@ namespace CalamityMod.Projectiles.Pets } } - /*public override void PostDraw(Color lightColor) - { - if (!Main.gamePaused || Main.gameMenu) - { - Vector2 projDirect = projectile.position - Main.screenPosition; - if ((float)Main.mouseX > projDirect.X && (float)Main.mouseX < projDirect.X + (float)projectile.width && (float)Main.mouseY > projDirect.Y && (float)Main.mouseY < projDirect.Y + (float)projectile.height) - { - int playerTileX = (int)(Main.player[projectile.owner].Center.X / 16f); - int playerTileY = (int)(Main.player[projectile.owner].Center.Y / 16f); - int projTileX = (int)projectile.Center.X / 16; - int projTileY = (int)projectile.Center.Y / 16; - int lastTileRangeX = Main.player[projectile.owner].lastTileRangeX; - int lastTileRangeY = Main.player[projectile.owner].lastTileRangeY; - if (playerTileX >= projTileX - lastTileRangeX && playerTileX <= projTileX + lastTileRangeX + 1 && playerTileY >= projTileY - lastTileRangeY && playerTileY <= projTileY + lastTileRangeY + 1) - { - Main.player[projectile.owner].noThrow = 2; - Main.player[projectile.owner].cursorItemIconEnabled = true; - Main.player[projectile.owner].cursorItemIconID = 3213; - if (PlayerInput.UsingGamepad) - { - Main.player[projectile.owner].GamepadEnableGrappleCooldown(); - } - if (Main.mouseRight && Main.mouseRightRelease && Player.StopMoneyTroughFromWorking == 0) - { - Main.mouseRightRelease = false; - if (Main.player[projectile.owner].chest == -2) - { - Main.PlaySound(SoundID.Item11, -1, -1); - Main.player[projectile.owner].chest = -1; - Recipe.FindRecipes(); - return; - } - Main.player[projectile.owner].GetCalamityPlayer().trashManChest = projectile.type; - Main.player[projectile.owner].chest = -2; - Main.player[projectile.owner].chestX = (int)(projectile.Center.X / 16f); - Main.player[projectile.owner].chestY = (int)(projectile.Center.Y / 16f); - Main.player[projectile.owner].talkNPC = -1; - Main.npcShop = 0; - Main.playerInventory = true; - Main.PlaySound(SoundID.Item10, -1, -1); - Recipe.FindRecipes(); - } - } - } - } - }*/ - private bool HoleBelow() //pretty much the same as the one used in mantis { int tileWidth = 4; diff --git a/Projectiles/Pets/RadiatorPet.cs b/Projectiles/Pets/RadiatorPet.cs index 406c8e749d..3cce2aaf4b 100644 --- a/Projectiles/Pets/RadiatorPet.cs +++ b/Projectiles/Pets/RadiatorPet.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Pets Projectile.frame = 0; } } - Lighting.AddLight(Projectile.Center, 0.4f, 1f, 0.5f); + Lighting.AddLight(Projectile.Center, 0.6f, 0.6f, 0.6f); Vector2 vector46 = Projectile.position; if (!fly) { diff --git a/Projectiles/Ranged/AbyssalFire.cs b/Projectiles/Ranged/AbyssalFire.cs index 039a95a092..f878da3300 100644 --- a/Projectiles/Ranged/AbyssalFire.cs +++ b/Projectiles/Ranged/AbyssalFire.cs @@ -1,20 +1,14 @@ using System; -using System.Collections.Generic; -using System.Linq; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.DataStructures; -using CalamityMod.Dusts; -using CalamityMod.Effects; using CalamityMod.Enums; -using CalamityMod.Graphics.Metaballs; using CalamityMod.Graphics.Primitives; using CalamityMod.NPCs; using CalamityMod.Packets.Entities; using CalamityMod.Particles; using CalamityMod.Utilities.Daybreak; using CalamityMod.Utilities.Daybreak.Buffers; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -22,7 +16,6 @@ using Terraria; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; -using Terraria.WorldBuilding; namespace CalamityMod.Projectiles.Ranged { @@ -153,15 +146,7 @@ namespace CalamityMod.Projectiles.Ranged } private float PrimitiveWidthFunction(float completionRatio, Vector2 vertexPos) { - float width; float maxBodyWidth = Projectile.scale * MaxLaserWidth * (1 + MathF.Pow(Utils.GetLerpValue(450, 500, VoidragonHoldout.ModProjectile().beamTimer, true), 3.5f) * 4); - float shrinkRatio = 0.018f; - - //if (completionRatio < shrinkRatio) - // width = MathF.Sin(completionRatio / shrinkRatio * MathHelper.PiOver2) * maxBodyWidth + shrinkRatio; - //else - // width = Utils.Remap(completionRatio, shrinkRatio, 1f, maxBodyWidth, 0f); - return maxBodyWidth * Utils.GetLerpValue(0f, 0.05f, completionRatio, true) * Utils.GetLerpValue(LaserLength, LaserLength - 0.1f, completionRatio, true); } diff --git a/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs b/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs index 7845aed473..99bae3b246 100644 --- a/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs +++ b/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Ranged public override float RecoilResolveSpeed => (KeepRefreshingLifetime || CurrentChargingFrames < ArcNovaDiffuser.Charge2Frames) ? 0.4f : 0.04f; public static int FramesPerLoad = 13; - public static int MaxLoadableShots = 15; + public static int MaxLoadableShots = 20; public static float BulletSpeed = 12f; public SlotId NovaChargeSlot; @@ -107,11 +107,13 @@ namespace CalamityMod.Projectiles.Ranged // Rapid Fire mode else if (ShotsLoaded > 0) { + float lvCompLerp = Math.Min(CurrentChargingFrames / ArcNovaDiffuser.Charge1Frames, 1); + // While bullets are remaining, refresh the lifespan; it will not refresh again after bullets run out Projectile.timeLeft = ArcNovaDiffuser.AftershotCooldownFrames; // Retract recoil & shoot faster if charged - ShootRecoilTimer -= ChargeLV1 ? 2.3f : 2f; + ShootRecoilTimer -= (ChargeLV1 ? 2.8f : 2f) * MathHelper.Lerp(0.4f, 1f, MathF.Pow(lvCompLerp, 2.5f)); if (ShootRecoilTimer <= 0f) { @@ -120,8 +122,9 @@ namespace CalamityMod.Projectiles.Ranged Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * BulletSpeed; Vector2 fireVec = shootVelocity.RotatedByRandom(MathHelper.ToRadians(2f)); + int damage = (int)(Projectile.damage * MathHelper.Lerp(0.5f, 1f, lvCompLerp)); if (Main.myPlayer == Projectile.owner) - Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, fireVec * (ChargeLV1 ? 1 : 0.7f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, fireVec * (ChargeLV1 ? 1 : 0.7f), ModContent.ProjectileType(), damage, Projectile.knockBack, Projectile.owner); for (int i = 0; i <= 4; i++) { Dust dust = Dust.NewDustPerfect(GunTipPosition - Projectile.velocity * 15, ModContent.DustType(), shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(1.2f, 1.6f), 0, default, Main.rand.NextFloat(0.8f, 1.8f)); @@ -137,7 +140,7 @@ namespace CalamityMod.Projectiles.Ranged } ShotsLoaded--; - ShootRecoilTimer = (int)MathHelper.Lerp(33, 13, Math.Min(CurrentChargingFrames / ArcNovaDiffuser.Charge1Frames, 1)); + ShootRecoilTimer = (int)MathHelper.Lerp(23, 13, lvCompLerp); OffsetLengthFromArm -= 6f; } } diff --git a/Projectiles/Ranged/AuroraFire.cs b/Projectiles/Ranged/AuroraFire.cs index 649136df35..b00bfce76c 100644 --- a/Projectiles/Ranged/AuroraFire.cs +++ b/Projectiles/Ranged/AuroraFire.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Ranged public class AuroraFire : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; - public override string Texture => "CalamityMod/Projectiles/Magic/RancorFog"; + public override string Texture => "CalamityMod/Particles/RancorFog"; public static int Lifetime => 480; public static int Fadetime => 450; diff --git a/Projectiles/Ranged/BallistaGreatArrow.cs b/Projectiles/Ranged/BallistaGreatArrow.cs index 33f3b8a93f..19be95a743 100644 --- a/Projectiles/Ranged/BallistaGreatArrow.cs +++ b/Projectiles/Ranged/BallistaGreatArrow.cs @@ -9,11 +9,6 @@ namespace CalamityMod.Projectiles.Ranged public class BallistaGreatArrow : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Type] = 10; - ProjectileID.Sets.TrailingMode[Type] = 1; - } public override void SetDefaults() { @@ -43,16 +38,10 @@ namespace CalamityMod.Projectiles.Ranged for (int i = 0; i < 2; i++) // Burst into 2 shards upwards { Vector2 baseVelocity = Vector2.UnitY * -12f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Top, baseVelocity.RotatedByRandom(MathHelper.Pi * 0.1f), ModContent.ProjectileType(), Projectile.damage / 4, Projectile.knockBack * 0.25f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Top, baseVelocity.RotatedByRandom(MathHelper.Pi * 0.1f), ModContent.ProjectileType(), Projectile.damage / 4, Projectile.knockBack * 0.25f, Projectile.owner); } } public override void OnKill(int timeLeft) => SoundEngine.PlaySound(SoundID.Item14, Projectile.position); - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); - return false; - } } } diff --git a/Projectiles/Ranged/BallistaGreatArrow.png b/Projectiles/Ranged/BallistaGreatArrow.png index 2883016d90..a359a261e9 100644 Binary files a/Projectiles/Ranged/BallistaGreatArrow.png and b/Projectiles/Ranged/BallistaGreatArrow.png differ diff --git a/Projectiles/Ranged/BallistaShard.cs b/Projectiles/Ranged/BallistaShard.cs new file mode 100644 index 0000000000..8032d79a8f --- /dev/null +++ b/Projectiles/Ranged/BallistaShard.cs @@ -0,0 +1,61 @@ +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Ranged +{ + public class BallistaShard : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 3; + } + public override void SetDefaults() + { + Projectile.width = 10; + Projectile.height = 10; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.penetrate = 1; + Projectile.aiStyle = ProjAIStyleID.Arrow; + Projectile.timeLeft = 120; + AIType = ProjectileID.WoodenArrowFriendly; + } + + public override void AI() + { + if (Projectile.timeLeft == 120) + Projectile.frame = Main.rand.Next(3); + + if (Projectile.velocity.Y <= -2f) + Projectile.velocity.Y = -2f; + Projectile.velocity.Y += 0.025f; + Projectile.rotation += Projectile.velocity.Y; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 60); + } + + public override void OnKill(int timeLeft) + { + for (int i = 0; i <= 2; i++) + { + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Sand, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); + } + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = TextureAssets.Projectile[Type].Value; + Rectangle frame = tex.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, SpriteEffects.None); + return false; + } + } +} diff --git a/Projectiles/Ranged/BallistaShard.png b/Projectiles/Ranged/BallistaShard.png new file mode 100644 index 0000000000..aba2ba5a10 Binary files /dev/null and b/Projectiles/Ranged/BallistaShard.png differ diff --git a/Projectiles/Ranged/BlissfulBombardierHoldout.cs b/Projectiles/Ranged/BlissfulBombardierHoldout.cs index 5fcbb6ddc3..d2cbdc12f4 100644 --- a/Projectiles/Ranged/BlissfulBombardierHoldout.cs +++ b/Projectiles/Ranged/BlissfulBombardierHoldout.cs @@ -96,8 +96,14 @@ namespace CalamityMod.Projectiles.Ranged } public override void HoldoutAI() { - // If there's no player, or the player is the server, or the owner's stunned, there'll be no holdout. - if (Owner.CantUseHoldout() && PostFireCooldown <= 0 && shootingTimer < (int)(Owner.itemAnimationMax * 0.8f)) + // If there's no player, or the player isn't holding fire, or the player's stunned, there'll be no holdout. + // The holdout will persist if on cooldown, but it is absolutely imperative that it can disappear if dead, CCed, etc. + if (Owner == null || !Owner.active || Owner.dead || Owner.CCed || Owner.noItems) + { + Projectile.Kill(); + return; + } + if (!Owner.channel && PostFireCooldown <= 0 && shootingTimer < (int)(Owner.itemAnimationMax * 0.8f)) { Projectile.Kill(); return; diff --git a/Projectiles/Ranged/BloodfireArrowProj.cs b/Projectiles/Ranged/BloodfireArrowProj.cs index 359c21e2e0..011b49ccc0 100644 --- a/Projectiles/Ranged/BloodfireArrowProj.cs +++ b/Projectiles/Ranged/BloodfireArrowProj.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Ranged } else { - Projectile.damage = (int)(Projectile.damage * 1.3f); // damage boost + Projectile.damage = (int)(Projectile.damage * 1.2f); // damage boost player.statLife -= 1; if (player.statLife <= 0) { diff --git a/Projectiles/Ranged/BrimstoneFireFriendly.cs b/Projectiles/Ranged/BrimstoneFireFriendly.cs index d10e45801b..f342548221 100644 --- a/Projectiles/Ranged/BrimstoneFireFriendly.cs +++ b/Projectiles/Ranged/BrimstoneFireFriendly.cs @@ -1,6 +1,7 @@ using System; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; +using CalamityMod.Graphics.Metaballs; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -15,7 +16,6 @@ namespace CalamityMod.Projectiles.Ranged public override string Texture => "CalamityMod/Projectiles/FireProj"; public static int Lifetime => 60; - public static int Fadetime => 50; public ref float Time => ref Projectile.ai[0]; public int MistType = -1; @@ -29,13 +29,13 @@ namespace CalamityMod.Projectiles.Ranged Projectile.MaxUpdates = 3; Projectile.timeLeft = Lifetime; Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 6; + Projectile.idStaticNPCHitCooldown = 5; } public override void AI() { Time++; - if (Time < Fadetime && Main.rand.NextBool(6)) + if (Main.rand.NextBool(6)) { Vector2 cinderPos = Projectile.Center + Main.rand.NextVector2Circular(60f, 60f) * Utils.Remap(Time, 0f, Lifetime, 0.5f, 1f); float cinderSize = Utils.GetLerpValue(6f, 12f, Time, true); @@ -47,13 +47,21 @@ namespace CalamityMod.Projectiles.Ranged } cinder.noGravity = true; cinder.scale *= cinderSize * 1.2f; - cinder.velocity += Projectile.velocity * Utils.Remap(Time, 0f, Fadetime * 0.75f, 1f, 0.1f) * Utils.Remap(Time, 0f, Fadetime * 0.1f, 0.1f, 1f); + cinder.velocity += Projectile.velocity * Utils.Remap(Time, 0f, Lifetime * 0.75f, 1f, 0.1f) * Utils.Remap(Time, 0f, Lifetime * 0.1f, 0.1f, 1f); } if (MistType == -1) MistType = Main.rand.Next(3); Lighting.AddLight(Projectile.Center, 0.75f, 0.15f, 0.15f); + if (Projectile.timeLeft > Lifetime - 8) + return; + float timeRatio = Utils.GetLerpValue(0f, Lifetime, Time); + float fireSize = Utils.Remap(timeRatio, 0.2f, 0.5f, 0.25f, 1f); + var p = CataclysmMetaball.SpawnParticle(Projectile.Center, Vector2.Zero, Terraria.GameContent.TextureAssets.Projectile[Type].Width() * fireSize); + p.rotation = Main.rand.NextFloat(MathHelper.TwoPi); + p.TextureToUse = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + p.SizeScaling = 0.6f; } // Keeping the flames in place when hitting a block @@ -69,11 +77,7 @@ namespace CalamityMod.Projectiles.Ranged // Expanding hitbox public override void ModifyDamageHitbox(ref Rectangle hitbox) { - int size = (int)Utils.Remap(Time, 0f, Fadetime, 10f, 40f); - - // Shrinks again after fading - if (Time > Fadetime) - size = (int)Utils.Remap(Time, Fadetime, Lifetime, 40f, 0f); + int size = (int)Utils.Remap(Time, 0f, Lifetime, 10f, 40f); hitbox.Inflate(size, size); } @@ -87,68 +91,18 @@ namespace CalamityMod.Projectiles.Ranged target.AddBuff(ModContent.BuffType(), 1200); // Gas up the enemy - int smokeCount = 3 + (int)MathHelper.Clamp(target.width * 0.1f, 0f, 20f); + int smokeCount = 4 + (int)MathHelper.Clamp(target.width * 0.1f, 0f, 20f); for (int i = 0; i < smokeCount; i++) { - bool Smoketype = Main.rand.NextBool(); Vector2 smokePos = target.Center + Main.rand.NextVector2Circular(target.width * 0.5f, target.height * 0.5f); - Vector2 smokeVel = Vector2.UnitY * (Smoketype ? Main.rand.NextFloat(-0.8f, -2f) : Main.rand.NextFloat(-1.2f, -0.2f)) * MathHelper.Clamp(target.height * 0.1f, 1f, 10f); - Particle smoke = new MediumMistParticle(smokePos, smokeVel, new Color(255, 50, 50), Color.DimGray, Smoketype ? Main.rand.NextFloat(0.4f, 0.75f) : Main.rand.NextFloat(1.5f, 2f), 220 - Main.rand.Next(50), 0.1f); + Vector2 smokeVel = Vector2.UnitY * Main.rand.NextFloat(-2.4f, -0.8f) * MathHelper.Clamp(target.height * 0.1f, 1f, 10f); + Particle smoke = new MediumMistParticle(smokePos, smokeVel, Color.MediumVioletRed, Color.Purple, Main.rand.NextFloat(1f, 2f), 245 - Main.rand.Next(50), 0.1f); GeneralParticleHandler.SpawnParticle(smoke); } } public override bool PreDraw(ref Color lightColor) { - Texture2D fire = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Texture2D mist = ModContent.Request("CalamityMod/Particles/MediumMist").Value; - - // The conga line of colors to sift through - Color color1 = new Color(255, 110, 100, 200); - Color color2 = new Color(255, 50, 50, 70); - Color color3 = new Color(255, 100, 100, 100); - Color color4 = new Color(200, 35, 30, 100); - float length = ((Time > Fadetime - 10f) ? 0.1f : 0.15f); - float vOffset = Math.Min(Time, 20f); - float timeRatio = Utils.GetLerpValue(0f, Lifetime, Time); - float fireSize = Utils.Remap(timeRatio, 0.2f, 0.5f, 0.25f, 1f); - - if (timeRatio >= 1f) - return false; - - for (float j = 1f; j >= 0f; j -= length) - { - // Color - Color fireColor = ((timeRatio < 0.1f) ? Color.Lerp(Color.Transparent, color1, Utils.GetLerpValue(0f, 0.1f, timeRatio)) : - ((timeRatio < 0.2f) ? Color.Lerp(color1, color2, Utils.GetLerpValue(0.1f, 0.2f, timeRatio)) : - ((timeRatio < 0.35f) ? color2 : - ((timeRatio < 0.7f) ? Color.Lerp(color2, color3, Utils.GetLerpValue(0.35f, 0.7f, timeRatio)) : - ((timeRatio < 0.85f) ? Color.Lerp(color3, color4, Utils.GetLerpValue(0.7f, 0.85f, timeRatio)) : - Color.Lerp(color4, Color.Transparent, Utils.GetLerpValue(0.85f, 1f, timeRatio))))))); - fireColor *= (1f - j) * Utils.GetLerpValue(0f, 0.2f, timeRatio, true); - Color innerColor = Color.Lerp(fireColor, Color.Black, 0.3f); - - // Positions and rotations - Vector2 firePos = Projectile.Center - Main.screenPosition - Projectile.velocity * vOffset * j; - float mainRot = -j * MathHelper.PiOver2 - Main.GlobalTimeWrappedHourly * (j + 1f) * 2f / length; - float trailRot = MathHelper.PiOver4 - mainRot; - - // Draw one backtrail - Vector2 trailOffset = Projectile.velocity * vOffset * length * 0.5f; - Main.EntitySpriteDraw(fire, firePos - trailOffset, null, innerColor * 0.25f, trailRot, fire.Size() * 0.5f, fireSize, SpriteEffects.None); - - // Draw the main fire - Main.EntitySpriteDraw(fire, firePos, null, innerColor, mainRot, fire.Size() * 0.5f, fireSize, SpriteEffects.None); - - // Draw the masking smoke - if (MistType > 2 || MistType < 0) - return false; - Main.spriteBatch.SetBlendState(BlendState.Additive); - Rectangle frame = mist.Frame(1, 3, 0, MistType); - Main.EntitySpriteDraw(mist, firePos, frame, Color.Lerp(fireColor, Color.White, 0.3f), mainRot, frame.Size() * 0.5f, fireSize, SpriteEffects.None); - Main.EntitySpriteDraw(mist, firePos, frame, fireColor, mainRot, frame.Size() * 0.5f, fireSize * 3f, SpriteEffects.None); - Main.spriteBatch.SetBlendState(BlendState.AlphaBlend); - } return false; } } diff --git a/Projectiles/Ranged/DryadsTearMain.cs b/Projectiles/Ranged/DryadsTearMain.cs index 25268fe87a..d9c91ae175 100644 --- a/Projectiles/Ranged/DryadsTearMain.cs +++ b/Projectiles/Ranged/DryadsTearMain.cs @@ -30,7 +30,8 @@ namespace CalamityMod.Projectiles.Ranged public int turnDirection = 0; // Direction it will rotate public int turnChange = 0; // Adds variance to multiple aspects of the bullet, including when it will change its turn direction public float turnIntensity = 0; // Adds a bit more variance, this time to velocity - public float damageMult = 1; // Multiplier that updates instantly, used for most of the gameplay effects + public float originalDamageMult = 1; // Multiplier that updates instantly, used ONLY for the gameplay effects + public float damageMult = 1; // Multiplier that updates instantly, used for most of the gameplay effects and some visual (why did I do this???) public float visualMult = 0.75f;// Multiplier that updates over time, used for most of the visual effects public Vector2 dropletPosition; // The position of the orbiting teardrop public Vector2 lastDropletPosition; // The previous position of the orbiting teardroplet @@ -41,7 +42,7 @@ namespace CalamityMod.Projectiles.Ranged public float dropletAttackLerp = 1; // A lerp variable used for timing the droplet's attack public int frameDelay = 0; // A few frames of delay after landing on the enemy before explosing, which improves the visuals public bool detachEffects = true; // Used for the moment when the droplet detatched from the main bullet - public bool isMaxPower => damageMult >= 1; // If the bullet is at maximum power + public bool isMaxPower = false; // If the bullet is at maximum power public float finalEffectMult => Projectile.scale * visualMult; // Used for many but not all visual scaling effects public NPC targeted; // The target being attacked by the droplet public ref float trueLifetime => ref Projectile.ai[2]; // The lifetime of the projectile, used over vanilla lifetime because it can increment by decimals @@ -50,9 +51,13 @@ namespace CalamityMod.Projectiles.Ranged public int fadeLifetime => (int)(35 + effectSpeedMod * Math.Max(1 - damageMult, 0)); // The time in which the projectile fades out and can no longer hit anything public int extendedLifetime => (int)(85 * Math.Min(damageMult, 1) + effectSpeedMod * Math.Max(1 - damageMult, 0)); // The time after lifetime reaches zero where the droplet does its attack public bool fading => trueLifetime <= fadeLifetime; // If the projectile is fading away + public bool crit = false; // If the main hit crit, used to make the teardrop crit + public Vector2 hitTileVel = Vector2.Zero; - public float explosionDamageMult = 1.4f; - public float maxDamageMult = 1.65f; + public float explosionDamageMult = 1f; + public float mainBulletDamageMult = 0.75f; + public float maxDamageMult = 2.15f; + public float bulletScalingDamagePow = 0.1f; // Applied to bullets so that fast fired bullets still do some damage, the original damage mult based on projectile number is put to the power of this number public static Asset ShineTexture { get; private set; } public static Asset BloomTexture { get; private set; } public override void Load() @@ -79,7 +84,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.friendly = true; Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = -1; - Projectile.tileCollide = false; + Projectile.tileCollide = true; Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; @@ -101,13 +106,14 @@ namespace CalamityMod.Projectiles.Ranged trueLifetime = fadeLifetime * 1.5f; turnDirection = Main.rand.NextBool() ? -1 : 1; turnChange = Main.rand.Next(30, 190 + 1); - turnIntensity = Main.rand.NextFloat(0.2f, 1.6f); + turnIntensity = Main.rand.NextFloat(0.45f, 2.9f); effectSpeedMod = Main.rand.Next(5, 35); } - if (time % turnChange == 0 && !fading) + if (time % turnChange == 0) turnDirection *= -1; - visualMult = MathHelper.Lerp(visualMult, damageMult, 0.1f / Projectile.MaxUpdates); + float visualMinPow = (isMaxPower ? damageMult : MathF.Pow(damageMult, 0.25f)); + visualMult = MathHelper.Lerp(visualMult, visualMinPow, 0.1f / Projectile.MaxUpdates); float speed = 8 * MathF.Pow(visualMult, 0.3f) * Math.Max(MathF.Pow(Utils.GetLerpValue(0, fadeLifetime, trueLifetime, true), 2), 0.15f); bool chanceForDust = Main.rand.NextBool((int)Math.Clamp((fading ? 8 : 5) / finalEffectMult, 3, 60)); @@ -122,7 +128,7 @@ namespace CalamityMod.Projectiles.Ranged dust.fadeIn = 1; } - if (time > 0) // Reduce damage and visual intensity for every projectile of this type from the same player that are relativley close to each other + if (time > 0 && Projectile.numHits == 0) // Reduce damage and visual intensity for every projectile of this type from the same player that are relativley close to each other { float damageReduction = 1; int ownedProj = Owner.ownedProjectileCounts[Projectile.type]; @@ -132,16 +138,26 @@ namespace CalamityMod.Projectiles.Ranged if (projectile.owner == Projectile.owner && projectile.active && projectile.type == Projectile.type && projectile != Projectile) damageReduction++; } - float newDamageMult = MathF.Pow(1 / damageReduction, 0.25f); - if (newDamageMult < damageMult && !fading) + int maxProjectilesToCount = 12; + float newDamageMult = (1 / Math.Min(MathF.Pow(damageReduction, 0.4f), maxProjectilesToCount)); + float newOriginalDamageMult = (1 / Math.Min(damageReduction, maxProjectilesToCount)); + if (newDamageMult < damageMult) + { damageMult = newDamageMult; + } + if (newOriginalDamageMult < originalDamageMult) + { + originalDamageMult = newOriginalDamageMult; + } } + if (time > 0) + isMaxPower = originalDamageMult >= 1; - if (isMaxPower) - damageMult = maxDamageMult; + if (isMaxPower && Projectile.numHits == 0) + { damageMult = 1.75f; originalDamageMult = 1.75f; } // This is done for visual reasons, the actual max power damage is applied on hit - float movement = Main.rand.NextFloat(0.009f, 0.0115f) * speed; + float movement = Main.rand.NextFloat(0.0120f, 0.0165f) * speed; if (damageMult < 1) Projectile.velocity += Vector2.Lerp(Projectile.velocity.RotatedBy(MathHelper.PiOver2 * turnDirection).SafeNormalize(Vector2.UnitX) * movement * turnIntensity, Projectile.velocity, MathF.Pow(Math.Min(damageMult + 0.15f, 1), 3.3f)); Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * speed; @@ -232,7 +248,7 @@ namespace CalamityMod.Projectiles.Ranged falling ? (int)(10 * (1 - dropLerp * 0.6f)) : (int)(6 + 2 * dropletScaling), 0.135f * dropletScaling * (1 + dropLerp * 0.3f), Color.Turquoise * colorMult, falling ? Color.Lime * colorMult : Color.Teal * colorMult, new Vector2(0.15f * (falling ? 0.5f + dropLerp * 3 : 1) * damageMult, (Math.Max(0.15f * lastDropletPosition.Distance(dropletPosition), 0.25f) * (1 - dropLerp * 0.2f))), noShrink: true, colorFadeSpeed: 5, glowOpacity: colorMult, shrinkSpeed: falling ? 1.5f - dropLerp : 0); GeneralParticleHandler.SpawnParticle(dropTrail, true); - if (Main.rand.NextBool(3)) + if (Main.rand.NextBool((int)(4 / damageMult) + 1)) { Dust dust = Dust.NewDustPerfect(dropletPosition + Main.rand.NextVector2Circular(5 + 20 * (1 - dropletAttackLerp), 5 + 20 * (1 - dropletAttackLerp)), ModContent.DustType()); dust.noGravity = true; @@ -261,8 +277,30 @@ namespace CalamityMod.Projectiles.Ranged trueLifetime -= 1 / MathF.Pow(damageMult, 0.3f); if (trueLifetime <= -extendedLifetime && Projectile.FinalExtraUpdate()) frameDelay++; + + if (hitTileVel != Vector2.Zero) + { + Projectile.velocity = Vector2.Lerp(Projectile.velocity, hitTileVel, 0.03f / damageMult); + } + time++; } + public override bool OnTileCollide(Vector2 oldVelocity) + { + if (Projectile.numHits == 0) // Store a tile reflect velocity and lerp to it afterwards + { + float velX = oldVelocity.X; + float velY = oldVelocity.Y; + if (Projectile.velocity.Y != oldVelocity.Y) + velY = -oldVelocity.Y; + if (Projectile.velocity.X != oldVelocity.X) + velX = -oldVelocity.X; + Projectile.velocity = oldVelocity; + hitTileVel = new Vector2(velX, velY); + Projectile.tileCollide = false; + } + return false; + } public void Splash() { if (dropletAttack) @@ -327,13 +365,15 @@ namespace CalamityMod.Projectiles.Ranged { float blastSize = 75 * scale; float minMultiplier = 0.15f; - int hitsToMinMult = (int)(3 + 5 * damageMult); - int knockback = (int)(7 * damageMult * (isMaxPower ? -1 : 1)); // Give heavy knockback at full power - int damage = (int)(Projectile.damage * explosionDamageMult * damageMult); - Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), targeted.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, Owner.whoAmI, blastSize, minMultiplier, hitsToMinMult); + int hitsToMinMult = (int)(3 + 5 * originalDamageMult); + int knockback = (int)(7 * originalDamageMult * (isMaxPower ? -1 : 1)); // Give heavy knockback at full power + float finalDamageMult = MathF.Pow(originalDamageMult, bulletScalingDamagePow); + int damage = (int)(Projectile.damage * explosionDamageMult * (isMaxPower ? maxDamageMult : finalDamageMult)); + Projectile blast = Projectile.NewProjectileDirect(Owner.GetSource_FromThis(), targeted.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, Owner.whoAmI, blastSize, minMultiplier, hitsToMinMult); blast.timeLeft = 8; - blast.DamageType = DamageClass.Ranged; + blast.DamageType = Projectile.DamageType; blast.ArmorPenetration = Projectile.ArmorPenetration; + blast.localAI[0] = (crit ? 1 : 0); // Sets the burst to crit if the bullet did } if (damageMult >= 0.75f) Owner.SetScreenshake(3f * damageMult); @@ -377,9 +417,15 @@ namespace CalamityMod.Projectiles.Ranged targeted = target; trueLifetime = fadeLifetime; - modifiers.SourceDamage *= damageMult; + float finalDamageMult = MathF.Pow(originalDamageMult, bulletScalingDamagePow); + modifiers.SourceDamage *= (isMaxPower ? maxDamageMult : finalDamageMult * mainBulletDamageMult); } - public override bool? CanHitNPC(NPC target) => ((time > 1) ? null : false && Projectile.numHits == 0); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (hit.Crit) + crit = true; + } + public override bool? CanHitNPC(NPC target) => ((time > 1 && Projectile.numHits == 0) ? null : false); public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float hitboxSize = 20 * Projectile.scale * damageMult; diff --git a/Projectiles/Ranged/ElysianArrowProj.cs b/Projectiles/Ranged/ElysianArrowProj.cs index f76f5fdcbd..d5bfec6beb 100644 --- a/Projectiles/Ranged/ElysianArrowProj.cs +++ b/Projectiles/Ranged/ElysianArrowProj.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Ranged } } - Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnSpot, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.15f), 0f, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnSpot, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.20f), 0f, Projectile.owner, 0f, 0f); SoundStyle onKill = new("CalamityMod/Sounds/Custom/Providence/ProvidenceHolyBlastShoot"); SoundEngine.PlaySound(onKill with { Volume = 0.4f, Pitch = 0.4f }, Projectile.position); diff --git a/Projectiles/Ranged/ExoFire.cs b/Projectiles/Ranged/ExoFire.cs index 59fe2939aa..7310012ff8 100644 --- a/Projectiles/Ranged/ExoFire.cs +++ b/Projectiles/Ranged/ExoFire.cs @@ -2,6 +2,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Particles; +using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -71,10 +72,12 @@ namespace CalamityMod.Projectiles.Ranged // I hate metaballs >:( Particle beam3 = new CustomSpark(Projectile.Center, Projectile.velocity * Main.rand.NextFloat(0.5f, 4f), "CalamityMod/Particles/SmallBloom", false, 4, ((37 - Time * (PhotoTimer == 0 ? 0.165f : 0.088f)) - PhotoTimer * 0.2f + (PhotoTimer == 1 ? 20 : 0)) * 0.005f, sparkColor, new Vector2(1f, 1 + Time * 0.1f), true, false); GeneralParticleHandler.SpawnParticle(beam3); + beam3.DrawLayer = Enums.GeneralDrawLayer.BeforeProjectiles; if (!photosens) { Particle beam32 = new CustomSpark(Projectile.Center, Projectile.velocity * Main.rand.NextFloat(0.5f, 4f), "CalamityMod/Particles/SmallBloom", false, 4, ((37 - Time * (PhotoTimer == 0 ? 0.165f : 0.088f)) - PhotoTimer * 0.2f + (PhotoTimer == 1 ? 20 : 0)) * 0.003f, Color.Lerp(Color.Blue, sparkColor, 0.5f), new Vector2(1f, 1 + Time * 0.1f), true, false); GeneralParticleHandler.SpawnParticle(beam32); + beam32.DrawLayer = Enums.GeneralDrawLayer.BeforeProjectiles; } } if (Main.rand.NextBool(35) && targetDist < 1400f && Time > 5) diff --git a/Projectiles/Ranged/FossilShard.cs b/Projectiles/Ranged/FossilShard.cs index 03a853f3db..ddf2cd0cea 100644 --- a/Projectiles/Ranged/FossilShard.cs +++ b/Projectiles/Ranged/FossilShard.cs @@ -1,5 +1,8 @@ using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged @@ -7,6 +10,10 @@ namespace CalamityMod.Projectiles.Ranged public class FossilShard : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 5; + } public override void SetDefaults() { Projectile.width = 10; @@ -21,6 +28,9 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { + if (Projectile.timeLeft == 120) + Projectile.frame = Main.rand.Next(5); + if (Projectile.ai[1] != 1f) { if (Projectile.velocity.Y <= -2f) @@ -42,5 +52,13 @@ namespace CalamityMod.Projectiles.Ranged Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Sand, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = TextureAssets.Projectile[Type].Value; + Rectangle frame = tex.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, SpriteEffects.None); + return false; + } } } diff --git a/Projectiles/Ranged/FossilShard.png b/Projectiles/Ranged/FossilShard.png index 9af9080d48..cb51af8250 100644 Binary files a/Projectiles/Ranged/FossilShard.png and b/Projectiles/Ranged/FossilShard.png differ diff --git a/Projectiles/Ranged/HailstormBulletProj.cs b/Projectiles/Ranged/HailstormBulletProj.cs index 4800aa818b..2c3bd5ef6b 100644 --- a/Projectiles/Ranged/HailstormBulletProj.cs +++ b/Projectiles/Ranged/HailstormBulletProj.cs @@ -1,5 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Particles; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -71,14 +70,12 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { Player Owner = Main.player[Projectile.owner]; - target.AddBuff(BuffID.Frostburn2, 120); if (hit.Crit) { SoundStyle crit = new("CalamityMod/Sounds/NPCHit/CryogenPhaseTransitionCrack"); SoundEngine.PlaySound(crit with { Volume = 0.35f, Pitch = 1f }, Projectile.Center); - if (!target.boss) - target.AddBuff(BuffID.Frozen, 120); + target.AddBuff(BuffID.Frozen, 120); int points = 6; float radians = MathHelper.TwoPi / points; @@ -98,7 +95,8 @@ namespace CalamityMod.Projectiles.Ranged { // This is about equivalent to the previous direct strike extra damage but can't also crit itself obviously // Also it's not as impacted by defense, which is why it's a bit weaker, rather than being a full 1f - modifiers.CritDamage += 0.85f; + Player Owner = Main.player[Projectile.owner]; + modifiers.CritDamage += 0.65f + (Owner.GetTotalCritChance(DamageClass.Ranged) * 0.004f); // .4% crit damage per 1% crit chance if (Projectile.numHits > 0) Projectile.damage = (int)(Projectile.damage * 0.5f); @@ -108,7 +106,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - if (Projectile.localAI[0] > 15f) + if (Projectile.localAI[0] > 16f) CalamityUtils.DrawAfterimagesFromEdge(Projectile, 0, lightColor); return false; } diff --git a/Projectiles/Ranged/HalleysInfernoHoldout.cs b/Projectiles/Ranged/HalleysInfernoHoldout.cs index 9d09b629f1..c76f38e264 100644 --- a/Projectiles/Ranged/HalleysInfernoHoldout.cs +++ b/Projectiles/Ranged/HalleysInfernoHoldout.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Ranged { if (ShotTimer <= 0 && Owner.Calamity().AvaliableStarburst > 1) { - ShotTimer = 4; + ShotTimer = 3; var spawnpos = Projectile.Center; var dir = spawnpos.DirectionTo(Main.MouseWorld); var color = Main.rand.Next(1, 7); @@ -97,10 +97,10 @@ namespace CalamityMod.Projectiles.Ranged for (var i = 0; i < 5; i++) GeneralParticleHandler.SpawnParticle(new GlowSparkParticle(spawnpos + dir * 36, (dir * Halley.shootSpeed).RotatedByRandom(0.75f) * Main.rand.NextFloat(0.5f, 1.5f), false, 7, 0.02f, drawColor, new Vector2(0.5f, 1f))); if (Projectile.owner == Main.myPlayer) - Projectile.NewProjectile(Owner.GetSource_ItemUse_WithPotentialAmmo(Halley, AmmoID.Gel), spawnpos + dir * 16,dir * Halley.shootSpeed * HalleysInferno.StarburstVelMult, ModContent.ProjectileType(), (int)(Owner.GetDamage(DamageClass.Ranged).ApplyTo(Halley.damage) * HalleysInferno.StarburstDmgMult), Halley.knockBack, Projectile.owner, color); - Owner.Calamity().StratusStarburst -= 2; + Projectile.NewProjectile(Owner.GetSource_ItemUse_WithPotentialAmmo(Halley, AmmoID.Gel), spawnpos + dir * 8 + dir.RotatedByRandom(MathHelper.TwoPi)*4,dir * Halley.shootSpeed * HalleysInferno.StarburstVelMult, ModContent.ProjectileType(), (int)(Owner.GetDamage(DamageClass.Ranged).ApplyTo(Halley.damage) * HalleysInferno.StarburstDmgMult), Halley.knockBack, Projectile.owner, color); + Owner.Calamity().StratusStarburst -= 1; SoundEngine.PlaySound(HalleysInferno.ShootSound); - RecoilAmount = 4; + RecoilAmount = 16; } } RecoilAmount *= 0.75f; diff --git a/Projectiles/Ranged/HalleysStarburst.cs b/Projectiles/Ranged/HalleysStarburst.cs index 41e48151e3..afde077a30 100644 --- a/Projectiles/Ranged/HalleysStarburst.cs +++ b/Projectiles/Ranged/HalleysStarburst.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = 1; - Projectile.MaxUpdates = 6; + Projectile.MaxUpdates = 9; Projectile.timeLeft = 60 * Projectile.MaxUpdates; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; diff --git a/Projectiles/Ranged/HyperiusBulletProj.cs b/Projectiles/Ranged/HyperiusBulletProj.cs index 89e23accd5..8a236fd3ff 100644 --- a/Projectiles/Ranged/HyperiusBulletProj.cs +++ b/Projectiles/Ranged/HyperiusBulletProj.cs @@ -146,7 +146,8 @@ namespace CalamityMod.Projectiles.Ranged for (int b = 0; b < 2; b++) { Vector2 velocity = (Projectile.velocity.SafeNormalize(Vector2.UnitX) * 7 * (tileTouched ? -1 : 1)).RotatedByRandom(0.5f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity * 0.7f, ModContent.ProjectileType(), (int)Math.Max(Projectile.originalDamage * 0.05f, 1), 0, Projectile.owner, 0f, 0f, Main.rand.Next(0, 4 + 1)); + Projectile split = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, velocity * 0.7f, ModContent.ProjectileType(), (int)Math.Max(Projectile.originalDamage * 0.05f, 1), 0, Projectile.owner, 0f, 0f, Main.rand.Next(0, 4 + 1)); + split.DamageType = Projectile.DamageType; } } } diff --git a/Projectiles/Ranged/OmniGunHoldout.cs b/Projectiles/Ranged/OmniGunHoldout.cs index c836aabdbc..db17fe5d03 100644 --- a/Projectiles/Ranged/OmniGunHoldout.cs +++ b/Projectiles/Ranged/OmniGunHoldout.cs @@ -181,11 +181,11 @@ namespace CalamityMod.Projectiles.Ranged } for (int i = 0; i <= 13; i++) { - Dust dust = Dust.NewDustPerfect(GunTipPosition, 303, shootVelocity.RotatedByRandom(0.5f) * Main.rand.NextFloat(0.2f, 0.4f), 80, default, Main.rand.NextFloat(0.4f, 1.3f)); + Dust dust = Dust.NewDustPerfect(GunTipPosition, DustID.SteampunkSteam, shootVelocity.RotatedByRandom(0.5f) * Main.rand.NextFloat(0.2f, 0.4f), 80, default, Main.rand.NextFloat(0.4f, 1.3f)); dust.noGravity = false; dust.color = Color.White; - Dust dust2 = Dust.NewDustPerfect(GunTipPosition, 278, shootVelocity.RotatedByRandom(0.5f) * Main.rand.NextFloat(0.1f, 0.5f)); + Dust dust2 = Dust.NewDustPerfect(GunTipPosition, DustID.FireworksRGB, shootVelocity.RotatedByRandom(0.5f) * Main.rand.NextFloat(0.1f, 0.5f)); dust2.noGravity = true; dust2.scale = Main.rand.NextFloat(0.52f, 0.72f); dust2.color = Color.Lerp(Color.Orange, Color.Gold, Main.rand.NextFloat(0f, 1f)); diff --git a/Projectiles/Ranged/PristineSecondary.cs b/Projectiles/Ranged/PristineSecondary.cs index 9a9a0820d6..4f823e1c52 100644 --- a/Projectiles/Ranged/PristineSecondary.cs +++ b/Projectiles/Ranged/PristineSecondary.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Ranged public class PristineSecondary : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; - public override string Texture => "CalamityMod/Projectiles/Magic/RancorFog"; + public override string Texture => "CalamityMod/Particles/RancorFog"; public ref float ScaleFactor => ref Projectile.ai[0]; public float LightPower = 0; diff --git a/Projectiles/Ranged/SevensStrikerHoldout.cs b/Projectiles/Ranged/SevensStrikerHoldout.cs index deefc94393..54a3e4a9da 100644 --- a/Projectiles/Ranged/SevensStrikerHoldout.cs +++ b/Projectiles/Ranged/SevensStrikerHoldout.cs @@ -52,24 +52,17 @@ namespace CalamityMod.Projectiles.Ranged // Consumes a coin, stores it, then calculates what effect will be executed if (Projectile.ai[1] == 0) { - // These checks are here so that the weapon doesn't consume two coins when first used - if (shotonce) + // Ensure the method doesn't consumes ammo on first shot to avoid consuming two coins + if (player.PickAmmo(player.HeldItem, out shot, out scaleFactor, out weaponDamage, out weaponKnockback, out _, !shotonce)) { - if (player.PickAmmo(player.HeldItem, out shot, out scaleFactor, out weaponDamage, out weaponKnockback, out _)) - { - Projectile.ai[0] = shot; - Projectile.ai[1] = CalculateOutcome(); - } - else - { - Projectile.Kill(); - } + Projectile.ai[0] = shot; + Projectile.ai[1] = CalculateOutcome(); } else { - Projectile.ai[1] = CalculateOutcome(); - shotonce = true; + Projectile.Kill(); } + shotonce = true; } rolltimer--; diff --git a/Projectiles/Rogue/AntlionSkewerSandCloud.cs b/Projectiles/Rogue/AntlionSkewerSandCloud.cs index dae0dba88c..2e08edf867 100644 --- a/Projectiles/Rogue/AntlionSkewerSandCloud.cs +++ b/Projectiles/Rogue/AntlionSkewerSandCloud.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Projectiles.Rogue public class AntlionSkewerSandCloud : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; - public override string Texture => "CalamityMod/Projectiles/Magic/RancorFog"; + public override string Texture => "CalamityMod/Particles/RancorFog"; public ref float CloudHue => ref Projectile.ai[0]; public override void SetDefaults() diff --git a/Projectiles/Rogue/AshenStalactiteDebris.png b/Projectiles/Rogue/AshenStalactiteDebris.png index 8afd326680..8e092d8e18 100644 Binary files a/Projectiles/Rogue/AshenStalactiteDebris.png and b/Projectiles/Rogue/AshenStalactiteDebris.png differ diff --git a/Projectiles/Rogue/AshenStalagmiteProj.png b/Projectiles/Rogue/AshenStalagmiteProj.png index 4f22b80bf9..08e667c762 100644 Binary files a/Projectiles/Rogue/AshenStalagmiteProj.png and b/Projectiles/Rogue/AshenStalagmiteProj.png differ diff --git a/Projectiles/Rogue/CosmicScythe.cs b/Projectiles/Rogue/CosmicScythe.cs index c285d8f872..76d5abf7f7 100644 --- a/Projectiles/Rogue/CosmicScythe.cs +++ b/Projectiles/Rogue/CosmicScythe.cs @@ -12,8 +12,6 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Projectiles/Boss/SignusScythe"; - private int originalDamage; - public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; diff --git a/Projectiles/Rogue/DuststormInABottleHoldout.cs b/Projectiles/Rogue/DuststormInABottleHoldout.cs index 194a525056..cac45d647a 100644 --- a/Projectiles/Rogue/DuststormInABottleHoldout.cs +++ b/Projectiles/Rogue/DuststormInABottleHoldout.cs @@ -20,8 +20,6 @@ namespace CalamityMod.Projectiles.Rogue public override int StartupTime { get; set; } public override int CooldownTime { get; set; } - bool isChannelable = false; - int explodeTimer = 0; public override void Defaults() diff --git a/Projectiles/Rogue/DuststormInABottleProj.cs b/Projectiles/Rogue/DuststormInABottleProj.cs index 4b3f248cf1..c6ce288920 100644 --- a/Projectiles/Rogue/DuststormInABottleProj.cs +++ b/Projectiles/Rogue/DuststormInABottleProj.cs @@ -1,4 +1,5 @@ using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.GameContent; using Terraria.ID; @@ -8,7 +9,6 @@ namespace CalamityMod.Projectiles.Rogue public class DuststormInABottleProj : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; - public override string Texture => "CalamityMod/Items/Weapons/Rogue/DuststormInABottle"; int lifetime => AIState == 1 ? 300 : 150; public override void SetStaticDefaults() @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Rogue Timer++; gravTimer++; - Projectile.rotation += 0.175f * Projectile.direction * Projectile.velocity.Length(); + Projectile.rotation += 0.075f * Projectile.direction * Projectile.velocity.Length(); if (gravTimer > 20) { Projectile.velocity.Y += 0.22f; @@ -71,7 +71,9 @@ namespace CalamityMod.Projectiles.Rogue } public override bool PreDraw(ref Color lightColor) { - Main.EntitySpriteDraw(TextureAssets.Projectile[Type].Value, Projectile.Center - Main.screenPosition, null, lightColor, Projectile.rotation, TextureAssets.Projectile[Type].Size() * 0.5f, Projectile.scale, 0); + Vector2 origin = TextureAssets.Projectile[Type].Size() * new Vector2(Projectile.velocity.X < 0f ? 0.4f : 0.6f, 0.5f); + SpriteEffects sp = Projectile.velocity.X < 0f ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Main.EntitySpriteDraw(TextureAssets.Projectile[Type].Value, Projectile.Center - Main.screenPosition, null, lightColor, Projectile.rotation, origin, Projectile.scale, sp); return false; } diff --git a/Projectiles/Rogue/DuststormInABottleProj.png b/Projectiles/Rogue/DuststormInABottleProj.png new file mode 100644 index 0000000000..a6b547a294 Binary files /dev/null and b/Projectiles/Rogue/DuststormInABottleProj.png differ diff --git a/Projectiles/Rogue/FossilShardThrown.cs b/Projectiles/Rogue/FossilShardThrown.cs index 7ba53c3140..adfd05797a 100644 --- a/Projectiles/Rogue/FossilShardThrown.cs +++ b/Projectiles/Rogue/FossilShardThrown.cs @@ -1,7 +1,9 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue @@ -11,6 +13,10 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Projectiles/Ranged/FossilShard"; + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 5; + } public override void SetDefaults() { Projectile.width = 10; @@ -31,6 +37,7 @@ namespace CalamityMod.Projectiles.Rogue { Projectile.originalDamage = SpearofPaleolith.ShardBaseDamage; Projectile.ContinuouslyUpdateDamageStats = true; + Projectile.frame = Main.rand.Next(5); } Projectile.velocity.X *= 0.975f; @@ -59,5 +66,13 @@ namespace CalamityMod.Projectiles.Rogue { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Sand, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = TextureAssets.Projectile[Type].Value; + Rectangle frame = tex.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, SpriteEffects.None); + return false; + } } } diff --git a/Projectiles/Rogue/SlickCaneProjectile.cs b/Projectiles/Rogue/SlickCaneProjectile.cs deleted file mode 100644 index a9584f036a..0000000000 --- a/Projectiles/Rogue/SlickCaneProjectile.cs +++ /dev/null @@ -1,167 +0,0 @@ -using System; -using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.Projectiles.BaseProjectiles; -using CalamityMod.Systems.Collections; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.Localization; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Rogue -{ - public class SlickCaneProjectile : BaseSpearProjectile - { - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - public override string Texture => "CalamityMod/Items/Weapons/Rogue/SlickCane"; - - private bool initialized = false; - public override void SetDefaults() - { - Projectile.width = 40; - Projectile.height = 36; - Projectile.DamageType = RogueDamageClass.Instance; - Projectile.timeLeft = 120; - Projectile.friendly = true; - Projectile.hostile = false; - Projectile.tileCollide = false; - Projectile.ignoreWater = true; - Projectile.penetrate = -1; - Projectile.ownerHitCheck = true; - Projectile.hide = true; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; - Projectile.alpha = 180; - Projectile.scale = 1.25f; - } - public override SpearType SpearAiType => SpearType.GhastlyGlaiveSpear; - public override float TravelSpeed => 8f; - - public override bool PreAI() - { - // Initialization. Using the AI hook would override the base spear's code, and we don't want that. - if (!initialized) - { - Main.player[Projectile.owner].Calamity().ConsumeStealthByAttacking(); - initialized = true; - } - return true; - } - - public override bool PreDraw(ref Color lightColor) - { - Vector2 drawPosition = Projectile.position + new Vector2(Projectile.width, Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; - Texture2D alternateHookTexture = Projectile.spriteDirection == -1 ? ModContent.Request("CalamityMod/Projectiles/Rogue/SlickCaneProjectileAlt").Value : Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Vector2 origin = new Vector2(Projectile.spriteDirection == 1 ? alternateHookTexture.Width + 8f : -8f, -8f); - Main.EntitySpriteDraw(alternateHookTexture, drawPosition, null, - lightColor, Projectile.rotation, - origin, Projectile.scale, SpriteEffects.None, 0); - return false; - } - - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) - { - float spearLengthMult = 2.5f; - float velocityMagnitude = 0f; - if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), - Main.player[Projectile.owner].Center, Main.player[Projectile.owner].Center + Projectile.velocity * spearLengthMult, - (TravelSpeed + 1f) * Projectile.scale, ref velocityMagnitude)) - { - return true; - } - return false; - } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - Player player = Main.player[Projectile.owner]; - //Dont drop money from Dummies, WoF eyes and worm segments to make grinding money a bit harder and not give money from Dummies since that was apparently happening - if (Projectile.owner == Main.myPlayer && target.IsAnEnemy(false) && !target.dontCountMe && !CalamityNPCSets.ForceDrawDebuffDisplay[target.type]) - { - float moneyValueToDrop = target.value / Main.rand.NextFloat(15f, 35f); - // Maximum of 50 silver, not counting steath strikes - moneyValueToDrop = (int)MathHelper.Clamp(moneyValueToDrop, 0, 5000f); - if (Projectile.Calamity().stealthStrike && Main.rand.NextBool(20)) - { - moneyValueToDrop += Item.buyPrice(0, Main.rand.Next(1, 3), Main.rand.Next(0, 100), Main.rand.Next(0, 100)); - SoundEngine.PlaySound(TheSevensStriker.TriplesSound, Projectile.Center); - } - else if (moneyValueToDrop > 0f) - SoundEngine.PlaySound(TheSevensStriker.DoublesSound, Projectile.Center); - while (moneyValueToDrop > 10000f) - { - int modifiedMoneyValue = (int)(moneyValueToDrop / 10000f); - if (modifiedMoneyValue > 50 && Main.rand.NextBool(5)) - { - modifiedMoneyValue /= Main.rand.Next(3) + 1; - } - if (Main.rand.NextBool(5)) - { - modifiedMoneyValue /= Main.rand.Next(3) + 1; - } - moneyValueToDrop -= 10000 * modifiedMoneyValue; - Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.GoldCoin, modifiedMoneyValue); - } - while (moneyValueToDrop > 100f) - { - int modifiedMoneyValue = (int)(moneyValueToDrop / 100f); - if (modifiedMoneyValue > 50 && Main.rand.NextBool(5)) - { - modifiedMoneyValue /= Main.rand.Next(3) + 1; - } - if (Main.rand.NextBool(5)) - { - modifiedMoneyValue /= Main.rand.Next(3) + 1; - } - moneyValueToDrop -= 100 * modifiedMoneyValue; - Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.SilverCoin, modifiedMoneyValue); - } - while (moneyValueToDrop > 0f) - { - int modifiedMoneyValue = (int)moneyValueToDrop; - if (modifiedMoneyValue > 50 && Main.rand.NextBool(5)) - { - modifiedMoneyValue /= Main.rand.Next(3) + 1; - } - if (Main.rand.NextBool(5)) - { - modifiedMoneyValue /= Main.rand.Next(4) + 1; - } - if (modifiedMoneyValue < 1) - { - modifiedMoneyValue = 1; - } - moneyValueToDrop -= modifiedMoneyValue; - Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.CopperCoin, modifiedMoneyValue); - } - } - } - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - // Boost dmg in proportion to money, caps at 1 plat. - if (Projectile.Calamity().stealthStrike) - { - Player player = Main.player[Projectile.owner]; - double money = Utils.CoinsCount(out bool overflow, player.inventory); - double cap = 1000000; - if (money >= cap) - money = cap; - if (money != 0) - { - modifiers.SourceDamage *= (float)(money / 1000000 + 1); - SoundEngine.PlaySound(TheSevensStriker.JackpotSound, Projectile.Center); - for (int j = 0; j < 8; j++) - { - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.GoldCoin, 0f, 0f, 100, default, 3f); - Main.dust[dust2].noGravity = true; - Main.dust[dust2].velocity *= 5f; - dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.GoldCoin, 0f, 0f, 100, default, 2f); - Main.dust[dust2].velocity *= 2f; - } - } - } - } - } -} diff --git a/Projectiles/Rogue/SlickCaneProjectileAlt.png b/Projectiles/Rogue/SlickCaneProjectileAlt.png deleted file mode 100644 index 1453d66510..0000000000 Binary files a/Projectiles/Rogue/SlickCaneProjectileAlt.png and /dev/null differ diff --git a/Projectiles/Rogue/WalkingCaneProjectile.cs b/Projectiles/Rogue/WalkingCaneProjectile.cs new file mode 100644 index 0000000000..833f863e5e --- /dev/null +++ b/Projectiles/Rogue/WalkingCaneProjectile.cs @@ -0,0 +1,94 @@ +using System; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Systems.Collections; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class WalkingCaneProjectile : BaseSpearProjectile + { + public override LocalizedText DisplayName => CalamityUtils.GetItemName(); + public static Asset AltTexture; + + private bool initialized = false; + + public override void SetStaticDefaults() + { + if (!Main.dedServ) + AltTexture = ModContent.Request("CalamityMod/Projectiles/Rogue/WalkingCaneProjectileAlt"); + } + public override void SetDefaults() + { + Projectile.width = 80; + Projectile.height = 80; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.timeLeft = 120; + Projectile.friendly = true; + Projectile.hostile = false; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.penetrate = -1; + Projectile.ownerHitCheck = true; + Projectile.hide = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + Projectile.alpha = 180; + Projectile.scale = 1.25f; + } + public override SpearType SpearAiType => SpearType.GhastlyGlaiveSpear; + public override float TravelSpeed => 35f; + + public override bool PreAI() + { + // Initialization. Using the AI hook would override the base spear's code, and we don't want that. + if (!initialized) + { + Main.player[Projectile.owner].Calamity().ConsumeStealthByAttacking(); + initialized = true; + } + return true; + } + + public override bool PreDraw(ref Color lightColor) + { + Vector2 drawPosition = Projectile.position + new Vector2(Projectile.width, Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; + Texture2D alternateHookTexture = Projectile.spriteDirection == -1 ? AltTexture.Value : Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Vector2 origin = new Vector2(Projectile.spriteDirection == 1 ? alternateHookTexture.Width + 8f : -8f, -8f); + + Main.EntitySpriteDraw(alternateHookTexture, drawPosition, null, lightColor, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + return false; + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + float spearLengthMult = 3.2f; + float velocityMagnitude = 0f; + // For whatever fucking reason CheckAABBvLineCollision fails when you're completely inside a hitbox, so check for that too + return targetHitbox.Contains(Main.LocalPlayer.Center.ToPoint()) || Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), + Main.player[Projectile.owner].Center, Main.player[Projectile.owner].Center + Projectile.velocity * spearLengthMult, (TravelSpeed + 1f) * Projectile.scale, ref velocityMagnitude); + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (Projectile.Calamity().stealthStrike) + { + target.Calamity().caneInsanityTimer = 600; + } + else if (target.Calamity().caneInsanityTimer > 0) + { + Vector2 position = target.Center + Main.rand.NextVector2CircularEdge(100f, 100f); + Vector2 velocity = (target.Center - position).SafeNormalize(Vector2.Zero) * 6f; + // Friendly shadow hands normally have four different behaviors, but Walking Cane only spawns shadow hands that immediately lunge + Projectile.NewProjectile(Projectile.GetSource_FromThis(), position, velocity, ProjectileID.InsanityShadowFriendly, (int)(Projectile.damage * 0.75f), Projectile.knockBack, Projectile.owner); + } + } + } +} diff --git a/Projectiles/Rogue/WalkingCaneProjectile.png b/Projectiles/Rogue/WalkingCaneProjectile.png new file mode 100644 index 0000000000..da54397462 Binary files /dev/null and b/Projectiles/Rogue/WalkingCaneProjectile.png differ diff --git a/Projectiles/Rogue/WalkingCaneProjectileAlt.png b/Projectiles/Rogue/WalkingCaneProjectileAlt.png new file mode 100644 index 0000000000..fe31c83a51 Binary files /dev/null and b/Projectiles/Rogue/WalkingCaneProjectileAlt.png differ diff --git a/Projectiles/Rogue/WrathwingCinder.cs b/Projectiles/Rogue/WrathwingCinder.cs index ab70362863..844aa62b7c 100644 --- a/Projectiles/Rogue/WrathwingCinder.cs +++ b/Projectiles/Rogue/WrathwingCinder.cs @@ -78,15 +78,6 @@ namespace CalamityMod.Projectiles.Rogue Projectile.velocity.X *= 0.995f; Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; - // commented out sound because it was way too loud - /* - if (projectile.localAI[0] == 0f) - { - projectile.localAI[0] = 1f; - Main.PlayTrackedSound(SoundID.DD2_BetsyFireballShot, projectile.Center); - } - */ - if (Projectile.ai[0] >= 2f) { Projectile.alpha -= 25; diff --git a/Projectiles/Summon/AmphibiansGuitarMinion.cs b/Projectiles/Summon/AmphibiansGuitarMinion.cs index 5f026779bb..48ea3829a3 100644 --- a/Projectiles/Summon/AmphibiansGuitarMinion.cs +++ b/Projectiles/Summon/AmphibiansGuitarMinion.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Summon } float oscillation = MathHelper.Clamp(Math.Abs((float)Math.Sin(Time * 5f / MathHelper.Pi)), 0f, 1f); - Vector2 intendedPosition = RotationPosition - Vector2.UnitY.RotatedBy(IntendedRotationAngle) * (Target == null ? 100f : (Target.Size.Length() / 2f) + (600f - 350f * oscillation)); + Vector2 intendedPosition = RotationPosition - Vector2.UnitY.RotatedBy(IntendedRotationAngle) * (Target == null ? 100f : (Target.Size.Length() / 2f) + (250f - 150f * oscillation)); Projectile.Center = Vector2.Lerp(Projectile.Center, intendedPosition, Utils.Remap(Projectile.DistanceSQ(intendedPosition), 6400f, 0f, 0.1f, 0.3f)); Projectile.rotation = IntendedRotationAngle; @@ -145,7 +145,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture = TextureAssets.Projectile[Type].Value; Rectangle frame = texture.Frame(horizontalFrames: 8, frameX: GuitarSprite); - Projectile.DrawProjectileWithBackglow(_effectsColor with { A = 0 }, lightColor, Target == null ? 0 : 8, texture, frame); + Projectile.DrawProjectileWithBackglow(_effectsColor with { A = 0 }, lightColor, Target == null ? 0 : 3, texture, frame); Main.EntitySpriteDraw( texture, diff --git a/Projectiles/Summon/AmphibiansGuitarProjectile.cs b/Projectiles/Summon/AmphibiansGuitarProjectile.cs index bde7e8a8b4..618e13537b 100644 --- a/Projectiles/Summon/AmphibiansGuitarProjectile.cs +++ b/Projectiles/Summon/AmphibiansGuitarProjectile.cs @@ -78,11 +78,6 @@ namespace CalamityMod.Projectiles.Summon dust.color = noteColor; dust.noLightEmittence = true; } - if (Projectile.ai[2] == 5 && time % 2 == 0) - { - Particle spark = new GlowSparkParticle(Projectile.Center + Projectile.velocity * Main.rand.NextFloat(-2, -1), -Projectile.velocity * 0.3f, false, 8, 0.065f, noteColor * 0.75f, new Vector2(1, 0.3f), true, false, 1f); - GeneralParticleHandler.SpawnParticle(spark); - } time++; } @@ -115,7 +110,7 @@ namespace CalamityMod.Projectiles.Summon if (IsHatNote) { for (int i = 0; i < 3; i++) - Main.EntitySpriteDraw(tex2.Value, generalDrawPos, null, noteColor with { A = 0 }, Main.GlobalTimeWrappedHourly * 7.3f + i * 2, tex2.Size() * 0.5f, Projectile.scale * (0.7f + i * 0.7f) * 0.9f, SpriteEffects.None); + Main.EntitySpriteDraw(tex2.Value, generalDrawPos, null, (noteColor * 0.5f) with { A = 0 }, Main.GlobalTimeWrappedHourly * 7.3f + i * 2, tex2.Size() * 0.5f, Projectile.scale * (0.6f + i * 0.6f), SpriteEffects.None); } return false; } diff --git a/Projectiles/Summon/AquaticStarMinion.cs b/Projectiles/Summon/AquaticStarMinion.cs index 8267a409ae..e07ceebd84 100644 --- a/Projectiles/Summon/AquaticStarMinion.cs +++ b/Projectiles/Summon/AquaticStarMinion.cs @@ -68,17 +68,10 @@ namespace CalamityMod.Projectiles.Summon Projectile.rotation += Projectile.velocity.X * 0.04f; // Make the minion spin depending on how fast it is. - Projectile.ChargingMinionAI(1200f, 1500f, 2200f, 150f, 0, 24f, 15f, 4f, new Vector2(0f, -60f), 12f, 12f, false, false, 1); + Projectile.ChargingMinionAI(1200f, 1500f, 2200f, 150f, 0, 24f, 15f, 4f, new Vector2(0f, -60f), 18f, 12f, true, true, 1); } public override bool MinionContactDamage() => true; - - public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) - { - fallThrough = true; // Should always be able to fly through platforms - return base.TileCollideStyle(ref width, ref height, ref fallThrough, ref hitboxCenterFrac); - } - public override bool OnTileCollide(Vector2 oldVelocity) => false; } } diff --git a/Projectiles/Summon/AstrageldonLaser.cs b/Projectiles/Summon/AstrageldonLaser.cs index 6b5f11be8b..c21edfed24 100644 --- a/Projectiles/Summon/AstrageldonLaser.cs +++ b/Projectiles/Summon/AstrageldonLaser.cs @@ -23,11 +23,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.alpha = 255; - Projectile.penetrate = -1; - Projectile.timeLeft = 600; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -2; - Projectile.extraUpdates = 1; + Projectile.MaxUpdates = 4; + Projectile.timeLeft = 180 * Projectile.MaxUpdates; Projectile.DamageType = DamageClass.Summon; } diff --git a/Projectiles/Summon/AstrageldonSummon.cs b/Projectiles/Summon/AstrageldonSummon.cs index c5a3c69c48..17e6e8a048 100644 --- a/Projectiles/Summon/AstrageldonSummon.cs +++ b/Projectiles/Summon/AstrageldonSummon.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Summon CalamityGlobalProjectile modProj = Projectile.Calamity(); //hitbox size scaling - float scale = (float)Math.Log(Projectile.minionSlots, 10f) + 1f; + float scale = 0.8f + Projectile.minionSlots * 0.2f; if (Projectile.scale != scale) Projectile.scale = scale; Projectile.width = (int)(64f * Projectile.scale); @@ -190,7 +190,7 @@ namespace CalamityMod.Projectiles.Summon { attackCounter += Main.rand.Next(1, 4); } - if (attackCounter > 300) + if (attackCounter > 240) { attackCounter = 0; Projectile.netUpdate = true; @@ -202,9 +202,24 @@ namespace CalamityMod.Projectiles.Summon attackCounter += 2; if (Main.myPlayer == Projectile.owner) { - Vector2 laserVel = Projectile.SafeDirectionTo(objectivepos) * laserSpeed; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, laserVel, projType, Projectile.damage, 0f, Projectile.owner); - Projectile.netUpdate = true; + if (Main.rand.NextBool()) + { + for (int i = 0; i < 8; i++) + { + Vector2 circleVel = ((MathHelper.TwoPi * i / 8f) - MathHelper.ToRadians(67.5f)).ToRotationVector2() * laserSpeed; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, circleVel, projType, Projectile.damage, 0f, Projectile.owner); + } + } + else + { + for (int i = 0; i < 5; i++) + { + Vector2 direction = Projectile.SafeDirectionTo(objectivepos); + Vector2 spreadPos = Projectile.Center + direction * Main.rand.NextFloat(1f, 4f) + direction.RotatedBy(MathHelper.PiOver2) * Main.rand.NextFloat(-16f, 16f); + Vector2 laserVel = direction * laserSpeed; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spreadPos, laserVel, projType, Projectile.damage, 0f, Projectile.owner); + } + } } } } diff --git a/Projectiles/Summon/BlackHawkBullet.cs b/Projectiles/Summon/BlackHawkBullet.cs index 7d43617505..fc4e98f5c0 100644 --- a/Projectiles/Summon/BlackHawkBullet.cs +++ b/Projectiles/Summon/BlackHawkBullet.cs @@ -14,16 +14,19 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { - Projectile.width = Projectile.height = 4; + Projectile.width = Projectile.height = 6; Projectile.light = 0.5f; Projectile.alpha = 0; - Projectile.extraUpdates = 4; Projectile.scale = 1.18f; Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.aiStyle = ProjAIStyleID.Arrow; - Projectile.timeLeft = 600; Projectile.tileCollide = false; + Projectile.MaxUpdates = 6; + Projectile.penetrate = 5; + Projectile.timeLeft = 60 * Projectile.MaxUpdates; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; AIType = ProjectileID.BulletHighVelocity; Projectile.DamageType = DamageClass.Summon; } diff --git a/Projectiles/Summon/BlackHawkSummon.cs b/Projectiles/Summon/BlackHawkSummon.cs index ccddc0d234..66d9de7a51 100644 --- a/Projectiles/Summon/BlackHawkSummon.cs +++ b/Projectiles/Summon/BlackHawkSummon.cs @@ -255,7 +255,7 @@ namespace CalamityMod.Projectiles.Summon //Increment attack cooldown if (Projectile.ai[1] > 0f) { - Projectile.ai[1]++; + Projectile.ai[1] += Main.rand.NextFloat(0.5f, 2f); } //Set the minion to be ready for attack if (Projectile.ai[1] > 60f) diff --git a/Projectiles/Summon/CorroslimeMinion.png b/Projectiles/Summon/BlightedSlimeCorro.png similarity index 100% rename from Projectiles/Summon/CorroslimeMinion.png rename to Projectiles/Summon/BlightedSlimeCorro.png diff --git a/Projectiles/Summon/CrimslimeMinion.png b/Projectiles/Summon/BlightedSlimeCrim.png similarity index 100% rename from Projectiles/Summon/CrimslimeMinion.png rename to Projectiles/Summon/BlightedSlimeCrim.png diff --git a/Projectiles/Summon/CrimslimeMinion.cs b/Projectiles/Summon/BlightedSlimeMinion.cs similarity index 69% rename from Projectiles/Summon/CrimslimeMinion.cs rename to Projectiles/Summon/BlightedSlimeMinion.cs index 934db01829..5871046865 100644 --- a/Projectiles/Summon/CrimslimeMinion.cs +++ b/Projectiles/Summon/BlightedSlimeMinion.cs @@ -2,23 +2,34 @@ using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class CrimslimeMinion : ModProjectile, ILocalizedModType + public class BlightedSlimeMinion : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public float dust = 0f; + public static Asset Corroslime; + public static Asset Crimslime; + public override void SetStaticDefaults() { Main.projFrames[Type] = 6; Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; + + if (!Main.dedServ) + { + Corroslime = ModContent.Request("CalamityMod/Projectiles/Summon/BlightedSlimeCorro"); + Crimslime = ModContent.Request("CalamityMod/Projectiles/Summon/BlightedSlimeCrim"); + } } public override void SetDefaults() @@ -34,47 +45,41 @@ namespace CalamityMod.Projectiles.Summon Projectile.penetrate = -1; Projectile.timeLeft *= 5; Projectile.minion = true; + AIType = ProjectileID.BabySlime; Projectile.tileCollide = false; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 23; - AIType = ProjectileID.BabySlime; + Projectile.localNPCHitCooldown = 30; Projectile.DamageType = DamageClass.Summon; } - public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) - { - fallThrough = false; - return true; - } - public override void AI() { Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); if (dust == 0f) { - int constant = 16; - for (int i = 0; i < constant; i++) + int dustAmt = 16; + for (int i = 0; i < dustAmt; i++) { - Vector2 rotate = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.75f; - rotate = rotate.RotatedBy((double)((float)(i - (constant / 2 - 1)) * 6.28318548f / (float)constant), default) + Projectile.Center; + Vector2 rotate = Vector2.Normalize(Projectile.velocity) * new Vector2(Projectile.width / 2f, Projectile.height) * 0.75f; + rotate = rotate.RotatedBy((i - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt) + Projectile.Center; Vector2 faceDirection = rotate - Projectile.Center; - int dust = Dust.NewDust(rotate + faceDirection, 0, 0, DustID.Blood, faceDirection.X * 1f, faceDirection.Y * 1f, 100, default, 1.1f); + int dust = Dust.NewDust(rotate + faceDirection, 0, 0, WorldGen.crimson ? DustID.Blood : DustID.Demonite, faceDirection.X, faceDirection.Y, 100, default, 1.1f); Main.dust[dust].noGravity = true; Main.dust[dust].noLight = true; Main.dust[dust].velocity = faceDirection; } dust += 1f; } - bool isMinion = Projectile.type == ModContent.ProjectileType(); - player.AddBuff(ModContent.BuffType(), 3600); + bool isMinion = Projectile.type == ModContent.ProjectileType(); + player.AddBuff(ModContent.BuffType(), 3600); if (isMinion) { if (player.dead) { - modPlayer.cSlime2 = false; + modPlayer.blightedSlime = false; } - if (modPlayer.cSlime2) + if (modPlayer.blightedSlime) { Projectile.timeLeft = 2; } @@ -85,7 +90,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Texture2D texture2D13 = (WorldGen.crimson ? Crimslime : Corroslime).Value; int framing = texture2D13.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Summon/BoneMatter.cs b/Projectiles/Summon/BoneMatter.cs deleted file mode 100644 index 5b86428a3d..0000000000 --- a/Projectiles/Summon/BoneMatter.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Summon -{ - public class BoneMatter : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 6; - ProjectileID.Sets.MinionShot[Type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 26; - Projectile.height = 32; - Projectile.friendly = true; - Projectile.tileCollide = true; - Projectile.DamageType = DamageClass.Summon; - } - - public override void AI() - { - if (Projectile.frameCounter++ % 9 == 8) - { - Projectile.frame++; - if (Projectile.frame >= Main.projFrames[Type]) - Projectile.Kill(); - } - } - } -} diff --git a/Projectiles/Summon/BoneMatter.png b/Projectiles/Summon/BoneMatter.png deleted file mode 100644 index 2f28b1ab30..0000000000 Binary files a/Projectiles/Summon/BoneMatter.png and /dev/null differ diff --git a/Projectiles/Summon/BoneMatter2.cs b/Projectiles/Summon/BoneMatter2.cs deleted file mode 100644 index f13ef7e259..0000000000 --- a/Projectiles/Summon/BoneMatter2.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Summon -{ - public class BoneMatter2 : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 6; - ProjectileID.Sets.MinionShot[Type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 26; - Projectile.height = 28; - Projectile.friendly = true; - Projectile.tileCollide = true; - Projectile.DamageType = DamageClass.Summon; - } - - public override void AI() - { - Projectile.frameCounter++; - if (Projectile.frameCounter % 9 == 8) - { - Projectile.frame++; - if (Projectile.frame >= Main.projFrames[Type]) - Projectile.Kill(); - } - } - } -} diff --git a/Projectiles/Summon/BoneMatter2.png b/Projectiles/Summon/BoneMatter2.png deleted file mode 100644 index 277aedabfd..0000000000 Binary files a/Projectiles/Summon/BoneMatter2.png and /dev/null differ diff --git a/Projectiles/Summon/BrimstoneElementalMinion.cs b/Projectiles/Summon/BrimstoneElementalMinion.cs index 81f4e960a3..b906f1c827 100644 --- a/Projectiles/Summon/BrimstoneElementalMinion.cs +++ b/Projectiles/Summon/BrimstoneElementalMinion.cs @@ -2,7 +2,10 @@ using CalamityMod.CalPlayer; using CalamityMod.Dusts; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -43,7 +46,7 @@ namespace CalamityMod.Projectiles.Summon bool isActive = Projectile.type == ModContent.ProjectileType(); Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.brimElemental && !modPlayer.allElementals && !modPlayer.brimElementalVanity && !modPlayer.allElementalsVanity) + if (modPlayer.brimElemental is null && modPlayer.allElementals is null && !modPlayer.brimElementalVanity && !modPlayer.allElementalsVanity) { Projectile.active = false; return; @@ -219,5 +222,29 @@ namespace CalamityMod.Projectiles.Summon return null; } } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = TextureAssets.Projectile[Type].Value; + Rectangle frame = tex.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + SpriteEffects sp = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + var cplayer = Main.player[Projectile.owner].Calamity(); + + if ((cplayer.brimElemental.HasValue && !cplayer.brimElemental.Value) || (cplayer.allElementals.HasValue && !cplayer.allElementals.Value)) + { + Vector3 hsl = Main.rgbToHsl(Color.Red); + CalamityUtils.EnterShaderRegion(Main.spriteBatch); + GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(1f); + GameShaders.Misc["CalamityMod:BasicTint"].UseSaturation(0.25f); + GameShaders.Misc["CalamityMod:BasicTint"].UseColor(Main.hslToRgb(1 - hsl.X, hsl.Y, hsl.Z)); + GameShaders.Misc["CalamityMod:BasicTint"].Apply(); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, sp); + CalamityUtils.ExitShaderRegion(Main.spriteBatch); + } + else + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, sp); + + return false; + } } } diff --git a/Projectiles/Summon/BrimstoneLaserSummon.cs b/Projectiles/Summon/BrimstoneLaserSummon.cs index 69c063bd29..151eafd682 100644 --- a/Projectiles/Summon/BrimstoneLaserSummon.cs +++ b/Projectiles/Summon/BrimstoneLaserSummon.cs @@ -1,5 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; -using Microsoft.Xna.Framework; +using CalamityMod.Graphics.Metaballs; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -8,6 +8,7 @@ namespace CalamityMod.Projectiles.Summon public class BrimstoneLaserSummon : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public override void SetStaticDefaults() { @@ -17,8 +18,6 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { Projectile.width = Projectile.height = 10; - Projectile.aiStyle = ProjAIStyleID.Arrow; - AIType = ProjectileID.CursedBullet; Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.alpha = 120; @@ -29,13 +28,23 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { - Lighting.AddLight(Projectile.Center, Projectile.Opacity * 0.5f, Projectile.Opacity * 0.05f, Projectile.Opacity * 0.05f); - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + CalamityUtils.HomeInOnNPC(Projectile, false, 300, 5.5f, 10f, true); + + if (Projectile.Calamity().HomingTarget < 0) + { + Projectile.velocity.Y += 0.025f; + } + + CalamitasMetaball.SpawnParticle(Projectile.Center + Projectile.velocity, Main.rand.NextVector2Circular(2, 2), 16f); + + if (Projectile.velocity.Y > 16f) + { + Projectile.velocity.Y = 16f; + } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 300); - public override Color? GetAlpha(Color lightColor) => new Color(250, 50, 50, Projectile.alpha); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 300); } } diff --git a/Projectiles/Summon/BrimstoneLaserSummon.png b/Projectiles/Summon/BrimstoneLaserSummon.png deleted file mode 100644 index 9b0d2a4f50..0000000000 Binary files a/Projectiles/Summon/BrimstoneLaserSummon.png and /dev/null differ diff --git a/Projectiles/Summon/CausticStaffProjectile.cs b/Projectiles/Summon/CausticStaffProjectile.cs index 2b6874179d..c2dfc942ed 100644 --- a/Projectiles/Summon/CausticStaffProjectile.cs +++ b/Projectiles/Summon/CausticStaffProjectile.cs @@ -48,27 +48,23 @@ namespace CalamityMod.Projectiles.Summon public static int GetDust(float type) { - if (type >= 4f && Main.rand.NextBool(5)) + if (type >= 3f && Main.rand.NextBool(5)) return DustID.IchorTorch; - if (type >= 3f && Main.rand.NextBool(4)) - return DustID.VenomStaff; - if (type >= 2f && Main.rand.NextBool(3)) + if (type >= 2f && Main.rand.NextBool(5)) return DustID.CursedTorch; - return DustID.Torch; + return Main.rand.NextBool(4) ? DustID.VenomStaff : DustID.Torch; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(BuffID.OnFire3, 30); + target.AddBuff(BuffID.OnFire3, 300); + target.AddBuff(BuffID.Venom, 300); if (MinionCount >= 2f) - target.AddBuff(BuffID.CursedInferno, 30); + target.AddBuff(BuffID.CursedInferno, 300); if (MinionCount >= 3f) - target.AddBuff(BuffID.Venom, 30); + target.AddBuff(BuffID.Ichor, 300); if (MinionCount >= 4f) - { - target.AddBuff(BuffID.Ichor, 30); - target.AddBuff(ModContent.BuffType(), 30); - } + target.AddBuff(ModContent.BuffType(), 300); } } } diff --git a/Projectiles/Summon/CausticStaffSummon.cs b/Projectiles/Summon/CausticStaffSummon.cs index 300d9a1f3c..3bb152d00c 100644 --- a/Projectiles/Summon/CausticStaffSummon.cs +++ b/Projectiles/Summon/CausticStaffSummon.cs @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Summon homeInVector.Normalize(); if (targetDist > 200f) { - float velocity = 6f; + float velocity = 10f; Projectile.velocity = (Projectile.velocity * 40f + homeInVector * velocity) / 41f; } else diff --git a/Projectiles/Summon/CloudElementalMinion.cs b/Projectiles/Summon/CloudElementalMinion.cs index 4346b826ea..0b2b9ef16c 100644 --- a/Projectiles/Summon/CloudElementalMinion.cs +++ b/Projectiles/Summon/CloudElementalMinion.cs @@ -2,7 +2,10 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -42,7 +45,7 @@ namespace CalamityMod.Projectiles.Summon { Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.cloudElemental && !modPlayer.allElementals && !modPlayer.cloudElementalVanity && !modPlayer.allElementalsVanity) + if (!modPlayer.cloudElemental.HasValue && modPlayer.allElementals is null && !modPlayer.cloudElementalVanity && !modPlayer.allElementalsVanity) { Projectile.active = false; return; @@ -166,5 +169,28 @@ namespace CalamityMod.Projectiles.Summon return null; } } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = TextureAssets.Projectile[Type].Value; + Rectangle frame = tex.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + SpriteEffects sp = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + var cplayer = Main.player[Projectile.owner].Calamity(); + + if ((cplayer.cloudElemental.HasValue && !cplayer.cloudElemental.Value) || (cplayer.allElementals.HasValue && !cplayer.allElementals.Value)) + { + CalamityUtils.EnterShaderRegion(Main.spriteBatch); + GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(1f); + GameShaders.Misc["CalamityMod:BasicTint"].UseSaturation(0.25f); + GameShaders.Misc["CalamityMod:BasicTint"].UseColor(Color.White); + GameShaders.Misc["CalamityMod:BasicTint"].Apply(); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, sp); + CalamityUtils.ExitShaderRegion(Main.spriteBatch); + } + else + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, sp); + + return false; + } } } diff --git a/Projectiles/Summon/CnidarianJellyfishOnTheString.cs b/Projectiles/Summon/CnidarianJellyfishOnTheString.cs index 14adef8764..4556370957 100644 --- a/Projectiles/Summon/CnidarianJellyfishOnTheString.cs +++ b/Projectiles/Summon/CnidarianJellyfishOnTheString.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Summon public const float SegmentDistance = 20; public static int FadeoutTime = 20; public static int ElectrifyTimer = 180; - public static float ZapDamageMultiplier = 0.5f; + public static float ZapDamageMultiplier = 1f; //Sounds public static readonly SoundStyle ZapSound = SoundID.Item94 with { Volume = SoundID.Item94.Volume * 0.5f }; diff --git a/Projectiles/Summon/CorroslimeMinion.cs b/Projectiles/Summon/CorroslimeMinion.cs deleted file mode 100644 index 9fd7296ef8..0000000000 --- a/Projectiles/Summon/CorroslimeMinion.cs +++ /dev/null @@ -1,97 +0,0 @@ -using CalamityMod.Buffs.Summon; -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Summon -{ - public class CorroslimeMinion : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - public float dust = 0f; - - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 6; - Main.projPet[Type] = true; - ProjectileID.Sets.MinionSacrificable[Type] = true; - ProjectileID.Sets.MinionTargettingFeature[Type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 26; - Projectile.height = 26; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.minionSlots = 1; - Projectile.alpha = 75; - Projectile.aiStyle = ProjAIStyleID.Pet; - Projectile.timeLeft = 18000; - Projectile.penetrate = -1; - Projectile.timeLeft *= 5; - Projectile.minion = true; - AIType = ProjectileID.BabySlime; - Projectile.tileCollide = false; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 23; - Projectile.DamageType = DamageClass.Summon; - } - - public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) - { - fallThrough = false; - return true; - } - - public override void AI() - { - Player player = Main.player[Projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - if (dust == 0f) - { - int constant = 16; - for (int i = 0; i < constant; i++) - { - Vector2 rotate = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.75f; - rotate = rotate.RotatedBy((double)((float)(i - (constant / 2 - 1)) * 6.28318548f / (float)constant), default) + Projectile.Center; - Vector2 faceDirection = rotate - Projectile.Center; - int dust = Dust.NewDust(rotate + faceDirection, 0, 0, DustID.Demonite, faceDirection.X * 1f, faceDirection.Y * 1f, 100, default, 1.1f); - Main.dust[dust].noGravity = true; - Main.dust[dust].noLight = true; - Main.dust[dust].velocity = faceDirection; - } - dust += 1f; - } - bool isMinion = Projectile.type == ModContent.ProjectileType(); - player.AddBuff(ModContent.BuffType(), 3600); - if (isMinion) - { - if (player.dead) - { - modPlayer.cSlime = false; - } - if (modPlayer.cSlime) - { - Projectile.timeLeft = 2; - } - } - } - - public override bool MinionContactDamage() => true; - - public override bool PreDraw(ref Color lightColor) - { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; - int y6 = framing * Projectile.frame; - Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); - return false; - } - - public override bool OnTileCollide(Vector2 oldVelocity) => false; - } -} diff --git a/Projectiles/Summon/CorruptionSlimeGodMinion.png b/Projectiles/Summon/CorruptionSlimeGodMinion.png deleted file mode 100644 index 70d4fe5869..0000000000 Binary files a/Projectiles/Summon/CorruptionSlimeGodMinion.png and /dev/null differ diff --git a/Projectiles/Summon/CosmilampMinion.cs b/Projectiles/Summon/CosmilampMinion.cs index 1d7269474d..8bf43bdb38 100644 --- a/Projectiles/Summon/CosmilampMinion.cs +++ b/Projectiles/Summon/CosmilampMinion.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.friendly = true; Projectile.ignoreWater = false; Projectile.tileCollide = false; - Projectile.minionSlots = Cosmilamp.LanternSummonCost; + Projectile.minionSlots = 1f; Projectile.timeLeft = 90000; Projectile.penetrate = -1; Projectile.minion = true; diff --git a/Projectiles/Summon/CrimsonSlimeGodMinion.cs b/Projectiles/Summon/CrimsonSlimeGodMinion.cs deleted file mode 100644 index 3199f82bbc..0000000000 --- a/Projectiles/Summon/CrimsonSlimeGodMinion.cs +++ /dev/null @@ -1,99 +0,0 @@ -using CalamityMod.Buffs.Summon; -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.GameContent; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Summon -{ - public class CrimsonSlimeGodMinion : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - public override string Texture => "CalamityMod/Projectiles/Summon/CrimslimeMinion"; - public float dust = 0f; - - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 6; - ProjectileID.Sets.MinionSacrificable[Type] = true; - ProjectileID.Sets.MinionTargettingFeature[Type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 26; - Projectile.height = 26; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.minionSlots = 0f; - Projectile.alpha = 75; - Projectile.aiStyle = ProjAIStyleID.Pet; - Projectile.timeLeft = 18000; - Projectile.penetrate = -1; - Projectile.timeLeft *= 5; - Projectile.minion = true; - Projectile.tileCollide = false; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 23; - AIType = ProjectileID.BabySlime; - Projectile.DamageType = DamageClass.Summon; - } - - public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) - { - fallThrough = false; - return true; - } - - public override void AI() - { - Player player = Main.player[Projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - if (dust == 0f) - { - int constant = 16; - for (int i = 0; i < constant; i++) - { - Vector2 rotate = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.75f; - rotate = rotate.RotatedBy((double)((float)(i - (constant / 2 - 1)) * 6.28318548f / (float)constant), default) + Projectile.Center; - Vector2 faceDirection = rotate - Projectile.Center; - int dust = Dust.NewDust(rotate + faceDirection, 0, 0, DustID.Blood, faceDirection.X * 1f, faceDirection.Y * 1f, 100, default, 1.1f); - Main.dust[dust].noGravity = true; - Main.dust[dust].noLight = true; - Main.dust[dust].velocity = faceDirection; - } - dust += 1f; - } - bool isMinion = Projectile.type == ModContent.ProjectileType(); - player.AddBuff(ModContent.BuffType(), 3600); - if (!modPlayer.slimeGod) - { - Projectile.active = false; - return; - } - if (isMinion) - { - if (player.dead) - { - modPlayer.sGod = false; - } - if (modPlayer.sGod) - { - Projectile.timeLeft = 2; - } - } - } - - public override bool OnTileCollide(Vector2 oldVelocity) => false; - - public override bool PreDraw(ref Color lightColor) - { - Texture2D slom = TextureAssets.Projectile[Type].Value; - Rectangle frame = slom.Frame(1, Main.projFrames[Type], 0, Projectile.frame); - Main.EntitySpriteDraw(slom, Projectile.Center - Main.screenPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, frame.Size() / 2f, Projectile.scale, SpriteEffects.None); - return false; - } - } -} diff --git a/Projectiles/Summon/CrimsonSlimeGodMinion.png b/Projectiles/Summon/CrimsonSlimeGodMinion.png deleted file mode 100644 index e4e1a4620f..0000000000 Binary files a/Projectiles/Summon/CrimsonSlimeGodMinion.png and /dev/null differ diff --git a/Projectiles/Summon/DazzlingStabber.cs b/Projectiles/Summon/DazzlingStabber.cs index bfa59c1b17..99ffe5c6ac 100644 --- a/Projectiles/Summon/DazzlingStabber.cs +++ b/Projectiles/Summon/DazzlingStabber.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.netImportant = true; Projectile.friendly = true; Projectile.ignoreWater = true; - Projectile.minionSlots = 0.333f; + Projectile.minionSlots = 1f; Projectile.timeLeft = 90000; Projectile.penetrate = -1; Projectile.tileCollide = false; @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Summon bladeColor = Color.Orchid; Projectile.extraUpdates = 1; damageMult = 0.5f; - Projectile.ArmorPenetration = 40; + Projectile.ArmorPenetration = 20; break; case 2: // Rock bladeColor = Color.OrangeRed; @@ -82,7 +82,6 @@ namespace CalamityMod.Projectiles.Summon default: // Flame bladeColor = Color.Orange; damageMult = 1; - Projectile.ArmorPenetration = 20; break; } @@ -124,7 +123,7 @@ namespace CalamityMod.Projectiles.Summon { SoundStyle slam = new("CalamityMod/Sounds/NPCHit/RavagerRockPillarHit", 2); SoundEngine.PlaySound(slam with { Volume = 0.4f, Pitch = Main.rand.NextFloat(-0.25f, -0.15f), MaxInstances = -1 }, Projectile.Center); - for (int i = 0; i < 7; i++) + for (int i = 0; i < 5; i++) { Particle spark = new CustomSpark(Projectile.Center, Vector2.One.RotatedByRandom(100) * Main.rand.NextFloat(1f, 5f), "CalamityMod/Projectiles/Typeless/ArtifactOfResilienceShard6", false, Main.rand.Next(15, 25 + 1), Main.rand.NextFloat(0.75f, 1.2f), Color.White, new Vector2(1.3f, 0.5f), false, false, Main.rand.NextFloat(-5, 5), false, false); GeneralParticleHandler.SpawnParticle(spark); @@ -137,7 +136,7 @@ namespace CalamityMod.Projectiles.Summon { if (KnifeType == 1 && attacksDone > 0 && Utils.Distance(Projectile.Center, storedPos) < 150 && attackCooldown == 0) { - Particle spark = new GlowSparkParticle(Projectile.Center, -Projectile.velocity * 0.1f, false, 20, 0.03f, bladeColor * 0.55f, new Vector2(0.8f, 2.3f), true, false, 0.45f); + Particle spark = new GlowSparkParticle(Projectile.Center, -Projectile.velocity * 0.1f, false, 20, 0.03f, bladeColor * 0.4f, new Vector2(0.8f, 2.3f), true, false, 0.45f); GeneralParticleHandler.SpawnParticle(spark); } if (KnifeType == 2 && attackCooldown == 0) @@ -167,12 +166,6 @@ namespace CalamityMod.Projectiles.Summon Particle spark2 = new CustomSpark(Projectile.Center, Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.5f) * Main.rand.NextFloat(1f, 5f), "CalamityMod/Particles/ProvidenceMarkParticle", false, 14, Main.rand.NextFloat(0.9f, 1.2f), Color.Gold, new Vector2(0.5f, 1.5f), true, false, 0, false, false, -0.25f); GeneralParticleHandler.SpawnParticle(spark2); - for (int i = 0; i < 2; i++) - { - Particle trail = new GlowSparkParticle(Projectile.Center + i * Projectile.velocity * 0.4f, -Projectile.velocity * 0.05f, false, 9, 0.05f, Color.Orange * 0.6f, new Vector2(1, 0.3f), true, false, 0.85f); - GeneralParticleHandler.SpawnParticle(trail); - } - } if (attackCooldown == 0) SliceTarget(potentialTarget); diff --git a/Projectiles/Summon/EnchantedKnifeSummon.cs b/Projectiles/Summon/EnchantedKnifeSummon.cs index 9aa3853d86..aef98f6ded 100644 --- a/Projectiles/Summon/EnchantedKnifeSummon.cs +++ b/Projectiles/Summon/EnchantedKnifeSummon.cs @@ -33,7 +33,6 @@ namespace CalamityMod.Projectiles.Summon } private Action _currentState; - private ref float DashTimer => ref Projectile.ai[0]; private ref float SwingTimer => ref Projectile.ai[1]; @@ -62,14 +61,21 @@ namespace CalamityMod.Projectiles.Summon Projectile.width = Projectile.height = 32; } + public override bool? CanDamage() => SwingTimer >= SwingWait && SwingTimer <= SwingWait + SwingTime ? base.CanDamage() : false; + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + float damageMult = MathHelper.Clamp(Utils.GetLerpValue(3, 0, Projectile.numHits), 0.25f, 1); + modifiers.SourceDamage *= damageMult; + } + #region AI public override void MinionAI() { if (!HasSpawned) { + IFrames = -1; TrailCacheLength = 4; - DashTimer = Main.rand.Next(30); Projectile.velocity = Projectile.DirectionFrom(Owner.Center); CurrentState = GoToOwnerState; HasSpawned = true; @@ -157,7 +163,7 @@ namespace CalamityMod.Projectiles.Summon if (SwingTimer == SwingWait + SwingTime * 0.5f && Main.myPlayer == Projectile.owner) { Vector2 spawnPosition = SwingCenter + predictiveDirection.SafeNormalize(-Vector2.UnitY) * 40f; - Projectile.NewProjectileDirect( + Projectile.NewProjectile( Projectile.GetSource_FromThis(), spawnPosition, predictiveDirection, @@ -166,14 +172,30 @@ namespace CalamityMod.Projectiles.Summon Projectile.knockBack, Projectile.owner); } - - if (DashTimer >= DashCooldown) + if ((SwingTimer == SwingWait && SwingDirection == 1) || (SwingTimer == SwingWait + SwingTime && SwingDirection == -1)) { - Vector2 dashVelocity = CalamityUtils.CalculatePredictiveAimToTarget(SwingCenter, Target, DashSpeed); + Projectile.ResetLocalNPCHitImmunity(); + Projectile.numHits = 0; + } + + if (Vector2.Distance(SwingCenter, Target.Center) > 48f + MathF.Min(Target.width, Target.height) * 0.8f) + { + Vector2 dashVelocity = CalamityUtils.CalculatePredictiveAimToTarget(SwingCenter, Target, ChaseSpeed); if (!float.IsNaN(dashVelocity.X) && !float.IsNaN(dashVelocity.Y)) Projectile.velocity = dashVelocity; - DashTimer = 0f; } + else if (Vector2.Distance(SwingCenter, Target.Center) < 40f + MathF.Min(Target.width, Target.height) * 0.5f) + { + Vector2 dashVelocity = CalamityUtils.CalculatePredictiveAimToTarget(SwingCenter, Target, RecoilSpeed); + if (!float.IsNaN(dashVelocity.X) && !float.IsNaN(dashVelocity.Y)) + Projectile.velocity = dashVelocity; + } + else + Projectile.velocity *= 0.5f; + + // Cancel out choppy movement + if (Projectile.velocity.Length() < 1f) + Projectile.velocity *= 0f; SwingTimer += 1f * SwingDirection; if (SwingTimer == 0f || SwingTimer == SwingWait + SwingTime + SwingWait) @@ -183,9 +205,6 @@ namespace CalamityMod.Projectiles.Summon else HasStartedSwinging = true; } - - if (Projectile.DistanceSQ(Target.Center) > 320f * 320f) - DashTimer += Main.rand.NextBool((int)DashCooldown) ? 2 : 1; } private void OnStateChange(Action newState) diff --git a/Projectiles/Summon/FlameBlast.cs b/Projectiles/Summon/FlameBlast.cs index 3a3533b16a..40276faf94 100644 --- a/Projectiles/Summon/FlameBlast.cs +++ b/Projectiles/Summon/FlameBlast.cs @@ -42,9 +42,9 @@ namespace CalamityMod.Projectiles.Summon count += 1f; } Projectile.localAI[0] += 1f; - if (Projectile.localAI[0] > 4f) + if (Projectile.localAI[0] > 4f && Projectile.localAI[0] % 2 == 0f) { - Particle beam = new CustomSpark(Projectile.Center, Projectile.velocity * 0.1f, "CalamityMod/Particles/SmallBloom", false, 8, 0.085f, Color.Lerp(Color.OrangeRed, Color.Goldenrod, Utils.GetLerpValue(270, 230, Projectile.timeLeft)), new Vector2(1f, (1 + 0.8f * velPower)), true, false, 0, false, false, 0.5f * velPower); + Particle beam = new CustomSpark(Projectile.Center, Projectile.velocity * 0.1f, "CalamityMod/Particles/SmallBloom", false, 8, 0.085f, Color.Lerp(Color.OrangeRed, Color.Goldenrod, Utils.GetLerpValue(270, 230, Projectile.timeLeft)), new Vector2(1f, 1 + 0.8f * velPower), true, false, 0, false, false, 0.5f * velPower); GeneralParticleHandler.SpawnParticle(beam); } diff --git a/Projectiles/Summon/FrostBeam.cs b/Projectiles/Summon/FrostBeam.cs index 115b330c06..2d7284f8ca 100644 --- a/Projectiles/Summon/FrostBeam.cs +++ b/Projectiles/Summon/FrostBeam.cs @@ -24,12 +24,15 @@ namespace CalamityMod.Projectiles.Summon Projectile.timeLeft = 200; Projectile.coldDamage = true; Projectile.DamageType = DamageClass.Summon; + Projectile.penetrate = -1; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; } public override void AI() { - Projectile.localAI[0] += 1f; - if (Projectile.localAI[0] > 5f) + Projectile.localAI[0]++; + if (Projectile.localAI[0] > 2f && Projectile.ai[0] == 0f) { for (int i = 0; i < 6; i++) { @@ -43,33 +46,32 @@ namespace CalamityMod.Projectiles.Summon } } } - public override void OnKill(int timeLeft) + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - Projectile.position = Projectile.Center; - Projectile.width = Projectile.height = 70; - Projectile.position -= Projectile.Size * 0.5f; - Projectile.maxPenetrate = -1; - Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.damage /= 3; - Projectile.Damage(); - int flowerPetalCount = Main.rand.Next(3, 5 + 1); - float thetaDelta = Projectile.velocity.ToRotation(); - float weaveDistanceMin = 2f; - float weaveDistanceOutwardMax = 3f; - float weaveDistanceInner = 0.5f; - for (float theta = 0f; theta < MathHelper.TwoPi; theta += 0.05f) + if (Projectile.ai[0] == 0f) { - Vector2 velocity = theta.ToRotationVector2() * + Projectile.ai[0]++; + Projectile.ExpandHitboxBy(128); + Projectile.Damage(); + int flowerPetalCount = Main.rand.Next(3, 5 + 1); + float thetaDelta = Projectile.velocity.ToRotation(); + float weaveDistanceMin = 2f; + float weaveDistanceOutwardMax = 3f; + float weaveDistanceInner = 0.5f; + for (float theta = 0f; theta < MathHelper.TwoPi; theta += 0.05f) + { + Vector2 velocity = theta.ToRotationVector2() * (weaveDistanceMin + // The 0.5 in here is to prevent the petal from looping back into itself. With a 0.5 addition, it is perfect, coming back to (0,0) // instead of weaving backwards. (float)(Math.Sin(thetaDelta + theta * flowerPetalCount) + 0.5f + weaveDistanceInner) * weaveDistanceOutwardMax); - Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.MushroomSpray, velocity); - dust.noGravity = true; - dust.scale = 1.35f; + Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.MushroomSpray, velocity); + dust.noGravity = true; + dust.scale = 1.35f; + } + Projectile.Kill(); } } } diff --git a/Projectiles/Summon/HarvestStaffMinion.cs b/Projectiles/Summon/HarvestStaffMinion.cs index 10915893e7..feea449d27 100644 --- a/Projectiles/Summon/HarvestStaffMinion.cs +++ b/Projectiles/Summon/HarvestStaffMinion.cs @@ -42,7 +42,8 @@ namespace CalamityMod.Projectiles.Summon if (value == AIState.Attack) { Animation = AnimationState.Run; - SoundEngine.PlaySound(ScreamSound, Projectile.Center); + if (!CalamityClientConfig.Instance.MisophoniaSupport) + SoundEngine.PlaySound(ScreamSound, Projectile.Center); } else if (value == AIState.Idle) Animation = AnimationState.Idle; @@ -385,7 +386,7 @@ namespace CalamityMod.Projectiles.Summon // When the pumpkin encounters a 1-tile-height obstacle, it'll climb it, like the player. Collision.StepUp(ref Projectile.position, ref Projectile.velocity, Projectile.width, Projectile.height, ref Projectile.stepSpeed, ref Projectile.gfxOffY); - if (Main.rand.NextBool(700)) + if (Main.rand.NextBool(700) && !CalamityClientConfig.Instance.MisophoniaSupport) SoundEngine.PlaySound(Main.rand.NextBool(20) ? IdleRareSound : IdleSound, Projectile.Center); } diff --git a/Projectiles/Summon/HydrothermicVent.cs b/Projectiles/Summon/HydrothermicVent.cs index a90d0b2d32..fdd82f6bb5 100644 --- a/Projectiles/Summon/HydrothermicVent.cs +++ b/Projectiles/Summon/HydrothermicVent.cs @@ -173,15 +173,6 @@ namespace CalamityMod.Projectiles.Summon Projectile.ai[0] = 20f; } } - - //doesn't look good - /*Vector2 goreVec = new Vector2(projectile.Center.X, projectile.Center.Y - yAdjust - 10f); - Vector2 goreVec = new Vector2(projectile.Center.X + projectile.velocity.X, projectile.Center.Y + projectile.velocity.Y); - if (Main.rand.NextBool(8)) - { - int smoke = Gore.NewGore(goreVec, default, Main.rand.Next(375, 378), 0.5f); - Main.gore[smoke].behindTiles = true; - }*/ } } diff --git a/Projectiles/Summon/IceSentry.cs b/Projectiles/Summon/IceSentry.cs index 83cce4898f..1d5b62f0f9 100644 --- a/Projectiles/Summon/IceSentry.cs +++ b/Projectiles/Summon/IceSentry.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame = 9; Projectile.localAI[1]++; - if (Projectile.localAI[1] > 2) + if (Projectile.localAI[1] > 3) { Projectile.localAI[1] = 0; @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.ai[1] < 300f) Projectile.ai[1]++; - float delay = 60f - Projectile.ai[1] / 60f * 10f; + float delay = 60f - Projectile.ai[1] / 60f * 9f; if (Projectile.localAI[0] > delay) { Projectile.localAI[0] = 0f; diff --git a/Projectiles/Summon/MoonFist.cs b/Projectiles/Summon/MoonFist.cs index ca9f891814..b7fb680e86 100644 --- a/Projectiles/Summon/MoonFist.cs +++ b/Projectiles/Summon/MoonFist.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.penetrate = -1; Projectile.MaxUpdates = 2; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = Projectile.MaxUpdates * 10; + Projectile.localNPCHitCooldown = -1; Projectile.netImportant = true; Projectile.timeLeft = 90000; Projectile.DamageType = DamageClass.Summon; @@ -122,13 +122,13 @@ namespace CalamityMod.Projectiles.Summon public void AttackTarget(NPC target) { - int reelBackTime = 32; - int homeDelay = 27; + int reelBackTime = 30; + int homeDelay = 15; int attackTime = 150; int attackCycleInterval = reelBackTime + attackTime; // Teleport to the enemy if it's far away. - if (!Projectile.WithinRange(target.Center, 1200f)) + if (!Projectile.WithinRange(target.Center, 960f)) { Vector2 teleportDestination = target.Center + Main.rand.NextVector2Unit() * Main.rand.NextFloat(250f, 300f); DoTeleport(teleportDestination); @@ -145,11 +145,11 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame = (int)Math.Round(MathHelper.Lerp(6f, 11f, AttackTimer / reelBackTime)); // Reel back and look at the target. - float hoverOffset = MathHelper.Lerp(200f, 480f, AttackTimer / reelBackTime); + float hoverOffset = MathHelper.Lerp(160f, 320f, AttackTimer / reelBackTime); hoverOffset += MathHelper.Lerp(-10f, 75f, Projectile.identity % 9f / 1f); float spin = MathHelper.Lerp(-0.27f, 0.27f, Projectile.identity / 7f % 1f); Vector2 hoverDestination = target.Center - target.SafeDirectionTo(target.Center, Vector2.UnitY).RotatedBy(spin) * hoverOffset; - Vector2 idealVelocity = Projectile.SafeDirectionTo(hoverDestination) * MathHelper.Min(25f, Projectile.Distance(hoverDestination)); + Vector2 idealVelocity = Projectile.SafeDirectionTo(hoverDestination) * MathHelper.Min(12f, Projectile.Distance(hoverDestination)); Projectile.Center = Vector2.Lerp(Projectile.Center, hoverDestination, 0.02f); Projectile.velocity = Vector2.Lerp(Projectile.velocity, idealVelocity, 0.03f).MoveTowards(idealVelocity, 0.5f); @@ -164,6 +164,8 @@ namespace CalamityMod.Projectiles.Summon } else if (DelayUntilNextPunch <= 0) { + Projectile.ResetLocalNPCHitImmunity(); + // Home towards the target briefly after the initial charge. if (AttackTimer >= reelBackTime + homeDelay) Projectile.velocity = Projectile.SuperhomeTowardsTarget(target, 34f, 24f); @@ -203,14 +205,10 @@ namespace CalamityMod.Projectiles.Summon Projectile.netUpdate = true; } - public override bool MinionContactDamage() => true; + public override bool MinionContactDamage() => DelayUntilNextPunch <= 0 && AttackTimer > 0f; public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - // Rebound on collision. - if (DelayUntilNextPunch > 0 || AttackTimer <= 0f) - return; - // Create some cool particles to go with the hit. Vector2 impactPoint = Vector2.Lerp(Projectile.Center, target.Hitbox.ClosestPointInRect(Projectile.Center), 0.5f); for (int i = 0; i < 7; i++) @@ -235,7 +233,7 @@ namespace CalamityMod.Projectiles.Summon SoundEngine.PlaySound(SoundID.Item74 with { Pitch = -0.36f }, Projectile.Center); DelayUntilNextPunch = WarloksMoonFist.PunchCooldownTime - 10; - Projectile.velocity = Projectile.SafeDirectionTo(target.Center, -Vector2.UnitY).RotatedBy(0.16f) * Projectile.velocity.Length() * -0.45f; + Projectile.velocity = Projectile.SafeDirectionTo(target.Center, -Vector2.UnitY).RotatedBy(0.16f) * Projectile.velocity.Length() * -0.3f; Projectile.netUpdate = true; } diff --git a/Projectiles/Summon/PlaguebringerSummon.cs b/Projectiles/Summon/PlaguebringerSummon.cs index 66667c4cdf..4583bf50d0 100644 --- a/Projectiles/Summon/PlaguebringerSummon.cs +++ b/Projectiles/Summon/PlaguebringerSummon.cs @@ -80,7 +80,8 @@ namespace CalamityMod.Projectiles.Summon bee.usesLocalNPCImmunity = true; bee.localNPCHitCooldown = 10; bee.penetrate = 2; - bee.DamageType = DamageClass.Generic; + bee.DamageType = DamageClass.Summon; + bee.CritChance = 0; } } } diff --git a/Projectiles/Summon/PolypLauncherProjectile.cs b/Projectiles/Summon/PolypLauncherProjectile.cs index d73745b2f2..80dabcd0bd 100644 --- a/Projectiles/Summon/PolypLauncherProjectile.cs +++ b/Projectiles/Summon/PolypLauncherProjectile.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Summon dust_splash += 1; } int split = 0; - int shardAmt = Main.rand.Next(1, 5); + int shardAmt = Main.rand.Next(2, 4); while (split < shardAmt) { //Calculate the velocity of the projectile diff --git a/Projectiles/Summon/PolypLauncherSentry.cs b/Projectiles/Summon/PolypLauncherSentry.cs index 1c30e6c755..25e50d12c9 100644 --- a/Projectiles/Summon/PolypLauncherSentry.cs +++ b/Projectiles/Summon/PolypLauncherSentry.cs @@ -52,22 +52,22 @@ namespace CalamityMod.Projectiles.Summon Projectile.ai[0] -= 1f; return; } - Projectile.ai[1] += Main.rand.Next(1, 3); + Projectile.ai[1]++; - NPC potentialTarget = Projectile.Center.MinionHoming(800f, player, false); + NPC potentialTarget = Projectile.Center.MinionHoming(400f, player, false); if (Projectile.owner == Main.myPlayer && potentialTarget != null) { - if (Projectile.ai[1] > 40f) + if (Projectile.ai[1] > 75f) { Vector2 spawnPosition = new Vector2(Projectile.oldPosition.X + (Projectile.width / 2), Projectile.oldPosition.Y + (Projectile.height / 2)); float shootSpeed = 16f; float gravity = -PolypLauncherProjectile.Gravity; float distance = Vector2.Distance(spawnPosition, potentialTarget.Center); - float angle = 0.25f * (float)Math.Asin(MathHelper.Clamp(gravity * distance * 1.5f / (float)Math.Pow(shootSpeed, 2), -1f, 1f)); + float angle = 0.25f * MathF.Asin(MathHelper.Clamp(gravity * distance * 1.5f / MathF.Pow(shootSpeed, 2f), -1f, 1f)); - Vector2 velocity = new Vector2(0f, -shootSpeed).RotatedBy(angle).RotatedByRandom(0.1f); + Vector2 velocity = new Vector2(0f, -shootSpeed).RotatedBy(angle).RotatedByRandom(0.05f); velocity.X *= (potentialTarget.Center.X - Projectile.Center.X < 0).ToDirectionInt(); Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPosition, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); diff --git a/Projectiles/Summon/ProfanedEnergy.cs b/Projectiles/Summon/ProfanedEnergy.cs index 19db3f0522..c6d599c406 100644 --- a/Projectiles/Summon/ProfanedEnergy.cs +++ b/Projectiles/Summon/ProfanedEnergy.cs @@ -160,7 +160,7 @@ namespace CalamityMod.Projectiles.Summon SoundEngine.PlaySound(SoundID.Item73, Projectile.Center); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, (shootVel * Main.rand.NextFloat(0.8f, 1.2f)).RotatedBy(0.75f * (attacks % 2 == 0 ? -1 : 1)).RotatedByRandom(0.4f), ModContent.ProjectileType(), Projectile.damage, 0, Projectile.owner); - Particle orb2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Goldenrod, "CalamityMod/Particles/BloomRing", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0, Main.rand.NextFloat(0.75f, 1f), 15); + Particle orb2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Goldenrod, "CalamityMod/Particles/BloomRing", Vector2.One, 0f, 0, Main.rand.NextFloat(0.6f, 0.75f), 15); GeneralParticleHandler.SpawnParticle(orb2); attackTimer = 8; @@ -191,7 +191,7 @@ namespace CalamityMod.Projectiles.Summon SoundStyle fireHeal = new("CalamityMod/Sounds/Custom/ProfanedGuardians/GuardianDash"); SoundEngine.PlaySound(fireHeal with { Volume = 0.7f, Pitch = 0.3f }, Projectile.Center); - Particle orb2 = new CustomPulse(Projectile.Center, Vector2.Zero, new Color(54, 209, 54), "CalamityMod/Particles/BloomRing", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0, 1.3f, 24); + Particle orb2 = new CustomPulse(Projectile.Center, Vector2.Zero, new Color(54, 209, 54), "CalamityMod/Particles/BloomRing", Vector2.One, 0f, 0, 1f, 24); GeneralParticleHandler.SpawnParticle(orb2); } attackCooldown--; diff --git a/Projectiles/Summon/RustyBeaconPulse.cs b/Projectiles/Summon/RustyBeaconPulse.cs index c8a403f834..2256e9fa3f 100644 --- a/Projectiles/Summon/RustyBeaconPulse.cs +++ b/Projectiles/Summon/RustyBeaconPulse.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Summon } Projectile.Opacity = 1f - (float)Math.Pow(LifetimeCompletion, 1.56); - Projectile.scale = MathHelper.Lerp(0.5f, 7f, LifetimeCompletion); + Projectile.scale = MathHelper.Lerp(0.5f, 5f, LifetimeCompletion); Projectile.rotation += Projectile.localAI[0] * 0.012f; } diff --git a/Projectiles/Summon/RustyDrone.cs b/Projectiles/Summon/RustyDrone.cs index 4435cc6f3d..3f8d7012ba 100644 --- a/Projectiles/Summon/RustyDrone.cs +++ b/Projectiles/Summon/RustyDrone.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Type]; // Hover in place. - Projectile.velocity = -Vector2.UnitY * (float)Math.Sin(MathHelper.TwoPi * Projectile.timeLeft / 96f) * 3f; + Projectile.velocity = -Vector2.UnitY * MathF.Sin(MathHelper.TwoPi * Projectile.timeLeft / 96f) * 3f; // Look at nearby enemies. NPC potentialTarget = Projectile.Center.MinionHoming(1000f, Owner); @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.spriteDirection = (Projectile.Center.X < potentialTarget.Center.X).ToDirectionInt(); // Release pulses of irradiated energy. - if (Projectile.timeLeft % RustyBeaconPrototype.PulseReleaseRate == RustyBeaconPrototype.PulseReleaseRate / 2) + if (Projectile.timeLeft % RustyBeaconPrototype.PulseReleaseRate == 1) { SoundEngine.PlaySound(SoundID.DD2_WitherBeastAuraPulse with { Volume = 1.6f }, Projectile.Center); diff --git a/Projectiles/Summon/SandElementalHealer.cs b/Projectiles/Summon/SandElementalHealer.cs index aa69a548bf..df2e86ec86 100644 --- a/Projectiles/Summon/SandElementalHealer.cs +++ b/Projectiles/Summon/SandElementalHealer.cs @@ -2,8 +2,11 @@ using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Healing; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -44,7 +47,7 @@ namespace CalamityMod.Projectiles.Summon Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.oasisElemental && !modPlayer.allElementals && !modPlayer.oasisElementalVanity && !modPlayer.allElementalsVanity) + if (!modPlayer.oasisElemental.HasValue && modPlayer.allElementals is null && !modPlayer.oasisElementalVanity && !modPlayer.allElementalsVanity) { Projectile.active = false; return; @@ -198,5 +201,29 @@ namespace CalamityMod.Projectiles.Summon return null; } } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = TextureAssets.Projectile[Type].Value; + Rectangle frame = tex.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + SpriteEffects sp = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + var cplayer = Main.player[Projectile.owner].Calamity(); + + if ((cplayer.oasisElemental.HasValue && !cplayer.oasisElemental.Value) || (cplayer.allElementals.HasValue && !cplayer.allElementals.Value)) + { + Vector3 hsl = Main.rgbToHsl(Color.LawnGreen); + CalamityUtils.EnterShaderRegion(Main.spriteBatch); + GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(1f); + GameShaders.Misc["CalamityMod:BasicTint"].UseSaturation(0.25f); + GameShaders.Misc["CalamityMod:BasicTint"].UseColor(Main.hslToRgb(1 - hsl.X, hsl.Y, hsl.Z)); + GameShaders.Misc["CalamityMod:BasicTint"].Apply(); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, sp); + CalamityUtils.ExitShaderRegion(Main.spriteBatch); + } + else + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, sp); + + return false; + } } } diff --git a/Projectiles/Summon/SandElementalMinion.cs b/Projectiles/Summon/SandElementalMinion.cs index 397f3481cd..267d778619 100644 --- a/Projectiles/Summon/SandElementalMinion.cs +++ b/Projectiles/Summon/SandElementalMinion.cs @@ -1,7 +1,10 @@ using System; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -41,7 +44,7 @@ namespace CalamityMod.Projectiles.Summon { Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.sandElemental && !modPlayer.allElementals && !modPlayer.sandElementalVanity && !modPlayer.allElementalsVanity) + if (!modPlayer.sandElemental.HasValue && modPlayer.allElementals is null && !modPlayer.sandElementalVanity && !modPlayer.allElementalsVanity) { Projectile.active = false; return; @@ -250,5 +253,29 @@ namespace CalamityMod.Projectiles.Summon } } public override bool? CanDamage() => false; + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = TextureAssets.Projectile[Type].Value; + Rectangle frame = tex.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + SpriteEffects sp = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + var cplayer = Main.player[Projectile.owner].Calamity(); + + if ((cplayer.sandElemental.HasValue && !cplayer.sandElemental.Value) || (cplayer.allElementals.HasValue && !cplayer.allElementals.Value)) + { + Vector3 hsl = Main.rgbToHsl(Color.SandyBrown); + CalamityUtils.EnterShaderRegion(Main.spriteBatch); + GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(1f); + GameShaders.Misc["CalamityMod:BasicTint"].UseSaturation(0.25f); + GameShaders.Misc["CalamityMod:BasicTint"].UseColor(Main.hslToRgb(1 - hsl.X, hsl.Y, hsl.Z)); + GameShaders.Misc["CalamityMod:BasicTint"].Apply(); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, sp); + CalamityUtils.ExitShaderRegion(Main.spriteBatch); + } + else + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, sp); + + return false; + } } } diff --git a/Projectiles/Summon/SkeletalDragonChild.cs b/Projectiles/Summon/SkeletalDragonChild.cs index 1c8edf6dc0..c82622f6c3 100644 --- a/Projectiles/Summon/SkeletalDragonChild.cs +++ b/Projectiles/Summon/SkeletalDragonChild.cs @@ -21,18 +21,15 @@ namespace CalamityMod.Projectiles.Summon Projectile.netImportant = true; Projectile.friendly = true; Projectile.ignoreWater = true; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 7; Projectile.minionSlots = 0f; Projectile.extraUpdates = 1; - Projectile.timeLeft = 18000; - Projectile.penetrate = -1; Projectile.tileCollide = false; - Projectile.timeLeft *= 5; Projectile.minion = true; Projectile.DamageType = DamageClass.Summon; } + public override bool? CanDamage() => false; + public override void AI() { Player player = Main.player[Projectile.owner]; @@ -50,6 +47,7 @@ namespace CalamityMod.Projectiles.Summon return; } + Projectile.timeLeft = 2; NPC target = Projectile.Center.MinionHoming(SkeletalDragonMother.DistanceToCheck * 0.666f, player); if (target != null) diff --git a/Projectiles/Summon/SkeletalDragonMother.cs b/Projectiles/Summon/SkeletalDragonMother.cs index 1d93cc03e1..7779c16e44 100644 --- a/Projectiles/Summon/SkeletalDragonMother.cs +++ b/Projectiles/Summon/SkeletalDragonMother.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 6; + Projectile.localNPCHitCooldown = 20; Projectile.minionSlots = 6f; Projectile.timeLeft = 18000; Projectile.penetrate = -1; diff --git a/Projectiles/Summon/SmallAresArms/CannonLaserbeam.cs b/Projectiles/Summon/SmallAresArms/CannonLaserbeam.cs index d59573fd37..3463b97ee7 100644 --- a/Projectiles/Summon/SmallAresArms/CannonLaserbeam.cs +++ b/Projectiles/Summon/SmallAresArms/CannonLaserbeam.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms public Projectile OwnerProjectile => CalamityUtils.FindProjectileByIdentity((int)Projectile.ai[1], Projectile.owner); - public const int LifetimeConst = 75; + public const int LifetimeConst = 90; public override float MaxScale => 0.5f + (float)Math.Cos(Main.GlobalTimeWrappedHourly * 10f) * 0.07f; public override float MaxLaserLength => 1560f; public override float Lifetime => LifetimeConst; diff --git a/Projectiles/Summon/SmallAresArms/ExoskeletonCannon.cs b/Projectiles/Summon/SmallAresArms/ExoskeletonCannon.cs index 5b9c20254a..a064b4282a 100644 --- a/Projectiles/Summon/SmallAresArms/ExoskeletonCannon.cs +++ b/Projectiles/Summon/SmallAresArms/ExoskeletonCannon.cs @@ -132,7 +132,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms // 15NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction float idealRotation = Main.myPlayer != Projectile.owner ? Projectile.rotation : Projectile.AngleTo(Main.MouseWorld); - NPC potentialTarget = Projectile.Center.ClosestNPCAt(AresExoskeleton.TargetingDistance); + NPC potentialTarget = Projectile.Center.MinionHoming(AresExoskeleton.TargetingDistance, Owner); if (potentialTarget != null) { Projectile.ai[1] = 1f; diff --git a/Projectiles/Summon/SmallAresArms/ExoskeletonPlasmaCannon.cs b/Projectiles/Summon/SmallAresArms/ExoskeletonPlasmaCannon.cs index 2620fa4b84..d8f5c00907 100644 --- a/Projectiles/Summon/SmallAresArms/ExoskeletonPlasmaCannon.cs +++ b/Projectiles/Summon/SmallAresArms/ExoskeletonPlasmaCannon.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon.SmallAresArms @@ -21,6 +22,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms public override void SetStaticDefaults() { Main.projFrames[Type] = 6; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; // Item.shoot assigns this as the minion } public override void PostAI() diff --git a/Projectiles/Summon/SmallSkeletonMinion.cs b/Projectiles/Summon/SmallSkeletonMinion.cs index d5be045715..5aaa5133c0 100644 --- a/Projectiles/Summon/SmallSkeletonMinion.cs +++ b/Projectiles/Summon/SmallSkeletonMinion.cs @@ -36,9 +36,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.timeLeft *= 5; Projectile.minion = true; Projectile.DamageType = DamageClass.Summon; - Projectile.MaxUpdates = 2; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = Projectile.MaxUpdates * 15; + Projectile.localNPCHitCooldown = 20; } public override void SendExtraAI(BinaryWriter writer) { @@ -66,82 +65,61 @@ namespace CalamityMod.Projectiles.Summon Projectile.frameCounter = 0; } if (Projectile.frame < 1) - { Projectile.frame = 1; - } if (Projectile.frame >= Main.projFrames[Type]) - { Projectile.frame = 1; - } bool isCorrectProjectile = Projectile.type == ModContent.ProjectileType(); player.AddBuff(ModContent.BuffType(), 3600); if (isCorrectProjectile) { if (player.dead) - { modPlayer.necrosteocytesDudes = false; - } if (modPlayer.necrosteocytesDudes) - { Projectile.timeLeft = 2; - } } NPC potentialTarget = Projectile.Center.MinionHoming(900f, player); - if (Projectile.velocity.Y == 0 && (HoleBelow() || (Projectile.Distance(player.Center) > 205f && Projectile.position.X == Projectile.oldPosition.X))) - { + if (Projectile.velocity.Y == 0 && (HoleBelow() || (Projectile.Distance(player.Center) > 320f && Projectile.position.X == Projectile.oldPosition.X) || (potentialTarget is not null && Projectile.Top.Y > potentialTarget.Bottom.Y))) Projectile.velocity.Y = -10f; - } else if (Projectile.velocity.Y != 0f) - { Projectile.frame = 2; - } - if (Projectile.velocity.Y > -16f) - { + if (Projectile.velocity.Y < 16f) Projectile.velocity.Y += 0.3f; - } - Projectile.ai[0]++; - if (Projectile.ai[0] % 60f == 59f && Main.myPlayer == Projectile.owner) - { - int type = Utils.SelectRandom(Main.rand, ModContent.ProjectileType(), ModContent.ProjectileType()); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, type, Projectile.damage, Projectile.knockBack, Projectile.owner); - } if (potentialTarget is null) { - if (Math.Abs(player.Center.X - Projectile.Center.X + 40f * Projectile.minionPos) > 160f) + if (Math.Abs(player.Center.X - Projectile.Center.X - 30f * Projectile.minionPos * player.direction) > 80f) { - Projectile.velocity.X += Main.rand.NextFloat(0.11f, 0.16f) * (player.Center.X - Projectile.Center.X + 40f * Projectile.minionPos > 0f).ToDirectionInt(); + Projectile.velocity.X += Main.rand.NextFloat(0.1f, 0.13f) * (player.Center.X - Projectile.Center.X + 40f * Projectile.minionPos > 0f).ToDirectionInt(); Projectile.velocity.X = MathHelper.Clamp(Projectile.velocity.X, -13f, 13f); } else { - Projectile.velocity.X *= 0.95f; + Projectile.velocity.X *= 0.925f; + if (MathF.Abs(Projectile.velocity.X) < 0.05f) + Projectile.velocity.X = 0f; } - if (Projectile.Distance(player.Center) <= 150f) - { + + if (Projectile.velocity.X == 0f) Projectile.frame = 0; - } if (Projectile.Distance(player.Center) > 1600f) { Projectile.Center = player.Center; + Projectile.velocity = Vector2.Zero; Projectile.netUpdate = true; } } else { - if (Math.Abs(potentialTarget.Center.X - Projectile.Center.X + (int)MathHelper.Min(potentialTarget.width / 2, 40f)) > (int)MathHelper.Min(potentialTarget.width / 2, 40f)) - { - Projectile.velocity.X += Main.rand.NextFloat(0.08f, 0.15f) * (potentialTarget.Center.X - Projectile.Center.X > 0f).ToDirectionInt(); - Projectile.velocity.X = MathHelper.Clamp(Projectile.velocity.X, -16f, 16f); - } - else - { + Projectile.velocity.X += Main.rand.NextFloat(0.1f, 0.13f) * (potentialTarget.Center.X > Projectile.Center.X).ToDirectionInt(); + Projectile.velocity.X = MathHelper.Clamp(Projectile.velocity.X, -13f, 13f); + if (Math.Sign(Projectile.velocity.X) != (potentialTarget.Center.X > Projectile.Center.X).ToDirectionInt()) Projectile.velocity.X *= 0.95f; - } + if (Projectile.Distance(player.Center) > 1400f) { Projectile.Center = player.Center; + Projectile.velocity = Vector2.Zero; Projectile.netUpdate = true; } Projectile.MinionAntiClump(0.075f); diff --git a/Projectiles/Summon/CorruptionSlimeGodMinion.cs b/Projectiles/Summon/StatigelBlightedSlime.cs similarity index 82% rename from Projectiles/Summon/CorruptionSlimeGodMinion.cs rename to Projectiles/Summon/StatigelBlightedSlime.cs index e627103010..3b7e1f44a3 100644 --- a/Projectiles/Summon/CorruptionSlimeGodMinion.cs +++ b/Projectiles/Summon/StatigelBlightedSlime.cs @@ -2,23 +2,33 @@ using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class CorruptionSlimeGodMinion : ModProjectile, ILocalizedModType + public class StatigelBlightedSlime : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; - public override string Texture => "CalamityMod/Projectiles/Summon/CorroslimeMinion"; + public override string Texture => "CalamityMod/Projectiles/Summon/BlightedSlimeCorro"; public float dust = 0f; + public static Asset Corroslime; + public static Asset Crimslime; + public override void SetStaticDefaults() { Main.projFrames[Type] = 6; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; + + if (!Main.dedServ) + { + Corroslime = ModContent.Request("CalamityMod/Projectiles/Summon/BlightedSlimeCorro"); + Crimslime = ModContent.Request("CalamityMod/Projectiles/Summon/BlightedSlimeCrim"); + } } public override void SetDefaults() @@ -37,7 +47,7 @@ namespace CalamityMod.Projectiles.Summon AIType = ProjectileID.BabySlime; Projectile.tileCollide = false; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 23; + Projectile.localNPCHitCooldown = 30; Projectile.DamageType = DamageClass.Summon; } @@ -66,8 +76,8 @@ namespace CalamityMod.Projectiles.Summon } dust += 1f; } - bool isMinion = Projectile.type == ModContent.ProjectileType(); - player.AddBuff(ModContent.BuffType(), 3600); + bool isMinion = Projectile.type == ModContent.ProjectileType(); + player.AddBuff(ModContent.BuffType(), 3600); if (!modPlayer.slimeGod) { Projectile.active = false; @@ -90,7 +100,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D slom = TextureAssets.Projectile[Type].Value; + Texture2D slom = (WorldGen.crimson ? Crimslime : Corroslime).Value; Rectangle frame = slom.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Main.EntitySpriteDraw(slom, Projectile.Center - Main.screenPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, frame.Size() / 2f, Projectile.scale, SpriteEffects.None); return false; diff --git a/Projectiles/Summon/VengefulSunSpiritMinion.cs b/Projectiles/Summon/VengefulSunSpiritMinion.cs index f298bbd61d..7d90986a47 100644 --- a/Projectiles/Summon/VengefulSunSpiritMinion.cs +++ b/Projectiles/Summon/VengefulSunSpiritMinion.cs @@ -108,9 +108,9 @@ namespace CalamityMod.Projectiles.Summon float shootSpeed = 15f; Vector2 source = Projectile.Center; var velocity = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(Projectile.Center, target, shootSpeed, 2); - Projectile beam = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center - velocity, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * (0.75f + Projectile.minionSlots * 0.25f)), Projectile.knockBack, Projectile.owner, ai1: (Projectile.minionSlots - 1) / 6f); + Projectile beam = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center - velocity, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * (0.8f + Projectile.minionSlots * 0.2f)), Projectile.knockBack, Projectile.owner, ai1: (Projectile.minionSlots - 1) / 6f); beam.DamageType = DamageClass.Summon; - Projectile.ai[1] += 60f / (0.75f + Projectile.minionSlots * 0.25f); + Projectile.ai[1] += 60f / (0.8f + Projectile.minionSlots * 0.2f); } } public override void SendExtraAI(BinaryWriter writer) diff --git a/Projectiles/Summon/VoidConcentrationDarkEnergy.png b/Projectiles/Summon/VoidConcentrationDarkEnergy.png new file mode 100644 index 0000000000..d2bb54b72b Binary files /dev/null and b/Projectiles/Summon/VoidConcentrationDarkEnergy.png differ diff --git a/Projectiles/Summon/VoidConcentrationDarkEnergyGlow.png b/Projectiles/Summon/VoidConcentrationDarkEnergyGlow.png new file mode 100644 index 0000000000..696b1d5475 Binary files /dev/null and b/Projectiles/Summon/VoidConcentrationDarkEnergyGlow.png differ diff --git a/Projectiles/Summon/WaterElementalMinion.cs b/Projectiles/Summon/WaterElementalMinion.cs index e04dd72736..918346f7c3 100644 --- a/Projectiles/Summon/WaterElementalMinion.cs +++ b/Projectiles/Summon/WaterElementalMinion.cs @@ -1,7 +1,10 @@ using System; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -40,7 +43,7 @@ namespace CalamityMod.Projectiles.Summon bool isMinion = Projectile.type == ModContent.ProjectileType(); Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.waterElemental && !modPlayer.allElementals && !modPlayer.waterElementalVanity && !modPlayer.allElementalsVanity) + if (!modPlayer.waterElemental.HasValue && modPlayer.allElementals is null && !modPlayer.waterElementalVanity && !modPlayer.allElementalsVanity) { Projectile.active = false; return; @@ -185,5 +188,29 @@ namespace CalamityMod.Projectiles.Summon } public override bool? CanDamage() => false; + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = TextureAssets.Projectile[Type].Value; + Rectangle frame = tex.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + SpriteEffects sp = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + var cplayer = Main.player[Projectile.owner].Calamity(); + + if ((cplayer.waterElemental.HasValue && !cplayer.waterElemental.Value) || (cplayer.allElementals.HasValue && !cplayer.allElementals.Value)) + { + Vector3 hsl = Main.rgbToHsl(Color.CornflowerBlue); + CalamityUtils.EnterShaderRegion(Main.spriteBatch); + GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(1f); + GameShaders.Misc["CalamityMod:BasicTint"].UseSaturation(0.25f); + GameShaders.Misc["CalamityMod:BasicTint"].UseColor(Main.hslToRgb(1 - hsl.X, hsl.Y, hsl.Z)); + GameShaders.Misc["CalamityMod:BasicTint"].Apply(); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, sp); + CalamityUtils.ExitShaderRegion(Main.spriteBatch); + } + else + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, sp); + + return false; + } } } diff --git a/Projectiles/Summon/WulfrumDroid.cs b/Projectiles/Summon/WulfrumDroid.cs index 18a1aac1ad..1c7d7480c1 100644 --- a/Projectiles/Summon/WulfrumDroid.cs +++ b/Projectiles/Summon/WulfrumDroid.cs @@ -247,7 +247,7 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.soundDelay > 0) Projectile.soundDelay--; - else + else if (!CalamityClientConfig.Instance.MisophoniaSupport) { SoundEngine.PlaySound(RandomChirpSound with { Volume = RandomChirpSound.Volume * Main.rand.NextFloat(0.5f, 1f) }, Projectile.Center); Projectile.soundDelay = NewSoundDelay; diff --git a/Projectiles/Typeless/AscendantAura.cs b/Projectiles/Typeless/AscendantAura.cs index 36a18030fa..1d3b8c7af3 100644 --- a/Projectiles/Typeless/AscendantAura.cs +++ b/Projectiles/Typeless/AscendantAura.cs @@ -63,25 +63,6 @@ namespace CalamityMod.Projectiles.Typeless // Stay on the player's head Projectile.Center = (Owner.MountedCenter + new Vector2(0, -45)); - Vector2 spawnPos = Projectile.Center + Main.rand.NextVector2Circular(5, 5); - int lifetime = Main.rand.Next(3, 6); - float scale = Main.rand.NextFloat(0.5f, 0.9f); - Color color = Main.rand.NextBool(3) ? Color.LightGreen : Color.Khaki; - /* - SparkParticle spark1 = new SparkParticle(spawnPos, new Vector2(Main.rand.NextFloat(7, 12), Main.rand.NextFloat(7, 12)), false, lifetime, scale, color); - GeneralParticleHandler.SpawnParticle(spark1); - SparkParticle spark2 = new SparkParticle(spawnPos, new Vector2(Main.rand.NextFloat(-7, -12), Main.rand.NextFloat(7, 12)), false, lifetime, scale, color); - GeneralParticleHandler.SpawnParticle(spark2); - SparkParticle spark3 = new SparkParticle(spawnPos, new Vector2(Main.rand.NextFloat(7, 12), Main.rand.NextFloat(-7, -12)), false, lifetime, scale, color); - GeneralParticleHandler.SpawnParticle(spark3); - SparkParticle spark4 = new SparkParticle(spawnPos, new Vector2(Main.rand.NextFloat(-7, -12), Main.rand.NextFloat(-7, -12)), false, lifetime, scale, color); - GeneralParticleHandler.SpawnParticle(spark4); - SparkParticle spark5 = new SparkParticle(Projectile.Center + new Vector2(20, 0), new Vector2(Main.rand.NextFloat(7, 12), 0), false, lifetime, scale, color); - GeneralParticleHandler.SpawnParticle(spark5); - SparkParticle spark6 = new SparkParticle(Projectile.Center + new Vector2(-20, 0), new Vector2(Main.rand.NextFloat(-7, -12), 0), false, lifetime, scale - 0.3f, color); - GeneralParticleHandler.SpawnParticle(spark6); - */ - // Emit some light Vector3 Light = new Vector3(0.251f, 0.255f, 0.219f); Lighting.AddLight(Projectile.Center, Light * 5); diff --git a/Projectiles/Typeless/CursorProj.cs b/Projectiles/Typeless/CursorProj.cs index 7caeee006b..0e138a1a4c 100644 --- a/Projectiles/Typeless/CursorProj.cs +++ b/Projectiles/Typeless/CursorProj.cs @@ -124,55 +124,55 @@ namespace CalamityMod.Projectiles.Typeless } if (Main.rand.NextBool(12)) { - Vector2 rotateFirstDust = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)Projectile.velocity.ToRotation(), default); - int crystalDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, crystalDustType, 0f, 0f, 160, default, 1f); - Main.dust[crystalDust].velocity *= 0.1f; - Main.dust[crystalDust].position = Projectile.Center + rotateFirstDust * (float)Projectile.width / 2f + Projectile.velocity * 2f; - Main.dust[crystalDust].fadeIn = 0.9f; + Vector2 rotateFirstDust = -Vector2.UnitX.RotatedByRandom(MathHelper.Pi / 16f).RotatedBy(Projectile.velocity.ToRotation()); + Dust crystalDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, crystalDustType, 0f, 0f, 160, default, 1f); + crystalDust.velocity *= 0.1f; + crystalDust.position = Projectile.Center + rotateFirstDust * Projectile.width / 2f + Projectile.velocity * 2f; + crystalDust.fadeIn = 0.9f; } if (Main.rand.NextBool(18)) { - Vector2 rotateSecondDust = -Vector2.UnitX.RotatedByRandom(0.39269909262657166).RotatedBy((double)Projectile.velocity.ToRotation(), default); - int greenDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.TerraBlade, 0f, 0f, 155, default, 0.8f); - Main.dust[greenDust].velocity *= 0.3f; - Main.dust[greenDust].position = Projectile.Center + rotateSecondDust * (float)Projectile.width / 2f; + Vector2 rotateSecondDust = -Vector2.UnitX.RotatedByRandom(MathHelper.Pi / 8f).RotatedBy(Projectile.velocity.ToRotation()); + Dust greenDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.TerraBlade, 0f, 0f, 155, default, 0.8f); + greenDust.velocity *= 0.3f; + greenDust.position = Projectile.Center + rotateSecondDust * Projectile.width / 2f; if (Main.rand.NextBool()) { - Main.dust[greenDust].fadeIn = 1.4f; + greenDust.fadeIn = 1.4f; } } if (Main.rand.NextBool(8)) { - Vector2 rotateThirdDust = -Vector2.UnitX.RotatedByRandom(0.78539818525314331).RotatedBy((double)Projectile.velocity.ToRotation(), default); - int randomDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 0, default, 1f); - Main.dust[randomDust].velocity *= 0.3f; - Main.dust[randomDust].noGravity = true; - Main.dust[randomDust].position = Projectile.Center + rotateThirdDust * (float)Projectile.width / 2f; + Vector2 rotateThirdDust = -Vector2.UnitX.RotatedByRandom(MathHelper.PiOver4).RotatedBy(Projectile.velocity.ToRotation()); + Dust randomDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 0, default, 1f); + randomDust.velocity *= 0.3f; + randomDust.noGravity = true; + randomDust.position = Projectile.Center + rotateThirdDust * Projectile.width / 2f; if (Main.rand.NextBool()) { - Main.dust[randomDust].fadeIn = 1.4f; + randomDust.fadeIn = 1.4f; } } if (Main.rand.NextBool(6)) { - Vector2 value13 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)Projectile.velocity.ToRotation(), default); - int crystalDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, crystalDustType, 0f, 0f, 100, default, 1f); - Main.dust[crystalDust2].velocity *= 0.3f; - Main.dust[crystalDust2].position = Projectile.Center + value13 * (float)Projectile.width / 2f; - Main.dust[crystalDust2].fadeIn = 1.2f; - Main.dust[crystalDust2].scale = 1.5f; - Main.dust[crystalDust2].noGravity = true; + Vector2 value13 = -Vector2.UnitX.RotatedByRandom(MathHelper.Pi / 16f).RotatedBy(Projectile.velocity.ToRotation()); + Dust crystalDust2 = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, crystalDustType, 0f, 0f, 100, default, 1f); + crystalDust2.velocity *= 0.3f; + crystalDust2.position = Projectile.Center + value13 * Projectile.width / 2f; + crystalDust2.fadeIn = 1.2f; + crystalDust2.scale = 1.5f; + crystalDust2.noGravity = true; } Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.2f / 255f, (255 - Projectile.alpha) * 0.2f / 255f, (255 - Projectile.alpha) * 0.2f / 255f); - int paleDust = Dust.NewDust(Projectile.position, Projectile.width - 28, Projectile.height - 28, DustID.BoneTorch, 0f, 0f, 100, default, 0.8f); - Main.dust[paleDust].velocity *= 0.1f; - Main.dust[paleDust].velocity += Projectile.velocity * 0.5f; - Main.dust[paleDust].noGravity = true; + Dust paleDust = Dust.NewDustDirect(Projectile.position, Projectile.width - 28, Projectile.height - 28, DustID.BoneTorch, 0f, 0f, 100, default, 0.8f); + paleDust.velocity *= 0.1f; + paleDust.velocity += Projectile.velocity * 0.5f; + paleDust.noGravity = true; if (Main.rand.NextBool(12)) { - int shinyDust = Dust.NewDust(Projectile.position, Projectile.width - 32, Projectile.height - 32, DustID.Teleporter, 0f, 0f, 100, default, 1f); - Main.dust[shinyDust].velocity *= 0.25f; - Main.dust[shinyDust].velocity += Projectile.velocity * 0.5f; + Dust shinyDust = Dust.NewDustDirect(Projectile.position, Projectile.width - 32, Projectile.height - 32, DustID.Teleporter, 0f, 0f, 100, default, 1f); + shinyDust.velocity *= 0.25f; + shinyDust.velocity += Projectile.velocity * 0.5f; } } @@ -182,9 +182,9 @@ namespace CalamityMod.Projectiles.Typeless return false; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 600); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 600); public override void OnKill(int timeLeft) { diff --git a/Projectiles/Typeless/CursorProjSplit.cs b/Projectiles/Typeless/CursorProjSplit.cs index 4d32133339..1d8ec32ba9 100644 --- a/Projectiles/Typeless/CursorProjSplit.cs +++ b/Projectiles/Typeless/CursorProjSplit.cs @@ -126,55 +126,55 @@ namespace CalamityMod.Projectiles.Typeless } if (Main.rand.NextBool(12)) { - Vector2 rotateFirstDust = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)Projectile.velocity.ToRotation(), default); - int crystalDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, crystalDustType, 0f, 0f, 100, default, 1f); - Main.dust[crystalDust].velocity *= 0.1f; - Main.dust[crystalDust].position = Projectile.Center + rotateFirstDust * (float)Projectile.width / 2f + Projectile.velocity * 2f; - Main.dust[crystalDust].fadeIn = 0.9f; + Vector2 rotateFirstDust = -Vector2.UnitX.RotatedByRandom(MathHelper.Pi / 16f).RotatedBy((double)Projectile.velocity.ToRotation(), default); + Dust crystalDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, crystalDustType, 0f, 0f, 100, default, 1f); + crystalDust.velocity *= 0.1f; + crystalDust.position = Projectile.Center + rotateFirstDust * Projectile.width / 2f + Projectile.velocity * 2f; + crystalDust.fadeIn = 0.9f; } if (Main.rand.NextBool(18)) { - Vector2 rotateSecondDust = -Vector2.UnitX.RotatedByRandom(0.39269909262657166).RotatedBy((double)Projectile.velocity.ToRotation(), default); - int greenDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.TerraBlade, 0f, 0f, 155, default, 0.8f); - Main.dust[greenDust].velocity *= 0.3f; - Main.dust[greenDust].position = Projectile.Center + rotateSecondDust * (float)Projectile.width / 2f; + Vector2 rotateSecondDust = -Vector2.UnitX.RotatedByRandom(MathHelper.Pi / 8f).RotatedBy(Projectile.velocity.ToRotation()); + Dust greenDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.TerraBlade, 0f, 0f, 155, default, 0.8f); + greenDust.velocity *= 0.3f; + greenDust.position = Projectile.Center + rotateSecondDust * Projectile.width / 2f; if (Main.rand.NextBool()) { - Main.dust[greenDust].fadeIn = 1.4f; + greenDust.fadeIn = 1.4f; } } if (Main.rand.NextBool(8)) { - Vector2 rotateThirdDust = -Vector2.UnitX.RotatedByRandom(0.78539818525314331).RotatedBy((double)Projectile.velocity.ToRotation(), default); - int randomDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 0, default, 1f); - Main.dust[randomDust].velocity *= 0.3f; - Main.dust[randomDust].noGravity = true; - Main.dust[randomDust].position = Projectile.Center + rotateThirdDust * (float)Projectile.width / 2f; + Vector2 rotateThirdDust = -Vector2.UnitX.RotatedByRandom(MathHelper.PiOver4).RotatedBy(Projectile.velocity.ToRotation()); + Dust randomDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 0, default, 1f); + randomDust.velocity *= 0.3f; + randomDust.noGravity = true; + randomDust.position = Projectile.Center + rotateThirdDust * Projectile.width / 2f; if (Main.rand.NextBool()) { - Main.dust[randomDust].fadeIn = 1.4f; + randomDust.fadeIn = 1.4f; } } if (Main.rand.NextBool(6)) { - Vector2 value13 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)Projectile.velocity.ToRotation(), default); - int crystalDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, crystalDustType, 0f, 0f, 100, default, 1f); - Main.dust[crystalDust2].velocity *= 0.3f; - Main.dust[crystalDust2].position = Projectile.Center + value13 * (float)Projectile.width / 2f; - Main.dust[crystalDust2].fadeIn = 1.2f; - Main.dust[crystalDust2].scale = 1.5f; - Main.dust[crystalDust2].noGravity = true; + Vector2 value13 = -Vector2.UnitX.RotatedByRandom(MathHelper.Pi / 16f).RotatedBy(Projectile.velocity.ToRotation()); + Dust crystalDust2 = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, crystalDustType, 0f, 0f, 100, default, 1f); + crystalDust2.velocity *= 0.3f; + crystalDust2.position = Projectile.Center + value13 * Projectile.width / 2f; + crystalDust2.fadeIn = 1.2f; + crystalDust2.scale = 1.5f; + crystalDust2.noGravity = true; } Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.2f / 255f, (255 - Projectile.alpha) * 0.2f / 255f, (255 - Projectile.alpha) * 0.2f / 255f); - int paleDust = Dust.NewDust(Projectile.position, Projectile.width - 28, Projectile.height - 28, DustID.BoneTorch, 0f, 0f, 100, default, 0.8f); - Main.dust[paleDust].velocity *= 0.1f; - Main.dust[paleDust].velocity += Projectile.velocity * 0.5f; - Main.dust[paleDust].noGravity = true; + Dust paleDust = Dust.NewDustDirect(Projectile.position, Projectile.width - 28, Projectile.height - 28, DustID.BoneTorch, 0f, 0f, 100, default, 0.8f); + paleDust.velocity *= 0.1f; + paleDust.velocity += Projectile.velocity * 0.5f; + paleDust.noGravity = true; if (Main.rand.NextBool(12)) { - int shinyDust = Dust.NewDust(Projectile.position, Projectile.width - 32, Projectile.height - 32, DustID.Teleporter, 0f, 0f, 100, default, 1f); - Main.dust[shinyDust].velocity *= 0.25f; - Main.dust[shinyDust].velocity += Projectile.velocity * 0.5f; + Dust shinyDust = Dust.NewDustDirect(Projectile.position, Projectile.width - 32, Projectile.height - 32, DustID.Teleporter, 0f, 0f, 100, default, 1f); + shinyDust.velocity *= 0.25f; + shinyDust.velocity += Projectile.velocity * 0.5f; } } @@ -184,9 +184,9 @@ namespace CalamityMod.Projectiles.Typeless return false; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 60); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 300); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 60); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 300); public override bool? CanHitNPC(NPC target) { @@ -213,23 +213,22 @@ namespace CalamityMod.Projectiles.Typeless int randomDust = 187; float crystalDust2 = 1.2f; - Vector2 dustRotate = (Projectile.rotation - 1.57079637f).ToRotationVector2(); - Vector2 dustVel = dustRotate * Projectile.velocity.Length() * (float)Projectile.MaxUpdates; + Vector2 dustRotate = (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2(); + Vector2 dustVel = dustRotate * Projectile.velocity.Length() * Projectile.MaxUpdates; SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); int dustCount; for (int j = 0; j < 20; j = dustCount + 1) { - int superRandomDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, otherDustType, 0f, 0f, 200, default, crystalDust2); - Dust dust = Main.dust[superRandomDust]; - dust.position = Projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)Projectile.width / 2f; + Dust dust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, otherDustType, 0f, 0f, 200, default, crystalDust2); + dust.position = Projectile.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat() * Projectile.width / 2f; dust.noGravity = true; dust.velocity.Y -= 6f; dust.velocity *= 3f; dust.velocity += dustVel * Main.rand.NextFloat(); - superRandomDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, default, 0.6f); - dust.position = Projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)Projectile.width / 2f; + dust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, default, 0.6f); + dust.position = Projectile.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat() * Projectile.width / 2f; dust.velocity.Y -= 6f; dust.velocity *= 2f; dust.noGravity = true; @@ -241,9 +240,8 @@ namespace CalamityMod.Projectiles.Typeless for (int k = 0; k < 10; k = dustCount + 1) { - int palestDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.BoneTorch, 0f, 0f, 0, default, 1.5f); - Main.dust[palestDust].position = Projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)Projectile.velocity.ToRotation(), default) * (float)Projectile.width / 3f; - Dust dust = Main.dust[palestDust]; + Dust dust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.BoneTorch, 0f, 0f, 0, default, 1.5f); + dust.position = Projectile.Center + Vector2.UnitX.RotatedByRandom(MathHelper.Pi).RotatedBy(Projectile.velocity.ToRotation()) * Projectile.width / 3f; dust.noGravity = true; dust.velocity.Y -= 6f; dust.velocity *= 0.5f; diff --git a/Projectiles/Typeless/DryadsTearBurst.cs b/Projectiles/Typeless/DryadsTearBurst.cs new file mode 100644 index 0000000000..02b0294c1e --- /dev/null +++ b/Projectiles/Typeless/DryadsTearBurst.cs @@ -0,0 +1,35 @@ +using System; +using System.IO; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class DryadsTearBurst : BasicBurst, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Ranged; + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + pushVelocity = Utils.DirectionTo(Projectile.Center, target.Center); + float minMult = Projectile.ai[1]; + int hitsToMinMult = (int)Projectile.ai[2]; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + modifiers.SourceDamage *= damageMult; + + if (Projectile.localAI[0] == 0) + modifiers.DisableCrit(); + else + modifiers.SetCrit(); + + if (customKnockback != 0) + target.MoveNPC(pushVelocity, customKnockback, hasStongDisplacement, Main.player[Projectile.owner]); + } + } +} diff --git a/Projectiles/Typeless/Elumphant.cs b/Projectiles/Typeless/Elumphant.cs index 8a5eb8ccd6..3e2d9c487a 100644 --- a/Projectiles/Typeless/Elumphant.cs +++ b/Projectiles/Typeless/Elumphant.cs @@ -123,31 +123,21 @@ namespace CalamityMod.Projectiles.Typeless } public void SetStats() { - maxTargetingDistance = (float)(500 * GetPower(0.3f)); - attackTimeAdjusted = (int)(FrozenCube.baseAttackSpeed / (GetPower(0.5f))); - damageScaling = (float)GetPower(1.35f, (1 + frozenCubePower * 0.2f)); - cooldownTime = (int)(FrozenCube.baseAttackCooldown / GetPower(0.5f)); + maxTargetingDistance = (float)(400 * (1+frozenCubePower)); + attackTimeAdjusted = (int)(FrozenCube.baseAttackSpeed/(1+frozenCubePower)); + damageScaling = 1+frozenCubePower; + cooldownTime = (int)(FrozenCube.baseAttackCooldown / (1 + frozenCubePower)); } public void SetElumphantPower() { int usedDefense = Owner.Calamity().frozenCubeUsedDefense; if (time == 0) // Show the player how much defense is being used CombatText.NewText(Projectile.Hitbox, color2, -usedDefense, false, true); - - // Defense investment softcaps at 110 (aka player has 330 defense) - float defenseCap = 110; - if (usedDefense > defenseCap) - { - float ratio = usedDefense / defenseCap; - usedDefense = (int)(defenseCap * MathF.Pow(ratio, 0.15f)); - } - - frozenCubePower = usedDefense * 0.05f; // 1 point of defense = 5% effectiveness - float power = (float)(GetPower(0.8f, (1 + frozenCubePower * 0.2f)) - 1); - Owner.Calamity().frozenCubeDebuffBoost = power; - Owner.Calamity().frozenCubeElumphantBoost = damageScaling - 1; - Owner.Calamity().ColdDebuffMultiplier += power; // Boost cold debuff damage + frozenCubePower = usedDefense * 0.04f; + Owner.Calamity().frozenCubeDebuffBoost = frozenCubePower; + Owner.Calamity().frozenCubeElumphantBoost = damageScaling; + Owner.Calamity().ColdDebuffMultiplier += frozenCubePower; } public double GetPower(float efficiency, float intenseScaling = 1) { @@ -288,7 +278,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.frame = 2; if (recoiling) { - attackTimeAdjusted = (int)(FrozenCube.baseAttackSpeed / GetPower(0.5f)); + attackTimeAdjusted = (int)(FrozenCube.baseAttackSpeed / (GetPower(0.5f))); if (Projectile.numHits > 1) attackTimer = attackTimeAdjusted; Projectile.numHits = 1; @@ -394,7 +384,7 @@ namespace CalamityMod.Projectiles.Typeless Vector2 shootPosition = Projectile.Center + shootVel * 5 * Projectile.scale; Projectile mist = Projectile.NewProjectileDirect(Owner.GetSource_FromThis(), shootPosition, (shootVel * shootPosition.Distance(targeted.Center) / 25) * Main.rand.NextFloat(0.9f, 1.1f), projectile, damage, 0, Owner.whoAmI, 0, Owner.ownedProjectileCounts[projectile] % 3, (float)GetPower(1)); } - mistShootTimer += (float)(0.35f * GetPower(0.25f)); + mistShootTimer += (float)(0.2f * GetPower(0.25f)); if (mistShootTimer >= 2f) mistShootTimer = 0; } @@ -444,7 +434,7 @@ namespace CalamityMod.Projectiles.Typeless if (Projectile.soundDelay == cryStart) // Sound { verticalSquash = 0.3f; - if (vis) + if (vis && !CalamityClientConfig.Instance.MisophoniaSupport) soundSlot = SoundEngine.PlaySound(FrozenCube.cry with { Pitch = Main.rand.NextFloat(-0.2f, 0.2f) }, Projectile.Center); } trunkRotation = Utils.AngleLerp(trunkRotation, maxTrunkRot * Projectile.spriteDirection, 0.025f); @@ -482,16 +472,20 @@ namespace CalamityMod.Projectiles.Typeless if (vis && Projectile.Opacity < 1) ScaleOpacity(1); Projectile.timeLeft++; - SetStats(); GetColor(); - SetElumphantPower(); ManageSquash(); + + if (!Owner.Calamity().frozenCubeVanity) + { + SetStats(); + SetElumphantPower(); + if (targeted != null && (targeted.life <= 0 || !targeted.active || !targeted.CanBeChasedBy(Projectile))) + GetTarget(false); + } + if (SoundEngine.TryGetActiveSound(soundSlot, out var sound) && sound.IsPlaying) sound.Position = Projectile.Center; - if (targeted != null && (targeted.life <= 0 || !targeted.active || !targeted.CanBeChasedBy(Projectile))) - GetTarget(false); - float sine = MathF.Sin(time * 0.04f); float sine2 = MathF.Sin(time * 0.08f); float sine3 = MathF.Sin(time * 0.1f); @@ -517,7 +511,12 @@ namespace CalamityMod.Projectiles.Typeless else { Projectile.Center = goalPosition; - if (targeted == null) + if (Owner.Calamity().frozenCubeVanity) + { + targeted = null; + attackTimer = 0; + } + else if (targeted == null) GetTarget(false); if (attackTimer > cooldownTime && targeted != null) // Mist Attack @@ -622,7 +621,7 @@ namespace CalamityMod.Projectiles.Typeless lastProjPos = Projectile.Center; - if (!Owner.Calamity().frozenCube) + if (!Owner.Calamity().frozenCube && !Owner.Calamity().frozenCubeVanity) { if (SoundEngine.TryGetActiveSound(soundSlot, out var sound2) && sound2.IsPlaying) sound2?.Stop(); @@ -774,5 +773,10 @@ namespace CalamityMod.Projectiles.Typeless // These extra frames before the hit allow for a bit of "hitstop" on the jump attack return (dashing && attackTimer >= attackTimeAdjusted + 3 && target == targeted) ? null : false; } + + public override bool? CanCutTiles() + { + return false; + } } } diff --git a/Projectiles/Typeless/Pigion.cs b/Projectiles/Typeless/Pigion.cs index 50ccb93c4f..f2863be666 100644 --- a/Projectiles/Typeless/Pigion.cs +++ b/Projectiles/Typeless/Pigion.cs @@ -41,13 +41,16 @@ namespace CalamityMod.Projectiles.Typeless Projectile.width = 42; Projectile.height = 28; Projectile.friendly = true; - Projectile.DamageType = AverageDamageClass.Instance; + highestSpeed = 18; + //Allow it to proc all class on hit effects. Pigion is spawned using a fixed damage, and applies best-class damage when it spawns the burst + Projectile.DamageType = AllClassDamageClass.Instance; Projectile.ignoreWater = true; Projectile.tileCollide = true; Projectile.penetrate = -1; Projectile.timeLeft = 600; Projectile.extraUpdates = 1; Projectile.usesLocalNPCImmunity = true; + Projectile.minion = true; //note: costs 0 minion slots. This allows it to benefit from "minion" effects } public void Frames() { @@ -295,10 +298,11 @@ namespace CalamityMod.Projectiles.Typeless float blastSize = 100; float minMultiplier = 0.1f; int hitsToMinMult = 4; - Projectile blast = Projectile.NewProjectileDirect(Owner.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage*pigNum), -15, Owner.whoAmI, blastSize, minMultiplier, hitsToMinMult); + Projectile blast = Projectile.NewProjectileDirect(Owner.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Owner.GetBestClassDamage().ApplyTo(Projectile.originalDamage*pigNum)), -15, Owner.whoAmI, blastSize, minMultiplier, hitsToMinMult); blast.timeLeft = 5; - blast.DamageType = AverageDamageClass.Instance; + blast.DamageType = AllClassDamageClass.Instance; //Proc effects for all classes, but has no effect on the dmg itself blast.CritChance = 100; + blast.minion = true; //note: costs 0 minion slots. This allows it to benefit from "minion" effects } Owner.SetScreenshake(3); diff --git a/Rarities/BurnishedAuric.cs b/Rarities/BurnishedAuric.cs index dfbc5c0a2c..add6120cf8 100644 --- a/Rarities/BurnishedAuric.cs +++ b/Rarities/BurnishedAuric.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Rarities { public class BurnishedAuric : ModRarity { - // Burnished Auric is Rarity 15 (Once was known as Violet) + // Burnished Auric is the rarity for Post-Yharon gear + // It is a unique rarity and does not have its items rarity change on reforge. public override Color RarityColor => TextClr * 2f; public static float MaxY = 4.5f; diff --git a/Rarities/CalamityRed.cs b/Rarities/CalamityRed.cs index 9ea280216b..8b9d121ac2 100644 --- a/Rarities/CalamityRed.cs +++ b/Rarities/CalamityRed.cs @@ -12,7 +12,8 @@ namespace CalamityMod.Rarities { public class CalamityRed : ModRarity { - // Calamity Red is Rarity 17 + // Calamity Red is the rarity for Post-SCal gear. It is considered the "same tier" as Exotic Rainbow for matters of sell value. + // It is a unique rarity and does not have its items rarity change on reforge. public override Color RarityColor => TextClr * 2f; public static float MaxY = 4.5f; diff --git a/Rarities/ColorTool.cs b/Rarities/ColorTool.cs index 45eb3a0820..4a5b029452 100644 --- a/Rarities/ColorTool.cs +++ b/Rarities/ColorTool.cs @@ -10,6 +10,7 @@ namespace CalamityMod.Rarities public static int RarityBurnishedAuric => ModContent.GetInstance().Type; public static int RarityCalamityRed => ModContent.GetInstance().Type; public static int RarityExoticRainbow => ModContent.GetInstance().Type; + public static int RarityCustomDev => ModContent.GetInstance().Type; public override bool PreDrawTooltipLine(Item Item, DrawableTooltipLine line, ref int yOffset) @@ -37,6 +38,11 @@ namespace CalamityMod.Rarities ExoticRainbow.Draw(Item, line); return false; } + if (Item.rare == RarityCustomDev) + { + HotPink.Draw(Item, line); + return false; + } } return true; } diff --git a/Rarities/CosmicPurple.cs b/Rarities/CosmicPurple.cs index 1c3e382f4a..d52a15a49c 100644 --- a/Rarities/CosmicPurple.cs +++ b/Rarities/CosmicPurple.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Rarities { public class CosmicPurple : ModRarity { - // Cosmic Purple is Rarity 14 (once was known as Dark Blue) + // Cosmic Purple is the rarity for Post-DoG gear. + // It is a unique rarity and does not have its items rarity change on reforge. public override Color RarityColor => TextClr * 2f; public static float MaxY = 4.5f; diff --git a/Rarities/DarkOrange.cs b/Rarities/DarkOrange.cs index 30959e183a..6526cfa05d 100644 --- a/Rarities/DarkOrange.cs +++ b/Rarities/DarkOrange.cs @@ -3,7 +3,9 @@ using Terraria.ModLoader; namespace CalamityMod.Rarities { - // Draedon's Arsenal "Rust" / "Bronze" rarity + // Dark Orange is used for Draedon's Arsenal items. + // It is a unique rarity and does not have its items rarity change on reforge. + public class DarkOrange : ModRarity { public override Color RarityColor => new Color(204, 71, 35); diff --git a/Rarities/ExoticRainbow.cs b/Rarities/ExoticRainbow.cs index cf065cc707..af47d1a2f2 100644 --- a/Rarities/ExoticRainbow.cs +++ b/Rarities/ExoticRainbow.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Rarities { public class ExoticRainbow : ModRarity { - // Exotic Rainbow is Rarity 17 (same as Calamity Red) + // Exotic Rainbow is the rarity for Post-SCal gear. It is considered the "same tier" as Calamity Red for matters of sell value. + // It is a custom rarity and does not have its items rarity change on reforge. public override Color RarityColor => TextClr * 2f; public static float MaxY = 4.5f; diff --git a/Rarities/HotPink.cs b/Rarities/HotPink.cs index 38dfd4abf9..1f915e2bae 100644 --- a/Rarities/HotPink.cs +++ b/Rarities/HotPink.cs @@ -1,21 +1,102 @@ -using Microsoft.Xna.Framework; +using System; +using System.Collections.Generic; +using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories.Wings; +using CalamityMod.Items.Armor.Demonshade; +using CalamityMod.Items.Tools; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Graphics; +using Terraria; +using Terraria.GameContent; +using Terraria.ID; using Terraria.ModLoader; +using Terraria.UI.Chat; namespace CalamityMod.Rarities { public class HotPink : ModRarity { - // Hot Pink is Rarity 16 - public override Color RarityColor => new Color(255, 0, 255); + // Hot Pink is used for developer items. It Has a system built in for custom rarity effects. + // It is a unique rarity and does not have its items rarity change on reforge. + public override Color RarityColor => TextColor; + public static Color TextColor => new Color(255, 0, 255); - // Hot Pink cannot turn into other rarities via prefix - /*public override int GetPrefixedRarity(int offset, float valueMult) => offset switch + public static Dictionary> CustomRarities = new() { - -2 => ModContent.RarityType(), - -1 => ModContent.RarityType(), - 1 => ModContent.RarityType(), - 2 => ModContent.RarityType(), - _ => Type, - };*/ + { ModContent.ItemType(), text => new TiredTailTextEffects(text) } + }; + public static Dictionary> CustomColors = new() + { + { ModContent.ItemType(), AngelicAlliance.RarityColor }, + { ModContent.ItemType(), Contagion.RarityColor }, + { ModContent.ItemType(), CrystylCrusher.RarityColor }, + { ModContent.ItemType(), TheDanceofLight.GetSyncedLightColor }, + { ModContent.ItemType(), DemonshadeHelm.DemonshadeRarityColor }, + { ModContent.ItemType(), DemonshadeHelm.DemonshadeRarityColor }, + { ModContent.ItemType(), DemonshadeHelm.DemonshadeRarityColor }, + { ModContent.ItemType(), DraconicDestruction.RarityColor }, + { ModContent.ItemType(), Earth.RarityColor }, + { ModContent.ItemType(), Endogenesis.RarityColor }, + { ModContent.ItemType(), Eternity.RarityColor }, + { ModContent.ItemType(), FlamsteedRing.RarityColor }, + { ModContent.ItemType(), IllustriousKnives.RarityColor }, + { ModContent.ItemType(), NanoblackReaper.RarityColor }, + { ModContent.ItemType(), ShatteredCommunity.GetRarityColor }, // Yes, this reuses Shattered Community's color + { ModContent.ItemType(), ProfanedSoulCrystal.RarityColor }, + { ModContent.ItemType(), RedSun.RarityColor }, + { ModContent.ItemType(), ScarletDevil.RarityColor }, + { ModContent.ItemType(), ShatteredCommunity.GetRarityColor }, + { ModContent.ItemType(), SomaPrime.RarityColor }, + { ModContent.ItemType(), StaffofBlushie.RarityColor }, + { ModContent.ItemType(), Svantechnical.RarityColor }, + { ModContent.ItemType(), Sylvestaff.RarityColor }, + { ModContent.ItemType(), TemporalUmbrella.RarityColor }, + { ModContent.ItemType(), TriactisTruePaladinianMageHammerofMight.RarityColor } + }; + + public static void Draw(Item Item, SpriteBatch spriteBatch, string text, int X, int Y, Color textColor, Color lightColor, float rotation, + Vector2 origin, Vector2 baseScale, float time, bool renderTextSparkles, DynamicSpriteFont font) + { + if (CustomColors.TryGetValue(Item.type, out var color)) // For items which use a custom item color, give them that custom color. + { + textColor = color.Invoke(); + } + TextSnippet[] snippets = ChatManager.ParseMessage(text, textColor).ToArray(); + + if (CustomRarities.ContainsKey(Item.type)) // For items in the custom rarity table, give them custom rarity effects. + { + for (int i = 0; i < snippets.Length; i++) + { + TextSnippet textSnippet = snippets[i]; + if (snippets[i].GetType() == typeof(TextSnippet)) + { + snippets[i] = CustomRarities[Item.type].Invoke(textSnippet.Text); + continue; + } + } + } + else + ChatManager.ConvertNormalSnippets(snippets); + + ChatManager.DrawColorCodedString(spriteBatch, font, snippets, new(X, Y), textColor, 0, Vector2.Zero, baseScale, out _, -1, true); + } + + public static void Draw(Item Item, string text, int X, int Y, float rotation, Vector2 origin, Vector2 baseScale, Color? textColor = null, Color? lightColor = null, bool? renderTextSparkles = null) + { + Draw(Item, Main.spriteBatch, text, X, Y, Colors.AlphaDarken(textColor ?? TextColor), lightColor ?? Color.White, rotation, origin, baseScale, Main.GlobalTimeWrappedHourly, + renderTextSparkles ?? CalamityClientConfig.Instance.TextEffects, FontAssets.MouseText.Value); + } + + public static void Draw(Item Item, DrawableTooltipLine line) + { + Draw(Item, line.Text, line.X, line.Y, line.Rotation, line.Origin, line.BaseScale); + } + } } diff --git a/Rarities/PureGreen.cs b/Rarities/PureGreen.cs index 5752ae8335..b48cf7c502 100644 --- a/Rarities/PureGreen.cs +++ b/Rarities/PureGreen.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Rarities { -2 => ItemRarityID.Purple, -1 => ModContent.RarityType(), - _ => Type, // Cannot reach Cosmic Purple or Burnished Auric + _ => Type, // All higher rarities are unique, and so it cannot go up. }; } } diff --git a/Rarities/Turquoise.cs b/Rarities/Turquoise.cs index 27428d0c1a..a0e5eda2b4 100644 --- a/Rarities/Turquoise.cs +++ b/Rarities/Turquoise.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Rarities -2 => ItemRarityID.Red, -1 => ItemRarityID.Purple, 1 => ModContent.RarityType(), - 2 => ModContent.RarityType(), // Cannot reach Cosmic Purple + 2 => ModContent.RarityType(), // All higher rarities are unique, and so it cannot go up past Pure Green _ => Type, }; } diff --git a/Scenes/MusicScenes/ProvidenceMusicScene.cs b/Scenes/MusicScenes/ProvidenceMusicScene.cs index 33b94b0f75..83bad91d2c 100644 --- a/Scenes/MusicScenes/ProvidenceMusicScene.cs +++ b/Scenes/MusicScenes/ProvidenceMusicScene.cs @@ -13,18 +13,19 @@ namespace CalamityMod.Systems public override int NPCType => ModContent.NPCType(); public static int ProvidenceTrack => (int)CalamityMod.Instance.GetMusicFromMusicMod("Providence"); public static int SilenceTrack => MusicLoader.GetMusicSlot(CalamityMod.Instance, "Sounds/Music/Silence"); - public override int? MusicModMusic => ProvidenceSpawnState() < 180f && ProvUtils.StandardAI() ? SilenceTrack : ProvidenceTrack; + public override int? MusicModMusic => ProvidenceSpawnState() < 180f ? SilenceTrack : ProvidenceTrack; public override int VanillaMusic => MusicID.LunarBoss; public override int OtherworldMusic => MusicID.OtherworldlyLunarBoss; public override void SpecialVisuals(Player player, bool isActive) { - if (ProvidenceSpawnState() == 180f && ProvUtils.StandardAI()) + if (ProvidenceSpawnState() == 180f) Main.musicFade[ProvidenceTrack] = 1f; } + public static float ProvidenceSpawnState() { int provIndex = CalamityGlobalNPC.holyBoss; - if (provIndex < 0 || provIndex >= Main.maxNPCs || !Main.npc[provIndex].active) + if (!Main.npc.IndexInRange(provIndex)) return -1f; var prov = Main.npc[provIndex]; diff --git a/Sounds/Item/SoupConsumptionMisophonic.ogg b/Sounds/Item/SoupConsumptionMisophonic.ogg new file mode 100644 index 0000000000..065ddcd00d Binary files /dev/null and b/Sounds/Item/SoupConsumptionMisophonic.ogg differ diff --git a/Systems/Collections/CalamityBuffSets.cs b/Systems/Collections/CalamityBuffSets.cs index d2b5741368..4880709a05 100644 --- a/Systems/Collections/CalamityBuffSets.cs +++ b/Systems/Collections/CalamityBuffSets.cs @@ -1,6 +1,5 @@ using CalamityMod.Buffs; using CalamityMod.Buffs.Alcohol; -using CalamityMod.Buffs.Cooldowns; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.Potions; using CalamityMod.Buffs.StatDebuffs; @@ -108,8 +107,12 @@ namespace CalamityMod.Systems.Collections ); private static DebuffData Alch(int level) => new DebuffData() { AlcoholLevel = level }; + /// + /// Associates a buff type with its unique . This class is used to store information about the buff such as DoT, elemental affliation, and whether or not it is an alcohol.
+ /// Defaults to null, or having no assigned . + ///
public static DebuffData[] DebuffDataset = BuffID.Sets.Factory.CreateNamedSet("DebuffData") - .Description("Stores DebuffData for a particular debuff") + .Description("Associates a buff with its DebuffData, which stores information about that buff.") .RegisterCustomSet(null, BuffID.OnFire, DebuffData.OnFire, BuffID.OnFire3, DebuffData.Hellfire, diff --git a/Systems/Collections/CalamityItemSets.cs b/Systems/Collections/CalamityItemSets.cs index 4b6187dbfd..3f7a5fca7f 100644 --- a/Systems/Collections/CalamityItemSets.cs +++ b/Systems/Collections/CalamityItemSets.cs @@ -14,7 +14,6 @@ using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; -using ReLogic.Reflection; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,7 +33,7 @@ namespace CalamityMod.Systems.Collections public static bool[] WeaponWithToolPowerAffectedBySummonPenalty = Factory.CreateNamedSet("WeaponWithToolPowerAffectedBySummonPenalty") .Description("Makes items with tool power still trigger the summon damage penalty.") .RegisterBoolSet(ItemID.ButchersChainsaw, ItemID.LucyTheAxe, ItemID.Rockfish, ItemType(), ItemType(), ItemType(), - ItemType(), ItemType()); + ItemType(), ItemType(), ItemType()); /// /// If for an item type, manually disables Calamity's summon damage penalty mechanic while that item type is held.
@@ -61,7 +60,7 @@ namespace CalamityMod.Systems.Collections ///
public static bool[] DisablesVeneratedLocketEffect = Factory.CreateNamedSet("DisablesVeneratedLocketEffect") .Description("Prevents this item from triggering Venerated Locket's clone projectiles.") - .RegisterBoolSet(ItemType(), ItemType(), ItemType()); + .RegisterBoolSet(ItemType(), ItemType(), ItemType()); /// /// If for an item type, this item is considered to be a magic gun.
@@ -168,6 +167,16 @@ namespace CalamityMod.Systems.Collections .Description("Labels this item as having Shady Salesman flavor text, making it draw at the top of the tooltip and the actual tooltip being drawn small below it.") .RegisterBoolSet(ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), ItemType()); + ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType()); + + /// + /// If for an item type, this item is an accessory which uses a keybind for an active ability.
+ /// Used for assigning it one of the dedicated keybind slots based on slot order with other accessories that use keybinds.
+ /// Defaults to . + ///
+ public static bool[] HasAccessoryKeybind = Factory.CreateNamedSet("HasAccessoryKeybind") + .Description("Counts this item as having an accessory keybind. Used for assigning which keybind goes to which accessory.") + .RegisterBoolSet(ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), + ItemType(),ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType()); } } diff --git a/Systems/Collections/CalamityNPCSets.cs b/Systems/Collections/CalamityNPCSets.cs index a59adcbdd0..4bcadfb295 100644 --- a/Systems/Collections/CalamityNPCSets.cs +++ b/Systems/Collections/CalamityNPCSets.cs @@ -12,8 +12,10 @@ using CalamityMod.NPCs.CeaselessVoid; using CalamityMod.NPCs.Crabulon; using CalamityMod.NPCs.Crags; using CalamityMod.NPCs.Cryogen; +using CalamityMod.NPCs.Deconstructors; using CalamityMod.NPCs.DesertScourge; using CalamityMod.NPCs.DevourerofGods; +using CalamityMod.NPCs.DraedonLabThings; using CalamityMod.NPCs.ExoMechs.Apollo; using CalamityMod.NPCs.ExoMechs.Ares; using CalamityMod.NPCs.ExoMechs.Artemis; @@ -78,6 +80,15 @@ namespace CalamityMod.Systems.Collections .Description("Labels this NPC as a bound town NPC, to prevent them from taking hostile damage.") .RegisterBoolSet(NPCID.BoundGoblin, NPCID.BoundWizard, NPCID.BoundMechanic, NPCID.SleepingAngler, NPCID.BartenderUnconscious, NPCID.WebbedStylist, NPCID.GolferRescue); + /// + /// If for an NPC type, this NPC will not be targeted by various sources of 'unpredicatable' damage.
+ /// Primarily used for NPCs which summon bosses when killed.
+ /// Defaults to . + ///
+ public static bool[] ProtectedHostileNPC = Factory.CreateNamedSet("ProtectedHostileNPC") + .Description("Prevents this NPC from being targeted by various sources of 'unpredictable' damage.") + .RegisterBoolSet(NPCID.CultistArcherBlue, NPCID.CultistDevote, NPCType(), NPCType(), NPCType()); + /// /// If for an NPC type, then that NPC will not provide increased Rage generation despite being considered a boss.
/// Primarily used by worm boss body and tail segments to prevent Rage being extraordinarily easy to get.
@@ -147,13 +158,12 @@ namespace CalamityMod.Systems.Collections NPCID.ZombieElfGirl, NPCID.BloodEelHead, NPCID.GoblinShark, NPCID.EyeballFlyingFish, NPCID.ZombieMerman); /// - /// If for an NPC type, then that NPC is a post-Plantera Dungeon enemy. This causes two separate changes to the enemy.
- /// First, it grants them a 20% chance to drop Ectoplasm upon death.
- /// Second, it multiplies their max health by 2.5x and increases their damage by a flat 30 if Moon Lord has been defeated.
+ /// If for an NPC type, then that NPC is a post-Plantera Dungeon enemy.
+ /// This will multiply their max health by 2.5x and increase their damage by a flat 30 if Moon Lord has been defeated.
/// Defaults to . ///
public static bool[] IsBuffedDungeonEnemy = Factory.CreateNamedSet("IsBuffedDungeonEnemy") - .Description("Makes this NPC directly drop Ectoplasm on death, and buffs its health and damage after defeating Moon Lord.") + .Description("Makes this Dungeon enemy have buffed health and damage after defeating Moon Lord.") .RegisterBoolSet(NPCID.SkeletonSniper, NPCID.TacticalSkeleton, NPCID.SkeletonCommando, NPCID.Paladin, NPCID.GiantCursedSkull, NPCID.BoneLee, NPCID.DiabolistWhite, NPCID.DiabolistRed, NPCID.NecromancerArmored, NPCID.Necromancer, NPCID.RaggedCasterOpenCoat, NPCID.RaggedCaster, NPCID.HellArmoredBonesSword, NPCID.HellArmoredBonesMace, NPCID.HellArmoredBonesSpikeShield, NPCID.HellArmoredBones, NPCID.BlueArmoredBonesSword, NPCID.BlueArmoredBonesNoPants, NPCID.BlueArmoredBonesMace, NPCID.BlueArmoredBones, @@ -218,7 +228,8 @@ namespace CalamityMod.Systems.Collections NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType()); /// - /// If for an NPC type, or will be called on this NPC even if is set. + /// If for an NPC type, or will be called on this NPC, even if is set.
+ /// Defaults to . ///
public static bool[] DoCheckDeadRegardlessRealLife = Factory.CreateNamedSet("DoCheckDeadRegardlessRealLife") .Description("Makes this NPC always call CheckDead, even if it sets realLife.") @@ -233,10 +244,12 @@ namespace CalamityMod.Systems.Collections .RegisterBoolSet(NPCID.TargetDummy, NPCType()); /// - /// The intended kill times of Calamity bosses, in frames + /// Associates an NPC type with its intended boss kill time, in frames.
+ /// Used for calculating enraged Providence's RDR and Yharon's bullet hell self-damage, as well as controlling making an NPC apply Boss Effects.
+ /// Defaults to 0, meaning the NPC has no defined kill time. ///
public static int[] BossKillTimes = Factory.CreateNamedSet("BossKillTimes") - .Description("The intended kill times of Calamity bosses, in frames") + .Description("Defines this NPC's intended boss kill time, in frames.") .RegisterIntSet(0, NPCID.KingSlime, 5400, // 1:30 (90 seconds) NPCID.EyeofCthulhu, 5400, // 1:30 (90 seconds) @@ -326,6 +339,35 @@ namespace CalamityMod.Systems.Collections NPCType(), 18000 // 5:00 (300 seconds) ); + + /// + /// Allows an NPC to be automatically registered as a critter in the Bestiary when the player is near them.
+ /// Should only be used in cases where an NPC does NOT follow the Vanilla definition of a critter. See . + ///
+ public static List ForciblyRegisterAsCritterInBestiary = new List + { + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType() + }; + + /// + /// Allows a variant of an NPC to count as credits towards another in the Bestiary.
+ /// This exists to prevent cases where dupilcate entries are made for two variants of the same creature, such as worms and their segments. + ///
+ public static Dictionary CountVariantsAsTheSameInBestiary = new Dictionary + { + { NPCType(), NPCType() }, + { NPCType(), NPCType() }, + { NPCType(), NPCType() }, + { NPCType(), NPCType() }, + }; + /// /// Associates an NPC type with the base value of their max health in Boss Rush.
/// If an NPC type is not a key in this dictionary, then it will use its standard max health value. diff --git a/Systems/Collections/CalamityProjectileSets.cs b/Systems/Collections/CalamityProjectileSets.cs index e16dc062b4..33f4565204 100644 --- a/Systems/Collections/CalamityProjectileSets.cs +++ b/Systems/Collections/CalamityProjectileSets.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Systems.Collections /// /// If for a projectile type, then that projectile is spawned by a post-Plantera Dungeon enemy.
- /// This increases the projectile's damage by a flat 30 if Moon Lord has been defeated.
+ /// This increases the projectile's damage by a flat 60 if Moon Lord has been defeated.
/// Defaults to . ///
public static bool[] IsBuffedDungeonProjectile = Factory.CreateNamedSet("IsBuffedDungeonProjectile") @@ -37,7 +37,7 @@ namespace CalamityMod.Systems.Collections /// /// If for a projectile type, then that projectile is spawned by a Solar Eclipse, Pumpkin Moon, or Frost Moon enemy.
- /// This increases the projectile's damage by a flat 15 during those events if Devourer of Gods has been defeated.
+ /// This increases the projectile's damage by a flat 30 during those events if Devourer of Gods has been defeated.
/// Defaults to . ///
public static bool[] IsBuffedEventProjectile = Factory.CreateNamedSet("IsBuffedEventProjectile") diff --git a/Systems/Graphic/LightingEffectsSystem.cs b/Systems/Graphic/LightingEffectsSystem.cs index 0f37544bcc..a5ef76761f 100644 --- a/Systems/Graphic/LightingEffectsSystem.cs +++ b/Systems/Graphic/LightingEffectsSystem.cs @@ -14,15 +14,11 @@ namespace CalamityMod.Systems { public const float MaxSignusDarkness = -0.4f; public const float MaxGFBSignusDarkness = MaxSignusDarkness * 2f; - public const float MaxAbyssDarkness = -0.7f; + public override void ModifyLightingBrightness(ref float scale) { // Apply the calculated darkness value for the local player. CalamityPlayer modPlayer = Main.LocalPlayer.Calamity(); - float darkRatio = MathHelper.Clamp(modPlayer.caveDarkness, 0f, 1f); - - if (modPlayer.ZoneAbyss) - scale += MaxAbyssDarkness * darkRatio; if (CalamityWorld.revenge) { @@ -34,11 +30,8 @@ namespace CalamityMod.Systems { float signusLifeRatio = 1f - (Main.npc[CalamityGlobalNPC.signus].life / Main.npc[CalamityGlobalNPC.signus].lifeMax); - float multiplier = 1f; - // Total darkness - float signusDarkness = signusLifeRatio * multiplier; - darkRatio = MathHelper.Clamp(signusDarkness, 0f, 1f); + float darkRatio = MathHelper.Clamp(signusLifeRatio, 0f, 1f); scale += (Main.zenithWorld ? MaxGFBSignusDarkness : MaxSignusDarkness) * darkRatio; } } diff --git a/Systems/Mechanic/GravityManipulationChangesSystem.cs b/Systems/Mechanic/GravityManipulationChangesSystem.cs new file mode 100644 index 0000000000..1f526e24b5 --- /dev/null +++ b/Systems/Mechanic/GravityManipulationChangesSystem.cs @@ -0,0 +1,126 @@ +using CalamityMod.Effects; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.GameInput; +using Terraria.Graphics; +using Terraria.Graphics.Effects; +using Terraria.Graphics.Renderers; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Mechanic +{ + public class GravityManipulationChangesSystem : ModSystem + { + public override void Load() + { + On_Player.UpdateControlHolds += DelayGravity; + On_PlayerInput.SetZoom_MouseInWorld += AdjustMousePositionWithGravityConfig; + + if (!Main.dedServ) + { + Main.QueueMainThreadAction(() => + { + On_Main.DoDraw += ForceGravityDirectionForDrawing; + On_LegacyPlayerRenderer.DrawPlayerInternal += FlipPlayerWithConfig; + }); + } + } + + public override void Unload() + { + On_Player.UpdateControlHolds -= DelayGravity; + On_PlayerInput.SetZoom_MouseInWorld -= AdjustMousePositionWithGravityConfig; + + if (!Main.dedServ) + { + Main.QueueMainThreadAction(() => + { + On_Main.DoDraw -= ForceGravityDirectionForDrawing; + On_LegacyPlayerRenderer.DrawPlayerInternal -= FlipPlayerWithConfig; + }); + } + } + + private static void DelayGravity(On_Player.orig_UpdateControlHolds orig, Player Player) + { + var cplay = Player.Calamity(); + if (CalamityKeybinds.SwitchGravityHotkey.GetAssignedKeysOrEmpty().Count != 0 && (Player.gravControl || Player.gravControl2) && !Player.mount.Active) + { + if (Player.controlUp && Player.releaseUp) + { + Player.gravDir *= -1; + } + if (CalamityKeybinds.SwitchGravityHotkey.JustPressed) + { + Player.gravDir *= -1; + Player.fallStart = (int)(Player.position.Y / 16f); + Player.jump = 0; + SoundEngine.PlaySound(SoundID.Item8, Player.position); + } + + if (Player.forcedGravity > 0) + { + Player.gravDir = -1f; + } + } + + if (cplay.justChangedGravity) + { + Player.gravDir = cplay.oldGravDir; + } + cplay.justChangedGravity = cplay.oldGravDir != Player.gravDir; + + cplay.oldGravDir = Player.gravDir; + + if (cplay.justChangedGravity) + { + Player.gravDir *= -1; + } + orig(Player); + } + + private static void AdjustMousePositionWithGravityConfig(On_PlayerInput.orig_SetZoom_MouseInWorld orig) + { + orig(); + if (!Main.gameMenu && CalamityClientConfig.Instance.DisableGravityScreenSwap && ((Main.LocalPlayer.gravDir == -1 && !Main.LocalPlayer.Calamity().justChangedGravity) || (Main.LocalPlayer.Calamity().oldGravDir == -1 && Main.LocalPlayer.Calamity().justChangedGravity)))//((Main.LocalPlayer.gravDir == -1 && !Main.LocalPlayer.Calamity().justChangedGravity) || (Main.LocalPlayer.Calamity().oldGravDir == -1 && Main.LocalPlayer.Calamity().justChangedGravity)) + { + var center = Main.screenHeight / 2; + Main.mouseY = center - (Main.mouseY - center); + } + } + + private void ForceGravityDirectionForDrawing(On_Main.orig_DoDraw orig, Main self, GameTime gameTime) + { + if (!CalamityClientConfig.Instance.DisableGravityScreenSwap || Main.gameMenu || Main.dedServ) + { + orig(self, gameTime); + } + else + { + Main.LocalPlayer.Calamity().tempGravDir = Main.LocalPlayer.gravDir; + Main.LocalPlayer.gravDir = 1; + orig(self, gameTime); + Main.LocalPlayer.gravDir = Main.LocalPlayer.Calamity().tempGravDir; + } + } + + private void FlipPlayerWithConfig(On_LegacyPlayerRenderer.orig_DrawPlayerInternal orig, LegacyPlayerRenderer self, Camera camera, Player drawPlayer, Vector2 position, float rotation, Vector2 rotationOrigin, float shadow, float alpha, float scale, bool headOnly) + { + if (!CalamityClientConfig.Instance.DisableGravityScreenSwap || Main.gameMenu || Main.dedServ || drawPlayer.whoAmI != Main.myPlayer) + { + orig(self, camera, drawPlayer, position, rotation, rotationOrigin, shadow, alpha, scale, headOnly); + } + else + { + drawPlayer.gravDir = drawPlayer.Calamity().tempGravDir; + orig(self, camera, drawPlayer, position, rotation, rotationOrigin, shadow, alpha, scale, headOnly); + drawPlayer.gravDir = 1; + } + } + } +} diff --git a/Systems/Mechanic/RecipeSystem.cs b/Systems/Mechanic/RecipeSystem.cs index 7ccf1fff33..d2a19e76fa 100644 --- a/Systems/Mechanic/RecipeSystem.cs +++ b/Systems/Mechanic/RecipeSystem.cs @@ -745,8 +745,6 @@ namespace CalamityMod.Systems { Vanilla(ItemID.Leather), ChangeIngredientStack(ItemID.RottenChunk, 2) }, { Vanilla(ItemID.JestersArrow), JesterArrowRecipeEdit }, { Vanilla(ItemID.TeleportationPotion), TeleportationPotionRecipeEdit }, - { Vanilla(ItemID.WormFood), WormFoodRecipeEdit }, - { Vanilla(ItemID.BloodySpine), BloodySpineRecipeEdit }, { Vanilla(ItemID.GoblinBattleStandard), ChangeIngredientStack(ItemID.TatteredCloth, 5) }, { Vanilla(ItemID.Beenade), BeenadeRecipeEdit }, { Vanilla(ItemID.ChlorophyteBar), ChangeIngredientStack(ItemID.ChlorophyteOre, 4) }, @@ -757,13 +755,13 @@ namespace CalamityMod.Systems // Tier lock various items to a higher tier (sorted by progression) { Vanilla(ItemID.Trimarang), AddIngredient(ItemType(), 5) }, - { Vanilla(ItemID.NightsEdge), AddIngredient(ItemType(), 5) }, + { Vanilla(ItemID.NightsEdge), AddIngredient(ItemType(), 10) }, { Vanilla(ItemID.FairyBoots), AddIngredient(ItemID.SoulofLight, 5) }, { Vanilla(ItemID.FairyBell), RemoveIngredient(ItemID.SoulofSight) }, { Vanilla(ItemID.HellfireTreads), AddIngredient(ItemType(), 4) }, { Vanilla(ItemID.SpiritFlame), AddGroup(AnyAdamantiteBar, 2) }, { Vanilla(ItemID.TerraBlade), AddIngredient(ItemType(), 12) }, - { Vanilla(ItemID.FireGauntlet), AddIngredient(ItemType(), 5) }, + { Vanilla(ItemID.FireGauntlet), AddIngredient(ItemType(), 8) }, { Vanilla(ItemID.Zenith), ZenithRecipeEdit }, // Tier unlock various items to a lower tier (sorted by progression) @@ -844,18 +842,6 @@ namespace CalamityMod.Systems r.ChangeIngredientStack(ItemID.SoulofFright, intendedStack); } - private static void WormFoodRecipeEdit(Recipe r) - { - r.ChangeIngredientStack(ItemID.VilePowder, 20); - r.ChangeIngredientStack(ItemID.RottenChunk, 10); - } - - private static void BloodySpineRecipeEdit(Recipe r) - { - r.ChangeIngredientStack(ItemID.ViciousPowder, 20); - r.ChangeIngredientStack(ItemID.Vertebrae, 10); - } - private static void ZenithRecipeEdit(Recipe r) { r.AddIngredient(ItemType(), 5); @@ -1229,7 +1215,6 @@ namespace CalamityMod.Systems #region Cooked Food private static void AddCookedFood() { - #region Alternative Recipes #region Cooked Fish Recipe r = Recipe.Create(ItemID.CookedFish); r.AddIngredient(); @@ -1339,19 +1324,6 @@ namespace CalamityMod.Systems r.Register(); r.SortAfterFirstRecipesOf(ItemID.CookedShrimp); r.DisableDecraft(); - #endregion - - r = Recipe.Create(ItemID.Bacon); - r.AddIngredient(); - r.AddTile(TileID.CookingPots); - r.Register(); - r.DisableDecraft(); - - r = Recipe.Create(ItemID.Bacon); - r.AddIngredient(); - r.AddTile(TileID.CookingPots); - r.Register(); - r.DisableDecraft(); r = Recipe.Create(ItemID.GoldenDelight); r.AddIngredient(); @@ -1513,7 +1485,7 @@ namespace CalamityMod.Systems r = Recipe.Create(ItemID.IceSkates); r.AddIngredient(ItemID.FlinxFur, 3); r.AddRecipeGroup("IronBar", 5); - r.AddTile(TileID.Anvils); + r.AddTile(TileID.Loom); r.Register(); // Water Walking Boots @@ -1569,14 +1541,6 @@ namespace CalamityMod.Systems r.Register(); r.DisableDecraft(); - // Fledgling Wings - r = Recipe.Create(ItemID.CreativeWings); - r.AddIngredient(2); - r.AddIngredient(ItemID.Cloud, 5); - r.AddIngredient(ItemID.Feather, 10); - r.AddTile(TileID.Anvils); - r.Register(); - // Flying Carpet r = Recipe.Create(ItemID.FlyingCarpet); r.AddIngredient(ItemID.Silk, 10); diff --git a/Systems/Mechanic/TilePingerSystem.PingEffects.cs b/Systems/Mechanic/TilePingerSystem.PingEffects.cs index 0627884742..6217aef3d7 100644 --- a/Systems/Mechanic/TilePingerSystem.PingEffects.cs +++ b/Systems/Mechanic/TilePingerSystem.PingEffects.cs @@ -142,33 +142,6 @@ public class WulfrumPingTileEffect : IPingedTileEffect, ILoadable Main.spriteBatch.Draw(emptyFrame, pos.ToWorldCoordinates() - Main.screenPosition, null, Color.White, 0, new Vector2(emptyFrame.Width / 2f, emptyFrame.Height / 2f), 16f, 0, 0); } - // CIT 16JUL2025: Tile lighting override is now applied via an On edit; this code is duplicated there, and thus is no longer needed here. - /*public void EditDrawData(int i, int j, ref TileDrawInfo drawData) - { - float distanceFromCenter = (new Point(i, j).ToWorldCoordinates() - PingCenter).Length(); - float currentExpansion = MathHelper.Clamp(PingProgress * MaxPingLife / (float)MaxPingTravelTime, 0f, 1f) * MaxPingRadius; - - if (distanceFromCenter - 8 > currentExpansion) - return; - - float brightness = 1f; - Tile tile = Framing.GetTileSafely(i, j); - //Counteracts slopes and half tiles being too bright - if (tile.Slope != SlopeType.Solid || tile.IsHalfBlock) - brightness = 0.64f; - - //Fade on the edges - if (distanceFromCenter + 8 > currentExpansion) - brightness *= 1 - (distanceFromCenter - currentExpansion + 8f) / 16f; - - //Fade away with the effect - brightness *= 1 - Math.Max(PingProgress - 0.9f, 0) / (0.1f); - - if (drawData.tileLight.R < 200 * brightness) drawData.tileLight.R = (byte)(200 * brightness); - if (drawData.tileLight.G < 200 * brightness) drawData.tileLight.G = (byte)(200 * brightness); - if (drawData.tileLight.B < 200 * brightness) drawData.tileLight.B = (byte)(200 * brightness); - }*/ - public void UpdateEffect() { if (PingTimer > 0) diff --git a/Systems/World/BestiaryRegistrySystem.cs b/Systems/World/BestiaryRegistrySystem.cs index ced469a837..d0d8bab95c 100644 --- a/Systems/World/BestiaryRegistrySystem.cs +++ b/Systems/World/BestiaryRegistrySystem.cs @@ -1,6 +1,11 @@ -using CalamityMod.NPCs.Abyss; +using System.Collections.Generic; +using CalamityMod.NPCs.Abyss; using CalamityMod.NPCs.Astral; using CalamityMod.NPCs.Crags; +using CalamityMod.NPCs.Deconstructors; +using CalamityMod.Systems.Collections; +using Terraria; +using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; @@ -11,10 +16,56 @@ namespace CalamityMod.Systems { public override void PostSetupContent() { + On_BestiaryDatabaseNPCsPopulator.AddEmptyEntries_CrittersAndEnemies_Automated += ForciblyAddEmptyEntriesForCritters; + On_NPCWasNearPlayerTracker.ScanWorldForFinds += ForciblySetWasSeenByPlayer; + // Manually register variants post-initiailization - ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCType()] = ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCType()]; - ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCType()] = ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCType()]; - ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCType()] = ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCType()]; + foreach (var pair in CalamityNPCSets.CountVariantsAsTheSameInBestiary) + ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[pair.Key] = ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[pair.Value]; + } + + private void ForciblyAddEmptyEntriesForCritters(On_BestiaryDatabaseNPCsPopulator.orig_AddEmptyEntries_CrittersAndEnemies_Automated orig, BestiaryDatabaseNPCsPopulator self) + { + orig(self); + + // Run through all entries again and remove the empty Enemy entries that are added by tMod itself. + // Afterwards, mnually add empty Critter entries for all NPCs within the ID set. + HashSet exclusions = BestiaryDatabaseNPCsPopulator.GetExclusions(); + foreach (KeyValuePair pair in ContentSamples.NpcsByNetId) + { + if (!exclusions.Contains(pair.Key)) + { + if (CalamityNPCSets.ForciblyRegisterAsCritterInBestiary.Contains(pair.Value.type)) + { + if (BestiaryDatabaseNPCsPopulator._currentDatabase._byNpcId.TryGetValue(pair.Value.netID, out BestiaryEntry enemyEntry) && enemyEntry.UIInfoProvider is not CritterUICollectionInfoProvider) + { + BestiaryDatabaseNPCsPopulator._currentDatabase.Entries.Remove(enemyEntry); + NPCLoader.SetBestiary(pair.Value, BestiaryDatabaseNPCsPopulator._currentDatabase, self.Register(BestiaryEntry.Critter(pair.Key))); + } + } + } + } + } + + private void ForciblySetWasSeenByPlayer(On_NPCWasNearPlayerTracker.orig_ScanWorldForFinds orig, NPCWasNearPlayerTracker self) + { + orig(self); + + // Allow NPCs with manully added empty critter entries to be registered by player proximity. + foreach (NPC npc in Main.ActiveNPCs) + { + if (!CalamityNPCSets.ForciblyRegisterAsCritterInBestiary.Contains(npc.type) || self._wasSeenNearPlayerByNetId.Contains(npc.netID)) + continue; + + for (int i = 0; i < self._playerHitboxesForBestiary.Count; i++) + { + if (npc.Hitbox.Intersects(self._playerHitboxesForBestiary[i])) + { + self._wasSeenNearPlayerByNetId.Add(npc.netID); + self.RegisterWasNearby(npc); + } + } + } } } } diff --git a/Tiles/Astral/AstralBeacon.cs b/Tiles/Astral/AstralBeacon.cs index 8040ce829c..4a2cf2de6f 100644 --- a/Tiles/Astral/AstralBeacon.cs +++ b/Tiles/Astral/AstralBeacon.cs @@ -38,7 +38,6 @@ namespace CalamityMod.Tiles.Astral TileObjectData.addTile(Type); AddMapEntry(new Color(128, 128, 158), CalamityUtils.GetItemName()); TileID.Sets.DisableSmartCursor[Type] = true; - MinPick = 200; } public override bool CanExplode(int i, int j) => false; diff --git a/Tiles/Crags/ScorchedRemainsGrass.cs b/Tiles/Crags/ScorchedRemainsGrass.cs index 728a96dc12..fc184afc16 100644 --- a/Tiles/Crags/ScorchedRemainsGrass.cs +++ b/Tiles/Crags/ScorchedRemainsGrass.cs @@ -177,9 +177,7 @@ namespace CalamityMod.Tiles.Crags #region 'Extra Drapes' Drawing private void DrawExtraTop(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - If the tile directly above this tile is not otherworldly stone, or if it is, there is air to both sides of that tile, draw the Extra surface - */ + // If the tile directly above this tile is not otherworldly stone, or if it is, there is air to both sides of that tile, draw the Extra surface if ( CheckTile(Type, false, 0, 1, i, j) || (CheckTile(Type, true, 0, 1, i, j) && CheckTile(Type, false, 1, 1, i, j) && CheckTile(Type, false, -1, 1, i, j) && CheckTile(Type, true, 1, 0, i, j) && CheckTile(Type, true, -1, 0, i, j)) @@ -194,9 +192,7 @@ namespace CalamityMod.Tiles.Crags private void DrawExtraWallEnds(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Ending the Extra when a wall is reached - */ + // Ending the Extra when a wall is reached //Left if ( @@ -220,9 +216,7 @@ namespace CalamityMod.Tiles.Crags private void DrawExtraOverhang(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Called from DrawExtraTop(). Ending the Extra when the edge of the tile is reached - */ + // Called from DrawExtraTop(). Ending the Extra when the edge of the tile is reached //Left if ( @@ -244,9 +238,7 @@ namespace CalamityMod.Tiles.Crags private void DrawExtraDrapes(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Hanging 'drapes' of the extra element - */ + // Hanging 'drapes' of the extra element //Base if ( @@ -325,113 +317,6 @@ namespace CalamityMod.Tiles.Crags { return Main.tile[i, j].TileFrameNumber * extraFrameWidth; } - - /* - private int GetTileVariant(int i, int j) - { - int variant = 0; //Default to using variant 1 - Tile sourceTile = Main.tile[i, j]; - //Now to get the particular 'variant group' to use, which is used to take the frameX/frameY of the tile and convert it to the variant the tile is using - int frameX = sourceTile.frameX / 18; - int frameY = sourceTile.frameY / 18; - if (frameY < 3 && !(frameX >= 6 && frameX < 9)) - { - int group = 0; - int[] group1XPos = new int[] { 1, 2, 3 }; - int[] group2XPos = new int[] { 0, 4, 5, 9, 10, 11, 12 }; - foreach (int k in group1XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 1; - } - } - foreach (int k in group2XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 2; - } - } - if (group == 1) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 3) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (group == 2) - { - if (frameY < 1) - { - variant = 0; - } - else if (frameY < 2) - { - variant = 1; - } - else - { - variant = 2; - } - } - } - else if (frameX < 6 && frameY >= 3) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 4) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 6 && frameX < 9) - { - if (frameX < 7) - { - variant = 0; - } - else if (frameX < 8) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 9 && frameY >= 3) - { - if (frameX < 10) - { - variant = 0; - } - else if (frameX < 11) - { - variant = 1; - } - else - { - variant = 2; - } - } - return (variant); - } - */ #endregion } } diff --git a/Tiles/Furniture/CorruptionEffigy.cs b/Tiles/Furniture/CorruptionEffigy.cs index c900255905..b8ee62c97b 100644 --- a/Tiles/Furniture/CorruptionEffigy.cs +++ b/Tiles/Furniture/CorruptionEffigy.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Tiles.Furniture TileObjectData.newTile.Width = 2; TileObjectData.newTile.Height = 4; - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 18 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newTile.Origin = new Point16(0, 3); diff --git a/Tiles/Furniture/CorruptionEffigy.png b/Tiles/Furniture/CorruptionEffigy.png index 665d755fd0..c7d093ac05 100644 Binary files a/Tiles/Furniture/CorruptionEffigy.png and b/Tiles/Furniture/CorruptionEffigy.png differ diff --git a/Tiles/Furniture/CorruptionEffigy_Highlight.png b/Tiles/Furniture/CorruptionEffigy_Highlight.png index bd91211397..1f60a74d44 100644 Binary files a/Tiles/Furniture/CorruptionEffigy_Highlight.png and b/Tiles/Furniture/CorruptionEffigy_Highlight.png differ diff --git a/Tiles/Furniture/CrimsonEffigy.cs b/Tiles/Furniture/CrimsonEffigy.cs index b462e4769b..75695a3d3d 100644 --- a/Tiles/Furniture/CrimsonEffigy.cs +++ b/Tiles/Furniture/CrimsonEffigy.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Tiles.Furniture TileObjectData.newTile.Width = 2; TileObjectData.newTile.Height = 4; - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 18 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newTile.Origin = new Point16(0, 3); diff --git a/Tiles/Furniture/CrimsonEffigy.png b/Tiles/Furniture/CrimsonEffigy.png index 623df7c679..73e0722d6a 100644 Binary files a/Tiles/Furniture/CrimsonEffigy.png and b/Tiles/Furniture/CrimsonEffigy.png differ diff --git a/Tiles/Furniture/CrimsonEffigy_Highlight.png b/Tiles/Furniture/CrimsonEffigy_Highlight.png index 65062f866a..95fd6e61b9 100644 Binary files a/Tiles/Furniture/CrimsonEffigy_Highlight.png and b/Tiles/Furniture/CrimsonEffigy_Highlight.png differ diff --git a/Tiles/Furniture/GluttonyBlender.cs b/Tiles/Furniture/GluttonyBlender.cs index 514b8238d5..6dbbdb6d56 100644 --- a/Tiles/Furniture/GluttonyBlender.cs +++ b/Tiles/Furniture/GluttonyBlender.cs @@ -236,8 +236,8 @@ namespace CalamityMod.Tiles.Furniture { Item dummy = new Item(); dummy.SetDefaults(ItemType); - // 0.5% per minute of duration, multiplied by 1.5x for T@ food and 2x for T3 food - float goodPercent = dummy.buffTime * (dummy.buffType == BuffID.WellFed3 ? 2f : dummy.buffType == BuffID.WellFed2 ? 1.5f : 1f) / 3600f / 2f; + // 0.1% per minute of duration, multiplied by 2x for T2 food and 10x for T3 food + float goodPercent = dummy.buffTime * (dummy.buffType == BuffID.WellFed3 ? 10f : dummy.buffType == BuffID.WellFed2 ? 2f : 1f) / 3600f / 10f; int itemDrop = Main.rand.NextFloat(100f) < goodPercent ? ModContent.ItemType() : ModContent.ItemType(); int i = Item.NewItem(Projectile.GetItemSource_DropAsItem(), Projectile.Center, itemDrop); diff --git a/Tiles/Furniture/Paintings/BaseCanvasPainting.cs b/Tiles/Furniture/Paintings/BaseCanvasPainting.cs index 6c036b064e..ebf85fd7f9 100644 --- a/Tiles/Furniture/Paintings/BaseCanvasPainting.cs +++ b/Tiles/Furniture/Paintings/BaseCanvasPainting.cs @@ -93,18 +93,18 @@ namespace CalamityMod.Tiles.Furniture.Paintings var t = Main.tile[i, j]; var texture = TextureAssets.Tile[Type].Value; var cube = CalamityUtils.FindTileEntity(i, j, 1, 1); - var pos = new Vector2(i * 16, j * 16) + CalamityUtils.TileDrawOffset; if (cube != null && t.TileFrameX == 0) { var fPX = (int)cube.framePosition.X; var fPY = (int)cube.framePosition.Y; var scale = (int)(texture.Width * 0.1f * cube.scale); + var rasterizer = Main.LocalPlayer.gravDir == -1f ? RasterizerState.CullNone : Main.Rasterizer; spriteBatch.End(); - spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, rasterizer, null); spriteBatch.Draw(texture, pos - Main.screenPosition, new Rectangle(fPX, fPY, scale, scale), Lighting.GetColor(i, j), 0, new Vector2(0, 0), 1 / cube.scale * Scale, 0, 0); spriteBatch.End(); - spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearWrap, DepthStencilState.None, Main.Rasterizer, null); + spriteBatch.Begin(); } // Calculate and draw the borders if (t.TileFrameX == 0 && t.TileFrameY == 0) diff --git a/Tiles/Furniture/PiggyCageGoldTile.cs b/Tiles/Furniture/PiggyCageGoldTile.cs index ae48755468..f2d2fa2a19 100644 --- a/Tiles/Furniture/PiggyCageGoldTile.cs +++ b/Tiles/Furniture/PiggyCageGoldTile.cs @@ -1,11 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using CalamityMod.Items.Placeables.Furniture; +using CalamityMod.Items.Placeables.Furniture; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.GameContent; using Terraria.ID; @@ -16,8 +12,14 @@ namespace CalamityMod.Tiles.Furniture { public class PiggyCageGoldTile : ModTile { + public static Asset topTexture; + public override void SetStaticDefaults() { + if (!Main.dedServ) + { + topTexture = ModContent.Request("CalamityMod/Tiles/Furniture/TransparentGoldCageTile_Top"); + } Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; Main.tileSolidTop[Type] = true; @@ -89,7 +91,7 @@ namespace CalamityMod.Tiles.Furniture drawRectangle = rect; drawRectangle.Y = 0; drawRectangle.Height = 10; - spriteBatch.Draw(BabyFlakCrabCageTile.topTexture.Value, position, drawRectangle, finalColor, 0f, zero, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(topTexture.Value, position, drawRectangle, finalColor, 0f, zero, 1f, SpriteEffects.None, 0f); } else { diff --git a/Tiles/Furniture/PiggyCageGoldTile.png b/Tiles/Furniture/PiggyCageGoldTile.png index a60cd8511d..035201e914 100644 Binary files a/Tiles/Furniture/PiggyCageGoldTile.png and b/Tiles/Furniture/PiggyCageGoldTile.png differ diff --git a/Tiles/Furniture/TransparentGoldCageTile_Top.png b/Tiles/Furniture/TransparentGoldCageTile_Top.png new file mode 100644 index 0000000000..be937ae4cc Binary files /dev/null and b/Tiles/Furniture/TransparentGoldCageTile_Top.png differ diff --git a/Tiles/FurnitureAshen/AshenAccentSlab.cs b/Tiles/FurnitureAshen/AshenAccentSlab.cs index 7eb8b524e2..6935d176e5 100644 --- a/Tiles/FurnitureAshen/AshenAccentSlab.cs +++ b/Tiles/FurnitureAshen/AshenAccentSlab.cs @@ -532,122 +532,5 @@ namespace CalamityMod.Tiles.FurnitureAshen Main.spriteBatch.Draw(glowmask, drawOffset + new Vector2(0f, 8f), new Rectangle?(new Rectangle(xDrawPos, yDrawPos, 18, 8)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } } - - /* - /// - /// Gets the tile variant to use. Returns -1 by default - /// - /// - /// - /// - public int GetTileVariant(int i, int j) - { - int variant = 0; //Default to using variant 1 - if (j % 3 < 2) - { - //We need to get the particular tile to refer to. This is the top left tile in each iteration of the pattern (large slab above the small rune bricks - Tile sourceTile = Main.tile[i - (i % 2), j - (j % 3)]; //Gets the tile for this iteration by taking the current position of the tile minus this tile's position in the pattern - //Now to get the particular 'variant group' to use, which is used to take the frameX/frameY of the tile and convert it to the variant the tile is using - int frameX = sourceTile.frameX / 18; - int frameY = sourceTile.frameY / 18; - if (frameY < 3 && !(frameX >= 6 && frameX < 9)) - { - int group = 0; - int[] group1XPos = new int[] { 1, 2, 3 }; - int[] group2XPos = new int[] { 0, 4, 5, 9, 10, 11, 12 }; - foreach (int k in group1XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 1; - } - } - foreach (int k in group2XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 2; - } - } - if (group == 1) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 3) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (group == 2) - { - if (frameY < 1) - { - variant = 0; - } - else if (frameY < 2) - { - variant = 1; - } - else - { - variant = 2; - } - } - } - else if (frameX < 6 && frameY >= 3) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 4) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 6 && frameX < 9) - { - if (frameX < 7) - { - variant = 0; - } - else if (frameX < 8) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 9 && frameY >= 3) - { - if (frameX < 10) - { - variant = 0; - } - else if (frameX < 11) - { - variant = 1; - } - else - { - variant = 2; - } - } - } - return (variant); - } - */ } } diff --git a/Tiles/FurnitureAshen/AshenSlab.cs b/Tiles/FurnitureAshen/AshenSlab.cs index 809dbd3bc7..88cb5bc72b 100644 --- a/Tiles/FurnitureAshen/AshenSlab.cs +++ b/Tiles/FurnitureAshen/AshenSlab.cs @@ -532,122 +532,5 @@ namespace CalamityMod.Tiles.FurnitureAshen Main.spriteBatch.Draw(glowmask, drawOffset + new Vector2(0f, 8f), new Rectangle?(new Rectangle(xDrawPos, yDrawPos, 18, 8)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } } - - /* - /// - /// Gets the tile variant to use. Returns -1 by default - /// - /// - /// - /// - public int GetTileVariant(int i, int j) - { - int variant = 0; //Default to using variant 1 - if (j % 3 < 2) - { - //We need to get the particular tile to refer to. This is the top left tile in each iteration of the pattern (large slab above the small rune bricks - Tile sourceTile = Main.tile[i - (i % 2), j - (j % 3)]; //Gets the tile for this iteration by taking the current position of the tile minus this tile's position in the pattern - //Now to get the particular 'variant group' to use, which is used to take the frameX/frameY of the tile and convert it to the variant the tile is using - int frameX = sourceTile.frameX / 18; - int frameY = sourceTile.frameY / 18; - if (frameY < 3 && !(frameX >= 6 && frameX < 9)) - { - int group = 0; - int[] group1XPos = new int[] { 1, 2, 3 }; - int[] group2XPos = new int[] { 0, 4, 5, 9, 10, 11, 12 }; - foreach (int k in group1XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 1; - } - } - foreach (int k in group2XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 2; - } - } - if (group == 1) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 3) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (group == 2) - { - if (frameY < 1) - { - variant = 0; - } - else if (frameY < 2) - { - variant = 1; - } - else - { - variant = 2; - } - } - } - else if (frameX < 6 && frameY >= 3) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 4) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 6 && frameX < 9) - { - if (frameX < 7) - { - variant = 0; - } - else if (frameX < 8) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 9 && frameY >= 3) - { - if (frameX < 10) - { - variant = 0; - } - else if (frameX < 11) - { - variant = 1; - } - else - { - variant = 2; - } - } - } - return (variant); - } - */ } } diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs b/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs index 1d736949b8..b8f9142d04 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs @@ -82,9 +82,7 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly #region 'Extra Drapes' Drawing private void DrawExtraTop(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - If the tile directly above this tile is not otherworldly stone, or if it is, there is air to both sides of that tile, draw the Extra surface - */ + // If the tile directly above this tile is not otherworldly stone, or if it is, there is air to both sides of that tile, draw the Extra surface if ( CheckTile(Type, false, 0, 1, i, j) || (CheckTile(Type, true, 0, 1, i, j) && CheckTile(Type, false, 1, 1, i, j) && CheckTile(Type, false, -1, 1, i, j) && CheckTile(Type, true, 1, 0, i, j) && CheckTile(Type, true, -1, 0, i, j)) @@ -99,9 +97,7 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly private void DrawExtraWallEnds(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Ending the Extra when a wall is reached - */ + // Ending the Extra when a wall is reached //Left if ( @@ -125,9 +121,7 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly private void DrawExtraOverhang(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Called from DrawExtraTop(). Ending the Extra when the edge of the tile is reached - */ + // Called from DrawExtraTop(). Ending the Extra when the edge of the tile is reached //Left if ( @@ -149,9 +143,7 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly private void DrawExtraDrapes(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Hanging 'drapes' of the extra element - */ + // Hanging 'drapes' of the extra element //Base if ( @@ -230,113 +222,6 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly { return Main.tile[i, j].TileFrameNumber * extraFrameWidth; } - - /* - private int GetTileVariant(int i, int j) - { - int variant = 0; //Default to using variant 1 - Tile sourceTile = Main.tile[i, j]; - //Now to get the particular 'variant group' to use, which is used to take the frameX/frameY of the tile and convert it to the variant the tile is using - int frameX = sourceTile.frameX / 18; - int frameY = sourceTile.frameY / 18; - if (frameY < 3 && !(frameX >= 6 && frameX < 9)) - { - int group = 0; - int[] group1XPos = new int[] { 1, 2, 3 }; - int[] group2XPos = new int[] { 0, 4, 5, 9, 10, 11, 12 }; - foreach (int k in group1XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 1; - } - } - foreach (int k in group2XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 2; - } - } - if (group == 1) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 3) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (group == 2) - { - if (frameY < 1) - { - variant = 0; - } - else if (frameY < 2) - { - variant = 1; - } - else - { - variant = 2; - } - } - } - else if (frameX < 6 && frameY >= 3) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 4) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 6 && frameX < 9) - { - if (frameX < 7) - { - variant = 0; - } - else if (frameX < 8) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 9 && frameY >= 3) - { - if (frameX < 10) - { - variant = 0; - } - else if (frameX < 11) - { - variant = 1; - } - else - { - variant = 2; - } - } - return (variant); - } - */ #endregion } } diff --git a/Tiles/MonsterBanner.png b/Tiles/MonsterBanner.png index 218f14301a..ff17756e1d 100644 Binary files a/Tiles/MonsterBanner.png and b/Tiles/MonsterBanner.png differ diff --git a/Tiles/Ores/AstralOre.cs b/Tiles/Ores/AstralOre.cs index d3a404368b..be3c6ca0ff 100644 --- a/Tiles/Ores/AstralOre.cs +++ b/Tiles/Ores/AstralOre.cs @@ -1,7 +1,5 @@ using System; -using System.Collections.Generic; using CalamityMod.Dusts; -using CalamityMod.Items.Materials; using CalamityMod.Tiles.Astral; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -29,7 +27,7 @@ namespace CalamityMod.Tiles.Ores TileID.Sets.Ore[Type] = true; TileID.Sets.OreMergesWithMud[Type] = true; - MinPick = 110; + MinPick = 210; DustType = DustID.ShadowbeamStaff; AddMapEntry(new Color(255, 153, 255), CreateMapEntryName()); MineResist = 3f; @@ -37,7 +35,7 @@ namespace CalamityMod.Tiles.Ores TileID.Sets.Ore[Type] = true; TileID.Sets.ChecksForMerge[Type] = true; - // TileID.Sets.DoesntGetReplacedWithTileReplacement[Type] = true; + TileID.Sets.DoesntGetReplacedWithTileReplacement[Type] = true; TileID.Sets.AvoidedByMeteorLanding[Type] = true; this.RegisterBlendMergeWith(ModContent.TileType()); @@ -72,19 +70,15 @@ namespace CalamityMod.Tiles.Ores } } - public override IEnumerable GetItemDrops(int i, int j) + public override bool CanKillTile(int i, int j, ref bool blockDamaged) { - if (!DownedBossSystem.downedAstrumDeus) - { - if (Main.rand.NextBool()) - yield return new Item(ModContent.ItemType()); - else - yield return new Item(0); - } - else - yield return new Item(ModContent.ItemType()); + return DownedBossSystem.downedAstrumDeus; } + public override bool CanExplode(int i, int j) + { + return false; + } public override void NumDust(int i, int j, bool fail, ref int num) { num = fail ? 1 : 3; diff --git a/Tiles/Pylons/CragsPylonBrokenTile.cs b/Tiles/Pylons/CragsPylonBrokenTile.cs new file mode 100644 index 0000000000..71e0ce16e8 --- /dev/null +++ b/Tiles/Pylons/CragsPylonBrokenTile.cs @@ -0,0 +1,35 @@ +using CalamityMod.Items.Placeables.Pylons; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Enums; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Pylons +{ + public class CragsPylonBrokenTile : ModTile + { + public override string Texture => "CalamityMod/Tiles/Pylons/CragsPylonTile"; + + public override void SetStaticDefaults() + { + Main.tileLavaDeath[Type] = false; + Main.tileFrameImportant[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.LavaPlacement = LiquidPlacement.Allowed; + TileObjectData.newTile.DrawYOffset = 2; + TileObjectData.addTile(Type); + + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + + AddMapEntry(Color.OrangeRed, CalamityUtils.GetItemName(ModContent.ItemType())); + TileID.Sets.PreventsSandfall[Type] = true; + } + public override bool CreateDust(int i, int j, ref int type) => false; + } +} diff --git a/Tiles/SunkenSea/SeaPrism.cs b/Tiles/SunkenSea/SeaPrism.cs index 0539abd2f6..085c79e037 100644 --- a/Tiles/SunkenSea/SeaPrism.cs +++ b/Tiles/SunkenSea/SeaPrism.cs @@ -2,6 +2,7 @@ using CalamityMod.Effects; using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Systems; +using CalamityMod.Utilities.Daybreak; using CalamityMod.Walls; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -358,8 +359,14 @@ namespace CalamityMod.Tiles.SunkenSea public override void OnModLoad() { - On_Main.DrawTiles += DrawSeaPrismsAndCrystals; - On_Main.DrawWalls += DrawSeaPrismWalls; + if (!Main.dedServ) + { + Main.QueueMainThreadAction(() => + { + On_Main.DrawTiles += DrawSeaPrismsAndCrystals; + On_Main.DrawWalls += DrawSeaPrismWalls; + }); + } SeaPrismTileType = ModContent.TileType(); SeaPrismCrystalTileType = ModContent.TileType(); @@ -397,9 +404,6 @@ namespace CalamityMod.Tiles.SunkenSea { Vector2 offscreenPosition = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - Main.tileBatch.End(); - Main.spriteBatch.End(); - var oldTex1 = Main.instance.GraphicsDevice.Textures[1]; var oldSampler1 = Main.instance.GraphicsDevice.SamplerStates[1]; var oldTex2 = Main.instance.GraphicsDevice.Textures[2]; @@ -415,11 +419,13 @@ namespace CalamityMod.Tiles.SunkenSea shader.Parameters["doGlint"].SetValue(true); Vector2 unscaledPosition = Main.Camera.UnscaledPosition; - GetScreenDrawArea(unscaledPosition, offscreenPosition + (Main.Camera.UnscaledPosition - Main.Camera.ScaledPosition), out var firstTileX, out var lastTileX, out var firstTileY, out var lastTileY); - if (solidLayer) + if ((solidLayer && !Main.drawToScreen) || (!solidLayer && Main.drawToScreen)) { + Main.tileBatch.End(); + Main.spriteBatch.End(out var snapshot); + Main.instance.GraphicsDevice.Textures[1] = SeaPrism.Green.Value; Main.instance.GraphicsDevice.SamplerStates[1] = SamplerState.LinearClamp; Main.instance.GraphicsDevice.Textures[2] = SeaPrism.Purple.Value; @@ -427,7 +433,8 @@ namespace CalamityMod.Tiles.SunkenSea Main.instance.GraphicsDevice.Textures[3] = SeaPrism.Glint.Value; Main.instance.GraphicsDevice.SamplerStates[3] = SamplerState.LinearClamp; - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, shader, Matrix.Identity); + Main.tileBatch.Begin(snapshot.RasterizerState, snapshot.TransformMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, snapshot.RasterizerState, shader, snapshot.TransformMatrix); for (int y = firstTileY; y < lastTileY + 4; y++) { @@ -437,9 +444,6 @@ namespace CalamityMod.Tiles.SunkenSea continue; Tile tile = Main.tile[x, y]; - if (tile == null) - continue; - int type = tile.TileType; if (type != SeaPrismTileType) continue; @@ -456,9 +460,26 @@ namespace CalamityMod.Tiles.SunkenSea Main.spriteBatch.Draw(SeaPrism.Blue.Value, position, sourceRect, light); } } + + Main.tileBatch.End(); + Main.spriteBatch.End(); + + Main.instance.GraphicsDevice.Textures[1] = oldTex1; + Main.instance.GraphicsDevice.SamplerStates[1] = oldSampler1; + Main.instance.GraphicsDevice.Textures[2] = oldTex2; + Main.instance.GraphicsDevice.SamplerStates[2] = oldSampler2; + Main.instance.GraphicsDevice.Textures[3] = oldTex3; + Main.instance.GraphicsDevice.SamplerStates[3] = oldSampler3; + + Main.tileBatch.Begin(snapshot.RasterizerState, snapshot.TransformMatrix); + Main.spriteBatch.Begin(snapshot); } - else + + if (!solidLayer) { + Main.tileBatch.End(); + Main.spriteBatch.End(out var snapshot); + Main.instance.GraphicsDevice.Textures[1] = SeaPrismCrystals.GreenCrystals.Value; Main.instance.GraphicsDevice.SamplerStates[1] = SamplerState.LinearClamp; Main.instance.GraphicsDevice.Textures[2] = SeaPrismCrystals.PurpleCrystals.Value; @@ -466,7 +487,7 @@ namespace CalamityMod.Tiles.SunkenSea Main.instance.GraphicsDevice.Textures[3] = SeaPrismCrystals.Glint.Value; Main.instance.GraphicsDevice.SamplerStates[3] = SamplerState.LinearClamp; - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, shader, Matrix.Identity); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, snapshot.RasterizerState, shader, snapshot.TransformMatrix); for (int y = firstTileY; y < lastTileY + 4; y++) { @@ -476,15 +497,11 @@ namespace CalamityMod.Tiles.SunkenSea continue; Tile tile = Main.tile[x, y]; - if (tile == null) - continue; - int type = tile.TileType; if (type != SeaPrismCrystalTileType) continue; - Vector2 offScreen = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - Vector2 position = new Vector2(x * 16, y * 16) - Main.screenPosition + offScreen; + Vector2 position = new Vector2(x * 16, y * 16) - Main.screenPosition + offscreenPosition; Rectangle sourceRect = new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16); Color light = Lighting.GetColor(x, y) * 1.5f; @@ -502,7 +519,7 @@ namespace CalamityMod.Tiles.SunkenSea Main.instance.GraphicsDevice.Textures[3] = MediumSeaPrismCrystal.Glint.Value; Main.instance.GraphicsDevice.SamplerStates[3] = SamplerState.LinearClamp; - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, shader, Matrix.Identity); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, snapshot.RasterizerState, shader, snapshot.TransformMatrix); for (int y = firstTileY; y < lastTileY + 4; y++) { @@ -512,15 +529,11 @@ namespace CalamityMod.Tiles.SunkenSea continue; Tile tile = Main.tile[x, y]; - if (tile == null) - continue; - int type = tile.TileType; if (type != MediumSeaPrismCrystalTileType) continue; - Vector2 offScreen = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - Vector2 position = new Vector2(x * 16, y * 16) - Main.screenPosition + offScreen; + Vector2 position = new Vector2(x * 16, y * 16) - Main.screenPosition + offscreenPosition; Rectangle sourceRect = new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16); Color light = Lighting.GetColor(x, y) * 1.5f; @@ -529,20 +542,19 @@ namespace CalamityMod.Tiles.SunkenSea } } + Main.spriteBatch.End(); + + Main.instance.GraphicsDevice.Textures[1] = oldTex1; + Main.instance.GraphicsDevice.SamplerStates[1] = oldSampler1; + Main.instance.GraphicsDevice.Textures[2] = oldTex2; + Main.instance.GraphicsDevice.SamplerStates[2] = oldSampler2; + Main.instance.GraphicsDevice.Textures[3] = oldTex3; + Main.instance.GraphicsDevice.SamplerStates[3] = oldSampler3; + + Main.tileBatch.Begin(snapshot.RasterizerState, snapshot.TransformMatrix); + Main.spriteBatch.Begin(snapshot); } - Main.spriteBatch.End(); - - Main.instance.GraphicsDevice.Textures[1] = oldTex1; - Main.instance.GraphicsDevice.SamplerStates[1] = oldSampler1; - Main.instance.GraphicsDevice.Textures[2] = oldTex2; - Main.instance.GraphicsDevice.SamplerStates[2] = oldSampler2; - Main.instance.GraphicsDevice.Textures[3] = oldTex3; - Main.instance.GraphicsDevice.SamplerStates[3] = oldSampler3; - - Main.spriteBatch.Begin(); - Main.tileBatch.Begin(); - orig(self, solidLayer, forRenderTargets, intoRenderTargets, waterStyleOverride); } @@ -551,7 +563,7 @@ namespace CalamityMod.Tiles.SunkenSea Vector2 offscreenPosition = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Main.tileBatch.End(); - Main.spriteBatch.End(); + Main.spriteBatch.End(out var snapshot); var oldTex1 = Main.instance.GraphicsDevice.Textures[1]; var oldSampler1 = Main.instance.GraphicsDevice.SamplerStates[1]; @@ -572,7 +584,7 @@ namespace CalamityMod.Tiles.SunkenSea shader.Parameters["diagonalScreenLength"].SetValue((Main.screenWidth / 2f) - (Main.screenHeight / 2f)); shader.Parameters["doGlint"].SetValue(false); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, snapshot.RasterizerState, null, snapshot.TransformMatrix); Vector2 unscaledPosition = Main.Camera.UnscaledPosition; @@ -618,8 +630,8 @@ namespace CalamityMod.Tiles.SunkenSea Main.instance.GraphicsDevice.SamplerStates[2] = oldSampler2; Main.instance.GraphicsDevice.Textures[3] = oldTex3; - Main.spriteBatch.Begin(); Main.tileBatch.Begin(); + Main.spriteBatch.Begin(snapshot); orig(self); } diff --git a/Tiles/UelibloomBrick.cs b/Tiles/UelibloomBrick.cs index d4f08a90bf..a12b232265 100644 --- a/Tiles/UelibloomBrick.cs +++ b/Tiles/UelibloomBrick.cs @@ -90,9 +90,7 @@ namespace CalamityMod.Tiles #region 'Extra Drapes' Drawing private void DrawExtraTop(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - If the tile directly above this tile is not otherworldly stone, or if it is, there is air to both sides of that tile, draw the Extra surface - */ + // If the tile directly above this tile is not otherworldly stone, or if it is, there is air to both sides of that tile, draw the Extra surface if ( CheckTile(Type, false, 0, 1, i, j) || (CheckTile(Type, true, 0, 1, i, j) && CheckTile(Type, false, 1, 1, i, j) && CheckTile(Type, false, -1, 1, i, j) && CheckTile(Type, true, 1, 0, i, j) && CheckTile(Type, true, -1, 0, i, j)) @@ -107,9 +105,7 @@ namespace CalamityMod.Tiles private void DrawExtraWallEnds(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Ending the Extra when a wall is reached - */ + // Ending the Extra when a wall is reached //Left if ( @@ -133,9 +129,7 @@ namespace CalamityMod.Tiles private void DrawExtraOverhang(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Called from DrawExtraTop(). Ending the Extra when the edge of the tile is reached - */ + // Called from DrawExtraTop(). Ending the Extra when the edge of the tile is reached //Left if ( @@ -157,9 +151,7 @@ namespace CalamityMod.Tiles private void DrawExtraDrapes(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Hanging 'drapes' of the extra element - */ + // Hanging 'drapes' of the extra element //Base if ( @@ -238,113 +230,6 @@ namespace CalamityMod.Tiles { return Main.tile[i, j].TileFrameNumber * extraFrameWidth; } - - /* - private int GetTileVariant(int i, int j) - { - int variant = 0; //Default to using variant 1 - Tile sourceTile = Main.tile[i, j]; - //Now to get the particular 'variant group' to use, which is used to take the frameX/frameY of the tile and convert it to the variant the tile is using - int frameX = sourceTile.frameX / 18; - int frameY = sourceTile.frameY / 18; - if (frameY < 3 && !(frameX >= 6 && frameX < 9)) - { - int group = 0; - int[] group1XPos = new int[] { 1, 2, 3 }; - int[] group2XPos = new int[] { 0, 4, 5, 9, 10, 11, 12 }; - foreach (int k in group1XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 1; - } - } - foreach (int k in group2XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 2; - } - } - if (group == 1) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 3) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (group == 2) - { - if (frameY < 1) - { - variant = 0; - } - else if (frameY < 2) - { - variant = 1; - } - else - { - variant = 2; - } - } - } - else if (frameX < 6 && frameY >= 3) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 4) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 6 && frameX < 9) - { - if (frameX < 7) - { - variant = 0; - } - else if (frameX < 8) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 9 && frameY >= 3) - { - if (frameX < 10) - { - variant = 0; - } - else if (frameX < 11) - { - variant = 1; - } - else - { - variant = 2; - } - } - return (variant); - } - */ #endregion } } diff --git a/Tiles/VernalSoil.cs b/Tiles/VernalSoil.cs index 729d05c74c..4826424766 100644 --- a/Tiles/VernalSoil.cs +++ b/Tiles/VernalSoil.cs @@ -199,9 +199,7 @@ namespace CalamityMod.Tiles #region 'Extra Drapes' Drawing private void DrawExtraTop(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - If the tile directly above this tile is not otherworldly stone, or if it is, there is air to both sides of that tile, draw the Extra surface - */ + // If the tile directly above this tile is not otherworldly stone, or if it is, there is air to both sides of that tile, draw the Extra surface if ( CheckTile(Type, false, 0, 1, i, j) || (CheckTile(Type, true, 0, 1, i, j) && CheckTile(Type, false, 1, 1, i, j) && CheckTile(Type, false, -1, 1, i, j) && CheckTile(Type, true, 1, 0, i, j) && CheckTile(Type, true, -1, 0, i, j)) @@ -216,9 +214,7 @@ namespace CalamityMod.Tiles private void DrawExtraWallEnds(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Ending the Extra when a wall is reached - */ + // Ending the Extra when a wall is reached //Left if ( @@ -242,9 +238,7 @@ namespace CalamityMod.Tiles private void DrawExtraOverhang(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Called from DrawExtraTop(). Ending the Extra when the edge of the tile is reached - */ + // Called from DrawExtraTop(). Ending the Extra when the edge of the tile is reached //Left if ( @@ -266,9 +260,7 @@ namespace CalamityMod.Tiles private void DrawExtraDrapes(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Hanging 'drapes' of the extra element - */ + // Hanging 'drapes' of the extra element //Base if ( @@ -347,113 +339,6 @@ namespace CalamityMod.Tiles { return Main.tile[i, j].TileFrameNumber * extraFrameWidth; } - - /* - private int GetTileVariant(int i, int j) - { - int variant = 0; //Default to using variant 1 - Tile sourceTile = Main.tile[i, j]; - //Now to get the particular 'variant group' to use, which is used to take the frameX/frameY of the tile and convert it to the variant the tile is using - int frameX = sourceTile.frameX / 18; - int frameY = sourceTile.frameY / 18; - if (frameY < 3 && !(frameX >= 6 && frameX < 9)) - { - int group = 0; - int[] group1XPos = new int[] { 1, 2, 3 }; - int[] group2XPos = new int[] { 0, 4, 5, 9, 10, 11, 12 }; - foreach (int k in group1XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 1; - } - } - foreach (int k in group2XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 2; - } - } - if (group == 1) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 3) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (group == 2) - { - if (frameY < 1) - { - variant = 0; - } - else if (frameY < 2) - { - variant = 1; - } - else - { - variant = 2; - } - } - } - else if (frameX < 6 && frameY >= 3) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 4) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 6 && frameX < 9) - { - if (frameX < 7) - { - variant = 0; - } - else if (frameX < 8) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 9 && frameY >= 3) - { - if (frameX < 10) - { - variant = 0; - } - else if (frameX < 11) - { - variant = 1; - } - else - { - variant = 2; - } - } - return (variant); - } - */ #endregion public override void NumDust(int i, int j, bool fail, ref int num) { diff --git a/Utilities/DropHelper.cs b/Utilities/DropHelper.cs index ee239e25e2..6ba7f98fe0 100644 --- a/Utilities/DropHelper.cs +++ b/Utilities/DropHelper.cs @@ -115,8 +115,6 @@ namespace CalamityMod public static string CataclysmKilledLast = CalamityUtils.GetTextValue("Condition.Drops.CataclysmKilledLast"); public static string CatastropheKilledLast = CalamityUtils.GetTextValue("Condition.Drops.CatastropheKilledLast"); public static string CynosureText = CalamityUtils.GetTextValue("Condition.Drops.Cynosure"); - - public static string ProvidenceEnragedText = CalamityUtils.GetTextValue("Condition.Drops.ProvidenceEnraged"); public static string ProvidenceChallengeText = CalamityUtils.GetTextValue("Condition.Drops.ProvidenceChallenge"); #endregion diff --git a/Utilities/ItemUtils.cs b/Utilities/ItemUtils.cs index 848c00118a..de041faf9f 100644 --- a/Utilities/ItemUtils.cs +++ b/Utilities/ItemUtils.cs @@ -12,6 +12,7 @@ using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Systems.Collections; +using Terraria.GameInput; namespace CalamityMod { @@ -54,7 +55,7 @@ namespace CalamityMod if (Main.dedServ || mhk is null) return ""; - List keys = mhk.GetAssignedKeysOrEmpty(); + List keys = mhk.GetAssignedKeysOrEmpty(PlayerInput.CurrentInputMode); if (keys.Count == 0) return GetText("Misc.HotkeyNotBound").Value; else @@ -109,6 +110,25 @@ namespace CalamityMod tooltips.FindAndReplace("[KEY]", finalKey); } + /// + /// Shortcut for automatically placing one keybind within a tooltip. Requires the "[KEY]" string to be replaced. + /// + /// The tooltip list provided to a ModifyTooltips TML hook. + /// The ModKeybind to integrate into the tooltip. + public static void IntegrateDynamicHotkey(this List tooltips, Item item) + { + if (Main.dedServ) + return; + + var mhk = item.GetDynamicModHotkey(); + + string finalKey = GetText("Misc.HotkeyNotEquipped").Value; + if (mhk is not null) + finalKey = mhk.TooltipHotkeyString(); + + tooltips.FindAndReplace("[KEY]", finalKey); + } + /// /// Shortcut method for adding "You have already consumed this item" tooltip /// diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs index d1eab75448..40cebbd5b7 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -314,6 +314,8 @@ namespace CalamityMod try { + if (mode == InputMode.Mouse) + mode = InputMode.Keyboard; return keybind.GetAssignedKeys(mode); } catch diff --git a/Utilities/NPCDebuffs.cs b/Utilities/NPCDebuffs.cs index 487ee4a02a..c5dbd5a42a 100644 --- a/Utilities/NPCDebuffs.cs +++ b/Utilities/NPCDebuffs.cs @@ -106,7 +106,7 @@ namespace CalamityMod NPCID.Sets.SpecificDebuffImmunity[npc.type][BuffID.Confused] = true; // Sets certain vanilla NPCs and all town NPCs to be immune to most debuffs. - bool isConsideredSpecialTarget = npc.type == NPCID.SkeletronHead || npc.type == NPCID.DD2EterniaCrystal; + bool isConsideredSpecialTarget = npc.type == NPCID.DD2EterniaCrystal; bool isTownNPC = npc.townNPC || NPCID.Sets.ActsLikeTownNPC[npc.type]; bool applyRegularBuffImmunitySpecialCases = isConsideredSpecialTarget || isTownNPC; if (applyRegularBuffImmunitySpecialCases) diff --git a/Utilities/NPCUtils.cs b/Utilities/NPCUtils.cs index 9b41cd6be3..a53da1a1f8 100644 --- a/Utilities/NPCUtils.cs +++ b/Utilities/NPCUtils.cs @@ -1,18 +1,11 @@ using System; -using System; -using System.Collections.Generic; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; -using System.Reflection; using CalamityMod.Balancing; -using CalamityMod.Balancing; -using CalamityMod.CalPlayer; using CalamityMod.DataStructures; using CalamityMod.Enums; using CalamityMod.Events; -using CalamityMod.Items.Accessories; -using CalamityMod.Items.Armor; using CalamityMod.NPCs; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.OldDuke; @@ -22,22 +15,17 @@ using CalamityMod.NPCs.SunkenSea; using CalamityMod.NPCs.Yharon; using CalamityMod.Packets; using CalamityMod.Systems.Collections; -using CalamityMod.Systems.Collections; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria; using Terraria.Audio; using Terraria.Chat; using Terraria.DataStructures; using Terraria.GameContent; using Terraria.ID; -using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using Terraria.ModLoader; -using static Terraria.ModLoader.ModContent; using static Terraria.ModLoader.ModContent; namespace CalamityMod diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index 8d3a4e0e50..10a5088a9f 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -545,8 +545,11 @@ namespace CalamityMod player.immune = true; player.immuneNoBlink = !blink; if (cooldownSlot < 0) - player.immuneTime = frames; - else + { + if (player.immuneTime < frames) + player.immuneTime = frames; + } + else if (player.hurtCooldowns[cooldownSlot] < frames) player.hurtCooldowns[cooldownSlot] = frames; return true; @@ -577,7 +580,8 @@ namespace CalamityMod // Apply iframes thoroughly. Player.AddImmuneTime is not used because iframes should not exceed the intended amount. player.immune = true; player.immuneNoBlink = !blink; - player.immuneTime = frames; + if (player.immuneTime < frames) + player.immuneTime = frames; for (int i = 0; i < player.hurtCooldowns.Length; ++i) if (player.hurtCooldowns[i] < frames) player.hurtCooldowns[i] = frames; diff --git a/Walls/LimestoneWall.cs b/Walls/LimestoneWall.cs index f6c40077db..a7a15cedd6 100644 --- a/Walls/LimestoneWall.cs +++ b/Walls/LimestoneWall.cs @@ -1,6 +1,7 @@ using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; +using Terraria; namespace CalamityMod.Walls { @@ -10,6 +11,7 @@ namespace CalamityMod.Walls public override void SetStaticDefaults() { + Main.wallHouse[Type] = true; DustType = DustID.Pot; AddMapEntry(new Color(125, 85, 61)); this.AddMapEntryWithWaterVisibility(new Color(78, 76, 127)); diff --git a/Walls/UnsafeWalls/UnsafeAstralGrassWall.cs b/Walls/UnsafeWalls/UnsafeAstralGrassWall.cs index a543900c4e..70952ffd8b 100644 --- a/Walls/UnsafeWalls/UnsafeAstralGrassWall.cs +++ b/Walls/UnsafeWalls/UnsafeAstralGrassWall.cs @@ -15,11 +15,6 @@ namespace CalamityMod.Walls.UnsafeWalls public static Asset leafTexture = null; public static Vector2 TileAdj => (Lighting.Mode == Terraria.Graphics.Light.LightMode.Retro || Lighting.Mode == Terraria.Graphics.Light.LightMode.Trippy) ? Vector2.Zero : Vector2.One * 12; - /*public override bool Autoload(ref string name, ref string texture) - { - mod.AddWall("AstralGrassWallUnsafe", this, texture); - return base.Autoload(ref name, ref texture); - }*/ public override void SetStaticDefaults() { diff --git a/Waters/FloralParadiseWater.cs b/Waters/FloralParadiseWater.cs deleted file mode 100644 index b51b2cbe5c..0000000000 --- a/Waters/FloralParadiseWater.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Waters -{ - public class FloralParadiseWaterflow : ModWaterfallStyle { } - - public class FloralParadiseWater : ModWaterStyle - { - public static int Type { get; private set; } - public static ModWaterStyle Instance { get; private set; } - - public override void SetStaticDefaults() - { - Type = Slot; - Instance = this; - } - - public override void Unload() - { - Type = -1; - Instance = null; - } - - public override int ChooseWaterfallStyle() - { - return ModContent.Find("CalamityMod/FloralParadiseWaterflow").Slot; - } - - public override int GetSplashDust() => DustID.Water; - public override int GetDropletGore() => GoreID.WaterDripCavern; - public override Color BiomeHairColor() => Color.PaleTurquoise; - } -} diff --git a/Waters/FloralParadiseWater.png b/Waters/FloralParadiseWater.png deleted file mode 100644 index 050b018ea8..0000000000 Binary files a/Waters/FloralParadiseWater.png and /dev/null differ diff --git a/Waters/FloralParadiseWater_Block.png b/Waters/FloralParadiseWater_Block.png deleted file mode 100644 index 0294eb4b3c..0000000000 Binary files a/Waters/FloralParadiseWater_Block.png and /dev/null differ diff --git a/Waters/FloralParadiseWater_Slope.png b/Waters/FloralParadiseWater_Slope.png deleted file mode 100644 index 2bd68c8094..0000000000 Binary files a/Waters/FloralParadiseWater_Slope.png and /dev/null differ diff --git a/Waters/FloralParadiseWaterflow.png b/Waters/FloralParadiseWaterflow.png deleted file mode 100644 index 6ac360d4b4..0000000000 Binary files a/Waters/FloralParadiseWaterflow.png and /dev/null differ diff --git a/World/BrimstoneCrag.cs b/World/BrimstoneCrag.cs index 611b17cbc0..314132b000 100644 --- a/World/BrimstoneCrag.cs +++ b/World/BrimstoneCrag.cs @@ -6,6 +6,7 @@ using CalamityMod.Tiles.Crags.Lily; using CalamityMod.Tiles.Crags.Spike; using CalamityMod.Tiles.Crags.Tree; using CalamityMod.Tiles.Ores; +using CalamityMod.Tiles.Pylons; using CalamityMod.Walls.UnsafeWalls; using Microsoft.Xna.Framework; using Terraria; @@ -266,6 +267,26 @@ namespace CalamityMod.World SchematicManager.PlaceSchematic>(SchematicManager.CragRuinKey2, new Point(biomeEdge - 150 + house4Offset, Main.maxTilesY - 125), SchematicAnchor.BottomCenter, ref place); + //place the broken Crags Pylon + Point pylonPlace = new Point(GenVars.dungeonSide == 1 ? (biomeStart + biomeMiddle) / 2 : (biomeMiddle + biomeEdge) / 2, Main.maxTilesY - 150); + while (!Main.tile[pylonPlace].HasTile && pylonPlace.Y < Main.maxTilesY - 75) + pylonPlace.Y++; + if (!Main.tile[pylonPlace].HasTile) + Main.tile[pylonPlace].TileType = (ushort)ModContent.TileType(); + //make sure there's space to place it + for (int i = pylonPlace.X - 1; i <= pylonPlace.X + 1; i++) + { + for (int j = pylonPlace.Y - 4; j <= pylonPlace.Y; j++) + { + Tile t = Main.tile[i, j]; + if (j == pylonPlace.Y) + t.ResetToType(Main.tile[pylonPlace].TileType); + else + WorldGen.KillTile(i, j); + } + } + WorldGen.PlaceObject(pylonPlace.X, pylonPlace.Y - 1, ModContent.TileType()); + //lava clean up again for (int x = biomeStart; x <= biomeEdge; x++) { diff --git a/World/CustomConditions.cs b/World/CustomConditions.cs index 67badca1ee..337a4e3d78 100644 --- a/World/CustomConditions.cs +++ b/World/CustomConditions.cs @@ -33,7 +33,7 @@ namespace CalamityMod.World public class SolidOrPlatform : GenCondition { - protected override bool CheckValidity(int x, int y) => TileID.Sets.Platforms[CalamityUtils.ParanoidTileRetrieval(x, y).TileType] || WorldGen.SolidTile(x, y); + protected override bool CheckValidity(int x, int y) => TileID.Sets.Platforms[CalamityUtils.ParanoidTileRetrieval(x, y).TileType] || WorldGen.SolidTile(Framing.GetTileSafely(x, y)); } public class IsNotTouchingAir : GenCondition diff --git a/World/CustomTemple.cs b/World/CustomTemple.cs index c2ff85acb2..1826053b78 100644 --- a/World/CustomTemple.cs +++ b/World/CustomTemple.cs @@ -921,6 +921,53 @@ namespace CalamityMod.World } } + // Places the "Lizard King" painting + int paintingAmt = Main.maxTilesX > 6400 ? Main.rand.Next(2, 4) : Main.maxTilesX > 4200 ? 2 : 1; + int paintingAttempts = 0; // Give up if all paintings cannot be placed after 10000 attempts + while (paintingAmt > 0 && paintingAttempts <= 10000) + { + paintingAttempts++; + int spotX = WorldGen.genRand.Next(templeLeft, templeRight); + int spotY = WorldGen.genRand.Next(templeTop, templeBottom); + if (Main.tile[spotX, spotY].WallType == WallID.LihzahrdBrickUnsafe && !Main.tile[spotX, spotY].HasTile) + { + bool abortPlacement = false; + for (int i = -70; i <= 70; i++) + { + for (int j = -70; j <= 70; j++) + { + int checkSpotX = spotX + i; + int checkSpotY = spotY + j; + if (!WorldGen.InWorld(checkSpotX, checkSpotY, 5)) + continue; + + Tile tile = Main.tile[checkSpotX, checkSpotY]; + if (tile.HasTile) + { + if (tile.TileType == TileID.Painting3X3) + { + abortPlacement = true; + break; + } + if (i >= -4 && i <= 4 && j >= -4 && j <= 4 && tile.TileType == TileID.LihzahrdBrick) + { + abortPlacement = true; + break; + } + } + } + + if (abortPlacement) + break; + } + if (abortPlacement) + continue; + + if (WorldGen.PlaceTile(spotX, spotY, TileID.Painting3X3, true, false, -1, 88)) + paintingAmt--; + } + } + // Return wood spikes back to normal after the above placements are done. Main.tileSolid[TileID.WoodenSpikes] = true; } diff --git a/World/SunkenSea.cs b/World/SunkenSea.cs index 786fcb8bf9..0bcb66de9c 100644 --- a/World/SunkenSea.cs +++ b/World/SunkenSea.cs @@ -774,66 +774,5 @@ namespace CalamityMod.World return false; } - - /* - public static void PlaceTit(int x, int y, ushort type = 165) - { - if (WorldGen.SolidTile(x, y - 1) && !Main.tile[x, y].HasTile && !Main.tile[x, y + 1].HasTile) - { - if (Main.tile[x, y - 1].TileType == (ushort)ModContent.TileType()) - { - if (WorldGen.genRand.Next(2) == 0 || Main.tile[x, y + 2].HasTile) - { - int num2 = WorldGen.genRand.Next(3) * 18; - Main.tile[x, y].TileType = type; - Main.tile[x, y].Get().HasTile = true; - Main.tile[x, y].TileFrameX = (short)num2; - Main.tile[x, y].TileFrameY = 72; - } - else - { - int num3 = WorldGen.genRand.Next(3) * 18; - Main.tile[x, y].TileType = type; - Main.tile[x, y].Get().HasTile = true; - Main.tile[x, y].TileFrameX = (short)num3; - Main.tile[x, y].TileFrameY = 0; - Main.tile[x, y + 1].TileType = type; - Main.tile[x, y + 1].Get().HasTile = true; - Main.tile[x, y + 1].TileFrameX = (short)num3; - Main.tile[x, y + 1].TileFrameY = 18; - } - } - } - else - { - if (WorldGen.SolidTile(x, y + 1) && !Main.tile[x, y].HasTile && !Main.tile[x, y - 1].HasTile) - { - if (Main.tile[x, y + 1].TileType == (ushort)ModContent.TileType()) - { - if (WorldGen.genRand.Next(2) == 0 || Main.tile[x, y - 2].HasTile) - { - int num13 = WorldGen.genRand.Next(3) * 18; - Main.tile[x, y].TileType = type; - Main.tile[x, y].Get().HasTile = true; - Main.tile[x, y].TileFrameX = (short)num13; - Main.tile[x, y].TileFrameY = 90; - } - else - { - int num14 = WorldGen.genRand.Next(3) * 18; - Main.tile[x, y - 1].TileType = type; - Main.tile[x, y - 1].Get().HasTile = true; - Main.tile[x, y - 1].TileFrameX = (short)num14; - Main.tile[x, y - 1].TileFrameY = 36; - Main.tile[x, y].TileType = type; - Main.tile[x, y].Get().HasTile = true; - Main.tile[x, y].TileFrameX = (short)num14; - Main.tile[x, y].TileFrameY = 54; - } - } - } - } - } - */ } } diff --git a/build.txt b/build.txt index d7a8171ac4..073dde9e3c 100644 --- a/build.txt +++ b/build.txt @@ -1,5 +1,5 @@ author = The Calamity Dev Team -version = 2.2.1 +version = 2.2.2 displayName = Calamity Mod modReferences = CalamityModMusic homepage = https://calamitymod.com