diff --git a/Buffs/DamageOverTime/HadopelagicPressure.cs b/Buffs/DamageOverTime/HadopelagicPressure.cs index 7cde6908ed..6cc7804326 100644 --- a/Buffs/DamageOverTime/HadopelagicPressure.cs +++ b/Buffs/DamageOverTime/HadopelagicPressure.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Buffs.DamageOverTime { public static DebuffData debuffData = new DebuffData() { - EnemyLostRegen = 400, + EnemyLostRegen = 350, //175 dps WaterDebuffScaling = 1 }; public override void SetStaticDefaults() diff --git a/Buffs/DamageOverTime/SulphuricPoisoning.cs b/Buffs/DamageOverTime/SulphuricPoisoning.cs index 79c6a49b58..614e9f0c56 100644 --- a/Buffs/DamageOverTime/SulphuricPoisoning.cs +++ b/Buffs/DamageOverTime/SulphuricPoisoning.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Buffs.DamageOverTime { public static DebuffData debuffData = new DebuffData() { - EnemyLostRegen = 240, + EnemyLostRegen = 350, //175 dps SicknessDebuffScaling = 1 }; public override void SetStaticDefaults() diff --git a/Buffs/DamageOverTime/VermillionFlux.cs b/Buffs/DamageOverTime/VermillionFlux.cs index ab64762903..8e4f03ccc0 100644 --- a/Buffs/DamageOverTime/VermillionFlux.cs +++ b/Buffs/DamageOverTime/VermillionFlux.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Buffs.DamageOverTime { public static DebuffData debuffData = new DebuffData(DebuffData.DebuffBehavior.Electric) { - EnemyLostRegen = 100, + EnemyLostRegen = 75, //150 dps when moving, 37.5 dps when stationary ElectricDebuffScaling = 1 }; public override void SetStaticDefaults() diff --git a/Buffs/DamageOverTime/Voidfrost.cs b/Buffs/DamageOverTime/Voidfrost.cs index 22f0ebda79..37280063fa 100644 --- a/Buffs/DamageOverTime/Voidfrost.cs +++ b/Buffs/DamageOverTime/Voidfrost.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Buffs.DamageOverTime { public static DebuffData debuffData = new DebuffData() { - EnemyLostRegen = 400, + EnemyLostRegen = 500, //250 dps is extra strong for its tier due to being difficult to inflict ColdDebuffScaling = 1 }; public override void SetStaticDefaults() diff --git a/Buffs/StatBuffs/SmashedEvil.cs b/Buffs/StatBuffs/SmashedEvil.cs new file mode 100644 index 0000000000..9991a19dad --- /dev/null +++ b/Buffs/StatBuffs/SmashedEvil.cs @@ -0,0 +1,64 @@ +using System; +using CalamityMod.DataStructures; +using CalamityMod.Items.Accessories; +using Terraria; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.StatBuffs +{ + public class SmashedEvil : ModBuff + { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 40, + SicknessDebuffScaling = 1, + HeatDebuffScaling = 1, + ColdDebuffScaling = 1, + ElectricDebuffScaling = 1, + WaterDebuffScaling = 1, + NPCLifeRegenMethod = SmashedEvilNPCRegen + + }; + + public static void SmashedEvilNPCRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + var cnpc = npc.Calamity(); + float totalDPS = debuffData.EnemyLostRegen; + + var heat = cnpc.ActiveHeatDebuffMultiplier; + var cold = cnpc.ActiveColdDebuffMultiplier; + var sick = cnpc.ActiveSicknessDebuffMultiplier; + var elec = cnpc.ActiveElectricDebuffMultiplier; + var water = cnpc.ActiveWaterDebuffMultiplier; + StatModifier totalScaling = + DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveHeatDebuffMultiplier, debuffData.HeatDebuffScaling) + .CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveColdDebuffMultiplier, debuffData.ColdDebuffScaling) + .CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveSicknessDebuffMultiplier, debuffData.SicknessDebuffScaling) + .CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveWaterDebuffMultiplier, debuffData.WaterDebuffScaling) + .CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveElectricDebuffMultiplier, debuffData.ElectricDebuffScaling) + )))); + totalDPS = totalScaling.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); + } + public override void SetStaticDefaults() + { + Main.debuff[Type] = false; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; + } + + public override void Update(Player player, ref int buffIndex) + { + player.lifeRegenTime += 2; + player.GetDamage() += 0.1f; + player.moveSpeed += 0.2f; + } + + public override void Update(NPC npc, ref int buffIndex) + { + } + } +} diff --git a/Buffs/StatBuffs/SmashedEvil.png b/Buffs/StatBuffs/SmashedEvil.png new file mode 100644 index 0000000000..a75b74f944 Binary files /dev/null and b/Buffs/StatBuffs/SmashedEvil.png differ diff --git a/Buffs/Summon/WulfrumDroidBuff.png b/Buffs/Summon/WulfrumDroidBuff.png index bec3e3f78c..d64a5b4b9b 100644 Binary files a/Buffs/Summon/WulfrumDroidBuff.png and b/Buffs/Summon/WulfrumDroidBuff.png differ diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 8e709012c3..3b28f81093 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -454,6 +454,9 @@ namespace CalamityMod.CalPlayer public int consecutiveCaughtFish = 0; public float WeakTimeFreezeUseTimer = 0; public bool WeakTimeFreezeInUse = false; + + public int DemonAltarDialogueCounter = 0; + public int DemonAltarDialogueCooldown = 0; #endregion #region Sound @@ -722,8 +725,8 @@ namespace CalamityMod.CalPlayer public bool drawnAnyShieldThisFrame = false; // TODO -- Some way to show the player their total shield points. - public int TotalEnergyShielding => RoverDriveShieldDurability + LunicCorpsShieldDurability + pSoulShieldDurability + SpongeShieldDurability; - public int TotalMaxShieldDurability => (roverDrive ? RoverDrive.ShieldDurabilityMax : 0) + (lunicCorpsSet ? LunicCorpsHelmet.ShieldDurabilityMax : 0) + (profanedCrystalBuffs ? ProfanedSoulCrystal.ShieldDurabilityMax : ((pSoulArtifact && !profanedCrystal) ? ProfanedSoulArtifact.ShieldDurabilityMax : 0)) + (sponge ? TheSponge.ShieldDurabilityMax : 0); + public int TotalEnergyShielding => RoverDriveShieldDurability + LunicCorpsShieldDurability + pSoulShieldDurability + SpongeShieldDurability + (Starshield > 0 ? StratusStarburst : 0); + public int TotalMaxShieldDurability => (roverDrive ? RoverDrive.ShieldDurabilityMax : 0) + (lunicCorpsSet ? LunicCorpsHelmet.ShieldDurabilityMax : 0) + (profanedCrystalBuffs ? ProfanedSoulCrystal.ShieldDurabilityMax : ((pSoulArtifact && !profanedCrystal) ? ProfanedSoulArtifact.ShieldDurabilityMax : 0)) + (sponge ? TheSponge.ShieldDurabilityMax : 0) + (Starshield > 0 ? 100 : 0); public int RoverDriveShieldDurability = 0; public int LunicCorpsShieldDurability = 0; @@ -810,6 +813,7 @@ namespace CalamityMod.CalPlayer #region Accessory public bool shieldOfTheHighRulerDashVelocityBoosted = false; + public bool yharimsGift = false; public bool luxorsGift = false; public bool luxorHit = false; public bool luxorsGiftVanity = false; @@ -2353,6 +2357,7 @@ namespace CalamityMod.CalPlayer blazingCursorDamage = false; blazingCursorVisuals = false; + yharimsGift = false; luxorsGift = false; luxorsGiftVanity = false; fungalSymbiote = false; @@ -2645,6 +2650,9 @@ namespace CalamityMod.CalPlayer blunderBoosterVisibility = true; veneratedLocket = false; + if (DemonAltarDialogueCooldown > 0) + DemonAltarDialogueCooldown--; + alcoholPoisoning = false; shadowflame = false; daybroken = false; @@ -4485,6 +4493,10 @@ namespace CalamityMod.CalPlayer if (HasCustomDash && UsedDash.IsOmnidirectional) Player.maxFallSpeed = 50f; + // If the player isn't moving yet is still dashing, disable the dash (prevents weird hook jank) + if (Player.velocity == Vector2.Zero && Player.dashDelay == -1) + Player.dashDelay = 0; + tailFrameUp++; if (tailFrameUp == 8) { diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 4c6bb66a0b..878c6651be 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -460,7 +460,23 @@ namespace CalamityMod.CalPlayer } #endregion + #region OnHitNPC + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (Player.Calamity().yharimsGift) + target.AddBuff(ModContent.BuffType(),120); + } + #endregion + #region Modify Hit NPC + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (target.HasBuff()) + { + //This is essentially 10 AP, but independent of armor amount + modifiers.FlatBonusDamage += 5; + } + } public override void ModifyHitNPCWithItem(Item item, NPC target, ref NPC.HitModifiers modifiers) { modifiers.CritDamage += critDamage; @@ -886,7 +902,7 @@ namespace CalamityMod.CalPlayer float cooldownDurationScalar = MathHelper.Clamp((actualProjDamage - dodgeDamageGateValue) / (float)maxCooldownDurationDamageValue, 0f, 1f); // The Evolution - if (evolution) + if (evolution && !Player.HasBuff()) { if (Player.whoAmI == Main.myPlayer) { @@ -1925,10 +1941,6 @@ namespace CalamityMod.CalPlayer Rectangle location = new Rectangle((int)Player.position.X, (int)Player.position.Y - 16, Player.width, Player.height); CombatText.NewText(location, Color.LightBlue, Language.GetTextValue(shieldDamageText)); - // Give the player iframes for taking a shield hit, regardless of whether or not the shields broke. - int shieldHitIFrames = Player.ComputeHitIFrames(info); - Player.GiveIFrames(info.CooldownCounter, shieldHitIFrames, true); - // Spawn particles when hit with the shields up, regardless of whether or not the shields broke. // More particles spawn if a shield broke. if (pSoulArtifact) @@ -1999,6 +2011,10 @@ namespace CalamityMod.CalPlayer // If the shields completely absorbed the hit, then delete the hit using reflection. if (shieldsFullyAbsorbedHit) { + // Give the player iframes for taking a shield hit + int shieldHitIFrames = Player.ComputeHitIFrames(info); + Player.GiveIFrames(info.CooldownCounter, shieldHitIFrames, true); + freeDodgeFromShieldAbsorption = true; // Cancel defense damage, if it was going to occur this frame. @@ -2404,7 +2420,7 @@ namespace CalamityMod.CalPlayer Player.AddBuff(BuffID.Honey, 300, false); // Handle hit effects from the gem tech armor set. - Player.Calamity().GemTechState.PlayerOnHitEffects((int)hurtInfo.Damage); + Player.Calamity().GemTechState.PlayerOnHitEffects(hurtInfo); if (Player.whoAmI == Main.myPlayer) { @@ -2446,10 +2462,10 @@ namespace CalamityMod.CalPlayer if (dAmulet) { var source = Player.GetSource_Accessory_OnHurt(FindAccessory(), hurtInfo.DamageSource); - int projAmount = (rampartOfDeities ? 12 : 6); + var projAmount = (rampartOfDeities ? 12 : 6) * (Player.strongBees ? 1.5f : 1f); for (int n = 0; n < projAmount; n++) { - int deificProjDamage = (int)(Player.GetBestClassDamage().ApplyTo(DeificAmulet.StarDamage) * (Player.strongBees ? 0.85f : 1f)); + 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)]; if (onHitProj.whoAmI.WithinBounds(Main.maxProjectiles)) @@ -2460,8 +2476,6 @@ namespace CalamityMod.CalPlayer onHitProj.tileCollide = false; onHitProj.extraUpdates = 1; onHitProj.Calamity().conditionalHomingRange = 600f; - if (Player.strongBees) - onHitProj.penetrate += 1; } } } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index ca31f69ef6..8bdb1af27c 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -69,6 +69,8 @@ using CalamityMod.Tiles.Abyss.AbyssAmbient; using CalamityMod.Tiles.FurnitureAuric; using CalamityMod.Tiles.Ores; using CalamityMod.UI; +using CalamityMod.UI.DialogueDisplay; +using CalamityMod.UI.DialogueDisplay.DisplayEffects; using CalamityMod.Utilities; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -205,15 +207,24 @@ namespace CalamityMod.CalPlayer if (Player.HeldItem.type != ModContent.ItemType()) saharaSlicersBolts = 0; - if (Player.whoAmI == Main.myPlayer && Player.HeldItem.type == ModContent.ItemType() && (Player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) && !Player.dead && !Main.mapFullscreen && !Player.mouseInterface) + // Spawning for items that have holdouts active when held + if (Player.whoAmI == Main.myPlayer && !Player.dead && !Main.mapFullscreen && !Player.mouseInterface) { - int damage = (int)Player.GetTotalDamage().ApplyTo(Player.HeldItem.damage); - Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType(), damage, Player.HeldItem.knockBack, Player.whoAmI); - } - if (Player.whoAmI == Main.myPlayer && Player.HeldItem.type == ModContent.ItemType() && (Player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) && !Player.dead && !Main.mapFullscreen && !Player.mouseInterface) - { - int damage = (int)Player.GetTotalDamage().ApplyTo(Player.HeldItem.damage); - Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType(), damage, Player.HeldItem.knockBack, Player.whoAmI); + if (Player.HeldItem.type == ModContent.ItemType() && (Player.ownedProjectileCounts[ModContent.ProjectileType()] == 0)) + { + int damage = (int)Player.GetTotalDamage().ApplyTo(Player.HeldItem.damage); + Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType(), damage, Player.HeldItem.knockBack, Player.whoAmI); + } + if (Player.HeldItem.type == ModContent.ItemType() && (Player.ownedProjectileCounts[ModContent.ProjectileType()] == 0)) + { + int damage = (int)Player.GetTotalDamage().ApplyTo(Player.HeldItem.damage); + Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType(), damage, Player.HeldItem.knockBack, Player.whoAmI); + } + if (Player.HeldItem.type == ModContent.ItemType() && (Player.ownedProjectileCounts[ModContent.ProjectileType()] == 0)) + { + int damage = (int)Player.GetTotalDamage().ApplyTo(Player.HeldItem.damage); + Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType(), damage, Player.HeldItem.knockBack, Player.whoAmI); + } } // De-equipping Gael's Greatsword deletes all rage. @@ -1130,8 +1141,39 @@ namespace CalamityMod.CalPlayer } } + private void DemonAltarTalking() + { + + for (var h = -15; h < 15; h++) + { + for (var j = -15; j < 15; j++) + { + var tilePos = Player.Center.ToTileCoordinates() + new Point(h, j); + if (Main.tile[tilePos.X, tilePos.Y].TileType == TileID.DemonAltar) + { + string type = WorldGen.crimson ? "Mods.CalamityMod.EvilSmasher.CrimsonAltar" : "Mods.CalamityMod.EvilSmasher.DemonAltar"; + if (DialogueDisplaySystem.ContainsDialogueKey(type)) + DialogueDisplaySystem.RemoveDialogue(DialogueDisplaySystem.GetSlot(type)); + DialogueDisplaySystem.StartDialogueOnClient(type, new Vector2(tilePos.X * 16 + 16, tilePos.Y * 16), DemonAltarDialogueCounter, 180, false, new AltarText()); + DemonAltarDialogueCounter++; + DemonAltarDialogueCooldown = 300; + if (DemonAltarDialogueCounter >= 4) + { + DemonAltarDialogueCooldown = 3600; + DemonAltarDialogueCounter = 0; + } + return; + } + } + } + } private void MiscEffects() { + if (Player.inventory.Any(x => x.type == ItemID.Pwnhammer) && !Player.inventory.Any(x => x.type == ModContent.ItemType()) && Player.adjTile[TileID.DemonAltar] && DemonAltarDialogueCooldown <= 0 && Player.miscCounter % 30 == 0) + { + DemonAltarTalking(); + } + //Mana Burn update if (ManaBurnFireDrawer != null) { diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index c8432736c3..478ec02a8b 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -695,14 +695,14 @@ namespace CalamityMod.CalPlayer if (alchFlask && AlchFlaskCooldown == 0 && proj.type != ProjectileType()) { - int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(10); + int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(Player.strongBees ? 15 : 10); Vector2 seekerVelocity = new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f); Projectile bee = Projectile.NewProjectileDirect(source, position, seekerVelocity, ProjectileType(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2); bee.ArmorPenetration = 20; bee.penetrate = 2; bee.extraUpdates = 1; - AlchFlaskCooldown = Player.strongBees ? 6 : 7; + AlchFlaskCooldown = 7; } bool lifeAndShieldCondition = Player.statLife >= Player.statLifeMax2 && (!HasAnyEnergyShield || TotalEnergyShielding >= TotalMaxShieldDurability); @@ -1252,10 +1252,10 @@ namespace CalamityMod.CalPlayer } if (amalgam) { - target.AddBuff(BuffID.Daybreak, 120); - target.AddBuff(BuffType(), 120); + target.AddBuff(BuffType(), 120); + target.AddBuff(BuffID.Frostburn2, 120); target.AddBuff(BuffType(), 120); - target.AddBuff(BuffType(), 120); + target.AddBuff(BuffID.Electrified, 120); target.AddBuff(BuffType(), 120); } if (frostFlare) diff --git a/Cooldowns/CooldownRegistry.cs b/Cooldowns/CooldownRegistry.cs index b697488611..e22fb8fb3a 100644 --- a/Cooldowns/CooldownRegistry.cs +++ b/Cooldowns/CooldownRegistry.cs @@ -6,7 +6,6 @@ using Terraria.ModLoader; namespace CalamityMod.Cooldowns { - // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. public sealed class CooldownRegistry : ModSystem { // Indexed by ushort netID. Contains every registered cooldown. diff --git a/DataStructures/DebuffData.cs b/DataStructures/DebuffData.cs index f988a4dff5..ae5320365e 100644 --- a/DataStructures/DebuffData.cs +++ b/DataStructures/DebuffData.cs @@ -421,7 +421,7 @@ namespace CalamityMod.DataStructures }; public static DebuffData Electrified = new DebuffData(DebuffBehavior.Electric) { - EnemyLostRegen = 21, + EnemyLostRegen = 30, // 15 dps stationary, 60 dps moving EnemyVanillaRegenToCancelOut = 8, ElectricDebuffScaling = 1 }; diff --git a/DataStructures/GemTechArmorState.cs b/DataStructures/GemTechArmorState.cs index 19274a48c6..e117db21b2 100644 --- a/DataStructures/GemTechArmorState.cs +++ b/DataStructures/GemTechArmorState.cs @@ -202,7 +202,7 @@ namespace CalamityMod.DataStructures PreviouslyUsedGem = usedGemType; } - public void PlayerOnHitEffects(int hitDamage) + public void PlayerOnHitEffects(Player.HurtInfo hurtInfo) { // Don't do anything if the player is not wearing the Gem Tech set. var cgp = Owner.Calamity(); @@ -211,6 +211,7 @@ namespace CalamityMod.DataStructures bool gemWasLost = false; int gemDamage = 0; + int hitDamage = (int)hurtInfo.Damage; bool largeEnoughRegularHit = hitDamage >= GemTechHeadgear.GemBreakDamageLowerBound; // 09FEB2024: Ozzatron: chalice of the blood god no longer protects you when using gem tech armor. // It is now slightly anti-synergetic, in that taking tiny hits when you're already bleeding will make you keep losing gems. @@ -275,7 +276,7 @@ namespace CalamityMod.DataStructures gemDamage = CalamityUtils.DamageSoftCap(gemDamage, GemTechHeadgear.GemDamageSoftcapThreshold); if (Main.myPlayer == OwnerIndex) - Projectile.NewProjectile(Owner.GetSource_ItemUse(Owner.HeldItem), gemPosition, Vector2.Zero, ModContent.ProjectileType(), gemDamage, 0f, OwnerIndex, 0f, (int)GemThatShouldBeLost); + Projectile.NewProjectile(Owner.GetSource_OnHurt(hurtInfo.DamageSource), gemPosition, Vector2.Zero, ModContent.ProjectileType(), gemDamage, 0f, OwnerIndex, 0f, (int)GemThatShouldBeLost); } } diff --git a/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.CrimsonAltar.json b/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.CrimsonAltar.json new file mode 100644 index 0000000000..2b0ab25d50 --- /dev/null +++ b/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.CrimsonAltar.json @@ -0,0 +1,47 @@ +{ + "Revision": 1, + "DefaultColor": "FF0000", + "DefaultSpeaker": "DemonAltar", + "AlignType": 1, + "TextDelay": 2, + "BasePunctuationDelay": { + "Delay": 10, + "ForceSet": false, + "Locks": false + }, + "PunctuationDelayCap": 30, + "PunctuationDelays": { + "!": { + "Delay": 20, + "ForceSet": true, + "Locks": true + }, + "?": { + "Delay": 20, + "ForceSet": true, + "Locks": true + } + }, + "Pages": [ + { + "Lines": [ + "You, slayer of the flesh tower...[Pause(0.25)] we have an offer fitting of your deeds." + ] + }, + { + "Lines": [ + "We can bestow you might untold...[Pause(0.25)] [Shaking:to grind your enemies to dust!]" + ] + }, + { + "Lines": [ + "Simply yield the holy hammer unto the altar." + ] + }, + { + "Lines": [ + "Kneel, and we shall render you the strength." + ] + } + ] +} diff --git a/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.DemonAltar.json b/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.DemonAltar.json new file mode 100644 index 0000000000..bfdd7ae10c --- /dev/null +++ b/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.DemonAltar.json @@ -0,0 +1,47 @@ +{ + "Revision": 1, + "DefaultColor": "FF00FF", + "DefaultSpeaker": "DemonAltar", + "AlignType": 1, + "TextDelay": 2, + "BasePunctuationDelay": { + "Delay": 10, + "ForceSet": false, + "Locks": false + }, + "PunctuationDelayCap": 30, + "PunctuationDelays": { + "!": { + "Delay": 20, + "ForceSet": true, + "Locks": true + }, + "?": { + "Delay": 20, + "ForceSet": true, + "Locks": true + } + }, + "Pages": [ + { + "Lines": [ + "Bearer of the Holy Hammer...[Pause(0.25)] [Wavy:desirest thou to taste true power?]" + ] + }, + { + "Lines": [ + "Thine eyes shall be opened...[Pause(0.25)] [Shaking:thou shalt be even as the gods!]" + ] + }, + { + "Lines": [ + "Yield the hammer unto us upon the altar." + ] + }, + { + "Lines": [ + "Surrender, and thou shalt surely receive our might." + ] + } + ] +} diff --git a/Gores/DespairStoneGores/DespairStone.png b/Gores/DespairStoneGores/DespairStone.png index 2a59f561f1..044cd25bb1 100644 Binary files a/Gores/DespairStoneGores/DespairStone.png and b/Gores/DespairStoneGores/DespairStone.png differ diff --git a/Gores/DespairStoneGores/DespairStone2.png b/Gores/DespairStoneGores/DespairStone2.png index 1745408b2a..aa2b5b0df7 100644 Binary files a/Gores/DespairStoneGores/DespairStone2.png and b/Gores/DespairStoneGores/DespairStone2.png differ diff --git a/Items/Accessories/ChaosStone.cs b/Items/Accessories/ChaosStone.cs index 8b743a1c10..ed7d14d158 100644 --- a/Items/Accessories/ChaosStone.cs +++ b/Items/Accessories/ChaosStone.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories public class ChaosStone : ModItem, ILocalizedModType { public static float LostRegenPer100Mana => 8; - public static float DamageMultPer100Mana => 0.04f; + public static float DamageMultPer100Mana => 0.05f; public new string LocalizationCategory => "Items.Accessories"; public override void ModifyTooltips(List tooltips) { diff --git a/Items/Accessories/SlagsplitterPauldron.cs b/Items/Accessories/SlagsplitterPauldron.cs index 0bce37c59f..62ca8e1c6d 100644 --- a/Items/Accessories/SlagsplitterPauldron.cs +++ b/Items/Accessories/SlagsplitterPauldron.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Items.Accessories public static int PauldronSlamDamage = 330; public override void SetDefaults() { - Item.width = 54; - Item.height = 56; + Item.width = 42; + Item.height = 34; Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; Item.accessory = true; diff --git a/Items/Accessories/SlagsplitterPauldron.png b/Items/Accessories/SlagsplitterPauldron.png index f80c4876b9..ced8412b7b 100644 Binary files a/Items/Accessories/SlagsplitterPauldron.png and b/Items/Accessories/SlagsplitterPauldron.png differ diff --git a/Items/Accessories/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index d54b5c5e34..fdea11a01a 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -39,11 +39,11 @@ namespace CalamityMod.Items.Accessories modPlayer.rBrain = true; // Handles shaderain cloud spawning on hit modPlayer.amalgam = true; player.brainOfConfusionItem = Item; - modPlayer.HeatDebuffMultiplier += 2f; - modPlayer.ColdDebuffMultiplier += 2f; - modPlayer.SicknessDebuffMultiplier += 2f; - modPlayer.WaterDebuffMultiplier += 2f; - modPlayer.ElectricDebuffMultiplier += 2f; + modPlayer.HeatDebuffMultiplier += 3f; + modPlayer.ColdDebuffMultiplier += 3f; + modPlayer.SicknessDebuffMultiplier += 3f; + modPlayer.WaterDebuffMultiplier += 3f; + modPlayer.ElectricDebuffMultiplier += 3f; } public override void AddRecipes() diff --git a/Items/Accessories/YharimsGift.cs b/Items/Accessories/YharimsGift.cs index c505001aa1..224b1ed1c1 100644 --- a/Items/Accessories/YharimsGift.cs +++ b/Items/Accessories/YharimsGift.cs @@ -9,13 +9,14 @@ namespace CalamityMod.Items.Accessories public class YharimsGift : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public int dragonTimer = 60; + + public static int MeteorDamage => CalamityUtils.ScaleWithDifficulty(250); public override void SetDefaults() { Item.width = 20; Item.height = 22; - Item.defense = 12; + Item.defense = 10; Item.accessory = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.rare = ModContent.RarityType(); @@ -24,38 +25,20 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { + player.Calamity().yharimsGift = true; var source = player.GetSource_Accessory(Item); - player.moveSpeed += 0.15f; - player.GetDamage() += 0.15f; + player.moveSpeed += 0.2f; + player.GetDamage() += 0.1f; player.noKnockback = true; - if (!player.StandingStill()) - { - dragonTimer--; - if (dragonTimer <= 0) - { - if (player.whoAmI == Main.myPlayer) - { - int damage = (int)player.GetBestClassDamage().ApplyTo(175); - - int projectile1 = Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 5f, player.whoAmI, 0f, 0f); - Main.projectile[projectile1].timeLeft = 60; - } - dragonTimer = 60; - } - } - else - { - dragonTimer = 60; - } - if (player.immune) + if (player.HasIFrames()) { if (player.miscCounter % 8 == 0) { if (player.whoAmI == Main.myPlayer) { - int damage = (int)player.GetBestClassDamage().ApplyTo(375); + int damage = (int)player.GetBestClassDamage().ApplyTo(MeteorDamage); - CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 9f, player.whoAmI); + CalamityUtils.ProjectileRain(source, player.Center, 400f, 400f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 9f, player.whoAmI).Calamity().conditionalHomingRange = 160; } } } diff --git a/Items/Armor/Plaguebringer/PlaguebringerCarapace.cs b/Items/Armor/Plaguebringer/PlaguebringerCarapace.cs index 43566922ae..50c282e3db 100644 --- a/Items/Armor/Plaguebringer/PlaguebringerCarapace.cs +++ b/Items/Armor/Plaguebringer/PlaguebringerCarapace.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Armor.Plaguebringer public new string LocalizationCategory => "Items.Armor.Hardmode"; public static int MinionSlotBoost = 1; - public static float SummonDamageBoost = 0.15f; + public static float SummonDamageBoost = 0.20f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent()); public override void SetStaticDefaults() diff --git a/Items/Armor/Plaguebringer/PlaguebringerPistons.cs b/Items/Armor/Plaguebringer/PlaguebringerPistons.cs index 1ae9a366f0..2bd239bc58 100644 --- a/Items/Armor/Plaguebringer/PlaguebringerPistons.cs +++ b/Items/Armor/Plaguebringer/PlaguebringerPistons.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Armor.Plaguebringer public new string LocalizationCategory => "Items.Armor.Hardmode"; public static int MinionSlotBoost = 1; - public static float SummonDamageBoost = 0.15f; + public static float SummonDamageBoost = 0.20f; public static float MoveSpeedBoost = 0.15f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent(), MoveSpeedBoost.ToPercent()); diff --git a/Items/Armor/Plaguebringer/PlaguebringerVisor.cs b/Items/Armor/Plaguebringer/PlaguebringerVisor.cs index df326df8c0..3bf9a5e25f 100644 --- a/Items/Armor/Plaguebringer/PlaguebringerVisor.cs +++ b/Items/Armor/Plaguebringer/PlaguebringerVisor.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Armor.Plaguebringer public new string LocalizationCategory => "Items.Armor.Hardmode"; public static int MinionSlotBoost = 1; - public static float SummonDamageBoost = 0.15f; + public static float SummonDamageBoost = 0.20f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent()); // Set Bonus diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index c75db9fbc2..62313a8039 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -950,6 +950,7 @@ namespace CalamityMod.Items public override void ModifyItemScale(Item item, Player player, ref float scale) { + // Xyk 3MARCH2026: Doesn't work on any non use style 1 items currently, Doze will fix it if (item.CountsAsClass() && player.HasBuff(BuffID.Tipsy)) scale += 0.15f; } diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 6c604ce7de..94410c1bc9 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -211,7 +211,7 @@ namespace CalamityMod.Items { ItemID.RedRyder, Do(DamageExact(24)) }, { ItemID.RedsYoyo, Do(DamageExact(48)) }, // Red's Throw and Valkyrie Yoyo have the same stats { ItemID.RocketLauncher, Do(DamageExact(60), ShootSpeedExact(9)) }, - { ItemID.Sandgun, Do(DamageExact(22), UseExact(20)) }, + { ItemID.Sandgun, Do(UseExact(20)) }, { ItemID.SapphireStaff, Do(DamageExact(25)) }, { ItemID.ScourgeoftheCorruptor, Do(DamageExact(63)) }, { ItemID.Seedler, Do(UseMeleeSpeed, DamageExact(45), ShootSpeedExact(16)) }, diff --git a/Items/Fishing/FishingRods/WulfrumRod.png b/Items/Fishing/FishingRods/WulfrumRod.png index 593ae2bc0c..ef0b27fb58 100644 Binary files a/Items/Fishing/FishingRods/WulfrumRod.png and b/Items/Fishing/FishingRods/WulfrumRod.png differ diff --git a/Items/LabFinders/WhiteSeekingMechanism.cs b/Items/LabFinders/WhiteSeekingMechanism.cs index e415208707..a621e1835f 100644 --- a/Items/LabFinders/WhiteSeekingMechanism.cs +++ b/Items/LabFinders/WhiteSeekingMechanism.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.LabFinders { CreateRecipe(). AddIngredient(). - AddIngredient(ItemID.IceBlock, 50). + AddRecipeGroup("AnyIceBlock", 50). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Placeables/Astral/AstralSand.cs b/Items/Placeables/Astral/AstralSand.cs index a7e732363b..a317457627 100644 --- a/Items/Placeables/Astral/AstralSand.cs +++ b/Items/Placeables/Astral/AstralSand.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Astral Item.ResearchUnlockCount = 100; ItemTrader.ChlorophyteExtractinator.AddOption_OneWay(Type, 1, ItemID.SandBlock, 1); - ItemID.Sets.SandgunAmmoProjectileData[Type] = new(ModContent.ProjectileType(), 0); + ItemID.Sets.SandgunAmmoProjectileData[Type] = new(ModContent.ProjectileType(), 5); } public override void SetDefaults() diff --git a/Items/Potions/Alcohol/GrapeBeer.cs b/Items/Potions/Alcohol/GrapeBeer.cs index af8baea14b..1fcd4d64cf 100644 --- a/Items/Potions/Alcohol/GrapeBeer.cs +++ b/Items/Potions/Alcohol/GrapeBeer.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Potions.Alcohol { public new string LocalizationCategory => "Items.Potions"; - public static float CritLoss = 75; + public static float CritLoss = 50; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritLoss); public override void SetStaticDefaults() diff --git a/Items/SummonItems/DesertMedallion.cs b/Items/SummonItems/DesertMedallion.cs index 5be0d32527..09a96a112c 100644 --- a/Items/SummonItems/DesertMedallion.cs +++ b/Items/SummonItems/DesertMedallion.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.SummonItems public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.SandBlock, 40). + AddRecipeGroup("Sand", 40). AddIngredient(ItemID.AntlionMandible, 4). AddIngredient(2). AddTile(TileID.DemonAltar). diff --git a/Items/Tools/AstralHamaxe.cs b/Items/Tools/AstralHamaxe.cs index 2b7ba2735c..0caf445b78 100644 --- a/Items/Tools/AstralHamaxe.cs +++ b/Items/Tools/AstralHamaxe.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Tools Item.width = 60; Item.height = 70; Item.damage = 80; + Item.crit = 25; Item.knockBack = 5f; Item.useTime = 5; Item.useAnimation = 20; @@ -32,9 +33,6 @@ namespace CalamityMod.Items.Tools Item.autoReuse = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25; - public override void MeleeEffects(Player player, Rectangle hitbox) { Dust d = CalamityUtils.MeleeDustHelper(player, Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType(), 0.48f, 50, 78, -0.1f, 0.1f); diff --git a/Items/Tools/AstralPickaxe.cs b/Items/Tools/AstralPickaxe.cs index 5330fa612f..a0fc904380 100644 --- a/Items/Tools/AstralPickaxe.cs +++ b/Items/Tools/AstralPickaxe.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Tools Item.width = 50; Item.height = 60; Item.damage = 65; + Item.crit = 25; Item.knockBack = 5f; Item.useTime = 6; Item.useAnimation = 10; @@ -31,9 +32,6 @@ namespace CalamityMod.Items.Tools Item.autoReuse = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25; - public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Tools/ClimateChange/AridArtifact.cs b/Items/Tools/ClimateChange/AridArtifact.cs index 9949af0295..2e685defcd 100644 --- a/Items/Tools/ClimateChange/AridArtifact.cs +++ b/Items/Tools/ClimateChange/AridArtifact.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Tools.ClimateChange public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.SandBlock, 50). + AddRecipeGroup("Sand", 50). AddRecipeGroup("AnyAdamantiteBar", 10). AddIngredient(ItemID.AncientCloth, 5). AddTile(TileID.MythrilAnvil). diff --git a/Items/Tools/CrystylCrusher.cs b/Items/Tools/CrystylCrusher.cs index a4ad4abbf5..79a4fa8f1c 100644 --- a/Items/Tools/CrystylCrusher.cs +++ b/Items/Tools/CrystylCrusher.cs @@ -31,6 +31,7 @@ namespace CalamityMod.Items.Tools Item.width = 70; Item.height = 70; Item.damage = 400; + Item.crit = 25; Item.knockBack = 9f; Item.useTime = 1; Item.useAnimation = 10; @@ -56,9 +57,6 @@ namespace CalamityMod.Items.Tools return new Vector2(10, 10); } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25; - public override bool AltFunctionUse(Player player) => true; public override void HoldItem(Player player) diff --git a/Items/Tools/InfernaCutter.cs b/Items/Tools/InfernaCutter.cs index e4b232899e..44429ca5dd 100644 --- a/Items/Tools/InfernaCutter.cs +++ b/Items/Tools/InfernaCutter.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.Tools Item.width = 80; Item.height = 66; Item.damage = 110; + Item.crit = 10; Item.knockBack = 7f; Item.useTime = 8; Item.useAnimation = 12; @@ -30,9 +31,6 @@ namespace CalamityMod.Items.Tools Item.autoReuse = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; - public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox) { hitbox = CalamityUtils.FixSwingHitbox(54, 54); diff --git a/Items/Weapons/Magic/Apathanull.cs b/Items/Weapons/Magic/Apathanull.cs index 862e88b275..799f6e63bc 100644 --- a/Items/Weapons/Magic/Apathanull.cs +++ b/Items/Weapons/Magic/Apathanull.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 30; Item.damage = 63; Item.DamageType = DamageClass.Magic; + Item.crit = 12; Item.mana = 20; Item.useTime = 8; Item.useAnimation = 20; @@ -37,9 +38,6 @@ namespace CalamityMod.Items.Weapons.Magic public override void HoldItem(Player player) => player.Calamity().mouseRotationListener = true; - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 12; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Projectile.NewProjectileDirect(source, position, velocity.RotatedByRandom(0.7f), ModContent.ProjectileType(), damage, knockback, player.whoAmI); diff --git a/Items/Weapons/Magic/AstralStaff.cs b/Items/Weapons/Magic/AstralStaff.cs index 03a48809e3..c7cc0e9a90 100644 --- a/Items/Weapons/Magic/AstralStaff.cs +++ b/Items/Weapons/Magic/AstralStaff.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 72; Item.damage = 245; Item.DamageType = DamageClass.Magic; + Item.crit = 15; Item.mana = 26; Item.useTime = 18; Item.useAnimation = 18; @@ -36,9 +37,6 @@ namespace CalamityMod.Items.Weapons.Magic Item.shootSpeed = 15f; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 15; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 spawnPos = new Vector2(player.MountedCenter.X + Main.rand.Next(-200, 201), player.MountedCenter.Y - 600f); diff --git a/Items/Weapons/Magic/EldritchTome.cs b/Items/Weapons/Magic/EldritchTome.cs index e231ed2ab4..db855f0b79 100644 --- a/Items/Weapons/Magic/EldritchTome.cs +++ b/Items/Weapons/Magic/EldritchTome.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 30; Item.damage = 32; Item.DamageType = DamageClass.Magic; + Item.crit = 5; Item.mana = 7; Item.useTime = 7; Item.useAnimation = 21; @@ -31,9 +32,6 @@ namespace CalamityMod.Items.Weapons.Magic Item.shootSpeed = 12f; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 5; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 spreadVelocity = velocity.RotatedByRandom(MathHelper.ToRadians(18f)) * Main.rand.NextFloat(0.8f, 1.2f); diff --git a/Items/Weapons/Magic/HyperdeathRiftScepter.cs b/Items/Weapons/Magic/HyperdeathRiftScepter.cs index 384dabfa6c..f8978a184f 100644 --- a/Items/Weapons/Magic/HyperdeathRiftScepter.cs +++ b/Items/Weapons/Magic/HyperdeathRiftScepter.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 80; Item.height = 84; - Item.damage = 4300; + Item.damage = 4100; Item.DamageType = DamageClass.Magic; Item.mana = 50; Item.useTime = Item.useAnimation = 50; diff --git a/Items/Weapons/Magic/InfernalRift.cs b/Items/Weapons/Magic/InfernalRift.cs index a162271cf9..5b4f710290 100644 --- a/Items/Weapons/Magic/InfernalRift.cs +++ b/Items/Weapons/Magic/InfernalRift.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 16; Item.damage = 50; Item.DamageType = DamageClass.Magic; + Item.crit = 25; Item.mana = 15; Item.useTime = 2; Item.useAnimation = 30; @@ -38,10 +39,6 @@ namespace CalamityMod.Items.Weapons.Magic Item.shootSpeed = 28f; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25; - - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true); diff --git a/Items/Weapons/Magic/RecitationoftheBeast.cs b/Items/Weapons/Magic/RecitationoftheBeast.cs index 252fca4e1a..96af4794a6 100644 --- a/Items/Weapons/Magic/RecitationoftheBeast.cs +++ b/Items/Weapons/Magic/RecitationoftheBeast.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.width = 38; Item.height = 54; Item.damage = 60; + Item.crit = 20; Item.mana = 17; Item.noMelee = true; Item.useAnimation = 22; @@ -32,9 +33,6 @@ namespace CalamityMod.Items.Weapons.Magic Item.DamageType = DamageClass.Magic; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; - 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 < 6; i++) diff --git a/Items/Weapons/Magic/SHPC.cs b/Items/Weapons/Magic/SHPC.cs index f84d56f9d3..f7fa8e662f 100644 --- a/Items/Weapons/Magic/SHPC.cs +++ b/Items/Weapons/Magic/SHPC.cs @@ -1,10 +1,10 @@ -using CalamityMod.Items.Materials; +using System; +using System.Collections.Generic; +using System.IO; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.IO; using Terraria; using Terraria.Audio; using Terraria.DataStructures; @@ -92,6 +92,23 @@ namespace CalamityMod.Items.Weapons.Magic return soul; } + public override bool CanRightClick() + { + if (!Main.keyState.PressingShift()) + return false; + return true; + } + + public override void RightClick(Player player) + { + if (storedSoulpower > 0) + { + storedSoulpower = 0; + } + } + + public override bool ConsumeItem(Player player) => false; + public Color FindColorForSoul() { Color returnColor = new(0, 0, 0); diff --git a/Items/Weapons/Magic/StarShower.cs b/Items/Weapons/Magic/StarShower.cs index ae8c5a91a7..7711b1af37 100644 --- a/Items/Weapons/Magic/StarShower.cs +++ b/Items/Weapons/Magic/StarShower.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 40; Item.damage = 60; Item.DamageType = DamageClass.Magic; + Item.crit = 25; Item.mana = 15; Item.rare = ItemRarityID.Cyan; Item.useTime = 14; @@ -34,9 +35,6 @@ namespace CalamityMod.Items.Weapons.Magic Item.shootSpeed = ShootSpeed; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 mouse = player.ClampedMouseWorld(); diff --git a/Items/Weapons/Magic/TheDanceofLight.cs b/Items/Weapons/Magic/TheDanceofLight.cs index 32f4211022..9f50835ece 100644 --- a/Items/Weapons/Magic/TheDanceofLight.cs +++ b/Items/Weapons/Magic/TheDanceofLight.cs @@ -33,9 +33,10 @@ namespace CalamityMod.Items.Weapons.Magic Item.width = 40; Item.height = 42; Item.damage = 515; - Item.knockBack = 4f; Item.DamageType = DamageClass.Magic; + Item.crit = 20; Item.mana = 6; + Item.knockBack = 4f; Item.useStyle = ItemUseStyleID.Shoot; Item.useTime = 2; @@ -54,9 +55,6 @@ namespace CalamityMod.Items.Weapons.Magic Item.Calamity().devItem = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; - public override Vector2? HoldoutOffset() => Vector2.Zero; 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/UltraLiquidator.cs b/Items/Weapons/Magic/UltraLiquidator.cs index 6dc127929d..79819761d0 100644 --- a/Items/Weapons/Magic/UltraLiquidator.cs +++ b/Items/Weapons/Magic/UltraLiquidator.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = Item.height = 70; Item.damage = 120; + Item.crit = 30; Item.knockBack = 5f; Item.useTime = 3; Item.reuseDelay = Item.useAnimation = 15; @@ -37,9 +38,6 @@ namespace CalamityMod.Items.Weapons.Magic Item.rare = ItemRarityID.Purple; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 30; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo projSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 playerPos = player.RotatedRelativePoint(player.MountedCenter, true); diff --git a/Items/Weapons/Magic/ValkyrieRay.cs b/Items/Weapons/Magic/ValkyrieRay.cs index 5174f80dbc..3dfcc3b6cd 100644 --- a/Items/Weapons/Magic/ValkyrieRay.cs +++ b/Items/Weapons/Magic/ValkyrieRay.cs @@ -30,6 +30,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 115; Item.knockBack = 8.5f; Item.DamageType = DamageClass.Magic; + Item.crit = 11; Item.mana = 17; Item.useTime = ChargeFrames + CooldownFrames; Item.useAnimation = ChargeFrames + CooldownFrames; @@ -45,8 +46,6 @@ namespace CalamityMod.Items.Weapons.Magic Item.autoReuse = true; } - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 11; - public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Magic/VeeringWind.cs b/Items/Weapons/Magic/VeeringWind.cs index b3e9f78474..63c8f0dcad 100644 --- a/Items/Weapons/Magic/VeeringWind.cs +++ b/Items/Weapons/Magic/VeeringWind.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.IceBlock, 30). + AddRecipeGroup("AnyIceBlock", 30). AddIngredient(ItemID.Feather, 3). AddIngredient(ItemID.FallenStar, 5). AddIngredient(ItemID.Cloud, 10). diff --git a/Items/Weapons/Melee/ArkoftheCosmos.cs b/Items/Weapons/Melee/ArkoftheCosmos.cs index 14a4346bf8..c119913376 100644 --- a/Items/Weapons/Melee/ArkoftheCosmos.cs +++ b/Items/Weapons/Melee/ArkoftheCosmos.cs @@ -78,6 +78,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = Item.height = 136; Item.damage = 1800; Item.DamageType = DamageClass.MeleeNoSpeed; + Item.crit = 15; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 15; @@ -93,9 +94,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = RarityType(); } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 15; - public override bool AltFunctionUse(Player player) => true; public override void HoldItem(Player player) diff --git a/Items/Weapons/Melee/ArkoftheElements.cs b/Items/Weapons/Melee/ArkoftheElements.cs index 8a65882035..4dc95aa92f 100644 --- a/Items/Weapons/Melee/ArkoftheElements.cs +++ b/Items/Weapons/Melee/ArkoftheElements.cs @@ -56,6 +56,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.height = 172; Item.damage = 507; Item.DamageType = DamageClass.MeleeNoSpeed; + Item.crit = 10; Item.noUseGraphic = true; Item.noMelee = true; Item.useAnimation = 20; @@ -71,9 +72,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.shootSpeed = 16f; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; - public override bool AltFunctionUse(Player player) => true; public override void HoldItem(Player player) diff --git a/Items/Weapons/Melee/AstralPike.cs b/Items/Weapons/Melee/AstralPike.cs index 688ef97985..68a9bd3f48 100644 --- a/Items/Weapons/Melee/AstralPike.cs +++ b/Items/Weapons/Melee/AstralPike.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.height = 50; Item.damage = 90; Item.DamageType = TrueMeleeDamageClass.Instance; + Item.crit = 25; Item.noMelee = true; Item.useTurn = true; Item.noUseGraphic = true; @@ -35,9 +36,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.shootSpeed = 13f; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25; - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override void AddRecipes() diff --git a/Items/Weapons/Melee/Basher.cs b/Items/Weapons/Melee/Basher.cs index 4920f4ff29..99890c2b25 100644 --- a/Items/Weapons/Melee/Basher.cs +++ b/Items/Weapons/Melee/Basher.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.FurnitureAcidwood; using CalamityMod.Projectiles.Melee; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 56; Item.height = 60; - Item.damage = 40; + Item.damage = 85; Item.DamageType = TrueMeleeDamageClass.Instance; Item.useAnimation = Item.useTime = 30; Item.useStyle = ItemUseStyleID.Swing; @@ -30,6 +31,13 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ItemRarityID.Blue; } public override bool MeleePrefix() => true; + public override bool CanUseItem(Player player) => false; + public override void HoldItem(Player player) + { + if (Main.myPlayer == player.whoAmI) + player.Calamity().rightClickListener = true; + player.Calamity().mouseWorldListener = true; + } public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Melee/BrokenBiomeBlade.cs b/Items/Weapons/Melee/BrokenBiomeBlade.cs index 02a837769c..c4503e4546 100644 --- a/Items/Weapons/Melee/BrokenBiomeBlade.cs +++ b/Items/Weapons/Melee/BrokenBiomeBlade.cs @@ -327,7 +327,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(ItemType(), 10). AddIngredient(ItemID.HellstoneBar, 10). AddIngredient(ItemID.DirtBlock, 50). - AddIngredient(ItemID.StoneBlock, 50). + AddRecipeGroup("AnyStoneBlock", 50). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Weapons/Melee/DevilsSunrise.cs b/Items/Weapons/Melee/DevilsSunrise.cs index 99c244a22e..e9c89a9a0c 100644 --- a/Items/Weapons/Melee/DevilsSunrise.cs +++ b/Items/Weapons/Melee/DevilsSunrise.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.height = 66; Item.damage = 420; Item.DamageType = DamageClass.MeleeNoSpeed; + Item.crit = 10; Item.useAnimation = 25; Item.useTime = 5; Item.noMelee = true; @@ -35,8 +36,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.shootSpeed = 24f; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; // You can't use the sword if you've thrown it, silly public override bool CanUseItem(Player player) => player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0; public override void HoldItem(Player player) diff --git a/Items/Weapons/Melee/EvilSmasher.cs b/Items/Weapons/Melee/EvilSmasher.cs index 27abbe6fa8..596829a8c7 100644 --- a/Items/Weapons/Melee/EvilSmasher.cs +++ b/Items/Weapons/Melee/EvilSmasher.cs @@ -1,38 +1,203 @@ -using Terraria; +using System; +using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Melee; +using CalamityMod.Utilities.Daybreak; +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.Items.Weapons.Melee { - public class EvilSmasher : ModItem, ILocalizedModType + public class EvilSmasher : BaseSwordHoldoutItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override int ProjectileType => ModContent.ProjectileType(); + + public bool IsAnimating = false; + public int AnimationTime = 0; public override void SetDefaults() { + base.SetDefaults(); Item.width = 64; Item.height = 66; - Item.damage = 120; - Item.DamageType = DamageClass.Melee; - Item.useAnimation = Item.useTime = 38; - Item.useStyle = ItemUseStyleID.Swing; - Item.useTurn = true; + Item.damage = 200; + Item.DamageType = AverageDamageClass.Instance; + Item.useAnimation = Item.useTime = 120; + Item.channel = true; Item.knockBack = 6f; - Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; } - - public override float UseSpeedMultiplier(Player player) => 1f + (player.Calamity().evilSmasherBoost * 0.1f); - - public override void ModifyWeaponDamage(Player player, ref StatModifier damage) => damage *= 1f + player.Calamity().evilSmasherBoost * 0.1f; - - public override void ModifyWeaponKnockback(Player player, ref StatModifier knockback) => knockback *= 1f + (player.Calamity().evilSmasherBoost * 0.1f); - - public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) + public override void UpdateInventory(Player player) { - if (target.life <= 0 && player.Calamity().evilSmasherBoost < 10) - player.Calamity().evilSmasherBoost += 1; + AnimationTime = 300; + base.UpdateInventory(player); + } + + public override void Update(ref float gravity, ref float maxFallSpeed) + { + if (!IsAnimating) + { + if (AnimationTime < 300) + AnimationTime++; + return; + } + float completion = AnimationTime / 240f; + Item.noGrabDelay = 120; + Item.velocity = new Vector2(0, -1f); + int dotAmount = 0; + for (var i = 0; i < dotAmount; i++) + { + var ringDir = getRingOffset(i / (float)dotAmount * -MathHelper.TwoPi + MathHelper.TwoPi * completion * 3, ySquish: 3f); + Dust.NewDustPerfect(Item.Center + (ringDir * (completion - MathF.Pow(completion, 2)) * 256), i % 2 == 0 ? DustID.Crimson : DustID.Corruption, ringDir); + } + if (Main.rand.NextFloat() < completion) + Dust.NewDustPerfect(Item.Center, Main.rand.NextBool() ? DustID.CursedTorch : DustID.IchorTorch,Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi) * 5); + if (completion >= 1) + { + for (var i = 0; i < 50; i++) + { + Dust.NewDustPerfect(Item.Center, Main.rand.NextBool() ? DustID.CursedTorch : DustID.IchorTorch, Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi) * 5); + Dust.NewDustPerfect(Item.Center, Main.rand.NextBool() ? DustID.Crimson : DustID.Corruption, Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi) * 5); + } + IsAnimating = false; + Item.velocity = new Vector2(0, -5); + } + AnimationTime++; + } + + #region Textures + private static Asset GlowTex = null; + private static Texture2D GetGlowTex() + { + if (GlowTex == null) + { + GlowTex = ModContent.Request("CalamityMod/Particles/BloomCircle"); + } + return GlowTex.Value; + } + + private static Asset GlowBeamTex = null; + private static Texture2D GetGlowBeamTex() + { + if (GlowBeamTex == null) + { + GlowBeamTex = ModContent.Request("CalamityMod/Particles/BloomLineFade"); + } + return GlowBeamTex.Value; + } + private static Asset GlowBeamCapTex = null; + private static Texture2D GetGlowBeamCapTex() + { + if (GlowBeamCapTex == null) + { + GlowBeamCapTex = ModContent.Request("CalamityMod/Particles/BloomLineCap"); + } + return GlowBeamCapTex.Value; + } + #endregion + public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) + { + if (IsAnimating) + { + var color = Color.Lerp(Color.Purple, Color.Red, MathF.Sin(Main.GlobalTimeWrappedHourly * 6) * 0.5f + 0.5f); + + using (Main.spriteBatch.Scope()) + { + Main.spriteBatch.Begin(SpriteSortMode.Immediate, + BlendState.Additive, + SamplerState.PointClamp, + DepthStencilState.None, + Main.Rasterizer, + null, + Main.GameViewMatrix.TransformationMatrix + ); + + Main.spriteBatch.Draw(GetGlowTex(), Item.Center - Main.screenPosition, null, color, 0, GetGlowTex().Size() * 0.5f, 0.1f + 0.7f * (AnimationTime / 240f), SpriteEffects.None, 0); + int rep = 0; + for (float i = 0; i <= MathHelper.TwoPi; i += MathHelper.TwoPi * 0.166f) + { + Main.spriteBatch.Draw(GetGlowBeamTex(), Item.Center - Main.screenPosition, null, color, MathHelper.WrapAngle(Main.GlobalTimeWrappedHourly) + i, new(GetGlowBeamTex().Size().X * 0.5f, 0), 0f + 0.06f * (AnimationTime / 240f) * (rep == 0 ? 1 : 0.75f), SpriteEffects.None, 0); + rep = (rep + 1) % 2; + } + + Main.spriteBatch.End(); + } + + var tex = TextureAssets.Item[ItemID.Pwnhammer].Value; + Main.spriteBatch.Draw(tex, Item.Center - Main.screenPosition, null, Color.Lerp(lightColor, Color.Black, AnimationTime / 240f), 0, tex.Size() * 0.5f, MathHelper.Lerp(1, 1.75f, AnimationTime / 240f), SpriteEffects.None, 0); + return false; + + } + else if (AnimationTime < 300) + { + float completion = 1 - (AnimationTime - 240) / 60f; + var color = Color.Lerp(Color.Purple, Color.Red, MathF.Sin(Main.GlobalTimeWrappedHourly * 6) * 0.5f + 0.5f); + + using (Main.spriteBatch.Scope()) + { + Main.spriteBatch.Begin(SpriteSortMode.Immediate, + BlendState.Additive, + SamplerState.PointClamp, + DepthStencilState.None, + Main.Rasterizer, + null, + Main.GameViewMatrix.TransformationMatrix + ); + + Main.spriteBatch.Draw(GetGlowTex(), Item.Center - Main.screenPosition, null, color, 0, GetGlowTex().Size() * 0.5f, 0.1f + 0.7f * completion, SpriteEffects.None, 0); + int rep = 0; + for (float i = 0; i <= MathHelper.TwoPi; i += MathHelper.TwoPi * 0.166f) + { + Main.spriteBatch.Draw(GetGlowBeamTex(), Item.Center - Main.screenPosition, null, color, MathHelper.WrapAngle(Main.GlobalTimeWrappedHourly) + i, new(GetGlowBeamTex().Size().X * 0.5f, 0), 0f + 0.06f * completion * (rep == 0 ? 1 : 0.75f), SpriteEffects.None, 0); + rep = (rep + 1) % 2; + } + + Main.spriteBatch.End(); + } + } + return base.PreDrawInWorld(spriteBatch, lightColor, alphaColor, ref rotation, ref scale, whoAmI); + } + + private Vector2 getRingOffset(float rad, float xSquish = 1, float ySquish = 1) + { + return new Vector2((1 / xSquish) * MathF.Cos(rad), (1 / ySquish) * MathF.Sin(rad)); + } + } + + public class EvilSmasherSacrifice : GlobalItem + { + public override bool AppliesToEntity(Item entity, bool lateInstantiation) + { + return entity.type == ItemID.Pwnhammer; + } + + public override void Update(Item item, ref float gravity, ref float maxFallSpeed) + { + if (item.noGrabDelay > 0) return; //Only run once the item is fully settled + for (var i = 0; i < 5; i++) //Loop a couple times to check different vertical positions for the altar, improving accuracy. + { + var tileCheckPos = item.Center.ToTileCoordinates() + new Point(0, i); + if (Main.tile[tileCheckPos.X, tileCheckPos.Y].TileType == TileID.DemonAltar) + { + if (!(Main.netMode == NetmodeID.MultiplayerClient)) + { + var newItem = Main.item[Item.NewItem(item.GetSource_FromThis(), item.Hitbox, ModContent.ItemType())]; + newItem.noGrabDelay = 120; + newItem.prefix = item.prefix; + (newItem.ModItem as EvilSmasher).IsAnimating = true; + } + item.stack -= 1; + if (item.stack <= 0) + item.active = false; + return; + } + } } } } diff --git a/Items/Weapons/Melee/EvilSmasherGlow.png b/Items/Weapons/Melee/EvilSmasherGlow.png new file mode 100644 index 0000000000..a42c9964b6 Binary files /dev/null and b/Items/Weapons/Melee/EvilSmasherGlow.png differ diff --git a/Items/Weapons/Melee/ExaltedOathblade.cs b/Items/Weapons/Melee/ExaltedOathblade.cs index bfd403ae03..7b24615dc9 100644 --- a/Items/Weapons/Melee/ExaltedOathblade.cs +++ b/Items/Weapons/Melee/ExaltedOathblade.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 88; Item.height = 88; Item.damage = 90; + Item.crit = 31; Item.useAnimation = Item.useTime = 45; Item.useStyle = ItemUseStyleID.Shoot; @@ -39,7 +40,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ItemRarityID.Yellow; } public override bool MeleePrefix() => true; - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 31; public override bool CanUseItem(Player player) => player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0 && !player.Calamity().mouseRight; public override void HoldItem(Player player) { diff --git a/Items/Weapons/Melee/ForbiddenOathblade.cs b/Items/Weapons/Melee/ForbiddenOathblade.cs index b8339e9b17..1f474602f8 100644 --- a/Items/Weapons/Melee/ForbiddenOathblade.cs +++ b/Items/Weapons/Melee/ForbiddenOathblade.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 74; Item.height = 74; Item.damage = 58; + Item.crit = 21; Item.useAnimation = Item.useTime = 50; Item.useStyle = ItemUseStyleID.Shoot; @@ -38,7 +39,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ItemRarityID.Pink; } public override bool MeleePrefix() => true; - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 21; public override bool CanUseItem(Player player) => player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0 && !player.Calamity().mouseRight; public override void HoldItem(Player player) { diff --git a/Items/Weapons/Melee/Murasama.cs b/Items/Weapons/Melee/Murasama.cs index 5b5a7708c9..3f14bfa7fd 100644 --- a/Items/Weapons/Melee/Murasama.cs +++ b/Items/Weapons/Melee/Murasama.cs @@ -33,6 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.height = 134; Item.damage = 2200; Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance; + Item.crit = 61; Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; @@ -47,9 +48,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ModContent.RarityType(); } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 61; - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) { Texture2D texture; diff --git a/Items/Weapons/Melee/OldLordClaymore.cs b/Items/Weapons/Melee/OldLordClaymore.cs index 82d8b08a91..d3673b326a 100644 --- a/Items/Weapons/Melee/OldLordClaymore.cs +++ b/Items/Weapons/Melee/OldLordClaymore.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.height = 76; Item.damage = 144; Item.DamageType = TrueMeleeDamageClass.Instance; + Item.crit = 11; Item.useAnimation = Item.useTime = 90; // Yes it's actually supposed to be this slow Item.useStyle = ItemUseStyleID.Shoot; @@ -38,6 +39,5 @@ namespace CalamityMod.Items.Weapons.Melee Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/Melee/OldLordClaymoreGlow").Value); } public override bool MeleePrefix() => true; - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 11; } } diff --git a/Items/Weapons/Melee/Omniblade.cs b/Items/Weapons/Melee/Omniblade.cs index 1fc173a4e3..ac56bb47f4 100644 --- a/Items/Weapons/Melee/Omniblade.cs +++ b/Items/Weapons/Melee/Omniblade.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.height = 146; Item.damage = 100; Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance; + Item.crit = 45; Item.useAnimation = 12; Item.useStyle = ItemUseStyleID.Swing; Item.useTime = 12; @@ -31,9 +32,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ItemRarityID.Yellow; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 45; - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override void AddRecipes() diff --git a/Items/Weapons/Melee/PhosphorescentGauntlet.cs b/Items/Weapons/Melee/PhosphorescentGauntlet.cs index 367fe584f3..85cfbce481 100644 --- a/Items/Weapons/Melee/PhosphorescentGauntlet.cs +++ b/Items/Weapons/Melee/PhosphorescentGauntlet.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = Item.height = 40; Item.damage = 2705; Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance; + Item.crit = 10; Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; @@ -33,9 +34,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ModContent.RarityType(); } - // Terraria seems to really dislike high crit values in SetDefaults. - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Melee/PhotonRipper.cs b/Items/Weapons/Melee/PhotonRipper.cs index 8faaf618d0..ca5701977f 100644 --- a/Items/Weapons/Melee/PhotonRipper.cs +++ b/Items/Weapons/Melee/PhotonRipper.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 134; Item.height = 54; Item.damage = 3725; + Item.crit = 18; Item.knockBack = 12f; Item.useTime = 5; Item.useAnimation = 25; @@ -43,8 +44,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.value = CalamityGlobalItem.RarityVioletBuyPrice; } - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 18; - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override bool AltFunctionUse(Player player) => true; public override void HoldItem(Player player) diff --git a/Items/Weapons/Melee/Roxcalibur.cs b/Items/Weapons/Melee/Roxcalibur.cs index debc3d50b2..c0d4f25266 100644 --- a/Items/Weapons/Melee/Roxcalibur.cs +++ b/Items/Weapons/Melee/Roxcalibur.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 100; Item.height = 100; Item.damage = 180; + Item.crit = 8; Item.knockBack = 13f; Item.DamageType = DamageClass.Melee; Item.useStyle = ItemUseStyleID.Shoot; @@ -39,10 +40,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.channel = true; } - public override void ModifyWeaponCrit(Player player, ref float crit) - { - crit += 8f; - } public override bool CanUseItem(Player player) => Main.hardMode && player.ownedProjectileCounts[Item.shoot] < 1; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { @@ -61,7 +58,7 @@ namespace CalamityMod.Items.Weapons.Melee .AddIngredient(ItemID.SoulofNight, 10) .AddIngredient(5) .AddIngredient(ItemID.Obsidian, 10) - .AddIngredient(ItemID.StoneBlock, 100) + .AddRecipeGroup("AnyStoneBlock", 100) .AddIngredient(ItemID.Amethyst, 2) .AddTile(TileID.Anvils) .Register(); diff --git a/Items/Weapons/Melee/TitanArm.cs b/Items/Weapons/Melee/TitanArm.cs index 03b4a71cb1..425acf6f3a 100644 --- a/Items/Weapons/Melee/TitanArm.cs +++ b/Items/Weapons/Melee/TitanArm.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 46; Item.height = 58; Item.damage = 69; + Item.crit = 100; Item.knockBack = 80f; //This number doesn't mean anything, but it's not 9001f because that caused bugs. Item.useAnimation = Item.useTime = 12; Item.DamageType = DamageClass.Melee; @@ -24,9 +25,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.value = CalamityGlobalItem.RarityLimeBuyPrice; } - // Boosting crit in SetDefaults along with knockback seemed to severely inflate the reforging price. Guaranteed crits for more knockback. - public override void ModifyWeaponCrit(Player player, ref float crit) => crit = 100; - public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 300); diff --git a/Items/Weapons/Ranged/AntiMaterielRifle.cs b/Items/Weapons/Ranged/AntiMaterielRifle.cs index 8ed530291d..a0a470a866 100644 --- a/Items/Weapons/Ranged/AntiMaterielRifle.cs +++ b/Items/Weapons/Ranged/AntiMaterielRifle.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 40; Item.damage = 1818; Item.DamageType = DamageClass.Ranged; + Item.crit = 20; Item.useTime = Item.useAnimation = 60; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; @@ -37,9 +38,6 @@ namespace CalamityMod.Items.Weapons.Ranged public override void HoldItem(Player player) => player.scope = true; - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; - public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Ranged/AstralBlaster.cs b/Items/Weapons/Ranged/AstralBlaster.cs index e6c0803a7a..eed33698bf 100644 --- a/Items/Weapons/Ranged/AstralBlaster.cs +++ b/Items/Weapons/Ranged/AstralBlaster.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 24; Item.damage = 120; Item.DamageType = DamageClass.Ranged; + Item.crit = 25; Item.useTime = 15; Item.useAnimation = 15; Item.useStyle = ItemUseStyleID.Shoot; @@ -31,9 +32,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useAmmo = AmmoID.Bullet; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25; - public override Vector2? HoldoutOffset() => new Vector2(-5, 0); 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/Buzzkill.cs b/Items/Weapons/Ranged/Buzzkill.cs index cfeef85b6b..6c34e7b8ae 100644 --- a/Items/Weapons/Ranged/Buzzkill.cs +++ b/Items/Weapons/Ranged/Buzzkill.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.width = 76; Item.height = 42; Item.damage = 56; + Item.crit = 21; Item.useTime = 30; Item.useAnimation = 30; Item.useStyle = ItemUseStyleID.Shoot; @@ -37,9 +38,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 20f; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 21; - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/CorrodedCaustibow.cs b/Items/Weapons/Ranged/CorrodedCaustibow.cs index 2c4d7fcd6e..8bc2e73088 100644 --- a/Items/Weapons/Ranged/CorrodedCaustibow.cs +++ b/Items/Weapons/Ranged/CorrodedCaustibow.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 38; Item.damage = 75; Item.DamageType = DamageClass.Ranged; + Item.crit = 20; Item.useTime = 45; Item.useAnimation = 45; Item.useStyle = ItemUseStyleID.Shoot; @@ -31,9 +32,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useAmmo = AmmoID.Arrow; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (CalamityUtils.CheckWoodenAmmo(type, player)) diff --git a/Items/Weapons/Ranged/Eviscerator.cs b/Items/Weapons/Ranged/Eviscerator.cs index a6dca96d15..d0b79472dc 100644 --- a/Items/Weapons/Ranged/Eviscerator.cs +++ b/Items/Weapons/Ranged/Eviscerator.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 22; Item.damage = 60; Item.DamageType = DamageClass.Ranged; + Item.crit = 25; Item.useTime = 60; Item.useAnimation = 60; Item.useStyle = ItemUseStyleID.Shoot; @@ -31,9 +32,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useAmmo = AmmoID.Bullet; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25; - public override Vector2? HoldoutOffset() => new Vector2(-7, 0); 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/HalleysInferno.cs b/Items/Weapons/Ranged/HalleysInferno.cs index 69890dfbb8..791aaa307d 100644 --- a/Items/Weapons/Ranged/HalleysInferno.cs +++ b/Items/Weapons/Ranged/HalleysInferno.cs @@ -34,6 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.damage = 444; Item.knockBack = 5.5f; Item.DamageType = DamageClass.Ranged; + Item.crit = 20; // Burst of 5, one every 5 frames for 25 total. Cooldown of 39 frames. Item.useTime = 5; @@ -58,8 +59,6 @@ namespace CalamityMod.Items.Weapons.Ranged ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; public override void HoldItem(Player player) { if (player.mount.Type == MountID.Drill) diff --git a/Items/Weapons/Ranged/HandheldTank.cs b/Items/Weapons/Ranged/HandheldTank.cs index 9e0189cacd..18c4fd76dd 100644 --- a/Items/Weapons/Ranged/HandheldTank.cs +++ b/Items/Weapons/Ranged/HandheldTank.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 46; Item.DamageType = DamageClass.Ranged; Item.damage = 740; + Item.crit = 15; Item.knockBack = 16f; Item.useTime = Item.useAnimation = 74; Item.autoReuse = true; @@ -37,9 +38,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useAmmo = AmmoID.Rocket; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 15; - public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) { position += velocity.SafeNormalize(Vector2.UnitX) * 48f; diff --git a/Items/Weapons/Ranged/M1Garand.cs b/Items/Weapons/Ranged/M1Garand.cs index 27254cb375..e1428c34bf 100644 --- a/Items/Weapons/Ranged/M1Garand.cs +++ b/Items/Weapons/Ranged/M1Garand.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 22; Item.damage = 75; Item.DamageType = DamageClass.Ranged; - + Item.crit = 10; Item.useTime = 40; Item.useAnimation = 40; Item.useStyle = ItemUseStyleID.Shoot; @@ -35,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.rare = ItemRarityID.Orange; } - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override void HoldItem(Player player) { diff --git a/Items/Weapons/Ranged/MarksmanBow.cs b/Items/Weapons/Ranged/MarksmanBow.cs index 04583dd290..0dd35e7cab 100644 --- a/Items/Weapons/Ranged/MarksmanBow.cs +++ b/Items/Weapons/Ranged/MarksmanBow.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 110; Item.damage = 39; Item.DamageType = DamageClass.Ranged; + Item.crit = 10; Item.useTime = 5; Item.useAnimation = 15; Item.useLimitPerAnimation = 3; @@ -33,9 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().donorItem = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; - public override Vector2? HoldoutOffset() => new Vector2(-4, 0); 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/NitroExpressRifle.cs b/Items/Weapons/Ranged/NitroExpressRifle.cs index ee5b504667..04e64586c4 100644 --- a/Items/Weapons/Ranged/NitroExpressRifle.cs +++ b/Items/Weapons/Ranged/NitroExpressRifle.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 22; Item.damage = 210; Item.DamageType = DamageClass.Ranged; + Item.crit = 10; Item.useTime = 70; Item.useAnimation = 70; Item.useStyle = ItemUseStyleID.Shoot; @@ -35,9 +36,6 @@ namespace CalamityMod.Items.Weapons.Ranged public override Vector2? HoldoutOffset() => new Vector2(-10, 8); - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; - public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Ranged/OntologicalDespoiler.cs b/Items/Weapons/Ranged/OntologicalDespoiler.cs index 577180c67e..2a68495738 100644 --- a/Items/Weapons/Ranged/OntologicalDespoiler.cs +++ b/Items/Weapons/Ranged/OntologicalDespoiler.cs @@ -39,6 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 34; Item.damage = 445; Item.DamageType = DamageClass.Ranged; + Item.crit = 25; Item.useAnimation = Item.useTime = 8; Item.noMelee = true; Item.noUseGraphic = true; @@ -52,7 +53,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 12f; } - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25; public override bool AltFunctionUse(Player player) => true; public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override void HoldItem(Player player) diff --git a/Items/Weapons/Ranged/RubicoPrime.cs b/Items/Weapons/Ranged/RubicoPrime.cs index 46a5289e33..f9c5673f80 100644 --- a/Items/Weapons/Ranged/RubicoPrime.cs +++ b/Items/Weapons/Ranged/RubicoPrime.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 28; Item.damage = 450; Item.DamageType = DamageClass.Ranged; + Item.crit = 38; Item.knockBack = 10f; Item.useTime = 50; Item.useAnimation = 50; @@ -39,9 +40,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().donorItem = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 38; - public override Vector2? HoldoutOffset() => new Vector2(-6, 10); 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/SDFMG.cs b/Items/Weapons/Ranged/SDFMG.cs index 68ac499b6d..25bb058a33 100644 --- a/Items/Weapons/Ranged/SDFMG.cs +++ b/Items/Weapons/Ranged/SDFMG.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 34; Item.damage = 118; Item.DamageType = DamageClass.Ranged; + Item.crit = 15; Item.useTime = Item.useAnimation = 3; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; @@ -38,8 +39,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.rare = ModContent.RarityType(); } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 15; public override Vector2? HoldoutOffset() => new Vector2(-10, 0); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/Shardshocker.cs b/Items/Weapons/Ranged/Shardshocker.cs index 27d64ec957..c16a177347 100644 --- a/Items/Weapons/Ranged/Shardshocker.cs +++ b/Items/Weapons/Ranged/Shardshocker.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 44; Item.damage = 115; Item.DamageType = DamageClass.Ranged; + Item.crit = 6; Item.useTime = 60; Item.useAnimation = 60; Item.useStyle = ItemUseStyleID.Shoot; @@ -35,9 +36,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 50f; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 6; - public override Vector2? HoldoutOffset() => new Vector2(-10, 0); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/Shellshooter.cs b/Items/Weapons/Ranged/Shellshooter.cs index e39b9b4e76..bd08738f73 100644 --- a/Items/Weapons/Ranged/Shellshooter.cs +++ b/Items/Weapons/Ranged/Shellshooter.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 38; Item.damage = 40; Item.DamageType = DamageClass.Ranged; + Item.crit = 15; Item.useTime = 70; Item.useAnimation = 70; Item.useStyle = ItemUseStyleID.Shoot; @@ -30,9 +31,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useAmmo = AmmoID.Arrow; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 15; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (CalamityUtils.CheckWoodenAmmo(type, player)) diff --git a/Items/Weapons/Ranged/Shroomer.cs b/Items/Weapons/Ranged/Shroomer.cs index 2b619ab787..122cdf881c 100644 --- a/Items/Weapons/Ranged/Shroomer.cs +++ b/Items/Weapons/Ranged/Shroomer.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 28; Item.damage = 150; Item.DamageType = DamageClass.Ranged; + Item.crit = 35; Item.useTime = 35; Item.useAnimation = 35; Item.useStyle = ItemUseStyleID.Shoot; @@ -30,9 +31,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useAmmo = AmmoID.Bullet; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 35; - public override Vector2? HoldoutOffset() => new Vector2(-25, 0); public override void HoldItem(Player player) => player.scope = true; diff --git a/Items/Weapons/Ranged/SomaPrime.cs b/Items/Weapons/Ranged/SomaPrime.cs index 016c4f32fa..8e85adde27 100644 --- a/Items/Weapons/Ranged/SomaPrime.cs +++ b/Items/Weapons/Ranged/SomaPrime.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 34; Item.damage = 705; Item.DamageType = DamageClass.Ranged; + Item.crit = 26; Item.useAnimation = Item.useTime = 5; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; @@ -40,9 +41,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().devItem = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 26; - public override Vector2? HoldoutOffset() => new Vector2(-25, 0); 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/StellarCannon.cs b/Items/Weapons/Ranged/StellarCannon.cs index 7445e3628f..bee2941fdb 100644 --- a/Items/Weapons/Ranged/StellarCannon.cs +++ b/Items/Weapons/Ranged/StellarCannon.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 30; Item.damage = 180; Item.DamageType = DamageClass.Ranged; + Item.crit = 16; Item.useTime = 40; Item.useAnimation = 40; Item.useStyle = ItemUseStyleID.Shoot; @@ -33,9 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 3f; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 16; - public override Vector2? HoldoutOffset() { return new Vector2(-5, 0); diff --git a/Items/Weapons/Ranged/SuperradiantSlaughterer.cs b/Items/Weapons/Ranged/SuperradiantSlaughterer.cs index 9685412233..69a4afb43a 100644 --- a/Items/Weapons/Ranged/SuperradiantSlaughterer.cs +++ b/Items/Weapons/Ranged/SuperradiantSlaughterer.cs @@ -57,6 +57,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 46; Item.damage = 100; Item.DamageType = DamageClass.Ranged; + Item.crit = 21; Item.useTime = 10; Item.useAnimation = 10; Item.useStyle = ItemUseStyleID.Shoot; @@ -71,8 +72,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = ShootSpeed; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 21; public override bool AltFunctionUse(Player player) => true; public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Ranged/TheBlunderbass.cs b/Items/Weapons/Ranged/TheBlunderbass.cs index d29689df96..dd5a0564ae 100644 --- a/Items/Weapons/Ranged/TheBlunderbass.cs +++ b/Items/Weapons/Ranged/TheBlunderbass.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 26; Item.damage = 35; Item.DamageType = DamageClass.Ranged; + Item.crit = 6; Item.useTime = 55; Item.useAnimation = 55; Item.useStyle = ItemUseStyleID.Shoot; @@ -37,9 +38,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 25f; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 6; - public override Vector2? HoldoutOffset() => new Vector2(-10, 0); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/TheHive.cs b/Items/Weapons/Ranged/TheHive.cs index f43d7cfdde..e6f4359eeb 100644 --- a/Items/Weapons/Ranged/TheHive.cs +++ b/Items/Weapons/Ranged/TheHive.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.damage = 92; Item.DamageType = DamageClass.Ranged; + Item.crit = 16; Item.useAnimation = Item.useTime = OriginalUseTime; Item.shoot = ProjectileType(); Item.shootSpeed = 13f; @@ -38,9 +39,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.UseSound = new SoundStyle("CalamityMod/Sounds/Item/DudFire") with { Volume = .4f, Pitch = -.9f, PitchVariance = 0.1f }; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 16; - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] == 0; // Spawning the holdout won't consume ammo. diff --git a/Items/Weapons/Ranged/ThePack.cs b/Items/Weapons/Ranged/ThePack.cs index 9bafa9238f..56f34bfff0 100644 --- a/Items/Weapons/Ranged/ThePack.cs +++ b/Items/Weapons/Ranged/ThePack.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 46; Item.damage = 1000; Item.DamageType = DamageClass.Ranged; + Item.crit = 8; Item.useTime = Item.useAnimation = 53; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; @@ -34,9 +35,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().donorItem = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 8; - public override Vector2? HoldoutOffset() => new Vector2(-40, 0); 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/TyrannysEnd.cs b/Items/Weapons/Ranged/TyrannysEnd.cs index 86672a1208..641402f62c 100644 --- a/Items/Weapons/Ranged/TyrannysEnd.cs +++ b/Items/Weapons/Ranged/TyrannysEnd.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.damage = 2150; Item.knockBack = 9.5f; Item.DamageType = DamageClass.Ranged; + Item.crit = 35; Item.useTime = 60; Item.useAnimation = 60; Item.shoot = ProjectileID.BulletHighVelocity; @@ -35,9 +36,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().donorItem = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 35; - public override Vector2? HoldoutOffset() => new Vector2(-28, 0); public override void HoldItem(Player player) => player.scope = true; diff --git a/Items/Weapons/Rogue/Apoctolith.cs b/Items/Weapons/Rogue/Apoctolith.cs index ea514d1562..1fd2a9cfc4 100644 --- a/Items/Weapons/Rogue/Apoctolith.cs +++ b/Items/Weapons/Rogue/Apoctolith.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 66; Item.height = 64; Item.damage = 185; + Item.crit = 20; Item.shootSpeed = 18f; Item.shoot = ModContent.ProjectileType(); Item.useAnimation = Item.useTime = 26; @@ -32,9 +33,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.autoReuse = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; - public override void UseStyle(Player player, Rectangle heldItemFrame) { ExtraArmAnimations.ThrowArmAnimationFast(player, Item); diff --git a/Items/Weapons/Rogue/BlazingStar.cs b/Items/Weapons/Rogue/BlazingStar.cs index 5dd14afede..10e95bab7c 100644 --- a/Items/Weapons/Rogue/BlazingStar.cs +++ b/Items/Weapons/Rogue/BlazingStar.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.height = 32; Item.damage = 75; Item.DamageType = RogueDamageClass.Instance; + Item.crit = 4; Item.autoReuse = true; Item.noMelee = true; Item.noUseGraphic = true; @@ -33,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Rogue public override float StealthVelocityMultiplier => 1.3f; public override float StealthDamageMultiplier => 0.5f; - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 4; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { var p = Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, -1f); diff --git a/Items/Weapons/Rogue/Cinquedea.cs b/Items/Weapons/Rogue/Cinquedea.cs index 9ef1e82297..e3f8c318ce 100644 --- a/Items/Weapons/Rogue/Cinquedea.cs +++ b/Items/Weapons/Rogue/Cinquedea.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 32; Item.height = 32; Item.damage = 35; + Item.crit = 8; Item.rare = ItemRarityID.Orange; Item.knockBack = 5; Item.autoReuse = true; @@ -29,9 +30,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 8; - public override float StealthDamageMultiplier => 1.5f; public override float StealthVelocityMultiplier => 1.25f; diff --git a/Items/Weapons/Rogue/Crystalline.cs b/Items/Weapons/Rogue/Crystalline.cs index 83add7844f..a835714b1c 100644 --- a/Items/Weapons/Rogue/Crystalline.cs +++ b/Items/Weapons/Rogue/Crystalline.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 50; Item.height = 50; Item.damage = 16; + Item.crit = 4; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 18; @@ -29,9 +30,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 4; - public override float StealthDamageMultiplier => 1.7f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Rogue/FrostcrushValari.cs b/Items/Weapons/Rogue/FrostcrushValari.cs index 39545494e2..a43492d9e0 100644 --- a/Items/Weapons/Rogue/FrostcrushValari.cs +++ b/Items/Weapons/Rogue/FrostcrushValari.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.height = 58; Item.damage = 81; Item.DamageType = RogueDamageClass.Instance; + Item.crit = 16; Item.useTime = Item.useAnimation = 19; Item.knockBack = 12; @@ -33,9 +34,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.noUseGraphic = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 16; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/Glaive.cs b/Items/Weapons/Rogue/Glaive.cs index 9cbb1edc4a..2f6b9a5492 100644 --- a/Items/Weapons/Rogue/Glaive.cs +++ b/Items/Weapons/Rogue/Glaive.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.height = 32; Item.damage = 22; Item.DamageType = RogueDamageClass.Instance; + Item.crit = 6; Item.autoReuse = true; Item.noMelee = true; Item.noUseGraphic = true; @@ -32,7 +33,6 @@ namespace CalamityMod.Items.Weapons.Rogue public override float StealthVelocityMultiplier => 1.3f; public override float StealthDamageMultiplier => 0.6f; - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 6; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { var p = Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, -1f); diff --git a/Items/Weapons/Rogue/Hypothermia.cs b/Items/Weapons/Rogue/Hypothermia.cs index 31043a2f4e..10a951f840 100644 --- a/Items/Weapons/Rogue/Hypothermia.cs +++ b/Items/Weapons/Rogue/Hypothermia.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.height = 32; Item.damage = 148; Item.DamageType = RogueDamageClass.Instance; + Item.crit = 16; Item.useTime = 4; Item.useAnimation = 12; Item.reuseDelay = 1; @@ -39,9 +40,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 16; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/IceStar.cs b/Items/Weapons/Rogue/IceStar.cs index 9d025acef4..0beafe26c6 100644 --- a/Items/Weapons/Rogue/IceStar.cs +++ b/Items/Weapons/Rogue/IceStar.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = Item.height = 66; Item.damage = 45; + Item.crit = 7; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 12; @@ -28,9 +29,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 7; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/Kylie.cs b/Items/Weapons/Rogue/Kylie.cs index 6ed83a923b..fdbb110ebd 100644 --- a/Items/Weapons/Rogue/Kylie.cs +++ b/Items/Weapons/Rogue/Kylie.cs @@ -15,8 +15,10 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 34; Item.height = 50; Item.damage = 12; - Item.knockBack = 12; Item.DamageType = RogueDamageClass.Instance; + Item.crit = 16; + Item.knockBack = 12; + Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; Item.useTime = 25; @@ -29,9 +31,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.noUseGraphic = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 16; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/Prismalline.cs b/Items/Weapons/Rogue/Prismalline.cs index 8977ed8739..5ed879a35f 100644 --- a/Items/Weapons/Rogue/Prismalline.cs +++ b/Items/Weapons/Rogue/Prismalline.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 54; Item.height = 54; Item.damage = 36; + Item.crit = 4; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 20; @@ -30,9 +31,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 4; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/ProfanedPartisan.cs b/Items/Weapons/Rogue/ProfanedPartisan.cs index 9c04347e38..5814d9db9d 100644 --- a/Items/Weapons/Rogue/ProfanedPartisan.cs +++ b/Items/Weapons/Rogue/ProfanedPartisan.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 68; Item.height = 68; Item.damage = 222; + Item.crit = 15; Item.knockBack = 8f; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; @@ -33,9 +34,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shoot = ModContent.ProjectileType(); } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 15; - 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/ProfanedPartisan.png b/Items/Weapons/Rogue/ProfanedPartisan.png index 24b45d1ccc..3b46003a0d 100644 Binary files a/Items/Weapons/Rogue/ProfanedPartisan.png and b/Items/Weapons/Rogue/ProfanedPartisan.png differ diff --git a/Items/Weapons/Rogue/RadiantStar.cs b/Items/Weapons/Rogue/RadiantStar.cs index 16e52c9fc5..3b22c78a60 100644 --- a/Items/Weapons/Rogue/RadiantStar.cs +++ b/Items/Weapons/Rogue/RadiantStar.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 54; Item.height = 54; - Item.damage = 55; //33 + Item.damage = 55; + Item.crit = 8; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 12; @@ -29,9 +30,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 8; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/RotBall.cs b/Items/Weapons/Rogue/RotBall.cs index a915b82bc8..9ca38e95d4 100644 --- a/Items/Weapons/Rogue/RotBall.cs +++ b/Items/Weapons/Rogue/RotBall.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 30; Item.height = 30; Item.damage = 16; + Item.crit = 8; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 16; @@ -30,9 +31,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 8; - 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 52d204654e..0489ff32d1 100644 --- a/Items/Weapons/Rogue/ScarletDevil.cs +++ b/Items/Weapons/Rogue/ScarletDevil.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 108; Item.height = 108; Item.damage = 10000; + Item.crit = 20; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 60; @@ -41,9 +42,6 @@ namespace CalamityMod.Items.Weapons.Rogue return false; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; - public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Rogue/ShatteredDawn.cs b/Items/Weapons/Rogue/ShatteredDawn.cs index 0602d4e927..7331b6f831 100644 --- a/Items/Weapons/Rogue/ShatteredDawn.cs +++ b/Items/Weapons/Rogue/ShatteredDawn.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 66; Item.height = 66; Item.damage = 80; + Item.crit = 10; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 12; @@ -31,9 +32,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; - public override float StealthDamageMultiplier => 1.2f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Rogue/SlickCane.cs b/Items/Weapons/Rogue/SlickCane.cs index 60f192551e..0331d03098 100644 --- a/Items/Weapons/Rogue/SlickCane.cs +++ b/Items/Weapons/Rogue/SlickCane.cs @@ -17,8 +17,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; - Item.useAnimation = 26; - Item.useTime = 26; + Item.useTime = Item.useAnimation = 16; Item.useStyle = ItemUseStyleID.Shoot; Item.knockBack = 6f; Item.UseSound = SoundID.DD2_GhastlyGlaivePierce; diff --git a/Items/Weapons/Rogue/StellarKnife.cs b/Items/Weapons/Rogue/StellarKnife.cs index abe77f582a..5b7d1b4f7c 100644 --- a/Items/Weapons/Rogue/StellarKnife.cs +++ b/Items/Weapons/Rogue/StellarKnife.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 32; Item.height = 34; Item.damage = 69; + Item.crit = 4; Item.noMelee = true; Item.noUseGraphic = true; Item.useTime = Item.useAnimation = 9; @@ -30,9 +31,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 4; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable() && player.ownedProjectileCounts[Item.shoot] < knifeLimit) diff --git a/Items/Weapons/Rogue/StormfrontRazor.cs b/Items/Weapons/Rogue/StormfrontRazor.cs index 3d98b335f5..1d4d1e40e5 100644 --- a/Items/Weapons/Rogue/StormfrontRazor.cs +++ b/Items/Weapons/Rogue/StormfrontRazor.cs @@ -35,15 +35,13 @@ namespace CalamityMod.Items.Weapons.Rogue Item.useAnimation = 20; Item.useTime = 20; Item.damage = 38; + Item.crit = 8; Item.knockBack = 7f; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 8.2f; Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 8; - public override float StealthDamageMultiplier => 1.2f; public override float StealthVelocityMultiplier => 1.5f; diff --git a/Items/Weapons/Rogue/ThrowingBrick.cs b/Items/Weapons/Rogue/ThrowingBrick.cs index d290fbacab..d976788301 100644 --- a/Items/Weapons/Rogue/ThrowingBrick.cs +++ b/Items/Weapons/Rogue/ThrowingBrick.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 28; Item.height = 20; Item.damage = 14; + Item.crit = 20; Item.shootSpeed = 15f; Item.shoot = ModContent.ProjectileType(); Item.useAnimation = Item.useTime = 25; @@ -34,9 +35,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; - public override void UseStyle(Player player, Rectangle heldItemFrame) { ExtraArmAnimations.ThrowArmAnimationFast(player, Item); diff --git a/Items/Weapons/Rogue/TitaniumShuriken.cs b/Items/Weapons/Rogue/TitaniumShuriken.cs index baee97518b..0824bd3e35 100644 --- a/Items/Weapons/Rogue/TitaniumShuriken.cs +++ b/Items/Weapons/Rogue/TitaniumShuriken.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 34; Item.height = 34; Item.damage = 38; + Item.crit = 10; Item.useAnimation = Item.useTime = 9; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; @@ -28,10 +29,6 @@ namespace CalamityMod.Items.Weapons.Rogue } public override float StealthVelocityMultiplier => 1.25f; - - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; - 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/ToothBall.cs b/Items/Weapons/Rogue/ToothBall.cs index eada2f3536..633fb1f6cd 100644 --- a/Items/Weapons/Rogue/ToothBall.cs +++ b/Items/Weapons/Rogue/ToothBall.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 30; Item.height = 30; Item.damage = 16; + Item.crit = 8; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 16; @@ -30,9 +31,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 8; - 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/TwistingThunder.cs b/Items/Weapons/Rogue/TwistingThunder.cs index 1ff0517975..66aadf552c 100644 --- a/Items/Weapons/Rogue/TwistingThunder.cs +++ b/Items/Weapons/Rogue/TwistingThunder.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 56; Item.height = 56; Item.damage = 466; + Item.crit = 12; Item.knockBack = 10f; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; @@ -33,8 +34,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shoot = ModContent.ProjectileType(); } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 12; public override float StealthVelocityMultiplier => 1.5f; public override void ModifyStatsExtra(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) diff --git a/Items/Weapons/Summon/FuelCellBundle.cs b/Items/Weapons/Summon/FuelCellBundle.cs index 5a39da29cf..5c3e05a492 100644 --- a/Items/Weapons/Summon/FuelCellBundle.cs +++ b/Items/Weapons/Summon/FuelCellBundle.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.width = 32; Item.height = 32; Item.mana = 10; - Item.damage = 25; + Item.damage = 22; Item.useStyle = ItemUseStyleID.Swing; Item.useAnimation = Item.useTime = 36; Item.noMelee = true; diff --git a/Items/Weapons/Typeless/RelicOfDeliverance.cs b/Items/Weapons/Typeless/RelicOfDeliverance.cs index 8dd3c542b9..d6d2974145 100644 --- a/Items/Weapons/Typeless/RelicOfDeliverance.cs +++ b/Items/Weapons/Typeless/RelicOfDeliverance.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.Weapons.Typeless Item.width = 32; Item.height = 46; Item.damage = 1700; + Item.crit = 55; Item.useAnimation = Item.useTime = 35; Item.reuseDelay = 15; Item.useStyle = ItemUseStyleID.Shoot; @@ -38,9 +39,6 @@ namespace CalamityMod.Items.Weapons.Typeless itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.ToolsOther; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 55; - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0 && player.Calamity().DashID != GodslayerArmorDash.ID; } } diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 12ad3c9cbb..6a544156d4 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -1711,3 +1711,18 @@ CnidarianSummonTagBuff: { DisplayName: Cnidarian Summon Tag Buff Description: you are not seeing this } + +SmashedEvil: { + DisplayName: Smashed Evil + Description: Increased damage, movement speed, and regeneration + ItemTooltip: + ''' + - On Enemies - + All Types - 20 DPS + +5 damage taken + - On Players - + Regen returns to full strength 200% faster + 10% increased damage + 20% increased movement speed + ''' +} diff --git a/Localization/en-US/Mods.CalamityMod.Condition.hjson b/Localization/en-US/Mods.CalamityMod.Condition.hjson index d99892c2dd..b757a152d4 100644 --- a/Localization/en-US/Mods.CalamityMod.Condition.hjson +++ b/Localization/en-US/Mods.CalamityMod.Condition.hjson @@ -52,6 +52,8 @@ 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 HasWings: While wearing wings InAstral: In the Astral Infection diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 199439a01e..9e57c91d83 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -1867,7 +1867,7 @@ TheAmalgam: { DisplayName: The Amalgam Tooltip: ''' - All attacks inflict a variety of debuffs, 200% increased elemental debuff damage + All attacks inflict a variety of debuffs, 300% increased elemental debuff damage Most buffs last twice as long, and persist after dying Taking damage confuses nearby enemies and spawns a dank creeper The dank creeper flies above you, exploding into several shaderain clouds @@ -2121,9 +2121,9 @@ YharimsGift: { Tooltip: ''' {$Common.KnockbackImmunity} - Flaming meteors rain down after getting hit - Volatile dragon dust trails behind you - Increases damage and movement speed by 15% + Increases damage by 10% and movement speed by 20% + All attacks inflict [cbuff:CalamityMod/AuricRebuke] + Flaming meteors rain down while invincible [c/FCA92B:'The power to kill a god pulses from within this artifact'] ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index ee8d2c7dd1..432d733ff1 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -657,7 +657,7 @@ PrimordialEarth: { DisplayName: Primordial Earth Tooltip: ''' - Casts two enchanted blasts of sand that coverge with each other and explode + Casts two enchanted blasts of sand that converge with each other and explode Casting this spell at max mana while without mana sickness will cause it to give you and any player it hits the {$Buffs.SandsWindBuff.DisplayName} buff The {$Buffs.SandsWindBuff.DisplayName} buff increases your defense by {0}, damage by {1}%, and greatly buffs mana regen ''' @@ -781,6 +781,7 @@ SHPC: { {0} Press to use the machine as a vacuum, pulling in lingering souls Once released, a torrent of soul lasers is discharged scaling with the number of souls pulled in + Shift-Right Click this item in your inventory to eject the currently loaded Soul ''' // These are the soul effect descriptions, the number is the item ID of the soul NoSoul: "[c/808080:There is currently no soul type injected into the weapon]" @@ -1028,7 +1029,7 @@ VividClarity: { ''' Fires five randomized rays of exo-energy towards the cursor On enemy and tile hits, beams either explode into a big flash, - summon an additonal laser from the sky, or split into energy orbs + summon an additional laser from the sky, or split into energy orbs 'Its majesty inspires a stroke of unparalleled genius' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 55706016b7..d0043441be 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -166,11 +166,7 @@ BansheeHook: { Basher: { DisplayName: Basher - Tooltip: - ''' - Swings a rotten club that poisons and irradiates enemies on hit - Holding while swinging will increase the club's damage, but will also knock you back on hit - ''' + Tooltip: Swings a rotten club that irradiates enemies on hit while knocking you back in the process } BladecrestOathsword: { @@ -458,12 +454,19 @@ EvilSmasher: { DisplayName: Evil Smasher Tooltip: ''' - For every enemy you kill this hammer gains stat bonuses - These bonuses stack until a cap is reached - The bonus stacks will reset if you select a different item - The bonus stacks will be reduced by 1 every time you get hit + Channels a powerful hammer strike with the capability to crush all evil + Striking a tile with the hammer strike will cause an explosion and push you back + Striking enemies inflicts [cbuff:CalamityMod/SmashedEvil] on both the user and target + Charging strikes increases damage, explosion radius, and [cbuff:CalamityMod/SmashedEvil] duration 'EViL! sMaSH eVIl! SmAsh... ER!' ''' + //All damage and kill dialogue has the capitalization randomized when said + DamageDialogue0: smash! + DamageDialogue1: evil! + DamageDialogue2: crush! + DamageDialogue3: des.. troy! + KillDialogue0: smash evil! + KillDialogue1: smash.. er! } ExaltedOathblade: { @@ -747,7 +750,6 @@ HolyCollider: { Charged swings create four lingering flares that float around the point of impact Striking a flare with an uncharged strike will push it around and extend its lifetime Charged swings can empower flares, turning them into massive fireballs on hit and launching them to your cursor - Holding while swinging will repeatedly do uncharged slashes that create a spread of flames on hit ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson index 21a0c5eb27..2459dfcc26 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -876,7 +876,7 @@ ViridVanguard: { Alternates between summoning axes and swords, both laced with a powerful poison Axes orbit the player, dealing high damage at a close range Swords chase down enemies with extreme precision, tearing them to shreds - All weapons inflict [cbuff:CalamityMod/Sage Poison], which becomes more powerful the more weapons are summoned + 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 diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index bb4a5def16..7586da81d3 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -311,3 +311,4 @@ WulfrumScrew.DisplayName: Wulfrum Screw WulfrumScrewdriverProj.DisplayName: Wulfrum Screwdriver YinYoDark.DisplayName: Dark Shard YinYoLight.DisplayName: Light Shard +EvilSmasherProjectile.DisplayName: Evil Smasher diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index b99e09f691..729cf87c18 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -4990,6 +4990,7 @@ namespace CalamityMod.NPCs ("CalamityMod/Buffs/StatDebuffs/MarkedforDeath", NPC => NPC.Calamity().markedForDeath), ("CalamityMod/Buffs/StatDebuffs/PearlAura", NPC => NPC.Calamity().pearlAura), ("CalamityMod/Buffs/StatDebuffs/ProfanedWeakness", NPC => NPC.Calamity().relicOfResilienceWeakness), + ("CalamityMod/Buffs/StatBuffs/SmashedEvil", NPC => NPC.HasBuff()), ("CalamityMod/Buffs/StatDebuffs/TemporalSadness", NPC => NPC.Calamity().temporalSadness), ("CalamityMod/Buffs/StatDebuffs/TimeDistortion", NPC => NPC.Calamity().timeDistortion), ("CalamityMod/Buffs/StatDebuffs/WhisperingDeath", NPC => NPC.Calamity().whisperingDeath), diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 30f02069d7..0d477e9611 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -1231,6 +1231,8 @@ 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 if (type == NPCID.Merchant) { @@ -1375,12 +1377,12 @@ namespace CalamityMod.NPCs if (type == NPCID.SkeletonMerchant) { - shop.InsertAfter(ItemID.HealingPotion, ItemType()) - .InsertAfter(ItemID.HealingPotion, ItemID.MilkCarton) + shop.InsertAfter(ItemID.HealingPotion, ItemType(), Condition.MoonPhasesHalf0) + .InsertAfter(ItemID.HealingPotion, ItemID.MilkCarton, Condition.MoonPhasesHalf1) .InsertAfter(ItemID.SpelunkerFlare, ItemID.SpelunkerFlare, spelunkerGlowCondition, hasFlareGunUpgrade) - .AddWithCustomValue(ItemID.Marrow, Item.buyPrice(gold: 25), Condition.Hardmode) - .AddWithCustomValue(Item.buyPrice(gold: 15)) - .AddWithCustomValue(Item.buyPrice(gold: 15)); + .AddWithCustomValue(ItemID.Marrow, Item.buyPrice(gold: 25), Condition.Hardmode, Condition.MoonPhases26) // 26 = half moons + .AddWithCustomValue(Item.buyPrice(gold: 15), gibbousMoons) + .AddWithCustomValue(Item.buyPrice(gold: 15), crescentMoons); } if (type == NPCID.BestiaryGirl) diff --git a/Particles/VerticalSmear.png b/Particles/VerticalSmear.png index 74d237ccaa..b7dbc5945c 100644 Binary files a/Particles/VerticalSmear.png and b/Particles/VerticalSmear.png differ diff --git a/Particles/VerticalSmearThin.png b/Particles/VerticalSmearThin.png new file mode 100644 index 0000000000..7f60001d96 Binary files /dev/null and b/Particles/VerticalSmearThin.png differ diff --git a/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs b/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs index 886d0f4802..068a7bed17 100644 --- a/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs @@ -154,8 +154,10 @@ namespace CalamityMod.Projectiles.BaseProjectiles Projectile.width = Projectile.height = ItemTexture is null ? 1 : ItemTexture.Width(); Projectile.tileCollide = false; Projectile.netImportant = true; - // While having this enabled would be good, it seems to mess with crits on all holdout when applied, so it will stay disabled - //Projectile.ContinuouslyUpdateDamageStats = true; + // Base class assumes that the weapon is a ranged weapon. If it's not a ranged weapon, be sure to override this in its own SetDefaults + // This is necessary in order for dynamic stat updating to function properly! + Projectile.DamageType = DamageClass.Ranged; + Projectile.ContinuouslyUpdateDamageStats = true; } public override void OnSpawn(IEntitySource source) => OffsetLengthFromArm = MaxOffsetLengthFromArm; diff --git a/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs b/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs index 13125da4a5..8c9a1641a9 100644 --- a/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs @@ -297,6 +297,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles Projectile.extraUpdates = 0; Projectile.aiStyle = -2; Projectile.DamageType = ModLoader.GetMod("CalamityMod").Find("TrueMeleeDamageClass"); + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.tileCollide = false; ProjectileID.Sets.TrailingMode[Projectile.type] = 2; ProjectileID.Sets.TrailCacheLength[Projectile.type] = 100; diff --git a/Projectiles/Boss/AresPlasmaFireball.cs b/Projectiles/Boss/AresPlasmaFireball.cs index 52afa6e287..730f564336 100644 --- a/Projectiles/Boss/AresPlasmaFireball.cs +++ b/Projectiles/Boss/AresPlasmaFireball.cs @@ -34,6 +34,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.Opacity = 0f; CooldownSlot = ImmunityCooldownID.Bosses; Projectile.timeLeft = timeLeft; + Projectile.Calamity().DealsDefenseDamage = true; } public override void SendExtraAI(BinaryWriter writer) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 26a5993dbd..30b2834719 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -192,6 +192,8 @@ namespace CalamityMod.Projectiles /// Used by Arterial Assault, Deific Amulet's stars, and certain sand projectiles from the Sand Gun. /// public float conditionalHomingRange = 0f; + public float conditionalHomingVelocity = 12f; + public float conditionalHomingInertia = 20f; /// /// Whether or not this proj was spawned with grape beer on @@ -431,7 +433,7 @@ namespace CalamityMod.Projectiles if (ProjectileID.Sets.LightPet[projectile.type] && Main.LocalPlayer.Calamity().ZoneAbyss) EnhancedDarknessSystem.lights.Add(new() { center = projectile.Center, scale = 1 }); - if (projectile.bobber && projectile.type != ProjectileType() && RunFishingMinigames(projectile)) + if (projectile.bobber && projectile.type != ProjectileType() && RunFishingMinigames(projectile) && !Main.LocalPlayer.dead) return false; //Reset the Homing Target immediately before AI can re-set it on applicable projectiles HomingTarget = -1; @@ -3316,6 +3318,12 @@ namespace CalamityMod.Projectiles { projectile.Center = Main.npc[(int)PersistentFishingData].Center + PersistentFishingDataVector2; projectile.velocity = Vector2.Zero; + + if (owner.Distance(Main.npc[(int)PersistentFishingData].Center) > 1450) // Slightly before when fishing lines stop rendering due to distance from target + { + projectile.ai[0] = 1; + } + if (cplayer.mouseRight && projectile.ai[1] == 0 && owner.miscCounter % 10 == 0) { owner.lifeRegenCount -= 600; // -5 health per 10 ticks @@ -4289,10 +4297,27 @@ namespace CalamityMod.Projectiles arcFlashCooldown--; if (arcFlashCooldown == 0) showArcFlash = true; - if (conditionalHomingRange > 0f && Main.player[projectile.owner].heldProj != projectile.whoAmI && projectile.aiStyle != ProjAIStyleID.HeldProjectile) + if (conditionalHomingRange > 0f && Main.player[projectile.owner].heldProj != projectile.whoAmI && projectile.aiStyle != ProjAIStyleID.HeldProjectile && !grapeBeer) { - CalamityUtils.HomeInOnNPC(projectile, !projectile.tileCollide, conditionalHomingRange, 12f, 20f,true); + CalamityUtils.HomeInOnNPC(projectile, !projectile.tileCollide, conditionalHomingRange, conditionalHomingVelocity, conditionalHomingInertia, true); } + + // Grape beer-specific homing. If the projectile is aligned a certain amount to the direction to the target, it will home in. + else if (conditionalHomingRange > 0f && Main.player[projectile.owner].heldProj != projectile.whoAmI && projectile.aiStyle != ProjAIStyleID.HeldProjectile && grapeBeer) + { + NPC target = projectile.Center.ClosestNPCAt(conditionalHomingRange); + if (target is not null) + { + Vector2 targetDirection = projectile.SafeDirectionTo(target.Center); + + float trackingSpeed = Vector2.Dot(targetDirection, projectile.velocity.SafeNormalize(Vector2.UnitX)) > 0.835f ? 0.01325f : 0f; // Delicate values, please test changes you make to them + + Vector2 currVelocity = projectile.velocity; + + projectile.velocity = projectile.velocity.ToRotation().AngleTowards(targetDirection.ToRotation(), trackingSpeed).ToRotationVector2() * currVelocity.Length(); + } + } + if (brimstoneBullets) { PointParticle spark = new PointParticle(projectile.Center + projectile.velocity * 3, projectile.velocity, false, 2, 0.9f, Color.Crimson * 0.7f); diff --git a/Projectiles/DraedonsArsenal/AnomalysNanogunHoldout.cs b/Projectiles/DraedonsArsenal/AnomalysNanogunHoldout.cs index 65c00ee576..fb204c9e16 100644 --- a/Projectiles/DraedonsArsenal/AnomalysNanogunHoldout.cs +++ b/Projectiles/DraedonsArsenal/AnomalysNanogunHoldout.cs @@ -51,6 +51,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile.width = Projectile.height = 1; Projectile.friendly = true; Projectile.DamageType = DamageClass.Ranged; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; Projectile.tileCollide = false; } diff --git a/Projectiles/DraedonsArsenal/AugerHoldout.cs b/Projectiles/DraedonsArsenal/AugerHoldout.cs index 55dc54e885..0322389e2f 100644 --- a/Projectiles/DraedonsArsenal/AugerHoldout.cs +++ b/Projectiles/DraedonsArsenal/AugerHoldout.cs @@ -38,6 +38,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile.width = Projectile.height = 100; Projectile.friendly = true; Projectile.DamageType = TrueMeleeDamageClass.Instance; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.timeLeft = 5; Projectile.penetrate = -1; Projectile.tileCollide = false; diff --git a/Projectiles/DraedonsArsenal/VulcanHoldout.cs b/Projectiles/DraedonsArsenal/VulcanHoldout.cs index d86259fbd3..fe420edf1f 100644 --- a/Projectiles/DraedonsArsenal/VulcanHoldout.cs +++ b/Projectiles/DraedonsArsenal/VulcanHoldout.cs @@ -40,6 +40,12 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public int spearFakeCooldown = 0; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } + public override void KillHoldoutLogic() { diff --git a/Projectiles/Magic/AetherfluxCannonHoldout.cs b/Projectiles/Magic/AetherfluxCannonHoldout.cs index 22726a859c..289e1475bf 100644 --- a/Projectiles/Magic/AetherfluxCannonHoldout.cs +++ b/Projectiles/Magic/AetherfluxCannonHoldout.cs @@ -30,6 +30,11 @@ namespace CalamityMod.Projectiles.Magic public float postShotFade = 0; public override void SetStaticDefaults() => Main.projFrames[Type] = 8; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } public override void KillHoldoutLogic() { diff --git a/Projectiles/Magic/ApoctosisArrayHoldout.cs b/Projectiles/Magic/ApoctosisArrayHoldout.cs index 61c854a9f0..1cbfe4d6e6 100644 --- a/Projectiles/Magic/ApoctosisArrayHoldout.cs +++ b/Projectiles/Magic/ApoctosisArrayHoldout.cs @@ -35,6 +35,12 @@ namespace CalamityMod.Projectiles.Magic public int shotNum = 0; public SlotId ionHum { get; set; } + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } + public override void KillHoldoutLogic() { if (Owner.dead) diff --git a/Projectiles/Magic/ArtAttackHoldout.cs b/Projectiles/Magic/ArtAttackHoldout.cs index 3593087353..88b9ed5af2 100644 --- a/Projectiles/Magic/ArtAttackHoldout.cs +++ b/Projectiles/Magic/ArtAttackHoldout.cs @@ -20,6 +20,8 @@ namespace CalamityMod.Projectiles.Magic Projectile.width = 70; Projectile.height = 70; Projectile.friendly = false; + Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.timeLeft = 90000; diff --git a/Projectiles/Magic/CauldronHoldout.cs b/Projectiles/Magic/CauldronHoldout.cs index 3039f77888..a7dc3080e6 100644 --- a/Projectiles/Magic/CauldronHoldout.cs +++ b/Projectiles/Magic/CauldronHoldout.cs @@ -29,6 +29,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; } public override void AI() diff --git a/Projectiles/Magic/ChronomancersScytheHoldout.cs b/Projectiles/Magic/ChronomancersScytheHoldout.cs index f594450c37..37ce392c9d 100644 --- a/Projectiles/Magic/ChronomancersScytheHoldout.cs +++ b/Projectiles/Magic/ChronomancersScytheHoldout.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.height = 60; Projectile.friendly = true; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; Projectile.tileCollide = false; Projectile.penetrate = -1; diff --git a/Projectiles/Magic/ChronomancersScytheSwing.cs b/Projectiles/Magic/ChronomancersScytheSwing.cs index 07c79e9f38..6ad0a08f6a 100644 --- a/Projectiles/Magic/ChronomancersScytheSwing.cs +++ b/Projectiles/Magic/ChronomancersScytheSwing.cs @@ -31,6 +31,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ownerHitCheck = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 5; diff --git a/Projectiles/Magic/CoralSpoutHoldout.cs b/Projectiles/Magic/CoralSpoutHoldout.cs index 3312bcb246..821503dd27 100644 --- a/Projectiles/Magic/CoralSpoutHoldout.cs +++ b/Projectiles/Magic/CoralSpoutHoldout.cs @@ -34,6 +34,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.height = 30; Projectile.friendly = true; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; Projectile.tileCollide = false; } diff --git a/Projectiles/Magic/DarkSparkPrism.cs b/Projectiles/Magic/DarkSparkPrism.cs index 310cec8de3..136a815361 100644 --- a/Projectiles/Magic/DarkSparkPrism.cs +++ b/Projectiles/Magic/DarkSparkPrism.cs @@ -28,6 +28,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 10; diff --git a/Projectiles/Magic/EternityBook.cs b/Projectiles/Magic/EternityBook.cs index 07ddff29fc..bb8e559c85 100644 --- a/Projectiles/Magic/EternityBook.cs +++ b/Projectiles/Magic/EternityBook.cs @@ -30,6 +30,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; } diff --git a/Projectiles/Magic/GenesisHoldout.cs b/Projectiles/Magic/GenesisHoldout.cs index 1cae76f266..2137c1e5a2 100644 --- a/Projectiles/Magic/GenesisHoldout.cs +++ b/Projectiles/Magic/GenesisHoldout.cs @@ -31,6 +31,12 @@ namespace CalamityMod.Projectiles.Magic public float Windup { get; set; } = StarterWindup; public Color EffectsColor { get; set; } = Color.MediumSlateBlue; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } + public override void KillHoldoutLogic() { if (HeldItem.type != Owner.HeldItem.type || Owner.CantUseHoldout()) diff --git a/Projectiles/Magic/HadalUrnHoldout.cs b/Projectiles/Magic/HadalUrnHoldout.cs index c5d7c6e301..1387155526 100644 --- a/Projectiles/Magic/HadalUrnHoldout.cs +++ b/Projectiles/Magic/HadalUrnHoldout.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; } diff --git a/Projectiles/Magic/HeliumFlashHoldout.cs b/Projectiles/Magic/HeliumFlashHoldout.cs index bf3d5019cd..1c88496522 100644 --- a/Projectiles/Magic/HeliumFlashHoldout.cs +++ b/Projectiles/Magic/HeliumFlashHoldout.cs @@ -29,6 +29,12 @@ namespace CalamityMod.Projectiles.Magic public int starcoreFrameCounter = 0; public int starcoreFrame = 0; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } + public override void KillHoldoutLogic() { if (Owner.CantUseHoldout(false) || HeldItem.type != Owner.HeldItem.type) diff --git a/Projectiles/Magic/HeresyProj.cs b/Projectiles/Magic/HeresyProj.cs index e14d893f13..487a67cc6c 100644 --- a/Projectiles/Magic/HeresyProj.cs +++ b/Projectiles/Magic/HeresyProj.cs @@ -31,6 +31,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; } diff --git a/Projectiles/Magic/IncineratingFireball.cs b/Projectiles/Magic/IncineratingFireball.cs index 77ef628275..eee796c453 100644 --- a/Projectiles/Magic/IncineratingFireball.cs +++ b/Projectiles/Magic/IncineratingFireball.cs @@ -36,6 +36,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.alpha = 255; Projectile.friendly = true; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.penetrate = -1; Projectile.timeLeft = 60000; Projectile.tileCollide = false; diff --git a/Projectiles/Magic/IonBlasterHoldout.cs b/Projectiles/Magic/IonBlasterHoldout.cs index 53fa872562..967b4dc028 100644 --- a/Projectiles/Magic/IonBlasterHoldout.cs +++ b/Projectiles/Magic/IonBlasterHoldout.cs @@ -35,6 +35,12 @@ namespace CalamityMod.Projectiles.Magic public int shotNum = 0; public SlotId ionHum { get; set; } + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } + public override void KillHoldoutLogic() { if (Owner.dead) diff --git a/Projectiles/Magic/NanoPurgeHoldout.cs b/Projectiles/Magic/NanoPurgeHoldout.cs index 54bed4ff59..4ab9fe2854 100644 --- a/Projectiles/Magic/NanoPurgeHoldout.cs +++ b/Projectiles/Magic/NanoPurgeHoldout.cs @@ -30,6 +30,11 @@ namespace CalamityMod.Projectiles.Magic private ref float ChargeTowardsNextShot => ref Projectile.ai[1]; public override void SetStaticDefaults() => Main.projFrames[Type] = 4; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } public float postShotFade = 0; diff --git a/Projectiles/Magic/NebulousCataclysm_Held.cs b/Projectiles/Magic/NebulousCataclysm_Held.cs index 016f2c14e1..0a1276b3f3 100644 --- a/Projectiles/Magic/NebulousCataclysm_Held.cs +++ b/Projectiles/Magic/NebulousCataclysm_Held.cs @@ -41,6 +41,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; } diff --git a/Projectiles/Magic/OmicronHoldout.cs b/Projectiles/Magic/OmicronHoldout.cs index 4d83523c81..71f91a0114 100644 --- a/Projectiles/Magic/OmicronHoldout.cs +++ b/Projectiles/Magic/OmicronHoldout.cs @@ -27,6 +27,12 @@ namespace CalamityMod.Projectiles.Magic public float Windup { get; set; } = StarterWinup; public Color EffectsColor { get; set; } = Color.MediumVioletRed; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } + public override void KillHoldoutLogic() { if (Owner.CantUseHoldout() && PostFireCooldown <= 0) diff --git a/Projectiles/Magic/PurgeGuzzlerHoldout.cs b/Projectiles/Magic/PurgeGuzzlerHoldout.cs index 5041446fb2..a465def812 100644 --- a/Projectiles/Magic/PurgeGuzzlerHoldout.cs +++ b/Projectiles/Magic/PurgeGuzzlerHoldout.cs @@ -35,6 +35,13 @@ namespace CalamityMod.Projectiles.Magic public Color color1 = Color.Goldenrod; public Color color2 = Color.Orange; + + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } + public override void KillHoldoutLogic() { if (!isOnCooldown && (Owner.CantUseHoldout(false) || HeldItem.type != Owner.HeldItem.type)) diff --git a/Projectiles/Magic/RainbowPartyCannonProjectile.cs b/Projectiles/Magic/RainbowPartyCannonProjectile.cs index e891606c3b..7e4a2d6d76 100644 --- a/Projectiles/Magic/RainbowPartyCannonProjectile.cs +++ b/Projectiles/Magic/RainbowPartyCannonProjectile.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.height = 66; Projectile.penetrate = -1; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; } diff --git a/Projectiles/Magic/RancorHoldout.cs b/Projectiles/Magic/RancorHoldout.cs index 0a72c89b15..8091e26805 100644 --- a/Projectiles/Magic/RancorHoldout.cs +++ b/Projectiles/Magic/RancorHoldout.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; Projectile.hide = true; Projectile.timeLeft = 90000; diff --git a/Projectiles/Magic/RancorLaserbeam.cs b/Projectiles/Magic/RancorLaserbeam.cs index 05e4966f84..c79eea665f 100644 --- a/Projectiles/Magic/RancorLaserbeam.cs +++ b/Projectiles/Magic/RancorLaserbeam.cs @@ -42,6 +42,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.width = Projectile.height = 32; Projectile.friendly = true; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 5; diff --git a/Projectiles/Magic/RancorMagicCircle.cs b/Projectiles/Magic/RancorMagicCircle.cs index 02d318930e..908e460f4d 100644 --- a/Projectiles/Magic/RancorMagicCircle.cs +++ b/Projectiles/Magic/RancorMagicCircle.cs @@ -37,6 +37,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; Projectile.timeLeft = 90000; } diff --git a/Projectiles/Magic/SHPV.cs b/Projectiles/Magic/SHPV.cs index e89fb91356..92937065c8 100644 --- a/Projectiles/Magic/SHPV.cs +++ b/Projectiles/Magic/SHPV.cs @@ -49,6 +49,8 @@ namespace CalamityMod.Projectiles.Magic { Projectile.width = Projectile.height = 70; Projectile.friendly = true; + Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; } diff --git a/Projectiles/Magic/Snowflake.cs b/Projectiles/Magic/Snowflake.cs index edcd3fe031..c6d7098a65 100644 --- a/Projectiles/Magic/Snowflake.cs +++ b/Projectiles/Magic/Snowflake.cs @@ -30,6 +30,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.timeLeft = 280; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.coldDamage = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 40; diff --git a/Projectiles/Magic/SparklingEmpressHoldout.cs b/Projectiles/Magic/SparklingEmpressHoldout.cs index 92726655cf..c9725236cd 100644 --- a/Projectiles/Magic/SparklingEmpressHoldout.cs +++ b/Projectiles/Magic/SparklingEmpressHoldout.cs @@ -35,6 +35,12 @@ namespace CalamityMod.Projectiles.Magic public int CooldownTime => 20 * (deservesMana ? 2 : 1); private const int FishShineTime = 150; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } + public override void KillHoldoutLogic() { if (HeldItem.type != Owner.HeldItem.type || Owner.dead) diff --git a/Projectiles/Magic/SylvestaffHoldout.cs b/Projectiles/Magic/SylvestaffHoldout.cs index eb344012ef..61b6a1ee5a 100644 --- a/Projectiles/Magic/SylvestaffHoldout.cs +++ b/Projectiles/Magic/SylvestaffHoldout.cs @@ -57,6 +57,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.friendly = true; Projectile.penetrate = -1; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Magic/VitriolicViperHoldout.cs b/Projectiles/Magic/VitriolicViperHoldout.cs index ae04de7f52..86f1f61480 100644 --- a/Projectiles/Magic/VitriolicViperHoldout.cs +++ b/Projectiles/Magic/VitriolicViperHoldout.cs @@ -38,6 +38,12 @@ namespace CalamityMod.Projectiles.Magic public float vortexRotation = 0; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } + public override void KillHoldoutLogic() { if (Owner.CantUseHoldout(false) || HeldItem.type != Owner.HeldItem.type) diff --git a/Projectiles/Magic/YharimsCrystalBeam.cs b/Projectiles/Magic/YharimsCrystalBeam.cs index ea5730ca5b..2ca085d156 100644 --- a/Projectiles/Magic/YharimsCrystalBeam.cs +++ b/Projectiles/Magic/YharimsCrystalBeam.cs @@ -47,6 +47,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.width = 18; Projectile.height = 18; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.penetrate = -1; Projectile.alpha = 255; // The beam itself still stops on tiles, but its invisible "source" projectile ignores them. diff --git a/Projectiles/Melee/BasherHoldout.cs b/Projectiles/Melee/BasherHoldout.cs index ff82182a62..1658497495 100644 --- a/Projectiles/Melee/BasherHoldout.cs +++ b/Projectiles/Melee/BasherHoldout.cs @@ -1,250 +1,290 @@ -using CalamityMod.Buffs.StatDebuffs; +using System; +using System.Collections.Generic; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Items.Weapons.Melee; using CalamityMod.NPCs; -using CalamityMod.Projectiles.BaseProjectiles; 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; +using static Terraria.ModLoader.ModContent; +using static Terraria.Player; namespace CalamityMod.Projectiles.Melee { [PierceResistException] - public class BasherHoldout : BaseCustomUseStyleProjectile, ILocalizedModType + public class BasherHoldout : ModProjectile, ILocalizedModType { - public override int AssignedItemID => ModContent.ItemType(); - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public override string Texture => "CalamityMod/Items/Weapons/Melee/Basher"; - public override float HitboxOutset => 60; - - public override Vector2 HitboxSize => new Vector2(80, 80); - public override float HitboxRotationOffset => MathHelper.ToRadians(-45); - - public override Vector2 SpriteOrigin => new(-7, 65); - public Vector2 mousePos; - public Vector2 aimVel; - public bool doSwing = true; - public bool postSwing = false; - public float fadeIn = 0; - public int useAnim; - public int swingCount; - public bool finalFlip = false; + public ref float attackTimer => ref Projectile.ai[0]; + public Player Owner => Main.player[Projectile.owner]; + public int fireRate => (int)((Owner.HeldItem.useAnimation * Owner.inverseMeleeSpeed * Projectile.MaxUpdates) / 2.75f); + public int time = 0; + public Vector2 toMouse = Vector2.Zero; + public int cooldown => (int)(-Owner.HeldItem.useAnimation * Owner.inverseMeleeSpeed * Projectile.MaxUpdates); + public float bladeRot = 0; // Rotation of the blade + public int swingCount = 0; // Increases at the start of a swing + public float bladefx = 0; // Visual effects of the blade + // Checks to make sure sounds only happen once per swing + public bool makeSound = true; + public bool performSwing = false; + public float enabledHitbox = 0; // Deals damage when above 0, ticks down quickly + public float angledHold = 0; // Adds some angle based on swing direction + public float rumble = 0; + public override bool? CanDamage() => enabledHitbox > 0 ? null : false; + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + float outset = 15 * Projectile.scale; + Vector2 hitboxPosition = Owner.Center + toMouse * outset; + float hitboxSize = 70 * Projectile.scale; + return CalamityUtils.CircularHitboxCollision(hitboxPosition, hitboxSize, targetHitbox); + } public override void SetDefaults() { - base.SetDefaults(); + Projectile.width = Projectile.height = 100; + Projectile.friendly = true; + Projectile.DamageType = TrueMeleeDamageClass.Instance; + Projectile.timeLeft = 5; + Projectile.penetrate = -1; + Projectile.extraUpdates = 2; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.DamageType = TrueMeleeDamageClass.Instance; } - public override void WhenSpawned() + public void OnSpawn() { - Projectile.knockBack = 0; - Projectile.scale = 1; - Projectile.ai[1] = 1; - // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction - mousePos = Owner.Calamity().mouseWorld; - aimVel = (Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitX) * 65; - useAnim = Owner.itemAnimationMax; - - if (mousePos.X < Owner.Center.X) Owner.direction = -1; - else Owner.direction = 1; - - FlipAsSword = Owner.direction == -1 ? true : false; - } - - public override void UseStyle() - { - AnimationProgress = Animation % useAnim; - DrawUnconditionally = false; - - if (CanHit || postSwing) - mousePos = Owner.Center - aimVel; - else + if (time == 0) { - mousePos = Owner.Calamity().mouseWorld; + Projectile.knockBack = 0; + attackTimer = cooldown; } + } + public void ResetVariables() // After a swing, reset/adjust many stats + { + for (int i = 0; i < Main.maxNPCs; i++) + Projectile.localNPCImmunity[i] = 0; + Projectile.numHits = 0; + swingCount++; + makeSound = true; + enabledHitbox = 0; + Projectile.ForceNetUpdate(); + } + public void Positioning(Vector2 toMouse) // Hand and holdout positioning + { + Owner.heldProj = Projectile.whoAmI; + Owner.itemRotation = (Projectile.velocity * Owner.direction).ToRotation(); - if (CanHit && Owner.Calamity().mouseRight) - fadeIn = MathHelper.Lerp(fadeIn, 1, 0.1f); - else - fadeIn = MathHelper.Lerp(fadeIn, 0, 0.15f); + float angleVariation = (float)Math.Sin(time * 0.06f / Projectile.MaxUpdates) * 0.1f; + float outwardDistance = 5 * Projectile.scale; + Owner.ChangeDir(Math.Sign(toMouse.X)); + Owner.SetCompositeArmFront(true, CompositeArmStretchAmount.Full, (toMouse.ToRotation() + (bladeRot + angleVariation) * Owner.direction + MathHelper.PiOver2 * -Owner.direction) + (Owner.direction == -1 ? MathHelper.Pi : 0)); + Vector2 handPos = Owner.GetFrontHandPosition(CompositeArmStretchAmount.None, Owner.compositeFrontArm.rotation) + (Owner.compositeFrontArm.rotation + MathHelper.PiOver2).ToRotationVector2() * outwardDistance; + float armRotation = (Utils.DirectionTo(Owner.Center, handPos).ToRotation() - MathHelper.PiOver2) * Owner.gravDir + (Owner.gravDir == -1 ? MathHelper.Pi : 0f); + Owner.SetCompositeArmBack(true, CompositeArmStretchAmount.Full, armRotation); - if (!doSwing) + Projectile.velocity = toMouse.RotatedBy((bladeRot + angleVariation + angledHold) * Owner.direction); + Projectile.rotation = Projectile.velocity.ToRotation(); + Projectile.Center = handPos; + } + public override void AI() + { + if (!Owner.CantUseHoldout(false)) + Projectile.timeLeft = 5; + + Projectile.scale = Owner.GetMeleeScale() + 0.1f; + toMouse = Utils.DirectionTo(Owner.Center, Owner.ClampedMouseWorld()); + + Positioning(toMouse); + + OnSpawn(); + + if (enabledHitbox > 0) { - for (int i = 0; i < Main.maxNPCs; i++) - Projectile.localNPCImmunity[i] = 0; - - Projectile.numHits = 0; - // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction - mousePos = Owner.Calamity().mouseWorld; - aimVel = (Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitX) * 65; - CanHit = false; - if (mousePos.X < Owner.Center.X) Owner.direction = -1; - else Owner.direction = 1; - FlipAsSword = Owner.direction == -1 ? true : false; - doSwing = true; - swingCount++; - finalFlip = false; + bladefx = MathHelper.Lerp(bladefx, 1, 0.5f / Projectile.MaxUpdates * Owner.meleeSpeed); + if (Projectile.FinalExtraUpdate()) + enabledHitbox--; } else + bladefx = MathHelper.Lerp(bladefx, 0, 0.55f / Projectile.MaxUpdates * Owner.meleeSpeed); + + if (attackTimer == -1 || time < 25) { - if (!CanHit && !postSwing) + if (Owner.HeldItem.type != ItemType() || Main.mapFullscreen || Owner.mouseInterface || Owner.dead) { - if (mousePos.X < Owner.Center.X) Owner.direction = -1; - else Owner.direction = 1; + Projectile.Kill(); + return; } + } + else + Owner.itemTime = Owner.itemAnimation = 5; + #region Not Swinging + if (attackTimer < 0) // When the sword isn't swinging + { + Timers(); + + float lerp = Utils.GetLerpValue(cooldown, -1, attackTimer, true); + + float lerpSpeed = 0.2f / Projectile.MaxUpdates * Owner.meleeSpeed; + float maxAngle = MathHelper.PiOver4; + if (swingCount % 2 == 0) + angledHold = MathHelper.Lerp(angledHold, maxAngle, lerpSpeed); else + angledHold = MathHelper.Lerp(angledHold, -maxAngle, lerpSpeed); + + if (attackTimer == 0) // Reset a few things in prep for the next swing + ResetVariables(); + else // Wind up animation in prep for the next swing { - if ((Owner.Center - aimVel).X < Owner.Center.X) Owner.direction = -1; - else Owner.direction = 1; + int swingDir = (swingCount % 2 != 0 ? 1 : -1); + float lerp2 = Utils.GetLerpValue(cooldown, -1, attackTimer, true); + float start = -MathHelper.Pi * swingDir; + float end = -MathHelper.PiOver4 * 3 * swingDir; + bladeRot = MathHelper.Lerp(start, end, CalamityUtils.EaseInOutExp(lerp2, 2f, 2f)); + + if (Owner.controlUseItem && lerp > 0.9f) + performSwing = true; } - - - Projectile.rotation = Projectile.rotation.AngleLerp(Owner.AngleTo(mousePos) + MathHelper.ToRadians(45f), 0.1f); + return; + } + #endregion - if (AnimationProgress < (useAnim / 3)) + if (attackTimer >= fireRate) // Once the swing is done, put it on cooldown + { + attackTimer = cooldown; + performSwing = false; + } + else // Do the swing + { + #region Swinging + int swingDir = (swingCount % 2 != 0 ? -1 : 1); + float lerp = Utils.GetLerpValue(0, fireRate - 1, attackTimer, true); + float start = -MathHelper.PiOver4 * 3 * swingDir; + float end = MathHelper.Pi * swingDir; + bladeRot = MathHelper.Lerp(start, end, CalamityUtils.EaseInOutExp(lerp, 5f, 3f)); + + if (lerp > 0.3f && lerp < 0.8f) { - // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction - aimVel = (Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitX) * 65; - CanHit = false; - postSwing = false; - if (AnimationProgress == 0) - { - doSwing = false; - Projectile.ai[1] = -Projectile.ai[1]; - } - RotationOffset = MathHelper.Lerp(RotationOffset, MathHelper.ToRadians(120f * Projectile.ai[1] * Owner.direction), 0.2f); - } - else - { - if (!finalFlip) - { - FlipAsSword = Owner.direction < 0 ? true : false; - } + Vector2 dustPosition = Projectile.Center + Projectile.velocity * 78 * Projectile.scale; + Vector2 swingVel = Projectile.velocity.RotatedBy(MathHelper.PiOver2 * (swingCount % 2 == 0 ? -1 : 1) * Owner.direction); + Dust dust = Dust.NewDustPerfect(dustPosition, DustID.Pearlwood); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.85f, 1.3f); + dust.velocity = swingVel.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.5f, 2.5f); - float time = (AnimationProgress) - (useAnim / 3); - float timeMax = useAnim - (useAnim / 3); - - if (time == (int)(timeMax * 0.4f)) - { - SoundEngine.PlaySound(SoundID.DD2_MonkStaffSwing with { Volume = 0.6f, Pitch = Main.rand.NextFloat(-0.35f, -0.55f) }, Projectile.Center); - } - if ( time > (int)(timeMax * 0.2f) && time < (int)(timeMax * 0.85f)) - { - CanHit = true; - - Vector2 particleVel = new Vector2(0, 7 * -Projectile.ai[1] * Owner.direction).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)); - Vector2 particlePos = Owner.Center + (new Vector2(Main.rand.Next(10, 90), 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45))); - - Dust dust = Dust.NewDustPerfect(particlePos, DustID.Pearlwood); - dust.noGravity = true; - dust.scale = Main.rand.NextFloat(0.85f, 1.3f); - dust.velocity = -particleVel.RotatedByRandom(0.2f); - } + bool fall = Main.rand.NextBool(8); + Dust dust2 = Dust.NewDustPerfect(dustPosition, ModContent.DustType(), swingVel * Main.rand.NextFloat(3.5f, 5.5f)); + dust2.scale = Main.rand.NextFloat(0.65f, 0.85f); + dust2.noGravity = fall ? false : true; + dust2.color = Color.Chartreuse; + if (!fall) + dust2.fadeIn = 0.9f; else - CanHit = false; - - RotationOffset = MathHelper.Lerp(RotationOffset, MathHelper.ToRadians(MathHelper.Lerp(150f * Projectile.ai[1] * Owner.direction, 120f * -Projectile.ai[1] * Owner.direction, CalamityUtils.ExpInOutEasing(time / timeMax, 1))), - 0.2f); - - if (time >= timeMax) - doSwing = false; - if (time < (int)(timeMax * 0.7f)) - postSwing = true; - - if (CanHit) { - for (int i = 0; i < (Owner.Calamity().mouseRight ? 3 : 2); i++) - { - Vector2 dustPos = Owner.Center + (new Vector2(90, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)).RotatedByRandom(0.3f)); - Dust dust2 = Dust.NewDustPerfect(dustPos, i == 2 ? 278 : DustID.JungleTorch, Utils.DirectionTo(Owner.Center, dustPos) * Main.rand.NextFloat(1.2f, 2.5f)); - dust2.scale = Main.rand.NextFloat(0.55f, 0.85f) * (Owner.Calamity().mouseRight ? 1.3f : 1); - dust2.noGravity = i == 2 ? false : true; - dust2.color = i == 2 ? Color.Chartreuse : default; - } - } + dust.velocity.Y = 1.5f; + dust2.fadeIn = -0.5f; + } + } - } - ArmRotationOffset = MathHelper.ToRadians(-140f); - ArmRotationOffsetBack = MathHelper.ToRadians(-140f); - } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - if ((damageDone <= 2 || (target.life <= 0 && target.realLife == -1)) && Projectile.numHits > 0) - Projectile.numHits -= 1; - - SoundStyle fire = new("CalamityMod/Sounds/NPCHit/RavagerRockPillarHit", 3); - SoundEngine.PlaySound(fire with { Volume = 0.65f, Pitch = -0.2f }, Projectile.Center); - SoundEngine.PlaySound(SoundID.DrumTomHigh with { Volume = 0.45f, Pitch = -0.9f }, Projectile.Center); - - target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(BuffID.Poisoned, 90); - - Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, 7.5f * (Owner.Calamity().mouseRight ? 2.5f : 1), true); - - if (Owner.Calamity().mouseRight) - { - Owner.SetScreenshake(1.2f); - - SoundStyle fire3 = new("CalamityMod/Sounds/Item/DampExplosion"); - SoundEngine.PlaySound(fire3 with { Volume = 0.35f, Pitch = 0.7f }, Projectile.Center); - for (int i = 0; i < MathHelper.Clamp(15 - Projectile.numHits * 3, 2, 15); i++) + if (lerp > 0.4f) // Partway through make the hitbox and sound { - bool dType = i % 4 == 0; - Dust dust2 = Dust.NewDustPerfect(target.Center, dType ? 278 : DustID.JungleTorch, launchVel.RotatedByRandom(0.5f) * Main.rand.NextFloat(3.5f, 7f) * (dType ? 2 : 1)); - dust2.scale = Main.rand.NextFloat(0.65f, 1.35f) * (dType ? 0.7f : 1f); - dust2.noGravity = true; - dust2.color = dType ? Color.Chartreuse : default; + if (makeSound) + { + enabledHitbox = 8; + SoundEngine.PlaySound(SoundID.DD2_MonkStaffSwing with { Volume = 0.75f, Pitch = Main.rand.NextFloat(-0.35f, -0.55f) }, Projectile.Center); + makeSound = false; + } } - // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction - Vector2 playerLaunchVel = (Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitY) * 10; - Owner.velocity = playerLaunchVel; - } - - for (int i = 0; i < MathHelper.Clamp(6 - Projectile.numHits * 2, 2, 6); i++) - { - Dust dust2 = Dust.NewDustPerfect(target.Center, Main.rand.NextBool(5) ? DustID.JungleTorch : 79, ((Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitY) * -20).RotatedByRandom(0.7) * Main.rand.NextFloat(0.1f, 0.7f)); - dust2.scale = Main.rand.NextFloat(0.75f, 1.25f); - dust2.noGravity = true; + #endregion } + Timers(); + } + public void Timers() + { + time++; + // Only increment the attack animation when on cooldown or when allowed to swing + if ((attackTimer < fireRate && performSwing) || attackTimer < -1) + attackTimer++; + if (rumble > 0) + rumble -= 0.2f; } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + if (Projectile.numHits == 0) + { + Owner.SetScreenshake(2f); + + SoundStyle bash1 = new("CalamityMod/Sounds/Item/DampExplosion"); + SoundEngine.PlaySound(bash1 with { Volume = 0.45f, Pitch = 0.7f }, Projectile.Center); + SoundStyle bash2 = new("CalamityMod/Sounds/NPCHit/RavagerRockPillarHit", 3); + SoundEngine.PlaySound(bash2 with { Volume = 0.75f, Pitch = -0.2f }, Projectile.Center); + SoundEngine.PlaySound(SoundID.DrumTomHigh with { Volume = 0.55f, Pitch = -0.9f }, Projectile.Center); + + Vector2 playerLaunchVel = -toMouse * 10; + Owner.velocity = playerLaunchVel; + rumble = 20; + } + + target.AddBuff(ModContent.BuffType(), 300); + + Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); + target.MoveNPC(launchVel, 14f, true); + + for (int i = 0; i < MathHelper.Clamp(15 - Projectile.numHits * 3, 2, 15); i++) + { + bool dType = i % 4 == 0; + Dust dust = Dust.NewDustPerfect(target.Center, !dType ? DustID.Pearlwood : ModContent.DustType(), launchVel.RotatedByRandom(dType ? 0.2f : 0.5f) * Main.rand.NextFloat(2.5f, 7f) * (dType ? 3 : 1)); + dust.scale = Main.rand.NextFloat(0.65f, 1.05f) * ((dType || Main.rand.NextBool(3)) ? 2.2f : 1f); + dust.noGravity = true; + dust.color = dType ? Color.Chartreuse : default; + if (dType) + dust.fadeIn = 1.7f; + } + float minMult = 0.3f; int hitsToMinMult = 5; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= damageMult * (Owner.Calamity().mouseRight ? 2f : 1); + modifiers.SourceDamage *= damageMult; } public override bool PreDraw(ref Color lightColor) { - // Only draw the projectile if the projectile's owner is currently using the item this projectile is attached to. - if ((useAnim > 0 || DrawUnconditionally) && Owner.ItemAnimationActive) - { - Asset tex = ModContent.Request(Texture); + if (time < 3) + return false; - float r = FlipAsSword ? MathHelper.ToRadians(90) : 0f; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Texture2D swoosh = ModContent.Request("CalamityMod/Particles/VerticalSmearThin").Value; - for (int i = 0; i < 8; i++) - { - Color auraColor = Color.Chartreuse with { A = 0 } * 0.35f * fadeIn; - Vector2 drawOffset = (MathHelper.TwoPi * i / 8f).ToRotationVector2() * 8 * fadeIn; - Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + drawOffset + new Vector2(0, Owner.gfxOffY), tex.Frame(1, FrameCount, 0, Frame), auraColor, Projectile.rotation + RotationOffset + r, FlipAsSword ? new Vector2(tex.Width() - SpriteOrigin.X, SpriteOrigin.Y) : SpriteOrigin, Projectile.scale, spriteEffects != SpriteEffects.None ? spriteEffects : (FlipAsSword ? SpriteEffects.FlipHorizontally : SpriteEffects.None)); - } + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Vector2 vel = Projectile.rotation.ToRotationVector2(); + Color drawColor = Projectile.GetAlpha(lightColor); + float drawRotation = Projectile.rotation + ((Owner.direction == -1) ? MathHelper.Pi - MathHelper.PiOver4 : MathHelper.PiOver4); + Vector2 rotationPoint = (Owner.direction == -1) ? new Vector2(texture.Width, texture.Height) : new Vector2(0, texture.Height); + SpriteEffects flipSprite = (Owner.direction == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY), tex.Frame(1, FrameCount, 0, Frame), lightColor, Projectile.rotation + RotationOffset + r, FlipAsSword ? new Vector2(tex.Width() - SpriteOrigin.X, SpriteOrigin.Y) : SpriteOrigin, Projectile.scale, spriteEffects != SpriteEffects.None ? spriteEffects : (FlipAsSword ? SpriteEffects.FlipHorizontally : SpriteEffects.None)); - } + Vector2 placeAdjust = (drawRotation + MathHelper.PiOver2).ToRotationVector2() * 2.5f; + Color clr = Color.Tan; + int swingCountFlip = (swingCount % 2 == 0 ? 1 : 3) + Owner.direction == 0 ? 2 : 0; + Vector2 vel2 = Projectile.velocity.RotatedBy(MathHelper.PiOver2); + float extraRot = MathHelper.PiOver4 * 1.2f * (swingCount % 2 == 0 ? (Owner.direction == -1 ? 1 : -1) : (Owner.direction == -1 ? -1 : 1)); + float swooshDrawRotation = vel2.ToRotation() + extraRot; + SpriteEffects swooshFlipSprite = (swingCount % 2 == 0 ? (Owner.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None) : (Owner.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally)); + + Main.EntitySpriteDraw(swoosh, drawPosition + Projectile.velocity.RotatedBy(extraRot) * 12.5f, null, clr with { A = 0 } * bladefx * 0.4f, swooshDrawRotation, swoosh.Size() * 0.5f, Projectile.scale * 0.5f, swooshFlipSprite); //flipSprite | (swingCount % 2 == 0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally) + + Main.EntitySpriteDraw(texture, drawPosition + placeAdjust + Main.rand.NextVector2Circular(rumble, rumble), null, drawColor, drawRotation, rotationPoint, Projectile.scale, flipSprite); // The holdout + return false; } - public override void ResetStyle() + public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) { + overPlayers.Add(index); } } } diff --git a/Projectiles/Melee/BrokenBiomeBlade_AridGrandeur.cs b/Projectiles/Melee/BrokenBiomeBlade_AridGrandeur.cs index 4164215be3..8205cb5f9a 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_AridGrandeur.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_AridGrandeur.cs @@ -31,6 +31,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 70; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/DeathsAscensionSwing.cs b/Projectiles/Melee/DeathsAscensionSwing.cs index 36f9c36aee..f52f7a653f 100644 --- a/Projectiles/Melee/DeathsAscensionSwing.cs +++ b/Projectiles/Melee/DeathsAscensionSwing.cs @@ -46,6 +46,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ownerHitCheck = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 8; diff --git a/Projectiles/Melee/DevilsSunriseProj.cs b/Projectiles/Melee/DevilsSunriseProj.cs index 56e91d066e..9fdf15536d 100644 --- a/Projectiles/Melee/DevilsSunriseProj.cs +++ b/Projectiles/Melee/DevilsSunriseProj.cs @@ -36,6 +36,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.MeleeNoSpeed; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ownerHitCheck = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; diff --git a/Projectiles/Melee/EvilSmasherProjectile.cs b/Projectiles/Melee/EvilSmasherProjectile.cs new file mode 100644 index 0000000000..f7182884f2 --- /dev/null +++ b/Projectiles/Melee/EvilSmasherProjectile.cs @@ -0,0 +1,221 @@ +using System; +using System.Collections.Generic; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatBuffs; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Sounds; +using Humanizer; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + + public class EvilSmasherProjectile : BaseSwordHoldoutProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public Player Owner => Main.player[Projectile.owner]; + public override Item BaseItem => ModContent.GetModItem(ModContent.ItemType()).Item; + + public override string Texture => BaseItem.ModItem.Texture; + public override int AfterImageLength => 10; + public override int OffsetDistance => 50; + public override int CooldownTime { get; set; } + public override bool AlternateSwings => false; + public override bool useMeleeSpeed => false; + public override SoundStyle? UseSound => SoundID.DD2_MonkStaffSwing with {Volume = 1f}; + + bool hasSmashedTile = false; + bool playedChargeSound = false; + bool firstEnemyHit = true; + + public override void Defaults() + { + Projectile.extraUpdates = 3; + swingWidth = 200; + RotateInCooldown = 0; + RotateInStartup = 0; + Projectile.width = 64; + Projectile.height = 66; + } + + public override void Spawn() + { + angle = new Vector2(angle.X.DirectionalSign(), 0); + var player = Main.player[Projectile.owner]; + var modplayer = player.GetModPlayer(); + StartupTime = 80; + CooldownTime = 30; + swingTime = 10; + modplayer.swingNum = 0; + Projectile.timeLeft = 600; + Projectile.scale *= 1.25f; + Projectile.originalDamage = Projectile.damage; + } + + public override void AdditionalAI() + { + if (inStartup) + { + Projectile.damage = (int)(Projectile.originalDamage * (timer / (float)(StartupTime-1))); + Owner.velocity.X *= 0.97f; + } + if (inStartup && !Owner.channel && timer > 30) + { + timer = StartupTime - 1; + } + if (Owner.channel && timer == StartupTime - 1) + { + Projectile.timeLeft++; + timer--; + if (!playedChargeSound) { + SoundEngine.PlaySound(SoundID.Item178,Projectile.Center); + playedChargeSound = true; + for (int i = 0; i < 5; i++) + { + int sparkLifetime = Main.rand.Next(8, 12); + float sparkScale = Main.rand.NextFloat(0.5f, 1f); + var sparkColor = Main.rand.NextBool() ? Color.Purple : Color.Red; + + if (Main.rand.NextBool(5)) + sparkScale *= 1.4f; + + Vector2 sparkVelocity = Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi) * MathHelper.Lerp(10, 30, Main.rand.NextFloat()); + SparkParticle spark = new SparkParticle(Projectile.Center + angle * 30, sparkVelocity, false, sparkLifetime, sparkScale, sparkColor); + GeneralParticleHandler.SpawnParticle(spark); + } + } + } + if (!hasSmashedTile && inSwing && SwingCompletion > 0.275f) + { + var adjustedAngle = angle.RotatedBy(Projectile.spriteDirection * SwingFunction()); + Vector2 HammerFrontPos = Projectile.Center + adjustedAngle * -16 * Projectile.scale + (adjustedAngle.RotatedBy(MathHelper.PiOver2) * 20 * Projectile.scale * angle.X); + if (Collision.SolidCollision(HammerFrontPos, 1, 1)) + { + + Owner.velocity *= 0.15f; + Owner.velocity -= adjustedAngle.RotatedBy(MathHelper.PiOver2) * angle.X * MathHelper.Lerp(7.5f,16f,Projectile.damage / (float)Projectile.originalDamage); + 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 + Projectile.damage / (float)Projectile.originalDamage), 15)); + GeneralParticleHandler.SpawnParticle(new DirectionalPulseRing(HammerFrontPos, Vector2.Zero, Color.Purple, new Vector2(0.2f, 1f), ringRot, 0.2f, 0.75f * (2 + Projectile.damage / (float)Projectile.originalDamage), 30)); + GeneralParticleHandler.SpawnParticle(new DirectionalPulseRing(HammerFrontPos, Vector2.Zero, Color.Purple, new Vector2(0.2f, 1f), ringRot, 0.1f, 0.5f * (2 + Projectile.damage / (float)Projectile.originalDamage), 30)); + int radius = (int)(4 * Projectile.damage / (float)Projectile.originalDamage); + Point scanAreaStart = HammerFrontPos.ToTileCoordinates() + new Point(-radius, -radius); + Point scanAreaEnd = HammerFrontPos.ToTileCoordinates() + new Point(radius, radius); + Projectile.CreateImpactExplosion((int)(10 * Projectile.damage / (float)Projectile.originalDamage), Projectile.Center, ref scanAreaStart, ref scanAreaEnd, Projectile.width, out bool causedShockwaves); + + hasSmashedTile = true; + timer = StartupTime + swingTime; + angle = adjustedAngle; + var pos = Projectile.Center; + Projectile.Size *= 2 + Projectile.damage / (float)Projectile.originalDamage; + Projectile.Center = HammerFrontPos; + Projectile.Damage(); + Projectile.Size /= 2 + Projectile.damage / (float)Projectile.originalDamage; + Projectile.Center = pos; + + if ((Projectile.damage / (float)Projectile.originalDamage) >= 1) + SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact with {VariantsWeights = new ReadOnlySpan(new float[] { 1, 0, 0 })}); + SoundEngine.PlaySound(SoundID.DD2_MonkStaffGroundImpact); + } + } + Owner.heldProj = Projectile.whoAmI; + } + + public override float SwingFunction() + { + if (hasSmashedTile) + return MathHelper.ToRadians(MathHelper.Lerp(0, -swingWidth * 0.4f, MathF.Pow(CooldownCompletion, 0.5f))); + if (inStartup) + return MathHelper.ToRadians(MathHelper.SmoothStep(-swingWidth * 0.8f, -swingWidth * 0.66f, 1 - MathF.Pow(StartupCompletion, 0.5f))); + if (inCooldown) + return MathHelper.ToRadians(MathHelper.SmoothStep(swingWidth * 0.33f, swingWidth * 0.45f, MathF.Pow(CooldownCompletion, 0.5f))); + return MathHelper.ToRadians(MathHelper.SmoothStep(-swingWidth * .66f, (swingWidth * 0.33f), SwingCompletion)); + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (firstEnemyHit && Main.rand.NextFloat() < (Projectile.damage / (float)Projectile.originalDamage)) + { + string text = ""; + if (target.life > 0) + text = CalamityUtils.GetTextValue("Items.Weapons.Melee.EvilSmasher.DamageDialogue" + Main.rand.Next(4)); + else + text = CalamityUtils.GetTextValue("Items.Weapons.Melee.EvilSmasher.KillDialogue" + Main.rand.Next(2)); + char[] textToFormat = text.ToCharArray(); + for (var i = 0; i < textToFormat.Length; i++) + { + if (Main.rand.NextBool()) + textToFormat[i] = char.ToUpper(textToFormat[i]); + } + text = new string(textToFormat); + bool intense = target.life <= 0; + CombatText.NewText(Projectile.Hitbox, Color.Lerp(Color.DarkGray,Color.Gold, intense ? 0.25f: 0.1f), text, intense); + firstEnemyHit = false; + } + if (!hasSmashedTile && (Projectile.damage / (float)Projectile.originalDamage) >= 1) + { + for (int i = 0; i < 16; i++) + { + int sparkLifetime = Main.rand.Next(10, 15); + float sparkScale = Main.rand.NextFloat(1f, 2f); + var sparkColor = Main.rand.NextBool() ? Color.Purple : Color.Red; + + if (Main.rand.NextBool(5)) + sparkScale *= 1.4f; + + Vector2 sparkVelocity = Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi) * MathHelper.Lerp(10, 30, Main.rand.NextFloat()); + SparkParticle spark = new SparkParticle(target.Center, sparkVelocity, false, sparkLifetime, sparkScale, sparkColor); + GeneralParticleHandler.SpawnParticle(spark); + + } + SoundEngine.PlaySound(SoundID.DeerclopsRubbleAttack with { Volume = 0.5f, LimitsArePerVariant = false, MaxInstances = 1 }); + } + else if (!hasSmashedTile) + { + + SoundEngine.PlaySound(SoundID.Item69 with { Volume = 1f, LimitsArePerVariant = false, MaxInstances = 1 }); + } + target.AddBuff(ModContent.BuffType(), (int)MathHelper.Lerp(60, 900, Projectile.damage / (float)Projectile.originalDamage)); + Owner.AddBuff(ModContent.BuffType(), (int)MathHelper.Lerp(60, 900, Projectile.damage / (float)Projectile.originalDamage)); + } + + public override bool PreDraw(ref Color lightColor) + { + if (!inCooldown) + { + var tex = ModContent.Request(Texture + "Glow").Value; + float outlineWidth = (int)(4 * (Projectile.damage / (float)Projectile.originalDamage)) * 0.5f; + if (inSwing) + { + outlineWidth *= 1 - SwingCompletion; + } + for (float i = 0; i <= MathHelper.TwoPi; i += MathHelper.TwoPi * 0.25f) + { + Main.spriteBatch.Draw( + tex, + Projectile.Center + new Vector2(0, Projectile.gfxOffY) + Vector2.UnitX.RotatedBy(i + Projectile.rotation) * outlineWidth * Projectile.scale - Main.screenPosition, + null, + Color.Lerp(Color.Purple,Color.Red,MathF.Sin(Main.GlobalTimeWrappedHourly * 6)* 0.5f + 0.5f), + Projectile.rotation, + tex.Size() * 0.5f, + Projectile.scale, + Projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, + 0 + ); + } + } + if (inSwing) + return base.PreDraw(ref lightColor); + return true; + } + } +} diff --git a/Projectiles/Melee/Galaxia_AndromedasStride.cs b/Projectiles/Melee/Galaxia_AndromedasStride.cs index feb707f2c8..fb799c055b 100644 --- a/Projectiles/Melee/Galaxia_AndromedasStride.cs +++ b/Projectiles/Melee/Galaxia_AndromedasStride.cs @@ -35,6 +35,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 70; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/Galaxia_AriesWrath.cs b/Projectiles/Melee/Galaxia_AriesWrath.cs index a1b0c8100a..bf80280e05 100644 --- a/Projectiles/Melee/Galaxia_AriesWrath.cs +++ b/Projectiles/Melee/Galaxia_AriesWrath.cs @@ -37,6 +37,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 80; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/Galaxia_PhoenixsPride.cs b/Projectiles/Melee/Galaxia_PhoenixsPride.cs index 1d5953a2f1..feb887a46b 100644 --- a/Projectiles/Melee/Galaxia_PhoenixsPride.cs +++ b/Projectiles/Melee/Galaxia_PhoenixsPride.cs @@ -50,6 +50,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 74; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/Galaxia_PolarisGaze.cs b/Projectiles/Melee/Galaxia_PolarisGaze.cs index e7e4fa40cc..4ccc7f91a2 100644 --- a/Projectiles/Melee/Galaxia_PolarisGaze.cs +++ b/Projectiles/Melee/Galaxia_PolarisGaze.cs @@ -37,6 +37,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 70; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/HolyColliderHoldout.cs b/Projectiles/Melee/HolyColliderHoldout.cs index de8e35f5aa..923f3e19c5 100644 --- a/Projectiles/Melee/HolyColliderHoldout.cs +++ b/Projectiles/Melee/HolyColliderHoldout.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Melee AnimationProgress = Animation % (chargedSwing ? (int)(storedUseAnim * 1.2f) : storedUseAnim); DrawUnconditionally = false; - bool cantUse = (Owner.Calamity().mouseRight || Owner == null || !Owner.active || Owner.dead || Main.mouseLeftRelease || Owner.CCed || Owner.noItems); + bool cantUse = ( Owner == null || !Owner.active || Owner.dead || Main.mouseLeftRelease || Owner.CCed || Owner.noItems); if (CanHit || postSwing) mousePos = Owner.Center - aimVel; @@ -406,10 +406,10 @@ namespace CalamityMod.Projectiles.Melee SoundStyle hitSound = new("CalamityMod/Sounds/Item/HolyColliderSmallHit"); SoundEngine.PlaySound(hitSound with { Volume = 0.85f, PitchVariance = 0.25f }, Projectile.Center); - for (int i = 0; i < 8; i++) + for (int i = 0; i < 6; i++) { // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction - Projectile fadedFire = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, ((Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitY) * -11).RotatedByRandom(0.6f) * Main.rand.NextFloat(0.3f, 1f), ModContent.ProjectileType(), (int)(Projectile.damage * 0.05), Projectile.knockBack, Projectile.owner, 10, target.whoAmI); + Projectile fadedFire = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, ((Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitY) * -11).RotatedByRandom(0.6f) * Main.rand.NextFloat(0.3f, 1f), ModContent.ProjectileType(), (int)(Projectile.damage * 0.01), Projectile.knockBack, Projectile.owner, 10, target.whoAmI); fadedFire.timeLeft = Main.rand.Next(40, 55 + 1); } } @@ -445,7 +445,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 ? 1f : 0.5f) * damageMult; + modifiers.SourceDamage *= (chargedSwing ? 1f : 0.2f) * damageMult; } public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Melee/HolyColliderHolyFire.cs b/Projectiles/Melee/HolyColliderHolyFire.cs index 0318c62d67..46e0e0485c 100644 --- a/Projectiles/Melee/HolyColliderHolyFire.cs +++ b/Projectiles/Melee/HolyColliderHolyFire.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.localNPCHitCooldown = 10 * Projectile.MaxUpdates; } - public override bool? CanDamage() => ((time > 10 && !isLaunched) || (isLaunched && !setStats)) ? null : false; + public override bool? CanDamage() => (Projectile.ai[0] == 10 && Projectile.numHits > 5) ? false : ((time > 10 && !isLaunched) || (isLaunched && !setStats)) ? null : false; public override void AI() { @@ -50,7 +50,8 @@ namespace CalamityMod.Projectiles.Melee isLaunched = true; else Projectile.ai[2] = 0; - + if (Projectile.ai[0] == 10) + Projectile.localNPCHitCooldown = 60 * Projectile.MaxUpdates; Projectile.scale = Utils.GetLerpValue(0, 40, Projectile.timeLeft, true); @@ -143,6 +144,7 @@ namespace CalamityMod.Projectiles.Melee } if (Projectile.frame > 3) Projectile.frame = 0; + Main.NewText(Projectile.timeLeft); time++; } diff --git a/Projectiles/Melee/LightspeedHoldout.cs b/Projectiles/Melee/LightspeedHoldout.cs index e517fe64b4..26e85a1eed 100644 --- a/Projectiles/Melee/LightspeedHoldout.cs +++ b/Projectiles/Melee/LightspeedHoldout.cs @@ -74,6 +74,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.height = 94; Projectile.friendly = true; Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.penetrate = -1; diff --git a/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs b/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs index 68bc6ca463..77f8da080b 100644 --- a/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs +++ b/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs @@ -49,6 +49,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 74; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeur.cs b/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeur.cs index 75f363454a..d2b0c7cb51 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeur.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeur.cs @@ -35,6 +35,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 70; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/MurasamaSlash.cs b/Projectiles/Melee/MurasamaSlash.cs index fea77fab78..62c19d5938 100644 --- a/Projectiles/Melee/MurasamaSlash.cs +++ b/Projectiles/Melee/MurasamaSlash.cs @@ -36,6 +36,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 6; Projectile.frameCounter = 0; diff --git a/Projectiles/Melee/OmnibladeSwing.cs b/Projectiles/Melee/OmnibladeSwing.cs index 8e9ef1d4ae..f40e864581 100644 --- a/Projectiles/Melee/OmnibladeSwing.cs +++ b/Projectiles/Melee/OmnibladeSwing.cs @@ -28,6 +28,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ownerHitCheck = true; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 3; diff --git a/Projectiles/Melee/PhotonRipperProjectile.cs b/Projectiles/Melee/PhotonRipperProjectile.cs index 7df5d407e1..2208750278 100644 --- a/Projectiles/Melee/PhotonRipperProjectile.cs +++ b/Projectiles/Melee/PhotonRipperProjectile.cs @@ -36,6 +36,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ownerHitCheck = true; // No reason to ID-static the chainsaw -- multiple players can true melee simultaneously! Projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Melee/PrismaticBreakerHoldout.cs b/Projectiles/Melee/PrismaticBreakerHoldout.cs index f9b63480d5..8fb31ba0a0 100644 --- a/Projectiles/Melee/PrismaticBreakerHoldout.cs +++ b/Projectiles/Melee/PrismaticBreakerHoldout.cs @@ -25,6 +25,12 @@ namespace CalamityMod.Projectiles.Melee public float StarTimer = 0f; public float StarFrequency = 47f; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = MeleeRangedHybridDamageClass.Instance; + } + public override void HoldoutAI() { if (Owner.CantUseHoldout()) diff --git a/Projectiles/Melee/PrismaticMagicCircle.cs b/Projectiles/Melee/PrismaticMagicCircle.cs index 108b2e440d..66d896bd66 100644 --- a/Projectiles/Melee/PrismaticMagicCircle.cs +++ b/Projectiles/Melee/PrismaticMagicCircle.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.width = Projectile.height = 512; Projectile.friendly = true; Projectile.DamageType = MeleeRangedHybridDamageClass.Instance; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.tileCollide = false; Projectile.timeLeft = Lifetime; } diff --git a/Projectiles/Melee/PrismaticRay.cs b/Projectiles/Melee/PrismaticRay.cs index 9a7efa8c1a..df64d66a86 100644 --- a/Projectiles/Melee/PrismaticRay.cs +++ b/Projectiles/Melee/PrismaticRay.cs @@ -42,6 +42,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.width = Projectile.height = 36; Projectile.friendly = true; Projectile.DamageType = MeleeRangedHybridDamageClass.Instance; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.timeLeft = 360; diff --git a/Projectiles/Melee/RespiteblockHoldout.cs b/Projectiles/Melee/RespiteblockHoldout.cs index 47bff0a112..14a4f95538 100644 --- a/Projectiles/Melee/RespiteblockHoldout.cs +++ b/Projectiles/Melee/RespiteblockHoldout.cs @@ -28,6 +28,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ownerHitCheck = true; // No reason to ID-static the chainsaw -- multiple players can true melee simultaneously! Projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Melee/Spears/StreamGougeProj.cs b/Projectiles/Melee/Spears/StreamGougeProj.cs index ddefad369a..86ec5b4408 100644 --- a/Projectiles/Melee/Spears/StreamGougeProj.cs +++ b/Projectiles/Melee/Spears/StreamGougeProj.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.height = 40; Projectile.penetrate = -1; Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.friendly = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; diff --git a/Projectiles/Melee/TerratomereHoldoutProj.cs b/Projectiles/Melee/TerratomereHoldoutProj.cs index b5ecb88747..7a8fd9c7e1 100644 --- a/Projectiles/Melee/TerratomereHoldoutProj.cs +++ b/Projectiles/Melee/TerratomereHoldoutProj.cs @@ -89,6 +89,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.MeleeNoSpeed; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.timeLeft = Terratomere.SwingTime; Projectile.usesLocalNPCImmunity = true; Projectile.MaxUpdates = 2; diff --git a/Projectiles/Melee/TrueBiomeBlade_EarthenTides.cs b/Projectiles/Melee/TrueBiomeBlade_EarthenTides.cs index da7aad8975..48137f78b4 100644 --- a/Projectiles/Melee/TrueBiomeBlade_EarthenTides.cs +++ b/Projectiles/Melee/TrueBiomeBlade_EarthenTides.cs @@ -37,6 +37,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 70; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/TrueBiomeBlade_LamentationsOfTheChained.cs b/Projectiles/Melee/TrueBiomeBlade_LamentationsOfTheChained.cs index 1db4fff2ff..6da96fc3f6 100644 --- a/Projectiles/Melee/TrueBiomeBlade_LamentationsOfTheChained.cs +++ b/Projectiles/Melee/TrueBiomeBlade_LamentationsOfTheChained.cs @@ -38,6 +38,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 80; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/TrueBiomeBlade_SanguineFury.cs b/Projectiles/Melee/TrueBiomeBlade_SanguineFury.cs index efdf0451fa..c73df900ed 100644 --- a/Projectiles/Melee/TrueBiomeBlade_SanguineFury.cs +++ b/Projectiles/Melee/TrueBiomeBlade_SanguineFury.cs @@ -38,6 +38,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 70; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs b/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs index 95223e7aa4..a0445fe39e 100644 --- a/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs +++ b/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs @@ -51,6 +51,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 74; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Ranged/ChickenCannonHeld.cs b/Projectiles/Ranged/ChickenCannonHeld.cs index a34cdee075..bcb02eccf2 100644 --- a/Projectiles/Ranged/ChickenCannonHeld.cs +++ b/Projectiles/Ranged/ChickenCannonHeld.cs @@ -30,6 +30,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Ranged; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; } diff --git a/Projectiles/Ranged/ContagionBow.cs b/Projectiles/Ranged/ContagionBow.cs index e6261e8090..6717782c43 100644 --- a/Projectiles/Ranged/ContagionBow.cs +++ b/Projectiles/Ranged/ContagionBow.cs @@ -23,6 +23,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.Ranged; + Projectile.ContinuouslyUpdateDamageStats = true; } public override void AI() diff --git a/Projectiles/Ranged/HiveMissile.cs b/Projectiles/Ranged/HiveMissile.cs index a95485dbed..0a84bc428e 100644 --- a/Projectiles/Ranged/HiveMissile.cs +++ b/Projectiles/Ranged/HiveMissile.cs @@ -156,7 +156,7 @@ namespace CalamityMod.Projectiles.Ranged dust2.color = Main.rand.NextBool(3) ? EffectsColor : StaticEffectsColor; } var projAmount = isClusterRocket ? 3f : 2f; - if (Main.player[Projectile.owner].strongBees && Main.rand.NextBool()) + if (Main.player[Projectile.owner].strongBees) projAmount++; for (int k = 0; k < projAmount; k++) { diff --git a/Projectiles/Ranged/HiveNuke.cs b/Projectiles/Ranged/HiveNuke.cs index 42d6a91781..af0b2be614 100644 --- a/Projectiles/Ranged/HiveNuke.cs +++ b/Projectiles/Ranged/HiveNuke.cs @@ -241,7 +241,7 @@ namespace CalamityMod.Projectiles.Ranged var projAmount = isClusterRocket ? 30f : 20f; if (Main.player[Projectile.owner].strongBees) - projAmount *= 1.15f; + projAmount *= 1.25f; for (int k = 0; k < projAmount; k++) { int BEES = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, new Vector2(10, 10).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 0.8f), ModContent.ProjectileType(), (int)(Projectile.damage * (isClusterRocket ? 0.03f : 0.04f)), 0f, Projectile.owner, 0f, 0f, isClusterRocket ? 2f : 1f); diff --git a/Projectiles/Ranged/KingsbaneHoldout.cs b/Projectiles/Ranged/KingsbaneHoldout.cs index 23ea0c60bb..167c78065f 100644 --- a/Projectiles/Ranged/KingsbaneHoldout.cs +++ b/Projectiles/Ranged/KingsbaneHoldout.cs @@ -31,6 +31,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.friendly = true; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Ranged; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; Projectile.alpha = 255; } diff --git a/Projectiles/Ranged/NorfleetCannon.cs b/Projectiles/Ranged/NorfleetCannon.cs index 331e716686..d24165ad8d 100644 --- a/Projectiles/Ranged/NorfleetCannon.cs +++ b/Projectiles/Ranged/NorfleetCannon.cs @@ -45,6 +45,8 @@ namespace CalamityMod.Projectiles.Ranged Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.netImportant = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.ContinuouslyUpdateDamageStats = true; } public override void AI() diff --git a/Projectiles/Ranged/TauCannonBeam.cs b/Projectiles/Ranged/TauCannonBeam.cs index 72ea9e7190..e4e98e00e8 100644 --- a/Projectiles/Ranged/TauCannonBeam.cs +++ b/Projectiles/Ranged/TauCannonBeam.cs @@ -46,6 +46,8 @@ namespace CalamityMod.Projectiles.Ranged Projectile.tileCollide = false; Projectile.friendly = true; Projectile.usesLocalNPCImmunity = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.ContinuouslyUpdateDamageStats = true; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { diff --git a/Projectiles/Rogue/HypothermiaChunk.cs b/Projectiles/Rogue/HypothermiaChunk.cs index 3ce8253f53..20e1a7a0df 100644 --- a/Projectiles/Rogue/HypothermiaChunk.cs +++ b/Projectiles/Rogue/HypothermiaChunk.cs @@ -73,13 +73,13 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 300); target.AddBuff(ModContent.BuffType(), 150); } public override void OnHitPlayer(Player target, Player.HurtInfo info) { - target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 300); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Rogue/HypothermiaShard.cs b/Projectiles/Rogue/HypothermiaShard.cs index b62faae264..987c2786bd 100644 --- a/Projectiles/Rogue/HypothermiaShard.cs +++ b/Projectiles/Rogue/HypothermiaShard.cs @@ -59,8 +59,8 @@ namespace CalamityMod.Projectiles.Rogue return false; } - 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(), 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); public override void OnKill(int timeLeft) { for (int k = 0; k < 3; k++) diff --git a/Projectiles/Rogue/PlaguenadeProj.cs b/Projectiles/Rogue/PlaguenadeProj.cs index 8dd4b9c786..6f39328766 100644 --- a/Projectiles/Rogue/PlaguenadeProj.cs +++ b/Projectiles/Rogue/PlaguenadeProj.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Rogue Player player = Main.player[Projectile.owner]; int projAmt = Projectile.Calamity().stealthStrike ? 28 : 20; if (player.strongBees) - projAmt += Projectile.Calamity().stealthStrike ? 7 : 5; + projAmt = (int)(projAmt * 1.5f); for (int projIndex = 0; projIndex < projAmt; projIndex++) { float speedX = (float)Main.rand.Next(-35, 36) * 0.02f; diff --git a/Projectiles/Rogue/SlickCaneProjectile.cs b/Projectiles/Rogue/SlickCaneProjectile.cs index 54599b649a..a9584f036a 100644 --- a/Projectiles/Rogue/SlickCaneProjectile.cs +++ b/Projectiles/Rogue/SlickCaneProjectile.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.ownerHitCheck = true; Projectile.hide = true; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 5; + Projectile.localNPCHitCooldown = -1; Projectile.alpha = 180; Projectile.scale = 1.25f; } @@ -64,12 +64,10 @@ namespace CalamityMod.Projectiles.Rogue public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { - float f2 = Projectile.rotation - MathHelper.PiOver4 * - Math.Sign(Projectile.velocity.X) + (Projectile.spriteDirection == -1).ToInt() * MathHelper.Pi; + float spearLengthMult = 2.5f; float velocityMagnitude = 0f; - float scaleFactor = 18f; if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), - Main.player[Projectile.owner].Center, Projectile.Center + f2.ToRotationVector2() * scaleFactor, + Main.player[Projectile.owner].Center, Main.player[Projectile.owner].Center + Projectile.velocity * spearLengthMult, (TravelSpeed + 1f) * Projectile.scale, ref velocityMagnitude)) { return true; diff --git a/Projectiles/Rogue/Valaricicle.png b/Projectiles/Rogue/Valaricicle.png index d2db05e4da..3e948e73dd 100644 Binary files a/Projectiles/Rogue/Valaricicle.png and b/Projectiles/Rogue/Valaricicle.png differ diff --git a/Projectiles/Rogue/Valaricicle2.png b/Projectiles/Rogue/Valaricicle2.png index e88b3b8d3f..3cfc5330f5 100644 Binary files a/Projectiles/Rogue/Valaricicle2.png and b/Projectiles/Rogue/Valaricicle2.png differ diff --git a/Projectiles/Summon/AquasScepterRaindrop.cs b/Projectiles/Summon/AquasScepterRaindrop.cs index 4df8cfb6ad..7f91e149a1 100644 --- a/Projectiles/Summon/AquasScepterRaindrop.cs +++ b/Projectiles/Summon/AquasScepterRaindrop.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon @@ -10,6 +11,7 @@ namespace CalamityMod.Projectiles.Summon { // Sets the amount of frames this minion has on its spritesheet Main.projFrames[Type] = 1; + ProjectileID.Sets.SentryShot[Type] = true; } public sealed override void SetDefaults() //If you want to change the damage of this projectile, just change the base damage of AquasScepter, the item. Note that this will affect the damage of AquasScepterTeslaAura as well, because the damage of said projectile is set as a multiple of the base damage at the bottom of AquasScepterCloud.cs diff --git a/Projectiles/Summon/AquasScepterTeslaAura.cs b/Projectiles/Summon/AquasScepterTeslaAura.cs index d82c9ac926..94ce5fc9a5 100644 --- a/Projectiles/Summon/AquasScepterTeslaAura.cs +++ b/Projectiles/Summon/AquasScepterTeslaAura.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon @@ -13,6 +14,7 @@ namespace CalamityMod.Projectiles.Summon { // Sets the amount of frames this minion has on its spritesheet Main.projFrames[Type] = 5; + ProjectileID.Sets.SentryShot[Type] = true; } public sealed override void SetDefaults() //If you want to change the damage of this projectile, look near the bottom of AquasScepterCloud.cs because this projectile's damage is set in Projectile.NewProjectile as a multiple of the AquasScepterCloud damage value diff --git a/Projectiles/Summon/DazzlingStabber.cs b/Projectiles/Summon/DazzlingStabber.cs index ac5051de40..bfa59c1b17 100644 --- a/Projectiles/Summon/DazzlingStabber.cs +++ b/Projectiles/Summon/DazzlingStabber.cs @@ -130,6 +130,7 @@ namespace CalamityMod.Projectiles.Summon GeneralParticleHandler.SpawnParticle(spark); } } + justHit = false; } if (potentialTarget != null) diff --git a/Projectiles/Summon/PlaguebringerMK2.cs b/Projectiles/Summon/PlaguebringerMK2.cs index e1a38ea092..c7149d9a70 100644 --- a/Projectiles/Summon/PlaguebringerMK2.cs +++ b/Projectiles/Summon/PlaguebringerMK2.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Summon else Projectile.velocity = Projectile.SafeDirectionTo(destination) * Projectile.Distance(destination) / 36f; - int timeNeeded = (int)(MathHelper.Lerp(60f, 18f, MathHelper.Clamp(Projectile.localAI[1] / 320f, 0f, 1f)) * (player.strongBees ? 0.85f : 1f)); + int timeNeeded = (int)(MathHelper.Lerp(60f, 18f, MathHelper.Clamp(Projectile.localAI[1] / 320f, 0f, 1f)) * (player.strongBees ? 0.75f : 1f)); if (Projectile.ai[0] >= timeNeeded && Main.myPlayer == Projectile.owner) { Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, diff --git a/Projectiles/Summon/PlaguebringerSummon.cs b/Projectiles/Summon/PlaguebringerSummon.cs index ffa626a95c..66667c4cdf 100644 --- a/Projectiles/Summon/PlaguebringerSummon.cs +++ b/Projectiles/Summon/PlaguebringerSummon.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.ai[0] % 12 == 11) { int beeCount = Main.rand.Next(1, 3); - if (Owner.strongBees && Main.rand.NextBool(3)) + if (Owner.strongBees) ++beeCount; for (int i = 0; i < beeCount; i++) diff --git a/Projectiles/Summon/RustyBeaconPulse.cs b/Projectiles/Summon/RustyBeaconPulse.cs index daf22ad8c5..c8a403f834 100644 --- a/Projectiles/Summon/RustyBeaconPulse.cs +++ b/Projectiles/Summon/RustyBeaconPulse.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Weapons.Summon; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon @@ -13,6 +14,10 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public float LifetimeCompletion => 1f - Projectile.timeLeft / (float)RustyBeaconPrototype.PulseLifetime; + public override void SetStaticDefaults() + { + ProjectileID.Sets.SentryShot[Type] = true; + } public override void SetDefaults() { Projectile.width = 96; @@ -21,6 +26,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.penetrate = -1; + Projectile.DamageType = DamageClass.Summon; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 30; Projectile.timeLeft = RustyBeaconPrototype.PulseLifetime; diff --git a/Projectiles/Typeless/SandBall.cs b/Projectiles/Typeless/SandBall.cs index 218b99706d..1e56f608aa 100644 --- a/Projectiles/Typeless/SandBall.cs +++ b/Projectiles/Typeless/SandBall.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Typeless if (Projectile.ai[2] != 1) { for (var i = 0; i < 4; i++) - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity.RotatedByRandom(0.75f) * Main.rand.NextFloat(0.5f,0.75f), ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), Projectile.knockBack, Projectile.owner, ai2: 1); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity.RotatedByRandom(0.75f) * Main.rand.NextFloat(0.5f,0.75f), ModContent.ProjectileType(), (int)(Projectile.damage), Projectile.knockBack, Projectile.owner, ai2: 1); } } @@ -242,7 +242,7 @@ namespace CalamityMod.Projectiles.Typeless public class VolcanicSandBallGun : SandBall { public override string Texture => "CalamityMod/Projectiles/Typeless/SandBallVolcanic"; - public override int TileType => ModContent.TileType(); + public override int TileType => ModContent.TileType(); public override int ItemType => ModContent.ItemType(); public override int DustType => -1; diff --git a/Projectiles/Typeless/SkyFlareFriendly.cs b/Projectiles/Typeless/SkyFlareFriendly.cs index 58f6823a88..85f26a424f 100644 --- a/Projectiles/Typeless/SkyFlareFriendly.cs +++ b/Projectiles/Typeless/SkyFlareFriendly.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -50,6 +51,10 @@ namespace CalamityMod.Projectiles.Typeless return false; } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 300); + } public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item14, Projectile.position); diff --git a/Projectiles/Typeless/StratusBlackHole.cs b/Projectiles/Typeless/StratusBlackHole.cs index b803f42dfa..9e0df11dc6 100644 --- a/Projectiles/Typeless/StratusBlackHole.cs +++ b/Projectiles/Typeless/StratusBlackHole.cs @@ -34,6 +34,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.Opacity = 0; + Projectile.ContinuouslyUpdateDamageStats = true; } public override void AI() diff --git a/Systems/Mechanic/RecipeSystem.cs b/Systems/Mechanic/RecipeSystem.cs index 391f0a3aa1..9d8535f641 100644 --- a/Systems/Mechanic/RecipeSystem.cs +++ b/Systems/Mechanic/RecipeSystem.cs @@ -485,7 +485,7 @@ namespace CalamityMod.Systems // Life Crystal Recipe.Create(ItemID.LifeCrystal). - AddIngredient(ItemID.StoneBlock, 5). + AddRecipeGroup("AnyStoneBlock", 5). AddIngredient(ItemID.Ruby, 2). AddIngredient(ItemID.HealingPotion). AddTile(TileID.Anvils). @@ -1436,7 +1436,7 @@ namespace CalamityMod.Systems // Encumbering Stone r = Recipe.Create(ItemID.EncumberingStone); - r.AddIngredient(ItemID.StoneBlock, 100); + r.AddRecipeGroup("AnyStoneBlock", 100); r.AddTile(TileID.Anvils); r.Register(); } @@ -1448,13 +1448,13 @@ namespace CalamityMod.Systems // Wooden Chest weapons // Wooden Boomerang Recipe r = Recipe.Create(ItemID.WoodenBoomerang); - r.AddIngredient(ItemID.Wood, 7); + r.AddRecipeGroup("Wood", 7); r.AddTile(TileID.WorkBenches); r.Register(); // Wand of Sparking r = Recipe.Create(ItemID.WandofSparking); - r.AddIngredient(ItemID.Wood, 5); + r.AddRecipeGroup("Wood", 5); r.AddIngredient(ItemID.Torch, 3); r.AddIngredient(ItemID.FallenStar); r.AddCondition(Condition.NotRemixWorld); @@ -1599,7 +1599,7 @@ namespace CalamityMod.Systems r = Recipe.Create(ItemID.SandstorminaBottle); r.AddIngredient(ItemID.Bottle); r.AddIngredient(ItemID.Cloud, 5); - r.AddIngredient(ItemID.SandBlock, 5); + r.AddRecipeGroup("Sand", 5); r.AddIngredient(3); r.AddIngredient(ItemID.Feather, 3); r.AddTile(TileID.Anvils); diff --git a/Tiles/SunkenSea/EutrophicSand.cs b/Tiles/SunkenSea/EutrophicSand.cs index 440d1cbc81..c015c371b2 100644 --- a/Tiles/SunkenSea/EutrophicSand.cs +++ b/Tiles/SunkenSea/EutrophicSand.cs @@ -12,8 +12,6 @@ namespace CalamityMod.Tiles.SunkenSea { public override void SetStaticDefaults() { - TileID.Sets.GeneralPlacementTiles[Type] = false; - Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; TileID.Sets.HasSlopeFrames[Type] = true; diff --git a/Tiles/SunkenSea/Navystone.cs b/Tiles/SunkenSea/Navystone.cs index b4243dd14c..0f702a8bbc 100644 --- a/Tiles/SunkenSea/Navystone.cs +++ b/Tiles/SunkenSea/Navystone.cs @@ -11,8 +11,6 @@ namespace CalamityMod.Tiles.SunkenSea { public override void SetStaticDefaults() { - TileID.Sets.GeneralPlacementTiles[Type] = false; - Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; TileID.Sets.HasSlopeFrames[Type] = true; diff --git a/UI/DialogueDisplay/DisplayEffects/AltarText.cs b/UI/DialogueDisplay/DisplayEffects/AltarText.cs new file mode 100644 index 0000000000..e04228bf16 --- /dev/null +++ b/UI/DialogueDisplay/DisplayEffects/AltarText.cs @@ -0,0 +1,43 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.UI.DialogueDisplay.DisplayEffects +{ + public class AltarText : DisplayEffect + { + public override bool FadeWhenTooFar => false; + + public override bool DespawnWithAttachedNPC => false; + + public override Vector2 TextOffsetFromStart(Vector2 startPos, Vector2 textSize) + { + Vector2 halfSize = textSize * 0.5f; + return startPos - halfSize + (Vector2.UnitY * (textSize.Y - 60)); + } + float OffsetDisappearTime(float time, float ratio) => MathHelper.Clamp((time - (ratio * TimeToDisappear / 2f)) / (TimeToDisappear / 2f), 0f, 1f); + + public override Vector2 DisappearPositioning(Vector2 startPos, float time, DialogueCharacterData charData) => Vector2.Lerp(startPos, startPos + (Vector2.unitXVector * 12 * charData.Scale), CalamityUtils.SineOutEasing(OffsetDisappearTime(time, charData.CompletionRatio), 1)); + + public override float DisappearOpacity(float startOpacity, float time, DialogueCharacterData charData) => 1 - CalamityUtils.SineOutEasing(OffsetDisappearTime(time, charData.CompletionRatio), 1); + + public override Vector2 DisappearScale(Vector2 startScale, float time, DialogueCharacterData charData) => Vector2.Lerp(startScale, startScale * 0.75f, CalamityUtils.ExpOutEasing(OffsetDisappearTime(time, charData.CompletionRatio), 1)); + + public override void PreDraw(SpriteBatch spriteBatch, Vector2 textStart, Vector2 textSize, int textTimer, int switchTimer) + { + if (textTimer < 0) + return; + + float Opacity = 1f; + if (textTimer < 30f) + Opacity = MathHelper.Lerp(0f, 1f, CalamityUtils.CircOutEasing(textTimer / 30f, 1)); + + if (switchTimer > 0) + Opacity *= 1 - CalamityUtils.CircOutEasing(switchTimer / 60f, 1); + + Texture2D tex = ModContent.Request("CalamityMod/Particles/SmallBloom").Value; + spriteBatch.Draw(tex, textStart + textSize * 0.5f - Main.screenPosition, null, Color.Black * 0.6f * Opacity, 0f, tex.Size() * 0.5f, new Vector2(textSize.X / 160f, textSize.Y / 120f), 0, 0); + } + } +} diff --git a/Utilities/ItemUtils.cs b/Utilities/ItemUtils.cs index 3c29818724..4efddb7d89 100644 --- a/Utilities/ItemUtils.cs +++ b/Utilities/ItemUtils.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatBuffs; using CalamityMod.DataStructures; using CalamityMod.UI.CalamitasEnchants; using Microsoft.Xna.Framework; @@ -129,6 +130,7 @@ namespace CalamityMod public static Color TypelessDebuffColor => new(230, 202, 250); public static Color VulnHexDebuffColor => new(196, 35, 43); public static Color MiracleBlightDebuffColor => Main.DiscoColor; + public static Color SmashedEvilDebuffColor => Color.Lerp(new Color(162, 88, 231), new Color(221, 66, 97), MathHelper.SmoothStep(0, 1, (MathF.Sin(Main.GlobalTimeWrappedHourly * 2) + 1) * 0.5f)); private static readonly Dictionary> debuffColorWeightsCache = []; @@ -144,6 +146,11 @@ namespace CalamityMod { color = MiracleBlightDebuffColor; } + + else if (debuffId == ModContent.BuffType() && CalamityClientConfig.Instance.TextEffects) + { + color = SmashedEvilDebuffColor; + } else if (BuffDatasets.DebuffDataset[debuffId] is not null) { if (!debuffColorWeightsCache.TryGetValue(debuffId, out var weights)) diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index 20c261a77e..0db89dd408 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -134,7 +134,26 @@ namespace CalamityMod ret += best - 1f; return ret; } + /// + /// Calculates and returns the player's total melee scale boosts. This is used mostly for melee holdouts. + /// + /// If the item scale of the players held item should be added to the calculation.
+ /// Should be disabled for anything that doesn't lock you into holding one item. + /// + public static float GetMeleeScale(this Player player, bool addHeldItemScale = true) + { + float baseScale = 1; + player.ApplyMeleeScale(ref baseScale); // Gets vanilla's glove scale boosts + // Xyk 3MARCH2026: Will be implemented better by Doze eventually + if (addHeldItemScale) + baseScale += (player.HeldItem.scale - 1); + if (player.HasBuff(BuffID.Tipsy)) + baseScale += 0.15f; + + + return baseScale; + } public static float GetAmmoCostReduction(this Player player) { // Tally up all possible vanilla effects. diff --git a/World/DraedonStructures.cs b/World/DraedonStructures.cs index 083849c346..b4441f1453 100644 --- a/World/DraedonStructures.cs +++ b/World/DraedonStructures.cs @@ -338,35 +338,60 @@ namespace CalamityMod.World public static void PlaceSunkenSeaLab(out Point placementPoint, List workshopPoints, StructureMap structures) { + int tries = 0; string mapKey = SunkenSeaLabKey; PilePlacementMaps.TryGetValue(mapKey, out PilePlacementFunction pilePlacementFunction); SchematicMetaTile[,] schematic = TileMaps[mapKey]; int labWidth = schematic.GetLength(0); int labHeight = schematic.GetLength(1); - int sunkenSeaX = (GenVars.UndergroundDesertLocation.Left + GenVars.UndergroundDesertLocation.Right) / 2; - int sunkenSeaY = Main.maxTilesY / 2; + do + { + // Pick a location based on the Underground Desert, because the Sunken Sea is based on the Underground Desert + Rectangle ugDesert = GenVars.UndergroundDesertLocation; + int placementPositionX = -1; - int placementPositionX = sunkenSeaX < Main.maxTilesX / 2 ? sunkenSeaX - 120 : sunkenSeaX + 120; - int placementPositionY = (sunkenSeaY + (Main.maxTilesY / 4) - 25) - labHeight; + // Desperation generation: if 75% of attempts failed, start generating literally anywhere in the Sunken Sea + if (tries >= 1500) + placementPositionX = WorldGen.genRand.Next(ugDesert.Left, ugDesert.Right - labWidth); + // 50% chance to be on either the left or the right. + // If it's on the right then shove it left because all schematics are placed based on their top left corner. + else if (WorldGen.genRand.NextBool()) + placementPositionX = WorldGen.genRand.Next(ugDesert.Left - 20, ugDesert.Left + 10); + else + placementPositionX = WorldGen.genRand.Next(ugDesert.Right - 10, ugDesert.Right + 20) - labWidth; - placementPoint = new Point(placementPositionX, placementPositionY); - Vector2 schematicSize = new Vector2(schematic.GetLength(0), schematic.GetLength(1)); + int sunkenSeaY = 0; - /* - I do not think that this check needs to exist for now, no other structures exist in the sunken sea at the moment - Once other sunken sea structures are added, i will likely re-enable this and modify the generation so that it avoids protected areas again - This is just so i can have it generating in time for the patreon beta - */ + //copied the desert position code from the sunken sea's generation so the lab always generates within the sunken sea properly + for (int y = Main.maxTilesY - 200; y >= Main.worldSurface; y--) + { + if (Main.tile[placementPositionX, y].WallType == ModContent.WallType()) + { + sunkenSeaY = y - 80; //offset so it generates nicely + break; + } + } - //if (structures.CanPlace(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y))) - //{ - bool hasPlacedLogAndSchematic = false; - PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref hasPlacedLogAndSchematic, new Action(FillSunkenSeaLaboratoryChest)); - CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 20); - //Reverted changes to center point placement; the change caused it to not center like it should, offsetting the range at which the bio lab theme plays - CalamityWorld.SunkenSeaLabCenter = placementPoint.ToWorldCoordinates() + new Vector2(TileMaps[mapKey].GetLength(0), TileMaps[mapKey].GetLength(1)) * 8f; - //} + int placementPositionY = sunkenSeaY - labHeight; + + placementPoint = new Point(placementPositionX, placementPositionY); + Vector2 schematicSize = new Vector2(schematic.GetLength(0), schematic.GetLength(1)); + + if (structures.CanPlace(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y))) + { + bool hasPlacedLogAndSchematic = false; + PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref hasPlacedLogAndSchematic, new Action(FillSunkenSeaLaboratoryChest)); + CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 20); + //Reverted changes to center point placement; the change caused it to not center like it should, offsetting the range at which the bio lab theme plays + CalamityWorld.SunkenSeaLabCenter = placementPoint.ToWorldCoordinates() + new Vector2(TileMaps[mapKey].GetLength(0), TileMaps[mapKey].GetLength(1)) * 8f; + break; + } + //try again if the structure is colliding with a structure from another mod + else + tries++; + } + while (tries <= 2000); } #endregion