diff --git a/ExtraTextures/ThanatosReticleHead.png b/ExtraTextures/ThanatosReticleHead.png new file mode 100644 index 0000000000..e99eb727fe Binary files /dev/null and b/ExtraTextures/ThanatosReticleHead.png differ diff --git a/ExtraTextures/ThanatosReticleLeft.png b/ExtraTextures/ThanatosReticleLeft.png new file mode 100644 index 0000000000..352f281429 Binary files /dev/null and b/ExtraTextures/ThanatosReticleLeft.png differ diff --git a/ExtraTextures/ThanatosReticleProngLeft.png b/ExtraTextures/ThanatosReticleProngLeft.png new file mode 100644 index 0000000000..cc17cca2bd Binary files /dev/null and b/ExtraTextures/ThanatosReticleProngLeft.png differ diff --git a/ExtraTextures/ThanatosReticleProngRight.png b/ExtraTextures/ThanatosReticleProngRight.png new file mode 100644 index 0000000000..21f2487e14 Binary files /dev/null and b/ExtraTextures/ThanatosReticleProngRight.png differ diff --git a/ExtraTextures/ThanatosReticleRight.png b/ExtraTextures/ThanatosReticleRight.png new file mode 100644 index 0000000000..0cf153056b Binary files /dev/null and b/ExtraTextures/ThanatosReticleRight.png differ diff --git a/ExtraTextures/ThanatosReticleTop.png b/ExtraTextures/ThanatosReticleTop.png new file mode 100644 index 0000000000..8bb8ff0fc5 Binary files /dev/null and b/ExtraTextures/ThanatosReticleTop.png differ diff --git a/Items/Ammo/GodSlayerSlug.cs b/Items/Ammo/GodSlayerSlug.cs index 8e8f2f9eaf..13e30ffe2b 100644 --- a/Items/Ammo/GodSlayerSlug.cs +++ b/Items/Ammo/GodSlayerSlug.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Ammo public override void SetDefaults() { - item.damage = 42; + item.damage = 28; item.ranged = true; item.width = 22; item.height = 22; diff --git a/Items/Weapons/Magic/HadopelagicEcho.cs b/Items/Weapons/Magic/HadopelagicEcho.cs index 4598e96fa7..1725f7fa7b 100644 --- a/Items/Weapons/Magic/HadopelagicEcho.cs +++ b/Items/Weapons/Magic/HadopelagicEcho.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 230; + item.damage = 500; item.magic = true; item.mana = 15; item.width = 60; diff --git a/Items/Weapons/Magic/Heresy.cs b/Items/Weapons/Magic/Heresy.cs index 6d04804a89..cba4b87e94 100644 --- a/Items/Weapons/Magic/Heresy.cs +++ b/Items/Weapons/Magic/Heresy.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 444; + item.damage = 888; item.magic = true; item.mana = 10; item.width = 38; diff --git a/Items/Weapons/Melee/PhotonRipper.cs b/Items/Weapons/Melee/PhotonRipper.cs index 5b6bee5630..0d04bfb318 100644 --- a/Items/Weapons/Melee/PhotonRipper.cs +++ b/Items/Weapons/Melee/PhotonRipper.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee { item.height = 134; item.width = 54; - item.damage = 4050; + item.damage = 3725; // Displayed axe% is 1/5th of axePower here because trees have 500% hardness. This corrects for that. item.axe = 6000 / 5; diff --git a/Items/Weapons/Summon/AngryChickenStaff.cs b/Items/Weapons/Summon/AngryChickenStaff.cs index 7502e45db7..4d798301e0 100644 --- a/Items/Weapons/Summon/AngryChickenStaff.cs +++ b/Items/Weapons/Summon/AngryChickenStaff.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Items.Weapons.Summon { public class AngryChickenStaff : ModItem { - public const int Damage = 107; + public const int Damage = 300; public override void SetStaticDefaults() { DisplayName.SetDefault("Yharon's Kindle Staff"); diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index 8cce28d27a..496aaa8ed9 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -411,7 +411,37 @@ namespace CalamityMod.NPCs.Abyss npc.rotation = (float)System.Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) + 1.57f; } - public override bool? CanBeHitByProjectile(Projectile projectile) + public override bool CanHitPlayer(Player target, ref int cooldownSlot) + { + bool adultWyrmAlive = false; + if (CalamityGlobalNPC.adultEidolonWyrmHead != -1) + { + if (Main.npc[CalamityGlobalNPC.adultEidolonWyrmHead].active) + adultWyrmAlive = true; + } + + if (adultWyrmAlive) + cooldownSlot = 1; + + Rectangle targetHitbox = target.Hitbox; + + float dist1 = Vector2.Distance(npc.Center, targetHitbox.TopLeft()); + float dist2 = Vector2.Distance(npc.Center, targetHitbox.TopRight()); + float dist3 = Vector2.Distance(npc.Center, targetHitbox.BottomLeft()); + float dist4 = Vector2.Distance(npc.Center, targetHitbox.BottomRight()); + + float minDist = dist1; + if (dist2 < minDist) + minDist = dist2; + if (dist3 < minDist) + minDist = dist3; + if (dist4 < minDist) + minDist = dist4; + + return minDist <= 40f; + } + + public override bool? CanBeHitByProjectile(Projectile projectile) { if (projectile.minion && !projectile.Calamity().overridesMinionDamagePrevention) { diff --git a/NPCs/Abyss/EidolonWyrmHeadHuge.cs b/NPCs/Abyss/EidolonWyrmHeadHuge.cs index 8d64f1014f..291e425641 100644 --- a/NPCs/Abyss/EidolonWyrmHeadHuge.cs +++ b/NPCs/Abyss/EidolonWyrmHeadHuge.cs @@ -894,7 +894,7 @@ namespace CalamityMod.NPCs.Abyss { calamityGlobalNPC.newAI[2] += 1f; - float spinVelocityDivisor = targetDownDeep ? 180f : 120f; + float spinVelocityDivisor = targetDownDeep ? 120f : 90f; if (rotationDirection == 0) { // Set spin direction @@ -1172,7 +1172,7 @@ namespace CalamityMod.NPCs.Abyss if ((destination - npc.Center).Length() < spinLocationDistance || calamityGlobalNPC.newAI[1] > 0f) { calamityGlobalNPC.newAI[1] += 1f; - float spinVelocityDivisor = targetDownDeep ? 180f : 120f; + float spinVelocityDivisor = targetDownDeep ? 90f : 60f; if (rotationDirection == 0) { // Set spin direction diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 84903d1cba..5a64d1546e 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -1925,8 +1925,8 @@ namespace CalamityMod.NPCs bool thanatos = ThanatosIDs.Contains(npc.type); // Calculate extra DR based on kill time, similar to the Hush boss from The Binding of Isaac - bool increasedTimedDR = !GetDownedBossVariable(npc.type) || malice || nightProvi || prePlant_Destroyer || prePlant_AS || preML_Deus || preDoG_SW || malice_DS_Perfs || thanatos; - if (KillTime > 0 && AITimer < KillTime && !BossRushEvent.BossRushActive && increasedTimedDR) + bool useTimedDR = !GetDownedBossVariable(npc.type) || malice || nightProvi || prePlant_Destroyer || prePlant_AS || preML_Deus || preDoG_SW || malice_DS_Perfs || thanatos; + if (KillTime > 0 && AITimer < KillTime && !BossRushEvent.BossRushActive && useTimedDR) { bool tenTimes_TimedDR = nightProvi; bool fiveTimes_TimedDR = prePlant_Destroyer || prePlant_AS || preML_Deus || preDoG_SW || malice_DS_Perfs; diff --git a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs index cca960c8ab..ad16e2d76b 100644 --- a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs +++ b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal // Angles are wrapped to be 0 to 2pi instead of -pi to pi for convenience with absolute values. float rotationAdjusted = MathHelper.WrapAngle(projectile.rotation) + MathHelper.Pi; float oldRotationAdjusted = MathHelper.WrapAngle(projectile.oldRot[1]) + MathHelper.Pi; - float deltaAngle = Math.Abs(rotationAdjusted - oldRotationAdjusted); + float deltaAngle = Math.Abs(MathHelper.WrapAngle(rotationAdjusted - oldRotationAdjusted)); // Frame 1 effect: Prevent the sword from instantly firing a sword beam. if (projectile.localAI[1] == 0f) @@ -285,7 +285,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal float rotationAdjusted = MathHelper.WrapAngle(projectile.rotation) + MathHelper.Pi; float oldRotationAdjusted = MathHelper.WrapAngle(projectile.oldRot[1]) + MathHelper.Pi; - deltaAngle = Math.Abs(rotationAdjusted - oldRotationAdjusted); + deltaAngle = Math.Abs(MathHelper.WrapAngle(rotationAdjusted - oldRotationAdjusted)); if (deltaAngle < 0.04f) opacity = 0f; @@ -293,7 +293,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal return Color.Lerp(Color.Red, Color.PaleVioletRed * completionRatio, MathHelper.Clamp(completionRatio * 0.8f, 0f, 1f)) * opacity; } - internal float WidthFunction(float completionRatio) => (IsSmall ? 101f : 127f) * (1f - completionRatio); + internal float WidthFunction(float completionRatio) => (IsSmall ? 101f : 127f) * (1f - completionRatio) * 0.8f; public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { @@ -301,7 +301,9 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Texture2D hiltTexture = ModContent.GetTexture(Texture); if (IsSmall) bladeTexture = ModContent.GetTexture("CalamityMod/Projectiles/DraedonsArsenal/PhaseslayerBladeSmall"); - Vector2 bladeOffset = projectile.rotation.ToRotationVector2() * (IsSmall ? 90f : 132f) * projectile.scale; + + float bladeLength = (IsSmall ? 90f : 132f) * projectile.scale; + Vector2 bladeOffset = projectile.rotation.ToRotationVector2() * bladeLength; Vector2 origin = bladeTexture.Size() * 0.5f; origin /= IsSmall ? new Vector2(1f, 3f) : new Vector2(3f, 7f); @@ -313,26 +315,22 @@ namespace CalamityMod.Projectiles.DraedonsArsenal GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/SwordSlashTexture")); Player player = Main.player[projectile.owner]; - List positions = new List(); + float swingAngularDirection = Math.Sign(MathHelper.WrapAngle(projectile.rotation - projectile.oldRot[1])); - float swingAngularDirection = Math.Sign(projectile.rotation - projectile.oldRot[1]); - projectile.oldRot[0] += swingAngularDirection * 0.1f; - for (int i = 0; i < projectile.oldPos.Length; i++) + Vector2[] drawPoints = new Vector2[projectile.oldPos.Length]; + Vector2 perpendicularDirection = bladeOffset.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.PiOver2); + for (int i = 0; i < drawPoints.Length; i++) { if (projectile.oldPos[i] == Vector2.Zero) continue; - // Skip over any very points going in the wrong direction, to prevent "nets" from the primitive. - if (i > 1 && Math.Sign(projectile.oldRot[i - 1] - projectile.oldRot[i]) != swingAngularDirection) - continue; - - Vector2 position = projectile.position + projectile.oldRot[i].ToRotationVector2() * (IsSmall ? 90f : 132f) * projectile.scale; - - positions.Add(position); + float swingFactor = MathHelper.Min(1f, AngularDamageFactor); + float offsetFactor = i * -swingAngularDirection * MathHelper.Min(0.8f, swingFactor) * 100f; + float angularTurn = i * swingAngularDirection * -0.09f; + drawPoints[i] = projectile.position + perpendicularDirection.RotatedBy(angularTurn) * offsetFactor; } - projectile.oldRot[0] -= swingAngularDirection * 0.1f; - TrailDrawer.Draw(positions, projectile.Size * 0.5f - Main.screenPosition, 50); + TrailDrawer.Draw(drawPoints, projectile.Size * 0.5f + bladeOffset - Main.screenPosition, 50); spriteBatch.Draw(bladeTexture, projectile.Center + bladeOffset - Main.screenPosition, frame, Color.White, projectile.rotation + MathHelper.PiOver2, origin, projectile.scale, SpriteEffects.None, 0f); spriteBatch.Draw(hiltTexture, projectile.Center - Main.screenPosition, null, lightColor, projectile.rotation + MathHelper.PiOver2, hiltTexture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); diff --git a/Projectiles/Magic/EventHorizonStar.cs b/Projectiles/Magic/EventHorizonStar.cs index 5b030cb318..91dcd7fa77 100644 --- a/Projectiles/Magic/EventHorizonStar.cs +++ b/Projectiles/Magic/EventHorizonStar.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Magic if (projectile.localAI[0] >= 100) { Vector2 center = projectile.Center; - float homingRange = 250f; + float homingRange = 325f; bool homeIn = false; float inertia = 25f; float homingSpeed = 23f; diff --git a/Projectiles/Magic/T1000Proj.cs b/Projectiles/Magic/T1000Proj.cs index caebb2cf30..ba4cb99c21 100644 --- a/Projectiles/Magic/T1000Proj.cs +++ b/Projectiles/Magic/T1000Proj.cs @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Magic projectile.velocity = velocity; int projType = ModContent.ProjectileType(); - float velocityMult = 14f; + float velocityMult = 21f; float randNum = 4f; for (int j = 0; j < 4; j++) { diff --git a/Projectiles/Melee/BonebreakerProjectile.cs b/Projectiles/Melee/BonebreakerProjectile.cs index 6020ec3daa..d23ae63938 100644 --- a/Projectiles/Melee/BonebreakerProjectile.cs +++ b/Projectiles/Melee/BonebreakerProjectile.cs @@ -110,7 +110,14 @@ namespace CalamityMod.Projectiles.Melee target.AddBuff(ModContent.BuffType(), 240); } - public override bool? CanHitNPC(NPC target) => projectile.ai[0] != 1f; + public override bool? CanHitNPC(NPC target) + { + if (projectile.ai[0] == 1f) + { + return false; + } + return null; + } public override bool CanHitPvp(Player target) => projectile.ai[0] != 1f; } diff --git a/Projectiles/Melee/GalileosPlanet.cs b/Projectiles/Melee/GalileosPlanet.cs index a1d4069b10..306f79c7c6 100644 --- a/Projectiles/Melee/GalileosPlanet.cs +++ b/Projectiles/Melee/GalileosPlanet.cs @@ -22,8 +22,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { - projectile.width = 42; - projectile.height = 42; + projectile.width = projectile.height = 88; projectile.friendly = true; projectile.ignoreWater = true; projectile.extraUpdates = 1; diff --git a/Projectiles/Melee/Yoyos/OracleYoyo.cs b/Projectiles/Melee/Yoyos/OracleYoyo.cs index 64e6a384b9..553ec8552f 100644 --- a/Projectiles/Melee/Yoyos/OracleYoyo.cs +++ b/Projectiles/Melee/Yoyos/OracleYoyo.cs @@ -142,7 +142,11 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - // Charge up the red lightning aura with every hit + // On hit effects do not apply if no damage was done. + if (damage <= 0) + return; + + // Charge up the red lightning aura with every hit. AuraCharge += ChargePerHit; // Fire Auric orbs every few hits while supercharged. diff --git a/Projectiles/Ranged/GodSlayerSlugProj.cs b/Projectiles/Ranged/GodSlayerSlugProj.cs index dbbafe9be0..bdec562777 100644 --- a/Projectiles/Ranged/GodSlayerSlugProj.cs +++ b/Projectiles/Ranged/GodSlayerSlugProj.cs @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.tileCollide = false; // Reduce damage, but remove piercing. Reset local iframes so the bullet, turned blue, may always strike again. - projectile.damage = (int)(0.3f * projectile.damage); + projectile.damage = (int)(0.28f * projectile.damage); projectile.penetrate = 1; for (int i = 0; i < Main.maxNPCs; i++) projectile.localNPCImmunity[i] = 0; diff --git a/Projectiles/Rogue/EclipsesStealth.cs b/Projectiles/Rogue/EclipsesStealth.cs index 257317e083..7aa3f2efd9 100644 --- a/Projectiles/Rogue/EclipsesStealth.cs +++ b/Projectiles/Rogue/EclipsesStealth.cs @@ -106,7 +106,14 @@ namespace CalamityMod.Projectiles.Rogue return false; } - public override bool? CanHitNPC(NPC target) => projectile.ai[0] != 1f; + public override bool? CanHitNPC(NPC target) + { + if (projectile.ai[0] == 1f) + { + return false; + } + return null; + } public override bool CanHitPvp(Player target) => projectile.ai[0] != 1f; } diff --git a/Projectiles/Summon/EndoHydraHead.cs b/Projectiles/Summon/EndoHydraHead.cs index 6352c75f0e..84a73682f6 100644 --- a/Projectiles/Summon/EndoHydraHead.cs +++ b/Projectiles/Summon/EndoHydraHead.cs @@ -115,7 +115,7 @@ namespace CalamityMod.Projectiles.Summon if (body.ai[0] >= 0 && body.ai[0] < Main.npc.Length) { NPC target = Main.npc[(int)body.ai[0]]; - bool targetAliveAndInLineOfSight = target.active && projectile.Distance(target.Center) < EndoHydraBody.DistanceToCheck && Collision.CanHit(projectile.Center, 1, 1, target.Center, 1, 1); + bool targetAliveAndInLineOfSight = target.active && projectile.Distance(target.Center) < EndoHydraBody.DistanceToCheck; if (targetAliveAndInLineOfSight && target.CanBeChasedBy() && Main.myPlayer == projectile.owner) { if (Time % 40f == 24f) diff --git a/Projectiles/Summon/EndoRay.cs b/Projectiles/Summon/EndoRay.cs index 1ad285a510..b21267c6e3 100644 --- a/Projectiles/Summon/EndoRay.cs +++ b/Projectiles/Summon/EndoRay.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Projectiles.Summon projectile.extraUpdates = 100; projectile.timeLeft = 265; projectile.coldDamage = true; + projectile.tileCollide = false; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 100; } diff --git a/Projectiles/Summon/RadiantResolutionAura.cs b/Projectiles/Summon/RadiantResolutionAura.cs index 6bcaedbc13..807f847c0d 100644 --- a/Projectiles/Summon/RadiantResolutionAura.cs +++ b/Projectiles/Summon/RadiantResolutionAura.cs @@ -6,119 +6,141 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Summon { public class RadiantResolutionAura : ModProjectile { - public const float DistanceToCheck = 1600f; + public Player Owner => Main.player[projectile.owner]; + public ref float AllocatedSlots => ref projectile.ai[0]; + public ref float GeneralTimer => ref projectile.ai[1]; + + public const float TargetCheckDistance = 1600f; + public const int RadiantOrbAppearRateLowerBound = 7; + public const int RadiantOrbDamageUpperBound = 10000; public override void SetStaticDefaults() { - DisplayName.SetDefault("Saros Possession"); + DisplayName.SetDefault("Radiant Aura"); ProjectileID.Sets.MinionSacrificable[projectile.type] = true; ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; } public override void SetDefaults() { - projectile.width = 66; - projectile.height = 66; + projectile.width = projectile.height = 66; projectile.netImportant = true; projectile.friendly = true; projectile.ignoreWater = true; projectile.minionSlots = 1f; - projectile.timeLeft = 18000; + projectile.timeLeft = 90000; projectile.penetrate = -1; projectile.tileCollide = false; - projectile.timeLeft *= 5; projectile.minion = true; } public override void AI() { - Lighting.AddLight(projectile.Center, 2f, 2f, 2f); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - player.AddBuff(ModContent.BuffType(), 3600); + // Emit some light. + Lighting.AddLight(projectile.Center, Vector3.One * 1.2f); + + // Ensure that the projectile using this AI is the correct projectile and that the owner has the appropriate buffs. + VerifyIdentityOfCaller(); + + // Handle dynamic minion damage. + HandleDynamicMinionDamage(); + + // Store the allocated slots in the minionSlots field so that the amount of slots the projectile is holding + // is always correct. + projectile.minionSlots = projectile.ai[0]; + + // Stay near the target and spin around. + projectile.Center = Owner.Center - Vector2.UnitY * 16f; + projectile.rotation += MathHelper.ToRadians(AllocatedSlots * 0.85f + 3f); + + float damageMultiplier = (float)Math.Log(AllocatedSlots, 3D) + 1f; + + // Softcap the multiplier after it has exceeded 3x the base value. + float softcappedDamageMultiplier = damageMultiplier; + if (softcappedDamageMultiplier > 3f) + softcappedDamageMultiplier = ((damageMultiplier - 3f) * 0.1f) + 3f; + + int radiantOrbDamage = (int)(projectile.damage * softcappedDamageMultiplier); + int radiantOrbAppearRate = (int)(130 * Math.Pow(0.9, AllocatedSlots)); + + // Hard-cap the orb appear rate and damage. + // The latter is basically impossible to reach now due to rebalancing, but it shall remain for the time being. + if (radiantOrbAppearRate < RadiantOrbAppearRateLowerBound) + radiantOrbAppearRate = RadiantOrbAppearRateLowerBound; + + if (radiantOrbDamage > RadiantOrbDamageUpperBound) + radiantOrbDamage = RadiantOrbDamageUpperBound; + + // Attack nearby targets. + GeneralTimer++; + NPC potentialTarget = projectile.Center.MinionHoming(TargetCheckDistance, Owner); + if (potentialTarget != null && Main.myPlayer == projectile.owner) + AttackTarget(potentialTarget, radiantOrbAppearRate, radiantOrbDamage); + } + + public void VerifyIdentityOfCaller() + { + Owner.AddBuff(ModContent.BuffType(), 3600); bool isCorrectProjectile = projectile.type == ModContent.ProjectileType(); if (isCorrectProjectile) { - if (player.dead) - { - modPlayer.radiantResolution = false; - } - if (modPlayer.radiantResolution) - { - projectile.timeLeft = 2; - } - } + if (Owner.dead) + Owner.Calamity().radiantResolution = false; + if (Owner.Calamity().radiantResolution) + projectile.timeLeft = 2; + } + } + + public void HandleDynamicMinionDamage() + { if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); + projectile.Calamity().spawnedPlayerMinionDamageValue = Owner.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; projectile.localAI[0] += 1f; } - if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (Owner.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int trueDamage = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - player.MinionDamage()); + Owner.MinionDamage()); projectile.damage = trueDamage; } - projectile.minionSlots = projectile.ai[0]; + } - projectile.Center = player.Center - Vector2.UnitY * 16f; - - float allocatedSlots = projectile.ai[0]; - projectile.rotation += MathHelper.ToRadians(3f) + MathHelper.ToRadians(allocatedSlots * 0.85f); - - float damageMult = (float)Math.Log(allocatedSlots, 3) + 1f; - - //Softcap the mult after 9 slots - float newMult = damageMult; - if (newMult > 3f) - { - newMult = ((damageMult - 3f) * 0.1f) + 3f; - } - - int radiantOrbDamage = (int)(projectile.damage * newMult); - int radiantOrbAppearRate = (int)(130 * Math.Pow(0.9, allocatedSlots)); - - if (radiantOrbAppearRate < 7) - radiantOrbAppearRate = 7; - - if (radiantOrbDamage > 10000) - radiantOrbDamage = 10000; - - projectile.ai[1]++; - NPC potentialTarget = projectile.Center.MinionHoming(DistanceToCheck, player); - if (potentialTarget != null && Main.myPlayer == projectile.owner) + public void AttackTarget(NPC target, int radiantOrbAppearRate, int radiantOrbDamage) + { + if (GeneralTimer % 35f == 34f) { - if (projectile.ai[1] % 35 == 34) + for (int i = 0; i < 2; i++) { - for (int i = 0; i < 2; i++) - { - float angle = MathHelper.Lerp(-MathHelper.ToRadians(20f), MathHelper.ToRadians(20f), i / 2f); - Vector2 fireVelocity = projectile.SafeDirectionTo(potentialTarget.Center).RotatedBy(angle) * 15f; - Projectile.NewProjectile(projectile.Center, fireVelocity, ModContent.ProjectileType(), radiantOrbDamage / 2, projectile.knockBack, projectile.owner); - } + float angle = MathHelper.Lerp(-MathHelper.ToRadians(20f), MathHelper.ToRadians(20f), i / 2f); + Vector2 fireVelocity = projectile.SafeDirectionTo(target.Center).RotatedBy(angle) * 15f; + Projectile.NewProjectile(projectile.Center, fireVelocity, ModContent.ProjectileType(), radiantOrbDamage / 2, projectile.knockBack, projectile.owner); } - if (projectile.ai[1] % radiantOrbAppearRate == radiantOrbAppearRate - 1) + } + + if (GeneralTimer % radiantOrbAppearRate == radiantOrbAppearRate - 1) + { + Vector2 spawnPosition = projectile.Center + Main.rand.NextVector2Unit() * Main.rand.NextFloat(100f, 360f); + Vector2 bootlegRadianceOrbVelocity = projectile.SafeDirectionTo(target.Center) * 2f; + Projectile.NewProjectile(spawnPosition, bootlegRadianceOrbVelocity, ModContent.ProjectileType(), radiantOrbDamage, projectile.knockBack * 4f, projectile.owner); + for (int i = 0; i < 3; i++) { - Vector2 spawnPosition = projectile.Center + Main.rand.NextVector2Unit() * Main.rand.NextFloat(100f, 360f); - Vector2 bootlegRadianceOrbVelocity = projectile.SafeDirectionTo(potentialTarget.Center) * 2f; - Projectile.NewProjectile(spawnPosition, bootlegRadianceOrbVelocity, ModContent.ProjectileType(), radiantOrbDamage, projectile.knockBack * 4f, projectile.owner); - for (int i = 0; i < 3; i++) - { - float angle = MathHelper.Lerp(-MathHelper.ToRadians(30f), MathHelper.ToRadians(30f), i / 3f); - Vector2 fireVelocity = projectile.SafeDirectionTo(potentialTarget.Center).RotatedBy(angle) * 19f; - Projectile.NewProjectile(projectile.Center, fireVelocity, ModContent.ProjectileType(), radiantOrbDamage / 2, projectile.knockBack, projectile.owner); - } + float angle = MathHelper.Lerp(-MathHelper.ToRadians(30f), MathHelper.ToRadians(30f), i / 3f); + Vector2 fireVelocity = projectile.SafeDirectionTo(target.Center).RotatedBy(angle) * 19f; + Projectile.NewProjectile(projectile.Center, fireVelocity, ModContent.ProjectileType(), radiantOrbDamage / 2, projectile.knockBack, projectile.owner); } } } public override bool CanDamage() => false; + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D currentTexture = ModContent.GetTexture(Texture); diff --git a/Projectiles/Summon/SonOfYharon.cs b/Projectiles/Summon/SonOfYharon.cs index f24f76fb13..10d9634729 100644 --- a/Projectiles/Summon/SonOfYharon.cs +++ b/Projectiles/Summon/SonOfYharon.cs @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Summon } } - projectile.ChargingMinionAI(1000f, 2000f, 3000f, 500f, 1, 30f, 8f, 4f, new Vector2(0f, -60f), 40f, 8f, true, true); + projectile.ChargingMinionAI(1000f, 2000f, 3000f, 500f, 1, 30f, 8f, 4f, new Vector2(0f, -60f), 40f, 15.5f, true, true); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Typeless/CursorProjSplit.cs b/Projectiles/Typeless/CursorProjSplit.cs index a992d5d345..28d1320458 100644 --- a/Projectiles/Typeless/CursorProjSplit.cs +++ b/Projectiles/Typeless/CursorProjSplit.cs @@ -201,7 +201,14 @@ namespace CalamityMod.Projectiles.Typeless target.AddBuff(ModContent.BuffType(), 60); } - public override bool? CanHitNPC(NPC target) => projectile.alpha < 128; + public override bool? CanHitNPC(NPC target) + { + if (projectile.alpha >= 128) + { + return false; + } + return null; + } public override bool CanHitPvp(Player target) => projectile.alpha < 128; diff --git a/Tiles/Furniture/ChaosCandle.cs b/Tiles/Furniture/ChaosCandle.cs index 2a6c8aaae9..e8d55436b1 100644 --- a/Tiles/Furniture/ChaosCandle.cs +++ b/Tiles/Furniture/ChaosCandle.cs @@ -59,7 +59,8 @@ namespace CalamityMod.Tiles.Furniture public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { - CalamityUtils.DrawFlameSparks(235, 5, i, j); + if (Main.tile[i, j].frameX < 18) + CalamityUtils.DrawFlameSparks(235, 5, i, j); } public override void PostDraw(int i, int j, SpriteBatch spriteBatch) diff --git a/Tiles/Furniture/TranquilityCandle.cs b/Tiles/Furniture/TranquilityCandle.cs index f1c55286d4..af6f18d820 100644 --- a/Tiles/Furniture/TranquilityCandle.cs +++ b/Tiles/Furniture/TranquilityCandle.cs @@ -59,7 +59,8 @@ namespace CalamityMod.Tiles.Furniture public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { - CalamityUtils.DrawFlameSparks(62, 5, i, j); + if (Main.tile[i, j].frameX < 18) + CalamityUtils.DrawFlameSparks(62, 5, i, j); } public override void PostDraw(int i, int j, SpriteBatch spriteBatch) diff --git a/Tiles/FurnitureAbyss/AbyssTorch.cs b/Tiles/FurnitureAbyss/AbyssTorch.cs index ec76fb1868..c28ff30a23 100644 --- a/Tiles/FurnitureAbyss/AbyssTorch.cs +++ b/Tiles/FurnitureAbyss/AbyssTorch.cs @@ -70,7 +70,8 @@ namespace CalamityMod.Tiles.FurnitureAbyss } public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { - CalamityUtils.DrawFlameSparks(187, 5, i, j); + if (Main.tile[i, j].frameX < 66) + CalamityUtils.DrawFlameSparks(187, 5, i, j); } public override bool NewRightClick(int i, int j) diff --git a/Tiles/FurnitureAncient/AncientBasin.cs b/Tiles/FurnitureAncient/AncientBasin.cs index 748c8c4a80..4e4f9ac1ab 100644 --- a/Tiles/FurnitureAncient/AncientBasin.cs +++ b/Tiles/FurnitureAncient/AncientBasin.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Tiles.FurnitureAncient public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { Tile tile = Main.tile[i, j]; - if (tile.frameY == 18) + if (tile.frameY == 18 && tile.frameX < 54) { CalamityUtils.DrawFlameSparks(60, 5, i, j); } diff --git a/Tiles/FurnitureAncient/AncientChandelier.cs b/Tiles/FurnitureAncient/AncientChandelier.cs index 8234044626..69ff43f743 100644 --- a/Tiles/FurnitureAncient/AncientChandelier.cs +++ b/Tiles/FurnitureAncient/AncientChandelier.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Tiles.FurnitureAncient public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { Tile tile = Main.tile[i, j]; - if (tile.frameX == 18 && tile.frameY == 36) + if (tile.frameX < 54 && tile.frameY == 36) { CalamityUtils.DrawFlameSparks(60, 5, i, j); } diff --git a/Tiles/FurnitureAncient/AncientLamp.cs b/Tiles/FurnitureAncient/AncientLamp.cs index 15c3513f02..c63de59066 100644 --- a/Tiles/FurnitureAncient/AncientLamp.cs +++ b/Tiles/FurnitureAncient/AncientLamp.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Tiles.FurnitureAncient public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { Tile tile = Main.tile[i, j]; - if (tile.frameY == 18) + if (tile.frameY == 18 && tile.frameX < 18) { CalamityUtils.DrawFlameSparks(60, 5, i, j); } diff --git a/Tiles/FurnitureAncient/AncientLantern.cs b/Tiles/FurnitureAncient/AncientLantern.cs index 40295c533a..22f7093077 100644 --- a/Tiles/FurnitureAncient/AncientLantern.cs +++ b/Tiles/FurnitureAncient/AncientLantern.cs @@ -36,21 +36,36 @@ namespace CalamityMod.Tiles.FurnitureAncient Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].frameX < 18) + { + r = 1f; + g = 0.5f; + b = 0.5f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { CalamityUtils.DrawFlameEffect(ModContent.GetTexture("CalamityMod/Tiles/FurnitureAncient/AncientLanternFlame"), i, j); } - public override void HitWire(int i, int j) { - CalamityUtils.LightHitWire(Type, i, j, 3, 3); + CalamityUtils.LightHitWire(Type, i, j, 1, 2); } public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { Tile tile = Main.tile[i, j]; - if (tile.frameY == 18) + if (tile.frameY == 18 && tile.frameX < 18) { CalamityUtils.DrawFlameSparks(60, 5, i, j); } diff --git a/Tiles/FurnitureAshen/AshenBasin.cs b/Tiles/FurnitureAshen/AshenBasin.cs index 54b0988925..885db098c8 100644 --- a/Tiles/FurnitureAshen/AshenBasin.cs +++ b/Tiles/FurnitureAshen/AshenBasin.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Tiles.FurnitureAshen public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { Tile tile = Main.tile[i, j]; - if (tile.frameY == 18) + if (tile.frameY == 18 && tile.frameX < 54) { CalamityUtils.DrawFlameSparks(60, 5, i, j); } diff --git a/Tiles/FurnitureAshen/AshenCandelabra.cs b/Tiles/FurnitureAshen/AshenCandelabra.cs index 9225e4dc4b..b0fd790b25 100644 --- a/Tiles/FurnitureAshen/AshenCandelabra.cs +++ b/Tiles/FurnitureAshen/AshenCandelabra.cs @@ -77,7 +77,8 @@ namespace CalamityMod.Tiles.FurnitureAshen public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { - CalamityUtils.DrawFlameSparks(60, 5, i, j); + if (Main.tile[i, j].frameX < 35) + CalamityUtils.DrawFlameSparks(60, 5, i, j); } } } diff --git a/Tiles/FurnitureAshen/AshenCandle.cs b/Tiles/FurnitureAshen/AshenCandle.cs index 47b8bd56cb..b2a051ca0b 100644 --- a/Tiles/FurnitureAshen/AshenCandle.cs +++ b/Tiles/FurnitureAshen/AshenCandle.cs @@ -73,7 +73,8 @@ namespace CalamityMod.Tiles.FurnitureAshen public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { - CalamityUtils.DrawFlameSparks(60, 5, i, j); + if (Main.tile[i, j].frameX < 18) + CalamityUtils.DrawFlameSparks(60, 5, i, j); } } } diff --git a/Tiles/FurnitureAshen/AshenChandelier.cs b/Tiles/FurnitureAshen/AshenChandelier.cs index 56fb3c82ae..60036b2535 100644 --- a/Tiles/FurnitureAshen/AshenChandelier.cs +++ b/Tiles/FurnitureAshen/AshenChandelier.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Tiles.FurnitureAshen public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { Tile tile = Main.tile[i, j]; - if (tile.frameY == 18) + if (tile.frameY == 18 && tile.frameX < 54) { CalamityUtils.DrawFlameSparks(60, 5, i, j); } diff --git a/Tiles/FurnitureAshen/AshenLamp.cs b/Tiles/FurnitureAshen/AshenLamp.cs index e6179be5bb..402c59dffe 100644 --- a/Tiles/FurnitureAshen/AshenLamp.cs +++ b/Tiles/FurnitureAshen/AshenLamp.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Tiles.FurnitureAshen public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { Tile tile = Main.tile[i, j]; - if (tile.frameY == 0) + if (tile.frameY == 0 && tile.frameX < 18) { CalamityUtils.DrawFlameSparks(60, 5, i, j); } diff --git a/Tiles/FurnitureAshen/AshenLantern.cs b/Tiles/FurnitureAshen/AshenLantern.cs index 7ef4799944..97d243117f 100644 --- a/Tiles/FurnitureAshen/AshenLantern.cs +++ b/Tiles/FurnitureAshen/AshenLantern.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Tiles.FurnitureAshen public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { Tile tile = Main.tile[i, j]; - if (tile.frameY == 18) + if (tile.frameY == 18 && tile.frameX < 18) { CalamityUtils.DrawFlameSparks(60, 5, i, j); } diff --git a/Tiles/FurnitureCosmilite/CosmiliteBasinTile.cs b/Tiles/FurnitureCosmilite/CosmiliteBasinTile.cs index 2912fab2db..2912b63572 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteBasinTile.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteBasinTile.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { Tile tile = Main.tile[i, j]; - if (tile.frameY == 18) + if (tile.frameY == 18 && tile.frameX < 54) { CalamityUtils.DrawFlameSparks((int)CalamityDusts.PurpleCosmilite, 5, i, j); } diff --git a/Tiles/FurnitureProfaned/ProfanedCandelabra.cs b/Tiles/FurnitureProfaned/ProfanedCandelabra.cs index 00de7fe7b3..8ba459625d 100644 --- a/Tiles/FurnitureProfaned/ProfanedCandelabra.cs +++ b/Tiles/FurnitureProfaned/ProfanedCandelabra.cs @@ -64,7 +64,8 @@ namespace CalamityMod.Tiles.FurnitureProfaned public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { - CalamityUtils.DrawFlameSparks(246, 5, i, j); + if (Main.tile[i, j].frameX < 35) + CalamityUtils.DrawFlameSparks(246, 5, i, j); } } } diff --git a/Tiles/FurnitureProfaned/ProfanedCandle.cs b/Tiles/FurnitureProfaned/ProfanedCandle.cs index 4946095dbd..3087e8d025 100644 --- a/Tiles/FurnitureProfaned/ProfanedCandle.cs +++ b/Tiles/FurnitureProfaned/ProfanedCandle.cs @@ -74,7 +74,8 @@ namespace CalamityMod.Tiles.FurnitureProfaned public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { - CalamityUtils.DrawFlameSparks(246, 5, i, j); + if (Main.tile[i, j].frameX < 18) + CalamityUtils.DrawFlameSparks(246, 5, i, j); } } } diff --git a/Tiles/FurnitureProfaned/ProfanedLamp.cs b/Tiles/FurnitureProfaned/ProfanedLamp.cs index bce7c22619..347fdb75d9 100644 --- a/Tiles/FurnitureProfaned/ProfanedLamp.cs +++ b/Tiles/FurnitureProfaned/ProfanedLamp.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { - if (Main.tile[i, j].frameY == 0) + if (Main.tile[i, j].frameY == 0 && Main.tile[i, j].frameX < 18) { CalamityUtils.DrawFlameSparks(246, 5, i, j); } diff --git a/Tiles/FurnitureProfaned/ProfanedLantern.cs b/Tiles/FurnitureProfaned/ProfanedLantern.cs index a4f836b7cf..5f9f70084d 100644 --- a/Tiles/FurnitureProfaned/ProfanedLantern.cs +++ b/Tiles/FurnitureProfaned/ProfanedLantern.cs @@ -65,7 +65,8 @@ namespace CalamityMod.Tiles.FurnitureProfaned public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { - CalamityUtils.DrawFlameSparks(246, 5, i, j); + if (Main.tile[i, j].frameX < 18) + CalamityUtils.DrawFlameSparks(246, 5, i, j); } } }