diff --git a/Buffs/Potions/Soaring.cs b/Buffs/Potions/Soaring.cs index a9a75af3c5..f3b261e533 100644 --- a/Buffs/Potions/Soaring.cs +++ b/Buffs/Potions/Soaring.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Buffs.Potions { public class Soaring : ModBuff { - public override LocalizedText Description => base.Description.WithFormatArgs(SoaringPotion.FlightBoost.ToPercent()); + public override LocalizedText Description => base.Description.WithFormatArgs(SoaringPotion.FlightTimeBoost.ToPercent()); public override void SetStaticDefaults() { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 852712030f..8cd3129a3e 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3752,10 +3752,9 @@ namespace CalamityMod.CalPlayer (reaverSpeed ? ReaverHeadMobility.SetBonusFlightBoost : 0D) + (angelTreads ? AngelTreads.FlightTimeBoost : 0D) + (blueCandle ? WeightlessCandle.WingTimeBoost : 0D) + - (soaring ? SoaringPotion.FlightBoost : 0D) + + (soaring ? SoaringPotion.FlightTimeBoost : 0D) + (prismaticGreaves ? PrismaticGreaves.FlightTimeBoost : 0D) + (plagueReaper ? PlagueReaperMask.SetBonusFlightTimeBoost : 0D) + - (ascendantInsignia ? AscendantInsignia.FlightTimeBoost : Player.empressBrooch ? 0.33D : 0D) + externalFlightTimeMultBoost; if (community) diff --git a/DataStructures/Attunement.cs b/DataStructures/Attunement.cs index 9599aea147..cf54c1512f 100644 --- a/DataStructures/Attunement.cs +++ b/DataStructures/Attunement.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Melee; +using System; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; @@ -72,7 +73,12 @@ namespace CalamityMod.DataStructures /// >Used by evil attunements to check if a regular dash is avaialble /// Used by evil attunements to check if a strong dash is avaialble /// - public virtual bool Shoot(Player player, IEntitySource source, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack, ref int Combo, ref int CanLunge, ref int PowerLungeCounter) => true; + public virtual bool Shoot(Player player, IEntitySource source, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack, ref int Combo, ref int CanLunge, ref int PowerLungeCounter) + { + Projectile blade = Projectile.NewProjectileDirect(source, position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + blade.originalDamage = (int)MathF.Round(blade.originalDamage * DamageMultiplier); + return false; + } public virtual void PassiveEffect(Player player, IEntitySource source, ref int UseTimer, ref bool Procced, Projectile projectile = null) { @@ -155,20 +161,14 @@ namespace CalamityMod.DataStructures public override bool Shoot(Player player, IEntitySource source, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack, ref int Combo, ref int CanLunge, ref int PowerLungeCounter) { - switch (Combo) + Projectile blade = Projectile.NewProjectileDirect(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 0, 15); + blade.originalDamage = (int)MathF.Round(blade.originalDamage * DamageMultiplier); + if (Combo > 0) { - case 0: - Projectile.NewProjectile(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 0, 15); - break; - - case 1: - Projectile.NewProjectile(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 1, 20); - break; - - case 2: - Projectile.NewProjectile(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 2, 50); - break; + blade.ai[0] = Combo; + blade.ai[1] = (Combo == 2 ? 50 : 20); } + Combo++; if (Combo > 2) Combo = 0; @@ -202,7 +202,8 @@ namespace CalamityMod.DataStructures public override bool Shoot(Player player, IEntitySource source, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack, ref int Combo, ref int CanLunge, ref int PowerLungeCounter) { - Projectile.NewProjectile(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 26, (float)CanLunge); + Projectile blade = Projectile.NewProjectileDirect(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 26, (float)CanLunge); + blade.originalDamage = (int)MathF.Round(blade.originalDamage * DamageMultiplier); CanLunge = 0; return false; } @@ -283,20 +284,14 @@ namespace CalamityMod.DataStructures public override bool Shoot(Player player, IEntitySource source, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack, ref int Combo, ref int CanLunge, ref int PowerLungeCounter) { - switch (Combo) + Projectile blade = Projectile.NewProjectileDirect(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 0, 15); + blade.originalDamage = (int)MathF.Round(blade.originalDamage * DamageMultiplier); + if (Combo > 0) { - case 0: - Projectile.NewProjectile(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 0, 15); - break; - - case 1: - Projectile.NewProjectile(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 1, 20); - break; - - case 2: - Projectile.NewProjectile(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 2, 50); - break; + blade.ai[0] = Combo; + blade.ai[1] = (Combo == 2 ? 50 : 20); } + Combo++; if (Combo > 2) Combo = 0; @@ -331,6 +326,7 @@ namespace CalamityMod.DataStructures public override bool Shoot(Player player, IEntitySource source, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack, ref int Combo, ref int CanLunge, ref int PowerLungeCounter) { Projectile whipProj = Projectile.NewProjectileDirect(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 0, 0); + whipProj.originalDamage = (int)MathF.Round(whipProj.originalDamage * DamageMultiplier); if (whipProj.ModProjectile is TrueGrovetendersTouch whip) whip.flipped = Combo == 0 ? 1 : -1; Combo++; @@ -373,6 +369,7 @@ namespace CalamityMod.DataStructures PowerLungeCounter = 0; } Projectile proj = Projectile.NewProjectileDirect(source, player.Center, new Vector2(speedX, speedY), ProjectileType(), damage, knockBack, player.whoAmI, 26f, CanLunge > 0 ? 1f : 0f); + proj.originalDamage = (int)MathF.Round(proj.originalDamage * DamageMultiplier); if (proj.ModProjectile is TrueDecaysRetort rapier) rapier.ChargedUp = powerLungeAvailable; CanLunge--; diff --git a/Items/Accessories/AscendantInsignia.cs b/Items/Accessories/AscendantInsignia.cs index 9a38c4ae96..70e2f6a4ea 100644 --- a/Items/Accessories/AscendantInsignia.cs +++ b/Items/Accessories/AscendantInsignia.cs @@ -15,13 +15,13 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; // These values override Soaring Insignia's - public static double FlightTimeBoost = 0.5D; + public static int FlightTimeBoostFlat = CalamityUtils.SecondsToFrames(4); public static float MoveSpeedBoost = 0.15f; - public static float JumpSpeedBoost = 0.75f; // NOTE: Tooltip shares this number with move speed % as they're equal + public static float JumpSpeedBoost = 1f; public static float AccelerationBoost = 0.5f; public static int AbilityDuration = CalamityUtils.SecondsToFrames(4); public static int AbilityCooldown = CalamityUtils.SecondsToFrames(40); - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(FlightTimeBoost.ToPercent(), MoveSpeedBoost.ToPercent(), (1f + AccelerationBoost).Round(), AbilityDuration.FramesToSeconds(), AbilityCooldown.FramesToSeconds()); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(FlightTimeBoostFlat.FramesToSeconds(), MoveSpeedBoost.ToPercent(), JumpSpeedBoost.ToJumpSpeedPercent(), (1f + AccelerationBoost).Round(), AbilityDuration.FramesToSeconds(), AbilityCooldown.FramesToSeconds()); public override void ModifyTooltips(List list) => list.IntegrateDynamicHotkey(Item); public override void SetDefaults() @@ -41,6 +41,7 @@ namespace CalamityMod.Items.Accessories player.empressBrooch = true; player.moveSpeed += MoveSpeedBoost; player.jumpSpeedBoost += JumpSpeedBoost - 0.5f; + player.wingTimeMax += FlightTimeBoostFlat; } public override void AddRecipes() diff --git a/Items/Accessories/StatMeter.cs b/Items/Accessories/StatMeter.cs index bb95d2b0ca..d210db091b 100644 --- a/Items/Accessories/StatMeter.cs +++ b/Items/Accessories/StatMeter.cs @@ -211,8 +211,8 @@ namespace CalamityMod.Items.Accessories OnePlace((float)player.lifeRegen / 2f), // Divided by 2 to show HP/s, because vanilla! Also normally we'd divide this by 2 in Expert without Well Fed, but we disable that shit Sign(moveSpeedBoost) + TwoPlaces(100f * moveSpeedBoost), TwoPlaces(20f * player.GetJumpBoost())); - // Show wing stats only if over 0 flight time - if (wingFlightTime > 0f) + // Show wing stats only if over 0 flight time and wings are equipped + if (wingFlightTime > 0f && player.equippedWings != null) stats3 += this.GetLocalization("FlightTime").Format(TwoPlaces(wingFlightTime / 60f)); stats3 += "\n" + this.GetLocalization("MiscStats").Format( player.aggro, diff --git a/Items/Accessories/Wings/ElysianWings.cs b/Items/Accessories/Wings/ElysianWings.cs index 6c0a213294..52f9814b2a 100644 --- a/Items/Accessories/Wings/ElysianWings.cs +++ b/Items/Accessories/Wings/ElysianWings.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories.Wings public override float MaxAscentSpeed => 3f; public override float BaseAscent => 0.15f; - public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(240, 10f, 3f); + public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(210, 10f, 3f); public override void SetDefaults() { diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index e48d70f8fd..e184225e10 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -204,8 +204,8 @@ namespace CalamityMod.Items stats[(int)VanillaWingID.LeafWings].FlyTime = 170; stats[(int)VanillaWingID.LeafWings].AccRunSpeedOverride = 9f; stats[(int)VanillaWingID.LeafWings].AccRunAccelerationMult = 2f; - // (Spectre Wings) 1 -> 1.5 acceleration multiplier - stats[(int)VanillaWingID.GhostWings].AccRunAccelerationMult = 1.5f; + // (Spectre Wings) 1 -> 2 acceleration multiplier + stats[(int)VanillaWingID.GhostWings].AccRunAccelerationMult = 2f; // 170 -> 210 flight time stats[(int)VanillaWingID.BeetleWings].FlyTime = 210; @@ -1199,6 +1199,9 @@ namespace CalamityMod.Items player.maxFallSpeed *= 1.2f; } + if (item.type == ItemID.EmpressFlightBooster) + player.wingTimeMax += 150; + if (item.type == ItemID.DemonWings && !player.mount.Active) player.maxFallSpeed *= 1.2f; @@ -1268,7 +1271,6 @@ namespace CalamityMod.Items float moveSpeedBoost = modPlayer.moveSpeedBonus * 0.06f; float flightSpeedMult = 1f + - (modPlayer.soaring ? SoaringPotion.FlightBoost : 0f) + (modPlayer.reaverSpeed ? ReaverHeadMobility.SetBonusFlightBoost : 0f) + moveSpeedBoost; @@ -1294,14 +1296,14 @@ namespace CalamityMod.Items break; case ItemID.FlameWings: maxAscentMultiplier *= 1.1067f; - constantAscend *= 1.25f; + constantAscend *= 1.2f; break; case ItemID.ButterflyWings: maxAscentMultiplier *= 0.6667f; constantAscend *= 5f; break; case ItemID.GhostWings: - maxAscentMultiplier *= 0.6025f; + maxAscentMultiplier *= 0.6625f; constantAscend *= 5f; break; default: diff --git a/Items/Potions/SoaringPotion.cs b/Items/Potions/SoaringPotion.cs index 0404bafdb8..1934f9a9fb 100644 --- a/Items/Potions/SoaringPotion.cs +++ b/Items/Potions/SoaringPotion.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Items.Potions { public new string LocalizationCategory => "Items.Potions"; - public static float FlightBoost = 0.1f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(FlightBoost.ToPercent()); + public static float FlightTimeBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(FlightTimeBoost.ToPercent()); public override void SetStaticDefaults() { diff --git a/Items/Weapons/DraedonsArsenal/Auger.cs b/Items/Weapons/DraedonsArsenal/Auger.cs index f7ce73b68d..33bc3e191f 100644 --- a/Items/Weapons/DraedonsArsenal/Auger.cs +++ b/Items/Weapons/DraedonsArsenal/Auger.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { Item.width = 26; Item.height = 26; - Item.damage = 60; + Item.damage = 55; Item.DamageType = TrueMeleeDamageClass.Instance; Item.useTime = Item.useAnimation = 12; Item.knockBack = 12f; diff --git a/Items/Weapons/Melee/ArkoftheCosmos.cs b/Items/Weapons/Melee/ArkoftheCosmos.cs index 528419da7f..f2f4c46f55 100644 --- a/Items/Weapons/Melee/ArkoftheCosmos.cs +++ b/Items/Weapons/Melee/ArkoftheCosmos.cs @@ -77,13 +77,12 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.width = Item.height = 136; - Item.damage = 1800; + Item.damage = 1700; Item.DamageType = DamageClass.MeleeNoSpeed; Item.crit = 15; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = 15; - Item.useTime = 15; + Item.useAnimation = Item.useTime = 15; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Shoot; Item.knockBack = 9.5f; diff --git a/Items/Weapons/Melee/Ataraxia.cs b/Items/Weapons/Melee/Ataraxia.cs index 49cf9686b6..7af3af3ddc 100644 --- a/Items/Weapons/Melee/Ataraxia.cs +++ b/Items/Weapons/Melee/Ataraxia.cs @@ -21,10 +21,9 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 94; Item.height = 92; Item.DamageType = DamageClass.Melee; - Item.damage = 675; + Item.damage = 325; Item.knockBack = 2.5f; - Item.useAnimation = 10; - Item.useTime = 10; + Item.useAnimation = Item.useTime = 10; Item.autoReuse = true; Item.useTurn = true; @@ -47,12 +46,11 @@ namespace CalamityMod.Items.Weapons.Melee // Center projectile int centerID = ModContent.ProjectileType(); - int centerDamage = (damage / 2); - Projectile.NewProjectile(source, position, velocity, centerID, centerDamage, knockback, player.whoAmI); + Projectile.NewProjectile(source, position, velocity, centerID, damage, knockback, player.whoAmI); - // Side projectiles (these deal 75% damage) + // Side projectiles (these deal 50% damage) int sideID = ModContent.ProjectileType(); - int sideDamage = ((int)(0.75f * centerDamage) / 2); + int sideDamage = (int)(0.5f * damage); Vector2 originalVelocity = velocity; velocity.Normalize(); velocity *= 22f; diff --git a/Items/Weapons/Melee/BrokenBiomeBlade.cs b/Items/Weapons/Melee/BrokenBiomeBlade.cs index c4503e4546..2e91a5381e 100644 --- a/Items/Weapons/Melee/BrokenBiomeBlade.cs +++ b/Items/Weapons/Melee/BrokenBiomeBlade.cs @@ -34,16 +34,16 @@ namespace CalamityMod.Items.Weapons.Melee #region stats public static int BaseDamage = 38; - public static int DefaultAttunement_BaseDamage = 38; + public static int DefaultAttunement_BaseDamage = 34; - public static int EvilAttunement_BaseDamage = 50; + public static int EvilAttunement_BaseDamage = 45; public static int EvilAttunement_Lifesteal = 2; public static int EvilAttunement_BounceIFrames = 10; - public static int ColdAttunement_BaseDamage = 40; + public static int ColdAttunement_BaseDamage = 38; public static float ColdAttunement_ThirdSwingBoost = 1.15f; - public static int HotAttunement_BaseDamage = 42; + public static int HotAttunement_BaseDamage = 38; public static int HotAttunement_ShredPlayerIFrames = 6; public static int HotAttunement_LocalIFrames = 30; //Be warned its got one extra update so all the iframes should be divided in 2 public static float HotAttunement_ShredDecayRate = 1f; //How much charge is lost per frame. @@ -183,7 +183,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void ModifyWeaponDamage(Player player, ref StatModifier damage) { - damage += (mainAttunement?.DamageMultiplier ?? 1f) - 1f; + damage *= (mainAttunement?.DamageMultiplier ?? 1f); } public void SafeCheckAttunements() diff --git a/Items/Weapons/Melee/DevilsDevastation.cs b/Items/Weapons/Melee/DevilsDevastation.cs index 76da84fb72..117748c85f 100644 --- a/Items/Weapons/Melee/DevilsDevastation.cs +++ b/Items/Weapons/Melee/DevilsDevastation.cs @@ -20,6 +20,10 @@ namespace CalamityMod.Items.Weapons.Melee { public new string LocalizationCategory => "Items.Weapons.Melee"; public int throwCount = 0; + + public static int BigSlashDamageMult = 10; + public static float MarkDamageMult = 1.5f; // Multiplied on top of the big slash mult + public override void SetStaticDefaults() { CalamityItemSets.ExtraDebuffTooltip_Enemy[Type] = [ModContent.BuffType()]; @@ -81,7 +85,7 @@ namespace CalamityMod.Items.Weapons.Melee } if (player.Calamity().demonSwordKillMode && player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0 && player.Calamity().killModeCooldown == KillMode.cooldownMax + KillMode.buffMax) { - Projectile.NewProjectile(player.GetSource_ItemUse(Item), player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), Item.damage * 15, Item.knockBack, player.whoAmI, 0, throwCount); //This used to be 30x damage. + Projectile.NewProjectile(player.GetSource_ItemUse(Item), player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), Item.damage * BigSlashDamageMult, Item.knockBack, player.whoAmI, 0, throwCount); //This used to be 30x damage. } } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Melee/DragonPow.cs b/Items/Weapons/Melee/DragonPow.cs index d1e27ec1d4..64adc9d3bc 100644 --- a/Items/Weapons/Melee/DragonPow.cs +++ b/Items/Weapons/Melee/DragonPow.cs @@ -24,10 +24,9 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 76; Item.height = 82; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 660; + Item.damage = 333; Item.knockBack = 9f; - Item.useAnimation = 20; - Item.useTime = 20; + Item.useAnimation = Item.useTime = 20; Item.autoReuse = true; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/FourSeasonsGalaxia.cs b/Items/Weapons/Melee/FourSeasonsGalaxia.cs index 681c4a05ce..f8b2d163c6 100644 --- a/Items/Weapons/Melee/FourSeasonsGalaxia.cs +++ b/Items/Weapons/Melee/FourSeasonsGalaxia.cs @@ -169,12 +169,14 @@ namespace CalamityMod.Items.Weapons.Melee if (mainAttunement == null || player.altFunctionUse != ItemAlternativeFunctionID.None) return false; - return true; + Projectile blade = Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockback, player.whoAmI); + blade.originalDamage = (int)MathF.Round(blade.originalDamage * mainAttunement.DamageMultiplier); + return false; } public override void ModifyWeaponDamage(Player player, ref StatModifier damage) { - damage += (mainAttunement?.DamageMultiplier ?? 1f) - 1f; + damage *= (mainAttunement?.DamageMultiplier ?? 1f); } public void SafeCheckAttunements() diff --git a/Items/Weapons/Melee/GrandDad.cs b/Items/Weapons/Melee/GrandDad.cs index 0107109dc5..641d59cc06 100644 --- a/Items/Weapons/Melee/GrandDad.cs +++ b/Items/Weapons/Melee/GrandDad.cs @@ -29,10 +29,9 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 124; Item.height = 124; - Item.damage = 5777; // Feel free to change these 7s as balance requires. The other 7s should stay - Update: no more 2777... :( + Item.damage = 5577; // Feel free to change these 7s as balance requires. The other 7s should stay - Update: no more 2777... :( Item.DamageType = TrueMeleeDamageClass.Instance; - Item.useAnimation = 77; - Item.useTime = 77; + Item.useAnimation = Item.useTime = 77; Item.useTurn = true; Item.knockBack = 77f; Item.autoReuse = true; diff --git a/Items/Weapons/Melee/NeptunesBounty.cs b/Items/Weapons/Melee/NeptunesBounty.cs index 599732a4a1..b75794002b 100644 --- a/Items/Weapons/Melee/NeptunesBounty.cs +++ b/Items/Weapons/Melee/NeptunesBounty.cs @@ -21,10 +21,9 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 122; Item.height = 122; - Item.damage = 444; + Item.damage = 420; Item.knockBack = 9f; - Item.useTime = 65; - Item.useAnimation = 65; + Item.useAnimation = Item.useTime = 65; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 3f; diff --git a/Items/Weapons/Melee/OmegaBiomeBlade.cs b/Items/Weapons/Melee/OmegaBiomeBlade.cs index 0382ce0405..df460ccd9b 100644 --- a/Items/Weapons/Melee/OmegaBiomeBlade.cs +++ b/Items/Weapons/Melee/OmegaBiomeBlade.cs @@ -32,9 +32,9 @@ namespace CalamityMod.Items.Weapons.Melee public bool OnHitProc = false; #region stats - public static int BaseDamage = 200; + public static int BaseDamage = 150; - public static int WhirlwindAttunement_BaseDamage = 120; + public static int WhirlwindAttunement_BaseDamage = 150; public static int WhirlwindAttunement_LocalIFrames = 20; //Remember its got one extra update public static float WhirlwindAttunement_EnergyDamageMult = 0.5f; public static float WhirlwindAttunement_BaseSwingDamageMult = 0.4f; @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Melee public static int WhirlwindAttunement_PassiveBaseDamage = 80; - public static int SuperPogoAttunement_BaseDamage = 190; + public static int SuperPogoAttunement_BaseDamage = 200; public static int SuperPogoAttunement_PlayerShredIFrames = 8; public static int SuperPogoAttunement_LocalIFrames = 24; //Be warned its got one extra update so all the iframes should be divided in 2 public static float SuperPogoAttunement_ShotDamageMult = 2.5f; @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons.Melee public static int SuperPogoAttunement_PassiveLifeSteal = 7; - public static int ShockwaveAttunement_BaseDamage = 550; + public static int ShockwaveAttunement_BaseDamage = 600; public static float ShockwaveAttunement_BeamDamageMult = 0.25f; public static int ShockwaveAttunement_DashHitIFrames = 20; public static float ShockwaveAttunement_FullChargeMult = 3.6f; @@ -245,7 +245,7 @@ namespace CalamityMod.Items.Weapons.Melee if (mainAttunement == null) return; - damage += (mainAttunement?.DamageMultiplier ?? 1f) - 1f; + damage *= (mainAttunement?.DamageMultiplier ?? 1f); } public void SafeCheckAttunements() @@ -315,8 +315,8 @@ namespace CalamityMod.Items.Weapons.Melee if (secondaryAttunement.id == AttunementID.FlailBlade && MeatHook == null) { - int damage = (int)player.GetTotalDamage().ApplyTo(FlailBladeAttunement_PassiveBaseDamage); - MeatHook = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, ProjectileType(), damage, 0f, player.whoAmI); + MeatHook = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, ProjectileType(), FlailBladeAttunement_PassiveBaseDamage, 0f, player.whoAmI); + MeatHook.originalDamage = FlailBladeAttunement_PassiveBaseDamage; } secondaryAttunement.PassiveEffect(player, source, ref UseTimer, ref OnHitProc, MeatHook); @@ -356,7 +356,9 @@ namespace CalamityMod.Items.Weapons.Melee if (mainAttunement == null || player.altFunctionUse != ItemAlternativeFunctionID.None) return false; - return true; + Projectile blade = Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockback, player.whoAmI); + blade.originalDamage = (int)MathF.Round(blade.originalDamage * mainAttunement.DamageMultiplier); + return false; } internal static ChargingEnergyParticleSet BiomeEnergyParticles = new ChargingEnergyParticleSet(-1, 2, Color.White, Color.White, 0.04f, 20f); diff --git a/Items/Weapons/Melee/Orderbringer.cs b/Items/Weapons/Melee/Orderbringer.cs index b184ca0daf..1d5ac85c5f 100644 --- a/Items/Weapons/Melee/Orderbringer.cs +++ b/Items/Weapons/Melee/Orderbringer.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.width = Item.height = 112; - Item.damage = 800; + Item.damage = 700; Item.DamageType = DamageClass.Melee; Item.useAnimation = Item.useTime = 16; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Melee/SaharaSlicers.cs b/Items/Weapons/Melee/SaharaSlicers.cs index 415b9f6834..6cc1a949c4 100644 --- a/Items/Weapons/Melee/SaharaSlicers.cs +++ b/Items/Weapons/Melee/SaharaSlicers.cs @@ -28,10 +28,9 @@ namespace CalamityMod.Items.Weapons.Melee Item.noUseGraphic = true; Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; - Item.damage = 23; + Item.damage = 20; Item.DamageType = TrueMeleeDamageClass.Instance; - Item.useTime = 12; - Item.useAnimation = 12; + Item.useAnimation = Item.useTime = 12; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 3.3f; Item.knockBack = 6f; @@ -49,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Melee if (player.Calamity().saharaSlicersBolts > 0) { SoundEngine.PlaySound(SoundID.DD2_GhastlyGlaivePierce with { Pitch = 1.5f }, player.Center); - Projectile.NewProjectile(source, position, velocity * 2, ModContent.ProjectileType(), (int)(damage * 1.2), knockback * 1.2f, player.whoAmI, 1); + Projectile.NewProjectile(source, position, velocity * 2, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 1); player.Calamity().saharaSlicersBolts--; } else diff --git a/Items/Weapons/Melee/StormSaber.cs b/Items/Weapons/Melee/StormSaber.cs index be6ac805f3..22daf62b0a 100644 --- a/Items/Weapons/Melee/StormSaber.cs +++ b/Items/Weapons/Melee/StormSaber.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 58; Item.height = 64; - Item.damage = 43; + Item.damage = 38; Item.DamageType = DamageClass.Melee; Item.useTime = Item.useAnimation = 23; Item.useTurn = true; diff --git a/Items/Weapons/Melee/TeardropCleaver.cs b/Items/Weapons/Melee/TeardropCleaver.cs index e91262ae77..8ef0354eb1 100644 --- a/Items/Weapons/Melee/TeardropCleaver.cs +++ b/Items/Weapons/Melee/TeardropCleaver.cs @@ -18,11 +18,10 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 54; Item.height = 76; - Item.damage = 38; + Item.damage = 33; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 24; + Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 24; Item.useTurn = true; Item.knockBack = 5.5f; Item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/TheObliterator.cs b/Items/Weapons/Melee/TheObliterator.cs index 6e33876710..6f22bde96d 100644 --- a/Items/Weapons/Melee/TheObliterator.cs +++ b/Items/Weapons/Melee/TheObliterator.cs @@ -38,10 +38,9 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 42; Item.height = 40; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 400; + Item.damage = 370; Item.knockBack = 7.5f; - Item.useTime = 20; - Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/Melee/TrueBiomeBlade.cs b/Items/Weapons/Melee/TrueBiomeBlade.cs index 3d84957f94..3ed2204089 100644 --- a/Items/Weapons/Melee/TrueBiomeBlade.cs +++ b/Items/Weapons/Melee/TrueBiomeBlade.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Melee #region stats public static int BaseDamage = 115; - public static int DefaultAttunement_BaseDamage = 72; + public static int DefaultAttunement_BaseDamage = 90; public static int DefaultAttunement_SigilTime = 900; public static int DefaultAttunement_BeamTime = 90; public static float DefaultAttunement_LungeDamageMult = 2f; @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Melee public static float EvilAttunement_SlashDamageBoost = 3f; public static int EvilAttunement_SlashIFrames = 60; - public static int ColdAttunement_BaseDamage = 115; + public static int ColdAttunement_BaseDamage = 105; public static float ColdAttunement_ThirdSwingBoost = 1.25f; public static float ColdAttunement_MistDamageReduction = 0.11f; @@ -58,13 +58,13 @@ namespace CalamityMod.Items.Weapons.Melee public static int HotAttunement_LocalIFrames = 24; //Be warned its got one extra update so all the iframes should be divided in 2 public static float HotAttunement_ShredDecayRate = 0.65f; //How much charge is lost per frame. - public static int TropicalAttunement_BaseDamage = 120; + public static int TropicalAttunement_BaseDamage = 115; public static float TropicalAttunement_ChainDamageReduction = 0.6f; public static float TropicalAttunement_VineDamageReduction = 0.3f; public static float TropicalAttunement_SweetSpotDamageMultiplier = 1.5f; //It also crits, so be mindful of that public static int TropicalAttunement_LocalIFrames = 60; //Be warned its got 2 extra updates so all the iframes should be divided in 3 - public static int HolyAttunement_BaseDamage = 96; + public static int HolyAttunement_BaseDamage = 100; public static float HolyAttunement_BaseSwingDamageMult = 0.5f; public static float HolyAttunement_FullSwingDamageMult = 1f; public static float HolyAttunement_ThrowDamageBoost = 3f; @@ -207,7 +207,7 @@ namespace CalamityMod.Items.Weapons.Melee if (mainAttunement == null) return; - damage += (mainAttunement?.DamageMultiplier ?? 1f) - 1f; + damage *= (mainAttunement?.DamageMultiplier ?? 1f); } public void SafeCheckAttunements() diff --git a/Items/Weapons/Typeless/Aestheticus.cs b/Items/Weapons/Typeless/Aestheticus.cs index a7fa7ed44c..8a5e118585 100644 --- a/Items/Weapons/Typeless/Aestheticus.cs +++ b/Items/Weapons/Typeless/Aestheticus.cs @@ -16,9 +16,8 @@ namespace CalamityMod.Items.Weapons.Typeless Item.width = 58; Item.height = 58; Item.DamageType = AverageDamageClass.Instance; - Item.damage = 8; - Item.useAnimation = 25; - Item.useTime = 25; + Item.damage = 11; + Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 3f; Item.UseSound = SoundID.Item109; @@ -39,12 +38,12 @@ namespace CalamityMod.Items.Weapons.Typeless public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 600); } public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 600); } public override void AddRecipes() diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 7d1fdfae9b..576833de12 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -52,7 +52,7 @@ AeroStone: { DisplayName: Aero Stone Tooltip: ''' - Provides an additional {0} seconds of flight time + Grants {0} additional seconds of flight time You slowly recover flight time while in the air while not flying or gliding 'One of the ancient relics' ''' @@ -226,9 +226,10 @@ AscendantInsignia: { DisplayName: Ascendant Insignia Tooltip: ''' - Increases wing flight time by {0}%, movement and jump speed by {1}%, and acceleration by {2}x - Pressing [KEY] grants you the power of ascension, providing infinite flight time for {3} seconds - Ascension has a {4} second cooldown + Grants {0} additional seconds of flight time + Increases movement speed by {1}%, jump speed by {2}%, and acceleration by {3}x + Pressing [KEY] fully restores flight time and prevents it from decreasing for {4} seconds + This ability has a {5} second cooldown ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index 666b282305..d82a2f9688 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -140,7 +140,7 @@ ShadowPotion: { SoaringPotion: { DisplayName: Soaring Potion - Tooltip: "{0}% increased flight time and horizontal flight speed" + Tooltip: "{0}% increased flight time" } SulphurskinPotion: { diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index 05bafd65e4..d0f4c9fd89 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -179,7 +179,7 @@ EditedTooltip: { ''' FrogLeg: Increases jump speed by {0}% and allows auto-jump // Soaring Insignia - EmpressFlightBooster1: Increases wing flight time by 33% + EmpressFlightBooster1: Grants 2.5 additional seconds of flight time EmpressFlightBooster2: Increases movement speed by 7.5%, jump speed by 10%, and acceleration by 1.25x GravityGlobe: ''' diff --git a/Projectiles/Melee/AtaraxiaBoom.cs b/Projectiles/Melee/AtaraxiaBoom.cs index e8a9209d6c..b7ccf781d0 100644 --- a/Projectiles/Melee/AtaraxiaBoom.cs +++ b/Projectiles/Melee/AtaraxiaBoom.cs @@ -69,10 +69,8 @@ namespace CalamityMod.Projectiles.Melee } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - if (Projectile.numHits > 0) - Projectile.damage = (int)(Projectile.damage * 0.88f); - if (Projectile.damage < 1) - Projectile.damage = 1; + float damageMult = MathHelper.Clamp(Utils.GetLerpValue(4, 0, Projectile.numHits), 0.2f, 1); + modifiers.SourceDamage *= damageMult; } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.ai[0] == 1 ? 130 : 200, targetHitbox); } diff --git a/Projectiles/Melee/DevilsDevastationHoldout.cs b/Projectiles/Melee/DevilsDevastationHoldout.cs index acb46b317d..891f073e4b 100644 --- a/Projectiles/Melee/DevilsDevastationHoldout.cs +++ b/Projectiles/Melee/DevilsDevastationHoldout.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Melee // This is needed because EntitySource_ItemUse always sets Projectile.originalDamage to the item's damage, // regardless of the value passed into the damage argument of NewProjectile. // This results in continuous updating damage resetting the damage. - Projectile.originalDamage *= 15; + Projectile.originalDamage *= DevilsDevastation.BigSlashDamageMult; } public override void WhenSpawned() { @@ -117,7 +117,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 vel = (MathHelper.TwoPi * i / 4f).ToRotationVector2() * 2; Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), lastHitTarget.Center, vel.RotatedBy(MathHelper.ToRadians(45)), ModContent.ProjectileType(), 0, 0f, Owner.whoAmI, 1, 0); } - Projectile strike = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), lastHitTarget.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 1.666f), 0f, Owner.whoAmI, lastHitTarget.whoAmI, 0); + Projectile strike = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), lastHitTarget.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * DevilsDevastation.MarkDamageMult), 0f, Owner.whoAmI, lastHitTarget.whoAmI, 0); strike.DamageType = DamageClass.Melee; SoundStyle dieSound = new("CalamityMod/Sounds/Item/LanceofDestinyStrong"); SoundEngine.PlaySound(dieSound with { Volume = 0.9f, Pitch = 0.3f }, lastHitTarget.Center); diff --git a/Projectiles/Melee/DraconicSpark.cs b/Projectiles/Melee/DraconicSpark.cs index 94db48ae6e..18053a462e 100644 --- a/Projectiles/Melee/DraconicSpark.cs +++ b/Projectiles/Melee/DraconicSpark.cs @@ -30,9 +30,9 @@ namespace CalamityMod.Projectiles.Melee } // ai[0] controls what type of Draconic Spark this is. - // 0 = Orange spark (inflicts Daybroken) - // 1 = Red spark (inflicts Abyssal Flames) - // 2 = Yellow spark (inflicts Holy Flames) + // 0 = Orange spark + // 1 = Red spark + // 2 = Yellow spark public override void AI() { DrawProjectile(); diff --git a/Projectiles/Melee/DragonPowFlail.cs b/Projectiles/Melee/DragonPowFlail.cs index 708d4bba92..6ead67d9bf 100644 --- a/Projectiles/Melee/DragonPowFlail.cs +++ b/Projectiles/Melee/DragonPowFlail.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.ai[1] % 4 == 0) { int type = ModContent.ProjectileType(); - int damage = Projectile.damage / 8; + int damage = Projectile.damage / 2; float kb = 3f; float speed = DragonPow.SparkSpeed; Vector2 vel = new Vector2(speed, 0f).RotatedByRandom(MathHelper.TwoPi); @@ -196,7 +196,7 @@ namespace CalamityMod.Projectiles.Melee { int type = ModContent.ProjectileType(); int numWaterfalls = 12; - int waterfallDamage = Projectile.damage / 6; + int waterfallDamage = Projectile.damage / 4; float waterfallKB = 0f; for (int i = 0; i < numWaterfalls; ++i) { diff --git a/Projectiles/Melee/TrueBiomeBlade_ChainedMeatHook.cs b/Projectiles/Melee/TrueBiomeBlade_ChainedMeatHook.cs index 49f6e7f207..13cf62a01b 100644 --- a/Projectiles/Melee/TrueBiomeBlade_ChainedMeatHook.cs +++ b/Projectiles/Melee/TrueBiomeBlade_ChainedMeatHook.cs @@ -30,6 +30,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 66; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/TrueBiomeBlade_EarthenTides.cs b/Projectiles/Melee/TrueBiomeBlade_EarthenTides.cs index 48137f78b4..f8f5373825 100644 --- a/Projectiles/Melee/TrueBiomeBlade_EarthenTides.cs +++ b/Projectiles/Melee/TrueBiomeBlade_EarthenTides.cs @@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Melee Charge++; OverCharge--; Projectile.timeLeft = 2; - if ((Charge / MaxCharge >= 0.25f && CurrentIndicator == 0f) || (Charge / MaxCharge >= 0.5f && CurrentIndicator == 1f) || (Charge / MaxCharge >= 0.75f && CurrentIndicator == 2f) && Owner.whoAmI == Main.myPlayer) + if ((Charge / MaxCharge >= 0.2f && CurrentIndicator == 0f) || (Charge / MaxCharge >= 0.4f && CurrentIndicator == 1f) || (Charge / MaxCharge >= 0.6f && CurrentIndicator == 2f) || (Charge / MaxCharge >= 0.8f && CurrentIndicator == 3f) && Owner.whoAmI == Main.myPlayer) { for (int s = 0; s < 2; s++) { @@ -127,7 +127,7 @@ namespace CalamityMod.Projectiles.Melee if (Charge >= MaxCharge) { Charge = MaxCharge; - if (Owner.whoAmI == Main.myPlayer && CurrentIndicator < 4f) + if (Owner.whoAmI == Main.myPlayer && CurrentIndicator < 5f) { for (int s = 0; s < 5; s++) { diff --git a/Projectiles/Typeless/CursorProj.cs b/Projectiles/Typeless/CursorProj.cs index 7caeee006b..0e138a1a4c 100644 --- a/Projectiles/Typeless/CursorProj.cs +++ b/Projectiles/Typeless/CursorProj.cs @@ -124,55 +124,55 @@ namespace CalamityMod.Projectiles.Typeless } if (Main.rand.NextBool(12)) { - Vector2 rotateFirstDust = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)Projectile.velocity.ToRotation(), default); - int crystalDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, crystalDustType, 0f, 0f, 160, default, 1f); - Main.dust[crystalDust].velocity *= 0.1f; - Main.dust[crystalDust].position = Projectile.Center + rotateFirstDust * (float)Projectile.width / 2f + Projectile.velocity * 2f; - Main.dust[crystalDust].fadeIn = 0.9f; + Vector2 rotateFirstDust = -Vector2.UnitX.RotatedByRandom(MathHelper.Pi / 16f).RotatedBy(Projectile.velocity.ToRotation()); + Dust crystalDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, crystalDustType, 0f, 0f, 160, default, 1f); + crystalDust.velocity *= 0.1f; + crystalDust.position = Projectile.Center + rotateFirstDust * Projectile.width / 2f + Projectile.velocity * 2f; + crystalDust.fadeIn = 0.9f; } if (Main.rand.NextBool(18)) { - Vector2 rotateSecondDust = -Vector2.UnitX.RotatedByRandom(0.39269909262657166).RotatedBy((double)Projectile.velocity.ToRotation(), default); - int greenDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.TerraBlade, 0f, 0f, 155, default, 0.8f); - Main.dust[greenDust].velocity *= 0.3f; - Main.dust[greenDust].position = Projectile.Center + rotateSecondDust * (float)Projectile.width / 2f; + Vector2 rotateSecondDust = -Vector2.UnitX.RotatedByRandom(MathHelper.Pi / 8f).RotatedBy(Projectile.velocity.ToRotation()); + Dust greenDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.TerraBlade, 0f, 0f, 155, default, 0.8f); + greenDust.velocity *= 0.3f; + greenDust.position = Projectile.Center + rotateSecondDust * Projectile.width / 2f; if (Main.rand.NextBool()) { - Main.dust[greenDust].fadeIn = 1.4f; + greenDust.fadeIn = 1.4f; } } if (Main.rand.NextBool(8)) { - Vector2 rotateThirdDust = -Vector2.UnitX.RotatedByRandom(0.78539818525314331).RotatedBy((double)Projectile.velocity.ToRotation(), default); - int randomDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 0, default, 1f); - Main.dust[randomDust].velocity *= 0.3f; - Main.dust[randomDust].noGravity = true; - Main.dust[randomDust].position = Projectile.Center + rotateThirdDust * (float)Projectile.width / 2f; + Vector2 rotateThirdDust = -Vector2.UnitX.RotatedByRandom(MathHelper.PiOver4).RotatedBy(Projectile.velocity.ToRotation()); + Dust randomDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 0, default, 1f); + randomDust.velocity *= 0.3f; + randomDust.noGravity = true; + randomDust.position = Projectile.Center + rotateThirdDust * Projectile.width / 2f; if (Main.rand.NextBool()) { - Main.dust[randomDust].fadeIn = 1.4f; + randomDust.fadeIn = 1.4f; } } if (Main.rand.NextBool(6)) { - Vector2 value13 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)Projectile.velocity.ToRotation(), default); - int crystalDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, crystalDustType, 0f, 0f, 100, default, 1f); - Main.dust[crystalDust2].velocity *= 0.3f; - Main.dust[crystalDust2].position = Projectile.Center + value13 * (float)Projectile.width / 2f; - Main.dust[crystalDust2].fadeIn = 1.2f; - Main.dust[crystalDust2].scale = 1.5f; - Main.dust[crystalDust2].noGravity = true; + Vector2 value13 = -Vector2.UnitX.RotatedByRandom(MathHelper.Pi / 16f).RotatedBy(Projectile.velocity.ToRotation()); + Dust crystalDust2 = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, crystalDustType, 0f, 0f, 100, default, 1f); + crystalDust2.velocity *= 0.3f; + crystalDust2.position = Projectile.Center + value13 * Projectile.width / 2f; + crystalDust2.fadeIn = 1.2f; + crystalDust2.scale = 1.5f; + crystalDust2.noGravity = true; } Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.2f / 255f, (255 - Projectile.alpha) * 0.2f / 255f, (255 - Projectile.alpha) * 0.2f / 255f); - int paleDust = Dust.NewDust(Projectile.position, Projectile.width - 28, Projectile.height - 28, DustID.BoneTorch, 0f, 0f, 100, default, 0.8f); - Main.dust[paleDust].velocity *= 0.1f; - Main.dust[paleDust].velocity += Projectile.velocity * 0.5f; - Main.dust[paleDust].noGravity = true; + Dust paleDust = Dust.NewDustDirect(Projectile.position, Projectile.width - 28, Projectile.height - 28, DustID.BoneTorch, 0f, 0f, 100, default, 0.8f); + paleDust.velocity *= 0.1f; + paleDust.velocity += Projectile.velocity * 0.5f; + paleDust.noGravity = true; if (Main.rand.NextBool(12)) { - int shinyDust = Dust.NewDust(Projectile.position, Projectile.width - 32, Projectile.height - 32, DustID.Teleporter, 0f, 0f, 100, default, 1f); - Main.dust[shinyDust].velocity *= 0.25f; - Main.dust[shinyDust].velocity += Projectile.velocity * 0.5f; + Dust shinyDust = Dust.NewDustDirect(Projectile.position, Projectile.width - 32, Projectile.height - 32, DustID.Teleporter, 0f, 0f, 100, default, 1f); + shinyDust.velocity *= 0.25f; + shinyDust.velocity += Projectile.velocity * 0.5f; } } @@ -182,9 +182,9 @@ namespace CalamityMod.Projectiles.Typeless return false; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 600); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 600); public override void OnKill(int timeLeft) { diff --git a/Projectiles/Typeless/CursorProjSplit.cs b/Projectiles/Typeless/CursorProjSplit.cs index 4d32133339..1d8ec32ba9 100644 --- a/Projectiles/Typeless/CursorProjSplit.cs +++ b/Projectiles/Typeless/CursorProjSplit.cs @@ -126,55 +126,55 @@ namespace CalamityMod.Projectiles.Typeless } if (Main.rand.NextBool(12)) { - Vector2 rotateFirstDust = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)Projectile.velocity.ToRotation(), default); - int crystalDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, crystalDustType, 0f, 0f, 100, default, 1f); - Main.dust[crystalDust].velocity *= 0.1f; - Main.dust[crystalDust].position = Projectile.Center + rotateFirstDust * (float)Projectile.width / 2f + Projectile.velocity * 2f; - Main.dust[crystalDust].fadeIn = 0.9f; + Vector2 rotateFirstDust = -Vector2.UnitX.RotatedByRandom(MathHelper.Pi / 16f).RotatedBy((double)Projectile.velocity.ToRotation(), default); + Dust crystalDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, crystalDustType, 0f, 0f, 100, default, 1f); + crystalDust.velocity *= 0.1f; + crystalDust.position = Projectile.Center + rotateFirstDust * Projectile.width / 2f + Projectile.velocity * 2f; + crystalDust.fadeIn = 0.9f; } if (Main.rand.NextBool(18)) { - Vector2 rotateSecondDust = -Vector2.UnitX.RotatedByRandom(0.39269909262657166).RotatedBy((double)Projectile.velocity.ToRotation(), default); - int greenDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.TerraBlade, 0f, 0f, 155, default, 0.8f); - Main.dust[greenDust].velocity *= 0.3f; - Main.dust[greenDust].position = Projectile.Center + rotateSecondDust * (float)Projectile.width / 2f; + Vector2 rotateSecondDust = -Vector2.UnitX.RotatedByRandom(MathHelper.Pi / 8f).RotatedBy(Projectile.velocity.ToRotation()); + Dust greenDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.TerraBlade, 0f, 0f, 155, default, 0.8f); + greenDust.velocity *= 0.3f; + greenDust.position = Projectile.Center + rotateSecondDust * Projectile.width / 2f; if (Main.rand.NextBool()) { - Main.dust[greenDust].fadeIn = 1.4f; + greenDust.fadeIn = 1.4f; } } if (Main.rand.NextBool(8)) { - Vector2 rotateThirdDust = -Vector2.UnitX.RotatedByRandom(0.78539818525314331).RotatedBy((double)Projectile.velocity.ToRotation(), default); - int randomDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 0, default, 1f); - Main.dust[randomDust].velocity *= 0.3f; - Main.dust[randomDust].noGravity = true; - Main.dust[randomDust].position = Projectile.Center + rotateThirdDust * (float)Projectile.width / 2f; + Vector2 rotateThirdDust = -Vector2.UnitX.RotatedByRandom(MathHelper.PiOver4).RotatedBy(Projectile.velocity.ToRotation()); + Dust randomDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 0, default, 1f); + randomDust.velocity *= 0.3f; + randomDust.noGravity = true; + randomDust.position = Projectile.Center + rotateThirdDust * Projectile.width / 2f; if (Main.rand.NextBool()) { - Main.dust[randomDust].fadeIn = 1.4f; + randomDust.fadeIn = 1.4f; } } if (Main.rand.NextBool(6)) { - Vector2 value13 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)Projectile.velocity.ToRotation(), default); - int crystalDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, crystalDustType, 0f, 0f, 100, default, 1f); - Main.dust[crystalDust2].velocity *= 0.3f; - Main.dust[crystalDust2].position = Projectile.Center + value13 * (float)Projectile.width / 2f; - Main.dust[crystalDust2].fadeIn = 1.2f; - Main.dust[crystalDust2].scale = 1.5f; - Main.dust[crystalDust2].noGravity = true; + Vector2 value13 = -Vector2.UnitX.RotatedByRandom(MathHelper.Pi / 16f).RotatedBy(Projectile.velocity.ToRotation()); + Dust crystalDust2 = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, crystalDustType, 0f, 0f, 100, default, 1f); + crystalDust2.velocity *= 0.3f; + crystalDust2.position = Projectile.Center + value13 * Projectile.width / 2f; + crystalDust2.fadeIn = 1.2f; + crystalDust2.scale = 1.5f; + crystalDust2.noGravity = true; } Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.2f / 255f, (255 - Projectile.alpha) * 0.2f / 255f, (255 - Projectile.alpha) * 0.2f / 255f); - int paleDust = Dust.NewDust(Projectile.position, Projectile.width - 28, Projectile.height - 28, DustID.BoneTorch, 0f, 0f, 100, default, 0.8f); - Main.dust[paleDust].velocity *= 0.1f; - Main.dust[paleDust].velocity += Projectile.velocity * 0.5f; - Main.dust[paleDust].noGravity = true; + Dust paleDust = Dust.NewDustDirect(Projectile.position, Projectile.width - 28, Projectile.height - 28, DustID.BoneTorch, 0f, 0f, 100, default, 0.8f); + paleDust.velocity *= 0.1f; + paleDust.velocity += Projectile.velocity * 0.5f; + paleDust.noGravity = true; if (Main.rand.NextBool(12)) { - int shinyDust = Dust.NewDust(Projectile.position, Projectile.width - 32, Projectile.height - 32, DustID.Teleporter, 0f, 0f, 100, default, 1f); - Main.dust[shinyDust].velocity *= 0.25f; - Main.dust[shinyDust].velocity += Projectile.velocity * 0.5f; + Dust shinyDust = Dust.NewDustDirect(Projectile.position, Projectile.width - 32, Projectile.height - 32, DustID.Teleporter, 0f, 0f, 100, default, 1f); + shinyDust.velocity *= 0.25f; + shinyDust.velocity += Projectile.velocity * 0.5f; } } @@ -184,9 +184,9 @@ namespace CalamityMod.Projectiles.Typeless return false; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 60); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 300); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 60); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 300); public override bool? CanHitNPC(NPC target) { @@ -213,23 +213,22 @@ namespace CalamityMod.Projectiles.Typeless int randomDust = 187; float crystalDust2 = 1.2f; - Vector2 dustRotate = (Projectile.rotation - 1.57079637f).ToRotationVector2(); - Vector2 dustVel = dustRotate * Projectile.velocity.Length() * (float)Projectile.MaxUpdates; + Vector2 dustRotate = (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2(); + Vector2 dustVel = dustRotate * Projectile.velocity.Length() * Projectile.MaxUpdates; SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); int dustCount; for (int j = 0; j < 20; j = dustCount + 1) { - int superRandomDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, otherDustType, 0f, 0f, 200, default, crystalDust2); - Dust dust = Main.dust[superRandomDust]; - dust.position = Projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)Projectile.width / 2f; + Dust dust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, otherDustType, 0f, 0f, 200, default, crystalDust2); + dust.position = Projectile.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat() * Projectile.width / 2f; dust.noGravity = true; dust.velocity.Y -= 6f; dust.velocity *= 3f; dust.velocity += dustVel * Main.rand.NextFloat(); - superRandomDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, default, 0.6f); - dust.position = Projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)Projectile.width / 2f; + dust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, default, 0.6f); + dust.position = Projectile.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat() * Projectile.width / 2f; dust.velocity.Y -= 6f; dust.velocity *= 2f; dust.noGravity = true; @@ -241,9 +240,8 @@ namespace CalamityMod.Projectiles.Typeless for (int k = 0; k < 10; k = dustCount + 1) { - int palestDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.BoneTorch, 0f, 0f, 0, default, 1.5f); - Main.dust[palestDust].position = Projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)Projectile.velocity.ToRotation(), default) * (float)Projectile.width / 3f; - Dust dust = Main.dust[palestDust]; + Dust dust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.BoneTorch, 0f, 0f, 0, default, 1.5f); + dust.position = Projectile.Center + Vector2.UnitX.RotatedByRandom(MathHelper.Pi).RotatedBy(Projectile.velocity.ToRotation()) * Projectile.width / 3f; dust.noGravity = true; dust.velocity.Y -= 6f; dust.velocity *= 0.5f; diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index 8d3a4e0e50..10a5088a9f 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -545,8 +545,11 @@ namespace CalamityMod player.immune = true; player.immuneNoBlink = !blink; if (cooldownSlot < 0) - player.immuneTime = frames; - else + { + if (player.immuneTime < frames) + player.immuneTime = frames; + } + else if (player.hurtCooldowns[cooldownSlot] < frames) player.hurtCooldowns[cooldownSlot] = frames; return true; @@ -577,7 +580,8 @@ namespace CalamityMod // Apply iframes thoroughly. Player.AddImmuneTime is not used because iframes should not exceed the intended amount. player.immune = true; player.immuneNoBlink = !blink; - player.immuneTime = frames; + if (player.immuneTime < frames) + player.immuneTime = frames; for (int i = 0; i < player.hurtCooldowns.Length; ++i) if (player.hurtCooldowns[i] < frames) player.hurtCooldowns[i] = frames;