Merge pull request #1597 from CalamityTeam/ammo-balancing

Ammo balancing
This commit is contained in:
CongratsIsTrash authored and GitHub committed 2026-07-28 21:14:14 -04:00
commit ee62705007
16 files changed
+172 -46

No files matched your search

+4
View File
@@ -153,6 +153,10 @@ namespace CalamityMod.Balancing
// 25% resist to The Ballista's greatarrows.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<AstrumAureus>(), Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<BallistaGreatArrow>()))));
// 15% resist to Dryad's Tears.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<AstrumAureus>(), Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<DryadsTearMain>(), ProjectileType<DryadsTearBurst>()))));
#endregion
#region Duke Fishron
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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;
-4
View File
@@ -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
@@ -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
'''
}
@@ -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
+42
View File
@@ -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)
{
@@ -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 },
+1 -1
View File
@@ -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)
{
+67 -21
View File
@@ -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<Texture2D> ShineTexture { get; private set; }
public static Asset<Texture2D> 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<SquashDustPixelated>());
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<BasicBurst>(), 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<DryadsTearBurst>(), 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;
+1 -1
View File
@@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Ranged
}
}
Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnSpot, velocity, ModContent.ProjectileType<ElysianArrowRain>(), (int)(Projectile.damage * 0.15f), 0f, Projectile.owner, 0f, 0f);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnSpot, velocity, ModContent.ProjectileType<ElysianArrowRain>(), (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);
+5 -7
View File
@@ -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;
}
+35
View File
@@ -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]);
}
}
}