diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index 47a3920fe9..0c450ba4f3 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -153,6 +153,10 @@ namespace CalamityMod.Balancing // 25% resist to The Ballista's greatarrows. NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); + + // 15% resist to Dryad's Tears. + NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), Do(new ProjectileResistBalancingRule(0.85f, ProjectileType(), ProjectileType())))); + #endregion #region Duke Fishron diff --git a/Items/Ammo/CinderArrow.cs b/Items/Ammo/CinderArrow.cs index 1d647a03d4..30b7a18227 100644 --- a/Items/Ammo/CinderArrow.cs +++ b/Items/Ammo/CinderArrow.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Ammo { Item.width = 22; Item.height = 36; - Item.damage = 12; + Item.damage = 17; Item.DamageType = DamageClass.Ranged; Item.maxStack = Item.CommonMaxStack; Item.consumable = true; diff --git a/Items/Ammo/DryadsTear.cs b/Items/Ammo/DryadsTear.cs index c71578ffd1..cbbf0de76c 100644 --- a/Items/Ammo/DryadsTear.cs +++ b/Items/Ammo/DryadsTear.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Ammo { Item.width = 8; Item.height = 8; - Item.damage = 10; + Item.damage = 18; Item.DamageType = DamageClass.Ranged; Item.maxStack = Item.CommonMaxStack; Item.consumable = true; diff --git a/Items/Ammo/ElysianArrow.cs b/Items/Ammo/ElysianArrow.cs index c5533bdfe1..a4bd1b0057 100644 --- a/Items/Ammo/ElysianArrow.cs +++ b/Items/Ammo/ElysianArrow.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Ammo { Item.width = 22; Item.height = 36; - Item.damage = 15; + Item.damage = 20; Item.DamageType = DamageClass.Ranged; Item.maxStack = Item.CommonMaxStack; Item.consumable = true; diff --git a/Items/Ammo/HailstormBullet.cs b/Items/Ammo/HailstormBullet.cs index db811b79bc..4abdfbf323 100644 --- a/Items/Ammo/HailstormBullet.cs +++ b/Items/Ammo/HailstormBullet.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Ammo { Item.width = 14; Item.height = 20; - Item.damage = 12; + Item.damage = 9; Item.DamageType = DamageClass.Ranged; Item.consumable = true; Item.knockBack = 2f; diff --git a/Items/Ammo/VeriumBolt.cs b/Items/Ammo/VeriumBolt.cs index ae59a0bc45..9749a1b5b8 100644 --- a/Items/Ammo/VeriumBolt.cs +++ b/Items/Ammo/VeriumBolt.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Ammo { Item.width = 8; Item.height = 8; - Item.damage = 11; + Item.damage = 15; Item.DamageType = DamageClass.Ranged; Item.maxStack = Item.CommonMaxStack; Item.consumable = true; diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index e766a3958e..8a2d96d657 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -86,7 +86,6 @@ namespace CalamityMod.Items { ItemID.CrystalDart, Do(DamageExact(20)) }, // VANILLA: 14 DMG { ItemID.CrystalStorm, Do(DamageExact(40)) }, // VANILLA: 32 DMG { ItemID.CrystalVileShard, Do(DamageExact(35)) }, // VANILLA: 25 DMG - { ItemID.CursedArrow, Do(DamageExact(14)) }, // VANILLA: 17 DMG { ItemID.CursedDart, Do(DamageExact(25)) }, // VANILLA: 9 DMG { ItemID.Cutlass, Do(DamageExact(90), UseExact(11)) }, // VANILLA: 53 DMG, 16 UT { ItemID.DaedalusStormbow, Do(DamageExact(30)) }, // VANILLA: 38 DMG @@ -132,7 +131,6 @@ namespace CalamityMod.Items { ItemID.IceBoomerang, Do(ShootSpeedExact(9), UseExact(25)) }, // VANILLA: 20 UT, 11.5 VEL { ItemID.IceRod, Do(ShootSpeedExact(20), UseExact(6)) }, // VANILLA: 9 UT, 12 VEL { ItemID.IceSickle, Do(UseMeleeSpeed, DamageExact(75), ShootSpeedExact(20f)) }, // VANILLA: 50 DMG, 12 VEL - { ItemID.IchorArrow, Do(DamageExact(13)) }, // VANILLA: 16 DMG { ItemID.IchorBullet, Do(DamageExact(11)) }, // VANILLA: 13 DMG { ItemID.InfernoFork, Do(DamageExact(83), ShootSpeedExact(11)) }, // VANILLA: 70 DMG, 8 VEL { ItemID.InfluxWaver, Do(UseMeleeSpeed, DamageExact(80), UseExact(25)) }, // VANILLA: 100 DMG, 20 UT @@ -218,7 +216,6 @@ namespace CalamityMod.Items { ItemID.SkyFracture, Do(DamageExact(46)) }, // VANILLA: 38 DMG { ItemID.SlapHand, Do(UseTurn, DamageExact(120)) }, // VANILLA: 55 DMG { ItemID.Smolstar, Do(DamageExact(9)) }, // Blade Staff. VANILLA: 6 DMG - { ItemID.SniperRifle, Do(DamageExact(200), UseExact(40)) }, // VANILLA: 185 DMG, 36 UT { ItemID.SoulDrain, Do(DamageExact(38)) }, // Life Drain. VANILLA: 35 DMG { ItemID.SpaceGun, Do(DamageExact(23)) }, // VANILLA: 17 DMG { ItemID.Spear, Do(TrueMelee, DamageExact(14)) }, // VANILLA: 8 DMG @@ -255,7 +252,6 @@ namespace CalamityMod.Items { ItemID.Tsunami, Do(DamageExact(45)) }, // VANILLA: 53 DMG { ItemID.TungstenBullet, Do(DamageExact(8)) }, // VANILLA: 9 DMG { ItemID.TungstenShortsword, Do(TrueMelee, DamageExact(15)) }, // VANILLA: 10 DMG - { ItemID.UnholyArrow, Do(DamageExact(11)) }, // VANILLA: 12 DMG { ItemID.UnholyTrident, Do(DamageRatio(0.91f)) }, // VANILLA: 88 DMG. Uses ratios due to remix seed { ItemID.Uzi, Do(UseExact(8)) }, // VANILLA: 9 UT { ItemID.ValkyrieYoyo, Do(DamageExact(48)) }, // VANILLA: 70 DMG. Has the same stats as Red's Throw diff --git a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson index a1531dea4b..6bfea394d9 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson @@ -12,7 +12,7 @@ BloodfireArrow: { Tooltip: ''' High-velocity arrows with a blood soaked tip - Firing these arrows will drain your health and boost the arrow damage by 30% + Firing these arrows will drain your health and boost the arrow damage by 20% Accelerates your natural life regen and heals you on hit ''' } @@ -59,7 +59,11 @@ DryadsTear: { ElysianArrow: { DisplayName: Elysian Arrow - Tooltip: On impact, summons purifying light from above and below at the nearest enemy + Tooltip: + ''' + On impact, summons purifying light from above and below at the nearest enemy + Purifying light ignores 15 points of enemy Defense + ''' } FlashRound: { @@ -85,7 +89,7 @@ HailstormBullet: { Tooltip: ''' Once shot, bullets rapidly decelerate - Critical hits cause a flash freeze, dealing additional damage and freezing non-boss enemies + Critical hits cause a flash freeze, dealing additional damage based on your crit chance and freezing enemies ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index dfdadd18a3..dc6ed38dc6 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -47,6 +47,7 @@ DevourerofCodsBobber.DisplayName: Devourer of Cods Bobber DiamondOfTheDeepProjectile.DisplayName: Abyss Spirit DirectStrike.DisplayName: Nondescript Damaging Entity DragonDust.DisplayName: Dust +DryadsTearBurst.DisplayName: Teardrop Ripple DunesandBallFalling.DisplayName: Dunesand Ball DuneSandBallGun.DisplayName: Dunesand Ball EarlyBloomBobber.DisplayName: Early Bloom Bobber diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index e5e566d25d..cc73c5690e 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -3931,6 +3931,12 @@ namespace CalamityMod.Projectiles if (projectile.aiStyle == ProjAIStyleID.Flare && projectile.ai[2] == 1f && projectile.localAI[0] == 0f) projectile.localAI[1]--; + if (projectile.type == ProjectileID.BoneArrowFromMerchant) // Bone arrow no gravity before hitting tile + { + if (projectile.ai[2] != 1) + projectile.ai[0] = 0; + } + // Hack to allow Desert Tiger minion to fall through platforms while attacking if (projectile.type >= ProjectileID.StormTigerTier1 && projectile.type <= ProjectileID.StormTigerTier3) { @@ -4717,6 +4723,22 @@ namespace CalamityMod.Projectiles modifiers.SourceDamage *= calamityVelocityDamageMultiplier / vanillaVelocityDamageMultiplier; } + if (projectile.type == ProjectileID.UnholyArrow) // damage falloff + { + if (projectile.numHits > 0) + projectile.damage = (int)(projectile.damage * 0.75f / 0.95f); // Vanilla gives it 5% falloff, this cancels that out + if (projectile.damage < 1) + projectile.damage = 1; + } + + if (projectile.type == ProjectileID.HellfireArrow) // damage falloff + { + if (projectile.numHits > 0) + projectile.damage = (int)(projectile.damage * 0.8f); + if (projectile.damage < 1) + projectile.damage = 1; + } + // Adamantite Throwing Axe's lightning has damage falloff if (projectile.type == ProjectileID.CultistBossLightningOrbArc && projectile.ai[2] == 1f) { @@ -5006,6 +5028,26 @@ namespace CalamityMod.Projectiles #region TileCollide public override bool OnTileCollide(Projectile projectile, Vector2 oldVelocity) { + if (projectile.type == ProjectileID.BoneArrowFromMerchant) // Bone arrow bounce + { + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + projectile.timeLeft -= 120; + if (projectile.timeLeft < 1) + projectile.timeLeft = 1; + + if (projectile.ai[2] != 1) + SoundEngine.PlaySound(SoundID.NPCHit2 with { Volume = 0.5f, Pitch = Main.rand.NextFloat(-0.3f, 0.3f), MaxInstances = 10 }, projectile.Center); + projectile.ai[2] = 1; + + return false; + } //Crystal Darts use -1 local that needs to reset whenever they bounce if (projectile.type == ProjectileID.CrystalDart) { diff --git a/Projectiles/CalamityGlobalProjectileTweaks.cs b/Projectiles/CalamityGlobalProjectileTweaks.cs index 072e1ddb65..3a6f1fa8dd 100644 --- a/Projectiles/CalamityGlobalProjectileTweaks.cs +++ b/Projectiles/CalamityGlobalProjectileTweaks.cs @@ -159,7 +159,7 @@ namespace CalamityMod.Projectiles { ProjectileID.GoldenShowerFriendly, Do(PiercingExact(2), DefaultIDStaticIFrames) }, { ProjectileID.GreenCounterweight, counterweightTweaks }, { ProjectileID.Hamdrax, standardDrillTweaks }, // Drax (never internally renamed since 1.1) - { ProjectileID.HellfireArrow, Do(ExtraUpdatesDelta(+2)) }, + { ProjectileID.HellfireArrow, Do(ExtraUpdatesDelta(+2), LocalIFrames(-1)) }, { ProjectileID.IceBoomerang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.IceSickle, Do(ExtraUpdatesExact(1)) }, { ProjectileID.IchorBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, @@ -300,7 +300,7 @@ namespace CalamityMod.Projectiles { ProjectileID.BombFish, defaultIFrames }, { ProjectileID.Bone, defaultIFrames }, { ProjectileID.BoneArrow, defaultIFrames }, - { ProjectileID.BoneArrowFromMerchant, defaultIFrames }, + { ProjectileID.BoneArrowFromMerchant, Do(ExtraUpdatesExact(2), LocalIFrames(-1)) }, { ProjectileID.BoneDagger, defaultIFrames }, { ProjectileID.BookOfSkullsSkull, defaultIFrames }, { ProjectileID.BookStaffShot, defaultIFrames }, @@ -413,7 +413,7 @@ namespace CalamityMod.Projectiles { ProjectileID.IchorDart, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.JackOLantern, defaultIFrames }, { ProjectileID.JavelinFriendly, defaultIFrames }, - { ProjectileID.JestersArrow, defaultIFrames }, + { ProjectileID.JestersArrow, Do(LocalIFrames(-1)) }, { ProjectileID.Landmine, defaultIFrames }, { ProjectileID.LaserMachinegun, defaultIFrames }, { ProjectileID.LaserMachinegunLaser, defaultIFrames }, @@ -580,7 +580,7 @@ namespace CalamityMod.Projectiles { ProjectileID.TruffleSpore, defaultIFrames }, { ProjectileID.UFOLaser, defaultIFrames }, { ProjectileID.UFOMinion, defaultIFrames }, - { ProjectileID.UnholyArrow, defaultIFrames }, + { ProjectileID.UnholyArrow, Do(LocalIFrames(-1)) }, { ProjectileID.UnholyTridentFriendly, defaultIFrames }, { ProjectileID.UnholyWater, defaultIFrames }, { ProjectileID.VampireKnife, defaultIFrames }, diff --git a/Projectiles/Ranged/BloodfireArrowProj.cs b/Projectiles/Ranged/BloodfireArrowProj.cs index 359c21e2e0..011b49ccc0 100644 --- a/Projectiles/Ranged/BloodfireArrowProj.cs +++ b/Projectiles/Ranged/BloodfireArrowProj.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Ranged } else { - Projectile.damage = (int)(Projectile.damage * 1.3f); // damage boost + Projectile.damage = (int)(Projectile.damage * 1.2f); // damage boost player.statLife -= 1; if (player.statLife <= 0) { diff --git a/Projectiles/Ranged/DryadsTearMain.cs b/Projectiles/Ranged/DryadsTearMain.cs index 25268fe87a..01b36189e9 100644 --- a/Projectiles/Ranged/DryadsTearMain.cs +++ b/Projectiles/Ranged/DryadsTearMain.cs @@ -30,7 +30,8 @@ namespace CalamityMod.Projectiles.Ranged public int turnDirection = 0; // Direction it will rotate public int turnChange = 0; // Adds variance to multiple aspects of the bullet, including when it will change its turn direction public float turnIntensity = 0; // Adds a bit more variance, this time to velocity - public float damageMult = 1; // Multiplier that updates instantly, used for most of the gameplay effects + public float originalDamageMult = 1; // Multiplier that updates instantly, used ONLY for the gameplay effects + public float damageMult = 1; // Multiplier that updates instantly, used for most of the gameplay effects and some visual (why did I do this???) public float visualMult = 0.75f;// Multiplier that updates over time, used for most of the visual effects public Vector2 dropletPosition; // The position of the orbiting teardrop public Vector2 lastDropletPosition; // The previous position of the orbiting teardroplet @@ -41,7 +42,7 @@ namespace CalamityMod.Projectiles.Ranged public float dropletAttackLerp = 1; // A lerp variable used for timing the droplet's attack public int frameDelay = 0; // A few frames of delay after landing on the enemy before explosing, which improves the visuals public bool detachEffects = true; // Used for the moment when the droplet detatched from the main bullet - public bool isMaxPower => damageMult >= 1; // If the bullet is at maximum power + public bool isMaxPower = false; // If the bullet is at maximum power public float finalEffectMult => Projectile.scale * visualMult; // Used for many but not all visual scaling effects public NPC targeted; // The target being attacked by the droplet public ref float trueLifetime => ref Projectile.ai[2]; // The lifetime of the projectile, used over vanilla lifetime because it can increment by decimals @@ -50,9 +51,13 @@ namespace CalamityMod.Projectiles.Ranged public int fadeLifetime => (int)(35 + effectSpeedMod * Math.Max(1 - damageMult, 0)); // The time in which the projectile fades out and can no longer hit anything public int extendedLifetime => (int)(85 * Math.Min(damageMult, 1) + effectSpeedMod * Math.Max(1 - damageMult, 0)); // The time after lifetime reaches zero where the droplet does its attack public bool fading => trueLifetime <= fadeLifetime; // If the projectile is fading away + public bool crit = false; // If the main hit crit, used to make the teardrop crit + public Vector2 hitTileVel = Vector2.Zero; - public float explosionDamageMult = 1.4f; - public float maxDamageMult = 1.65f; + public float explosionDamageMult = 1f; + public float mainBulletDamageMult = 0.75f; + public float maxDamageMult = 2.15f; + public float bulletScalingDamagePow = 0.1f; // Applied to bullets so that fast fired bullets still do some damage, the original damage mult based on projectile number is put to the power of this number public static Asset ShineTexture { get; private set; } public static Asset BloomTexture { get; private set; } public override void Load() @@ -79,7 +84,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.friendly = true; Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = -1; - Projectile.tileCollide = false; + Projectile.tileCollide = true; Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; @@ -101,13 +106,14 @@ namespace CalamityMod.Projectiles.Ranged trueLifetime = fadeLifetime * 1.5f; turnDirection = Main.rand.NextBool() ? -1 : 1; turnChange = Main.rand.Next(30, 190 + 1); - turnIntensity = Main.rand.NextFloat(0.2f, 1.6f); + turnIntensity = Main.rand.NextFloat(0.45f, 2.9f); effectSpeedMod = Main.rand.Next(5, 35); } - if (time % turnChange == 0 && !fading) + if (time % turnChange == 0) turnDirection *= -1; - visualMult = MathHelper.Lerp(visualMult, damageMult, 0.1f / Projectile.MaxUpdates); + float visualMinPow = (isMaxPower ? damageMult : MathF.Pow(damageMult, 0.25f)); + visualMult = MathHelper.Lerp(visualMult, visualMinPow, 0.1f / Projectile.MaxUpdates); float speed = 8 * MathF.Pow(visualMult, 0.3f) * Math.Max(MathF.Pow(Utils.GetLerpValue(0, fadeLifetime, trueLifetime, true), 2), 0.15f); bool chanceForDust = Main.rand.NextBool((int)Math.Clamp((fading ? 8 : 5) / finalEffectMult, 3, 60)); @@ -122,7 +128,7 @@ namespace CalamityMod.Projectiles.Ranged dust.fadeIn = 1; } - if (time > 0) // Reduce damage and visual intensity for every projectile of this type from the same player that are relativley close to each other + if (time > 0 && Projectile.numHits == 0) // Reduce damage and visual intensity for every projectile of this type from the same player that are relativley close to each other { float damageReduction = 1; int ownedProj = Owner.ownedProjectileCounts[Projectile.type]; @@ -132,16 +138,26 @@ namespace CalamityMod.Projectiles.Ranged if (projectile.owner == Projectile.owner && projectile.active && projectile.type == Projectile.type && projectile != Projectile) damageReduction++; } - float newDamageMult = MathF.Pow(1 / damageReduction, 0.25f); - if (newDamageMult < damageMult && !fading) + int maxProjectilesToCount = 12; + float newDamageMult = (1 / Math.Min(MathF.Pow(damageReduction, 0.4f), maxProjectilesToCount)); + float newOriginalDamageMult = (1 / Math.Min(damageReduction, maxProjectilesToCount)); + if (newDamageMult < damageMult) + { damageMult = newDamageMult; + } + if (newOriginalDamageMult < originalDamageMult) + { + originalDamageMult = newOriginalDamageMult; + } } + if (time > 0) + isMaxPower = originalDamageMult >= 1; - if (isMaxPower) - damageMult = maxDamageMult; + if (isMaxPower && Projectile.numHits == 0) + { damageMult = 1.75f; originalDamageMult = 1.75f; } // This is done for visual reasons, the actual max power damage is applied on hit - float movement = Main.rand.NextFloat(0.009f, 0.0115f) * speed; + float movement = Main.rand.NextFloat(0.0120f, 0.0165f) * speed; if (damageMult < 1) Projectile.velocity += Vector2.Lerp(Projectile.velocity.RotatedBy(MathHelper.PiOver2 * turnDirection).SafeNormalize(Vector2.UnitX) * movement * turnIntensity, Projectile.velocity, MathF.Pow(Math.Min(damageMult + 0.15f, 1), 3.3f)); Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * speed; @@ -232,7 +248,7 @@ namespace CalamityMod.Projectiles.Ranged falling ? (int)(10 * (1 - dropLerp * 0.6f)) : (int)(6 + 2 * dropletScaling), 0.135f * dropletScaling * (1 + dropLerp * 0.3f), Color.Turquoise * colorMult, falling ? Color.Lime * colorMult : Color.Teal * colorMult, new Vector2(0.15f * (falling ? 0.5f + dropLerp * 3 : 1) * damageMult, (Math.Max(0.15f * lastDropletPosition.Distance(dropletPosition), 0.25f) * (1 - dropLerp * 0.2f))), noShrink: true, colorFadeSpeed: 5, glowOpacity: colorMult, shrinkSpeed: falling ? 1.5f - dropLerp : 0); GeneralParticleHandler.SpawnParticle(dropTrail, true); - if (Main.rand.NextBool(3)) + if (Main.rand.NextBool((int)(4 / damageMult) + 1)) { Dust dust = Dust.NewDustPerfect(dropletPosition + Main.rand.NextVector2Circular(5 + 20 * (1 - dropletAttackLerp), 5 + 20 * (1 - dropletAttackLerp)), ModContent.DustType()); dust.noGravity = true; @@ -261,8 +277,30 @@ namespace CalamityMod.Projectiles.Ranged trueLifetime -= 1 / MathF.Pow(damageMult, 0.3f); if (trueLifetime <= -extendedLifetime && Projectile.FinalExtraUpdate()) frameDelay++; + + if (hitTileVel != Vector2.Zero) + { + Projectile.velocity = Vector2.Lerp(Projectile.velocity, hitTileVel, 0.03f / damageMult); + } + time++; } + public override bool OnTileCollide(Vector2 oldVelocity) + { + if (Projectile.numHits == 0) // Store a tile reflect velocity and lerp to it afterwards + { + float velX = oldVelocity.X; + float velY = oldVelocity.Y; + if (Projectile.velocity.Y != oldVelocity.Y) + velY = -oldVelocity.Y; + if (Projectile.velocity.X != oldVelocity.X) + velX = -oldVelocity.X; + Projectile.velocity = oldVelocity; + hitTileVel = new Vector2(velX, velY); + Projectile.tileCollide = false; + } + return false; + } public void Splash() { if (dropletAttack) @@ -327,13 +365,15 @@ namespace CalamityMod.Projectiles.Ranged { float blastSize = 75 * scale; float minMultiplier = 0.15f; - int hitsToMinMult = (int)(3 + 5 * damageMult); - int knockback = (int)(7 * damageMult * (isMaxPower ? -1 : 1)); // Give heavy knockback at full power - int damage = (int)(Projectile.damage * explosionDamageMult * damageMult); - Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), targeted.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, Owner.whoAmI, blastSize, minMultiplier, hitsToMinMult); + int hitsToMinMult = (int)(3 + 5 * originalDamageMult); + int knockback = (int)(7 * originalDamageMult * (isMaxPower ? -1 : 1)); // Give heavy knockback at full power + float finalDamageMult = MathF.Pow(originalDamageMult, bulletScalingDamagePow); + int damage = (int)(Projectile.damage * explosionDamageMult * (isMaxPower ? maxDamageMult : finalDamageMult)); + Projectile blast = Projectile.NewProjectileDirect(Owner.GetSource_FromThis(), targeted.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, Owner.whoAmI, blastSize, minMultiplier, hitsToMinMult); blast.timeLeft = 8; blast.DamageType = DamageClass.Ranged; blast.ArmorPenetration = Projectile.ArmorPenetration; + blast.localAI[0] = (crit ? 1 : 0); // Sets the burst to crit if the bullet did } if (damageMult >= 0.75f) Owner.SetScreenshake(3f * damageMult); @@ -377,9 +417,15 @@ namespace CalamityMod.Projectiles.Ranged targeted = target; trueLifetime = fadeLifetime; - modifiers.SourceDamage *= damageMult; + float finalDamageMult = MathF.Pow(originalDamageMult, bulletScalingDamagePow); + modifiers.SourceDamage *= (isMaxPower ? maxDamageMult : finalDamageMult * mainBulletDamageMult); } - public override bool? CanHitNPC(NPC target) => ((time > 1) ? null : false && Projectile.numHits == 0); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (hit.Crit) + crit = true; + } + public override bool? CanHitNPC(NPC target) => ((time > 1 && Projectile.numHits == 0) ? null : false); public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float hitboxSize = 20 * Projectile.scale * damageMult; diff --git a/Projectiles/Ranged/ElysianArrowProj.cs b/Projectiles/Ranged/ElysianArrowProj.cs index f76f5fdcbd..d5bfec6beb 100644 --- a/Projectiles/Ranged/ElysianArrowProj.cs +++ b/Projectiles/Ranged/ElysianArrowProj.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Ranged } } - Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnSpot, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.15f), 0f, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnSpot, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.20f), 0f, Projectile.owner, 0f, 0f); SoundStyle onKill = new("CalamityMod/Sounds/Custom/Providence/ProvidenceHolyBlastShoot"); SoundEngine.PlaySound(onKill with { Volume = 0.4f, Pitch = 0.4f }, Projectile.position); diff --git a/Projectiles/Ranged/HailstormBulletProj.cs b/Projectiles/Ranged/HailstormBulletProj.cs index 4800aa818b..2c3bd5ef6b 100644 --- a/Projectiles/Ranged/HailstormBulletProj.cs +++ b/Projectiles/Ranged/HailstormBulletProj.cs @@ -1,5 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Particles; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -71,14 +70,12 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { Player Owner = Main.player[Projectile.owner]; - target.AddBuff(BuffID.Frostburn2, 120); if (hit.Crit) { SoundStyle crit = new("CalamityMod/Sounds/NPCHit/CryogenPhaseTransitionCrack"); SoundEngine.PlaySound(crit with { Volume = 0.35f, Pitch = 1f }, Projectile.Center); - if (!target.boss) - target.AddBuff(BuffID.Frozen, 120); + target.AddBuff(BuffID.Frozen, 120); int points = 6; float radians = MathHelper.TwoPi / points; @@ -98,7 +95,8 @@ namespace CalamityMod.Projectiles.Ranged { // This is about equivalent to the previous direct strike extra damage but can't also crit itself obviously // Also it's not as impacted by defense, which is why it's a bit weaker, rather than being a full 1f - modifiers.CritDamage += 0.85f; + Player Owner = Main.player[Projectile.owner]; + modifiers.CritDamage += 0.65f + (Owner.GetTotalCritChance(DamageClass.Ranged) * 0.004f); // .4% crit damage per 1% crit chance if (Projectile.numHits > 0) Projectile.damage = (int)(Projectile.damage * 0.5f); @@ -108,7 +106,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - if (Projectile.localAI[0] > 15f) + if (Projectile.localAI[0] > 16f) CalamityUtils.DrawAfterimagesFromEdge(Projectile, 0, lightColor); return false; } diff --git a/Projectiles/Typeless/DryadsTearBurst.cs b/Projectiles/Typeless/DryadsTearBurst.cs new file mode 100644 index 0000000000..02b0294c1e --- /dev/null +++ b/Projectiles/Typeless/DryadsTearBurst.cs @@ -0,0 +1,35 @@ +using System; +using System.IO; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class DryadsTearBurst : BasicBurst, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Ranged; + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + pushVelocity = Utils.DirectionTo(Projectile.Center, target.Center); + float minMult = Projectile.ai[1]; + int hitsToMinMult = (int)Projectile.ai[2]; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + modifiers.SourceDamage *= damageMult; + + if (Projectile.localAI[0] == 0) + modifiers.DisableCrit(); + else + modifiers.SetCrit(); + + if (customKnockback != 0) + target.MoveNPC(pushVelocity, customKnockback, hasStongDisplacement, Main.player[Projectile.owner]); + } + } +}