diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 54940f9ce3..334b399aa3 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1860,7 +1860,7 @@ namespace CalamityMod.CalPlayer if (sSpiritAmulet) { - int spawnTime = 65; // Time between energy spawns + int spawnTime = 75; // Time between energy spawns int energyCap = 8; // Max number of energies that can be alive at a time Projectile projectile = null; @@ -1877,7 +1877,7 @@ namespace CalamityMod.CalPlayer } } if (energyCount > 0) - sSpiritAmuletTimer = -spawnTime; // The spawn cooldown after launching energies is twice as long + sSpiritAmuletTimer = -spawnTime * 3; // The spawn cooldown after launching energies is much longer } int numOfEnergy = 0; for (int x = 0; x < Main.maxProjectiles; x++) // Get a count of energies in idle mode @@ -2073,29 +2073,26 @@ namespace CalamityMod.CalPlayer zapActivity += 1; if (zapActivity <= 300 && zapActivity % 30 == 0) { - for (int arcProjCount = 0; arcProjCount < 3; arcProjCount++) + float maxDistance = 300f; + int target = -1; + foreach (NPC npc in Main.ActiveNPCs) { - float maxDistance = 300f; - int target = -1; - foreach (NPC npc in Main.ActiveNPCs) + float targetDist = Vector2.Distance(npc.Center, Player.Center); + if (targetDist < maxDistance && npc.Calamity().arcZapCooldown == 0 && npc.CanBeChasedBy()) { - float targetDist = Vector2.Distance(npc.Center, Player.Center); - if (targetDist < maxDistance && npc.Calamity().arcZapCooldown == 0 && npc.CanBeChasedBy()) - { - maxDistance = targetDist; - target = npc.whoAmI; - } + maxDistance = targetDist; + target = npc.whoAmI; } + } - if (target > 0) - { - unstableSelectedTarget = Main.npc[target]; - unstableSelectedTarget.Calamity().arcZapCooldown = 18; - int damage = (int)Player.GetBestClassDamage().ApplyTo(18); + if (target > 0) + { + unstableSelectedTarget = Main.npc[target]; + unstableSelectedTarget.Calamity().arcZapCooldown = 25; + int damage = (int)Player.GetBestClassDamage().ApplyTo(15); - Projectile.NewProjectile(Player.GetSource_FromThis(), new Vector2(Player.Center.X, Player.Center.Y - 20f), new Vector2(0f, -2f), ModContent.ProjectileType(), damage, 0f, Player.whoAmI, target, 3f); - target = -1; - } + Projectile.NewProjectile(Player.GetSource_FromThis(), new Vector2(Player.Center.X, Player.Center.Y - 20f), new Vector2(0f, -2f), ModContent.ProjectileType(), damage, 0f, Player.whoAmI, target, 5f); + target = -1; } } else if (zapActivity > 600) @@ -2242,6 +2239,8 @@ namespace CalamityMod.CalPlayer raiderSoundCooldown--; if (astralStarRainCooldown > 0) astralStarRainCooldown--; + if (AbaddonCooldown > 0) + AbaddonCooldown--; if (VoidCooldown > 0) VoidCooldown--; if (ursaSergeantCooldown > 0) diff --git a/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs b/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs index f98612ef5b..f50c787909 100644 --- a/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs +++ b/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs @@ -78,6 +78,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings "PokerFace", "Raesh", "Sagittariod", + "sixtydegrees", "StipulateVenus", "Sunny", "_tofu", diff --git a/Items/Weapons/Melee/GreatswordofJudgement.cs b/Items/Weapons/Melee/GreatswordofJudgement.cs index 81de0f4665..9ac9d6eea4 100644 --- a/Items/Weapons/Melee/GreatswordofJudgement.cs +++ b/Items/Weapons/Melee/GreatswordofJudgement.cs @@ -106,7 +106,8 @@ namespace CalamityMod.Items.Weapons.Melee } if (completion >= 0.65f && spawnProj) { - Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, shootDir, Item.shoot, Item.damage, Item.knockBack, player.whoAmI, 0f); + if (!player.Calamity().bladeArmEnchant) // Manually remove projectiles when Tainted + Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, shootDir, Item.shoot, Item.damage, Item.knockBack, player.whoAmI, 0f); Particle swipe = new CustomSpark(player.Center - shootDir * 5, shootDir.RotatedBy(0.4f * (dir * (swingCount % 2 == 0 ? 1 : -1))) * 2.5f, "CalamityMod/Particles/VerticalSmearLarge", false, (int)(14 / player.GetAttackSpeed(DamageClass.Melee)), 0.6f, clr, new Vector2(1f, 1f), true, false, 0, false, false); GeneralParticleHandler.SpawnParticle(swipe); diff --git a/Items/Weapons/Melee/Orderbringer.cs b/Items/Weapons/Melee/Orderbringer.cs index 657b17ab47..3fc0e1639a 100644 --- a/Items/Weapons/Melee/Orderbringer.cs +++ b/Items/Weapons/Melee/Orderbringer.cs @@ -29,11 +29,12 @@ namespace CalamityMod.Items.Weapons.Melee public bool canHit => (completion >= 0.35f && completion <= 0.8f); public int swingCount = 0; public bool spawnProj = true; + public bool spawnTrueMeleeProj = true; public bool playSound = true; public override void SetDefaults() { Item.width = Item.height = 112; - Item.damage = 840; + Item.damage = 800; Item.DamageType = DamageClass.Melee; Item.useAnimation = Item.useTime = 16; Item.useStyle = ItemUseStyleID.Swing; @@ -72,6 +73,7 @@ namespace CalamityMod.Items.Weapons.Melee bladeHitboxPos = player.Center; bladeRotation = 0; spawnProj = true; + spawnTrueMeleeProj = true; playSound = true; int dir = -Math.Sign(player.Center.X - player.Calamity().mouseWorld.X); float startRot = MathHelper.ToRadians(-90) * dir * (swingCount % 2 == 0 ? 1 : -1); @@ -106,13 +108,16 @@ namespace CalamityMod.Items.Weapons.Melee } if (completion >= 0.65f && spawnProj) { - Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, shootDir, Item.shoot, Item.damage, Item.knockBack, player.whoAmI, 0f); - - for (int i = 0; i < 4; i++) + if (!player.Calamity().bladeArmEnchant) // Manually remove projectiles when Tainted { - float rot = Main.rand.NextFloat(0.5f, 0.65f) * (Main.rand.NextBool() ? 1 : -1); - Vector2 vel = (shootDir * 2.5f).RotatedByRandom(0.6f); - Projectile.NewProjectile(player.GetSource_FromThis(), player.ClampedMouseWorld() - (shootDir * 40) + Main.rand.NextVector2Circular(130, 130), vel.RotatedBy(rot) * Main.rand.NextFloat(0.9f, 1.2f), ModContent.ProjectileType(), (int)(Item.damage * 0.12f), (int)(Item.knockBack * 0.2f), player.whoAmI, 0, rot, 1); + Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, shootDir, Item.shoot, Item.damage, Item.knockBack, player.whoAmI, 0f); + + for (int i = 0; i < 4; i++) + { + float rot = Main.rand.NextFloat(0.5f, 0.65f) * (Main.rand.NextBool() ? 1 : -1); + Vector2 vel = (shootDir * 2.5f).RotatedByRandom(0.6f); + Projectile.NewProjectile(player.GetSource_FromThis(), player.ClampedMouseWorld() - (shootDir * 40) + Main.rand.NextVector2Circular(130, 130), vel.RotatedBy(rot) * Main.rand.NextFloat(0.9f, 1.2f), ModContent.ProjectileType(), (int)(Item.damage * 0.12f), (int)(Item.knockBack * 0.2f), player.whoAmI, 0, rot, 1); + } } Particle swipe = new CustomSpark(player.Center - shootDir * 5, shootDir.RotatedBy(0.4f * (dir * (swingCount % 2 == 0 ? 1 : -1))) * 2.5f, "CalamityMod/Particles/VerticalSmearLarge", false, (int)(14 / player.GetAttackSpeed(DamageClass.Melee)), 0.8f, player.Calamity().lightRGB, new Vector2(1f, 1f), true, false, 0, false, false); @@ -140,19 +145,23 @@ namespace CalamityMod.Items.Weapons.Melee } public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) { - int beamDamage = player.CalcIntDamage(Item.damage * 0.4f); - Vector2 mouseClamped = player.ClampedMouseWorld(); - SoundEngine.PlaySound(SoundID.Item84 with { Volume = 1f, Pitch = Main.rand.NextFloat(0.5f, 0.7f)}, player.Center); - for (int i = 0; i < 2; i++) + if (spawnTrueMeleeProj) { - Vector2 targetPos = Main.MouseWorld; - NPC target2 = Main.MouseWorld.ClosestNPCAt(650); - if (target2 != null) - targetPos = target2.Center; + int beamDamage = player.CalcIntDamage(Item.damage * 0.35f); + Vector2 mouseClamped = player.ClampedMouseWorld(); + SoundEngine.PlaySound(SoundID.Item84 with { Volume = 1f, Pitch = Main.rand.NextFloat(0.5f, 0.7f) }, player.Center); + for (int i = 0; i < 2; i++) + { + Vector2 targetPos = Main.MouseWorld; + NPC target2 = Main.MouseWorld.ClosestNPCAt(650); + if (target2 != null) + targetPos = target2.Center; - Vector2 spawnPos = mouseClamped + new Vector2(Main.rand.NextFloat(-300, 300), -900); - Vector2 vel = (targetPos - spawnPos).SafeNormalize(Vector2.UnitY) * 10; - Projectile.NewProjectile(player.GetSource_ItemUse(Item), spawnPos, vel, ModContent.ProjectileType(), beamDamage, 0, player.whoAmI); + Vector2 spawnPos = mouseClamped + new Vector2(Main.rand.NextFloat(-300, 300), -900); + Vector2 vel = (targetPos - spawnPos).SafeNormalize(Vector2.UnitY) * 10; + Projectile.NewProjectile(player.GetSource_ItemUse(Item), spawnPos, vel, ModContent.ProjectileType(), beamDamage, 0, player.whoAmI); + } + spawnTrueMeleeProj = false; } } public override void ModifyTooltips(List list) diff --git a/Items/Weapons/Melee/TheOracle.cs b/Items/Weapons/Melee/TheOracle.cs index 100bef55bb..ad16f5eeab 100644 --- a/Items/Weapons/Melee/TheOracle.cs +++ b/Items/Weapons/Melee/TheOracle.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Items.Weapons.Melee public class TheOracle : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; - public const int AuraBaseDamage = 68; - public const int AuraMaxDamage = 150; + public const float AuraBaseDamageMult = 0.35f; + public const float AuraMaxDamageMult = 0.8f; public static float Reach = 800f; public static float Speed = 60f; @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 58; Item.height = 50; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 192; + Item.damage = 201; Item.knockBack = 4f; Item.useTime = 20; Item.useAnimation = 20; diff --git a/Items/Weapons/Ranged/HalleysInferno.cs b/Items/Weapons/Ranged/HalleysInferno.cs index c6fbde9718..e17b40e422 100644 --- a/Items/Weapons/Ranged/HalleysInferno.cs +++ b/Items/Weapons/Ranged/HalleysInferno.cs @@ -62,6 +62,9 @@ namespace CalamityMod.Items.Weapons.Ranged public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; public override void HoldItem(Player player) { + if (player.mount.Type == MountID.Drill) + return; + if (Main.LocalPlayer == player) { if (!Main.projectile.Any(x=> x.active && x.owner == player.whoAmI && x.type == Item.shoot)) diff --git a/Items/Weapons/Rogue/Exorcism.cs b/Items/Weapons/Rogue/Exorcism.cs index 4f412f2c09..090684968f 100644 --- a/Items/Weapons/Rogue/Exorcism.cs +++ b/Items/Weapons/Rogue/Exorcism.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 109; Item.height = 128; - Item.damage = 192; + Item.damage = 222; Item.noMelee = true; Item.noUseGraphic = true; // Due to the amazing sound engine, having multiple crosses embedded in enemies cuts off the sound diff --git a/Items/Weapons/Rogue/ShardofAntumbra.cs b/Items/Weapons/Rogue/ShardofAntumbra.cs index 8afe0a8142..40adf3c663 100644 --- a/Items/Weapons/Rogue/ShardofAntumbra.cs +++ b/Items/Weapons/Rogue/ShardofAntumbra.cs @@ -15,12 +15,11 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 48; Item.height = 48; - Item.damage = 144; + Item.damage = 111; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = 17; + Item.useTime = Item.useAnimation = 17; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 17; Item.knockBack = 8f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; @@ -31,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override float StealthDamageMultiplier => 0.65f; + public override float StealthDamageMultiplier => 0.7f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Localization/en-US/Mods.CalamityMod.GameTips.hjson b/Localization/en-US/Mods.CalamityMod.GameTips.hjson index d9a4d5bfa2..43ad156217 100644 --- a/Localization/en-US/Mods.CalamityMod.GameTips.hjson +++ b/Localization/en-US/Mods.CalamityMod.GameTips.hjson @@ -13,7 +13,6 @@ BossEnemyTip: Killing the most harmless of enemies can awaken the wrath of a muc RoDAbyssTip: Use the Rod of Discord in the Abyss at your own risk. The light left behind may attract the attention of unwanted foes. TerminusTip: An ancient artifact resides at the bottom of the Abyss. Use with great caution. CodebreakerTip: The Codebreaker can be upgraded, allowing you to decrypt new schematics found in various labs around the world. -ChargeTip: Certain weaponry requires charge to use. Weapons can be charged at a Charging Station with Draedon Power Cells. PowerCellTip: Power Cell Factories generate Draedon Power Cells over time. FactoryChargingTip: Power Cell Factories and Charging Stations can be looted from labs in the Underground. StealthTip: Wearing any rogue class armor lets you build stealth! diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 78b6ad646f..3dc78ea7d4 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -978,7 +978,7 @@ ScourgeoftheSeas: { SeafoamBomb: { DisplayName: Seafoam Bomb - Tooltip: + Tooltip: ''' Hurls a lightweight bomb which bursts into a foam bubble Foam bubbles combine in pairs to form huge bubbles diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index c6b3218cf8..96898e2192 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -250,6 +250,9 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.Opacity = Main.npc[(int)NPC.ai[2]].Opacity; } + // Copy the damage state of the head + NPC.damage = Main.npc[(int)NPC.ai[2]].damage == 0 ? 0 : NPC.defDamage; + NPC aheadSegment = Main.npc[(int)NPC.ai[1]]; Vector2 directionToNextSegment = aheadSegment.Center - NPC.Center; if (aheadSegment.rotation != NPC.rotation) @@ -345,7 +348,6 @@ namespace CalamityMod.NPCs.DevourerofGods public override bool CanHitPlayer(Player target, ref int cooldownSlot) { - if (Main.npc[(int)NPC.ai[2]].dontTakeDamage) return false; cooldownSlot = ImmunityCooldownID.Bosses; diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 352bf5c3c0..0e3cd4c729 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -798,6 +798,8 @@ namespace CalamityMod.NPCs.DevourerofGods if (NPC.Opacity >= 1f) { + // Don't do contact damage while flying away after laser walls + NPC.damage = 0; NPC.Opacity = 1f; laserWallPhase = (int)LaserWallPhase.SetUp; @@ -2299,6 +2301,7 @@ namespace CalamityMod.NPCs.DevourerofGods AwaitingPhase2Teleport = false; NPC.Opacity = 1f - (postTeleportTimer / 255f); NPC.velocity = Vector2.Normalize(AdjustedPlayerCenter(10) - NPC.Center) * chargeVelocity; + NPC.damage = NPC.defDamage; NPC.ForceNetUpdate(false); NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + MathHelper.PiOver2; foreach (NPC n in Main.ActiveNPCs) diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index b420b42454..76374999e1 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -152,7 +152,6 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.life = Main.npc[(int)NPC.ai[2]].life; NPC.lifeMax = Main.npc[(int)NPC.ai[2]].lifeMax; - // Percent life remaining float lifeRatio = Main.npc[(int)NPC.ai[2]].life / (float)Main.npc[(int)NPC.ai[2]].lifeMax; @@ -249,6 +248,9 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.Opacity = Main.npc[(int)NPC.ai[2]].Opacity; } + // Copy the damage state of the head + NPC.damage = Main.npc[(int)NPC.ai[2]].damage == 0 ? 0 : NPC.defDamage; + Vector2 segmentDirection = NPC.Center; float playerXDist = player.position.X + (player.width / 2); float playerYDist = player.position.Y + (player.height / 2); diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index d1e74b8527..0ec70ed981 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -171,6 +171,9 @@ namespace CalamityMod.NPCs.Polterghast acceleration += revenge ? 0.035f : 0.025f; } + // Reset contact damage every frame + NPC.damage = NPC.defDamage; + // Predictiveness Vector2 lookAt = player.Center; Vector2 rotationVector = lookAt - vector; @@ -337,6 +340,9 @@ namespace CalamityMod.NPCs.Polterghast } else { + // Do not deal damage during movement to avoid cheap bullshit + NPC.damage = 0; + // Random location choice if (NPC.ai[0] == 0f) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/BrainOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/BrainOfCthulhuAI.cs index 5ff62a5b08..b037c818ca 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/BrainOfCthulhuAI.cs @@ -355,11 +355,6 @@ public class BrainOfCthulhuAI : VanillaAIOverride else NPC.defense = (int)(NPC.defDefense * Phase1DefenseMultiplier); - if (AIState <= BrainAIState.SurfaceSpawnAnimation) - NPC.damage = 0; - else - NPC.damage = NPC.defDamage; - #region Targeting if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) { @@ -559,6 +554,8 @@ public class BrainOfCthulhuAI : VanillaAIOverride private void SpawnAnimation() { + NPC.damage = 0; + if (SpawnTime != 0) //BoC should begin appearing { float d = Main.LocalPlayer.DistanceSQ(NPC.Center); @@ -638,6 +635,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride BrainOfCthulhuSystem.ScreenBlurStrength = 0f; BoCDrawOffset = Vector2.Zero; AIState = BrainAIState.Phase1Idle; + NPC.damage = NPC.defDamage; ResetAttackValues(); Time = -1; SpawnTime = -1; @@ -1041,6 +1039,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride BrainOfCthulhuSystem.ScreenBlurStrength = 0f; NPC.dontTakeDamage = false; + NPC.damage = 0; if (Time <= 15) { @@ -1108,6 +1107,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride OnSecondCreeperPhase = true; AIState = BrainAIState.Phase1Idle; Time = -1; + NPC.damage = NPC.defDamage; } else if (AttackCounter > -1 && wrappedCounter == 0) { @@ -1304,7 +1304,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride NPC.velocity = NPC.DirectionTo(goalPos).SafeNormalize(Vector2.UnitX * -Target.direction) * 8f; #endregion - float delay = OnSecondCreeperPhase ? StrongSwipeDelay : LightSwipeDelay; + int delay = OnSecondCreeperPhase ? StrongSwipeDelay : LightSwipeDelay; if (Time == 0) AttackList.Clear(); @@ -1325,9 +1325,9 @@ public class BrainOfCthulhuAI : VanillaAIOverride crushCount = StrongSwipeAmount; attackDelay = StrongSwipeDuration; } - int attackDur = attackDelay * crushCount; + int attackDur = delay + ((attackDelay + 1) * crushCount); - if (Time < delay + attackDur && Time % attackDelay == 0) + if (Time < attackDur && Time % attackDelay == 0) { List creepers = Main.npc.Where(n => n.active && n.type == NPCID.Creeper && n.AIOverride().Time == -1 && !AttackList.Contains((byte)n.whoAmI)).ToList(); if (creepers.Count > 1 && Main.netMode != NetmodeID.MultiplayerClient) @@ -1369,7 +1369,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride } } - if (Time > delay + attackDur + attackDelay) + if (Time > attackDur + attackDelay) { Time = 0; NPC.damage = NPC.defDamage; @@ -1395,6 +1395,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride { AttackSign = Main.rand.NextBool() ? -1 : 1; AttackPosition = Target.Center; + AttackList.Clear(); NPC.netUpdate = true; NPC.damage = 0; @@ -1555,6 +1556,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride NPC.dontTakeDamage = true; NPC.rotation *= 0.9f; TeleportTime = 0; + NPC.damage = 0; float animCounter = Time - 60; if (animCounter >= 0) @@ -1620,6 +1622,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride ResetAttackValues(); AIState = BrainAIState.Phase2Idle; NPC.dontTakeDamage = false; + NPC.damage = NPC.defDamage; } } else @@ -1707,6 +1710,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride else if (Time == ChaseTime + (TeleportDuration / 2f) && !AttackFlag) { NPC.Center = endPoint; + NPC.damage = NPC.defDamage; DisableMultiplayerSmoothing = true; AttackFlag = true; NPC.netUpdate = true; @@ -2569,20 +2573,20 @@ public class BrainOfCthulhuAI : VanillaAIOverride } NPC.damage = 0; + NPC.dontTakeDamage = false; if (AttackFlag) { if (AttackCounter == 0) { NPC.ShowNameOnHover = true; - NPC.velocity = NPC.DirectionFrom(Target.Center) * 8f; + NPC.velocity = NPC.DirectionFrom(Target.Center) * 4f; } else NPC.velocity *= 0.95f; if (AttackCounter >= IllusionTrickStunDuration) { - NPC.damage = NPC.defDamage; SetupForNextAttack(); NPC.Opacity = 1f; TeleportTime = 0; @@ -2607,6 +2611,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride continue; n.ModNPC().BeenHit = true; + n.netUpdate = true; } for (int i = 1; i <= 3; i++) @@ -2628,7 +2633,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride if (AttackList.Count > 0) { if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, -1, AttackList[0], 2f); + Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, -1, AttackList[0], 0, NPC.whoAmI); AttackList.RemoveAt(0); } @@ -2636,12 +2641,12 @@ public class BrainOfCthulhuAI : VanillaAIOverride { Vector2 direction = Target.velocity.SafeNormalize(Vector2.UnitX * Target.direction).RotatedBy(Main.rand.NextFloat(-MathHelper.Pi / 3f, MathHelper.Pi / 3f)); float distance = DefaultTeleportDistance; + NPC.damage = NPC.defDamage; AttackPosition = Target.Center + (direction * distance); BoCAfterImages = []; NPC.Opacity = 1f; TeleportTime = 0; Time = ChaseTime - 1; - NPC.damage = NPC.defDamage; NPC.netUpdate = true; ResetAttackValues(); @@ -2697,6 +2702,8 @@ public class BrainOfCthulhuAI : VanillaAIOverride { NPC.Opacity = 0f; BoCAfterImages = []; + NPC.damage = 0; + NPC.dontTakeDamage = true; } if (Time >= 180) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/CreeperAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/CreeperAI.cs index b8c3e0dad8..41aeb8b39c 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/CreeperAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/CreeperAI.cs @@ -525,6 +525,7 @@ public class CreeperAI : VanillaAIOverride CachedValue1 = MathHelper.TwoPi / creeperCount * localCreeperID; AttackPosition = NPC.Center; AttackAngle = 0; + Time = -1; NPC.netUpdate = true; } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/FalseBrain.cs b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/FalseBrain.cs index c0e5090a4b..10f95b12db 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/FalseBrain.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/FalseBrain.cs @@ -1,10 +1,15 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Packets; +using CalamityMod.Packets.Entities; using CalamityMod.Particles; +using CalamityMod.Projectiles.Boss.BrainOfCthulhu; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -13,6 +18,7 @@ using Terraria.DataStructures; using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; +using Terraria.ModLoader.IO; namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses.BrainOfCthulhu; @@ -47,15 +53,15 @@ public class FalseBrain : ModNPC, ILocalizedModType Music = MusicID.Boss3; SceneEffectPriority = (SceneEffectPriority)(-1); - NPC.localAI[0] = Main.rand.Next(6); + NPC.localAI[0] = Main.rand.Next(Main.getGoodWorld ? 7 : 6); NPC.localAI[1] = 1 + Main.rand.NextFloat(-0.25f, 0.25f); } private int Variant => (int)NPC.localAI[0]; private float Angle => NPC.ai[0]; private ref float Time => ref NPC.ai[1]; + int AttackTime { get => (int)NPC.ai[2]; set => NPC.ai[2] = value; } internal bool BeenHit = false; - int AttackTime = 0; int SpawnTime = 60; internal static float TimeDivisor => 360f; @@ -80,10 +86,8 @@ public class FalseBrain : ModNPC, ILocalizedModType { NPC.dontTakeDamage = true; - if (AttackTime == 60) + if (AttackTime++ >= 60) NPC.active = false; - - AttackTime++; } else { @@ -100,61 +104,47 @@ public class FalseBrain : ModNPC, ILocalizedModType } if (SpawnTime > 0) + SpawnTime--; + else if (SpawnTime >= -30) { - if (--SpawnTime == 0) + Time += --SpawnTime / -30f; + if(SpawnTime <= -30) NPC.dontTakeDamage = false; } - else if (SpawnTime > -30) - Time += --SpawnTime / -30f; else Time++; } + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(BeenHit); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + BeenHit = reader.ReadBoolean(); + } + public override void OnHitByItem(Player player, Item item, NPC.HitInfo hit, int damageDone) { - SmiteFool(player); + if (!BeenHit) + { + if (Main.netMode == NetmodeID.SinglePlayer) + Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 50, 0.5f, -1, player.whoAmI, 5, NPC.whoAmI); + else + BrainIllusionHitPacket.Send(NPC.whoAmI, player.whoAmI); + NPC.dontTakeDamage = true; + } } public override void OnHitByProjectile(Projectile projectile, NPC.HitInfo hit, int damageDone) { - if (!projectile.Calamity().IgnoreBoCIllusions && projectile.owner != -1) - SmiteFool(Main.player[projectile.owner]); - } - - private void SmiteFool(Player fool) - { - if (!BeenHit) + if (!BeenHit && !projectile.Calamity().IgnoreBoCIllusions && projectile.owner != -1) { - for (int i = 0; i < 6; i++) - { - Vector2 dir = fool.Center - NPC.Center; - int lifeTime = 24; - dir /= lifeTime / 2f * 5f; - dir *= i; - DirectionalPulseRing pulse = new(NPC.Center, dir, i % 2 == 0 ? Color.Red : Color.Orange, new Vector2(0.5f, 1), dir.ToRotation(), 0f, i / 5f, lifeTime + 8); - GeneralParticleHandler.SpawnParticle(pulse); - } - - BeenHit = true; - SoundEngine.PlaySound(BrainOfCthulhuAI.Laugh, NPC.Center); - fool.AddBuff(BuffID.Darkness, 900); - fool.AddBuff(BuffID.Bleeding, 900); - fool.AddBuff(BuffID.Confused, 60); - int timeToAdd = 300; - int bbIndex = fool.buffType.ToList().IndexOf(ModContent.BuffType()); - if (bbIndex != -1) - { - timeToAdd /= 2; - timeToAdd += fool.buffTime[bbIndex]; - } - - if (timeToAdd > 3600) - timeToAdd = 3600; - - fool.AddBuff(ModContent.BuffType(), timeToAdd); - - fool.Hurt(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BrainIllusion" + Main.rand.Next(1, 3 + 1)).ToNetworkText(fool.name)), 50, NPC.Center.X > fool.Center.X ? -1 : 1, cooldownCounter: 0, dodgeable: false, scalingArmorPenetration: 1f); - + if(Main.netMode == NetmodeID.SinglePlayer) + Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 50, 0.5f, -1, projectile.owner, 5, NPC.whoAmI); + else + BrainIllusionHitPacket.Send(NPC.whoAmI, projectile.owner); NPC.dontTakeDamage = true; } } diff --git a/Packets/Entities/BrainIllusionHitPacket.cs b/Packets/Entities/BrainIllusionHitPacket.cs new file mode 100644 index 0000000000..8a06dd068e --- /dev/null +++ b/Packets/Entities/BrainIllusionHitPacket.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Projectiles.Boss.BrainOfCthulhu; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; +using Terraria.ModLoader.IO; + +namespace CalamityMod.Packets.Entities; + +internal class BrainIllusionHitPacket : CalamityPacket +{ + public static BrainIllusionHitPacket Instance { get; private set; } + + public static void Send(int illusionIndex, int foolIndex) + { + // Only Client should send to Server + if (Main.dedServ) + return; + + var packet = Instance.CreateBasePacket(); + + packet.Write((byte)illusionIndex); + packet.Write((byte)foolIndex); + + packet.Send(); + } + + public override void HandlePacket(BinaryReader packet, int sender) + { + var bytes = packet.ReadBytes(2); + NPC illusion = Main.npc[(int)bytes[0]]; + Player fool = Main.player[(int)bytes[1]]; + if(Main.dedServ) + Projectile.NewProjectile(illusion.GetSource_FromThis(), illusion.Center, Vector2.Zero, ModContent.ProjectileType(), 50, 0.5f, -1, fool.whoAmI, 5, illusion.whoAmI); + illusion.dontTakeDamage = true; + illusion.netUpdate = true; + } +} diff --git a/Projectiles/Boss/BrainOfCthulhu/TelekineticBlast.cs b/Projectiles/Boss/BrainOfCthulhu/TelekineticBlast.cs index 779b55153e..51b65fce95 100644 --- a/Projectiles/Boss/BrainOfCthulhu/TelekineticBlast.cs +++ b/Projectiles/Boss/BrainOfCthulhu/TelekineticBlast.cs @@ -27,17 +27,40 @@ public class TelekineticBlast : ModProjectile, ILocalizedModType Projectile.penetrate = -1; Projectile.Opacity = 1f; Projectile.tileCollide = false; - Projectile.timeLeft = 1; + Projectile.timeLeft = 10; Projectile.damage = 0; Projectile.scale = 1; Projectile.hostile = true; + Projectile.netImportant = true; } Player target => Main.player[(int)Projectile.ai[0]]; - float debuffMultiplier => Projectile.ai[1]; + float debuffMultiplier => Main.npc[NPCSource].type == NPCID.BrainofCthulhu ? 2f : 1f; + int delay { get => (int)Projectile.ai[1]; set => Projectile.ai[1] = value; } + int NPCSource => (int)Projectile.ai[2]; + + public override void OnSpawn(IEntitySource source) + { + Projectile.netUpdate = true; + } public override void AI() { + if (Main.npc[NPC.crimsonBoss].AIOverride().AttackFlag) + { + Projectile.active = false; + return; + } + + if (--delay > 0) + return; + + if (Main.npc[NPCSource].ModNPC is FalseBrain illusion) + { + illusion.BeenHit = true; + Main.npc[NPCSource].netUpdate = true; + } + for (int i = 0; i < 6; i++) { Vector2 dir = target.Center - Projectile.Center; diff --git a/Projectiles/Melee/Yoyos/OracleYoyo.cs b/Projectiles/Melee/Yoyos/OracleYoyo.cs index 3d4fce1963..3c3f9778c5 100644 --- a/Projectiles/Melee/Yoyos/OracleYoyo.cs +++ b/Projectiles/Melee/Yoyos/OracleYoyo.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos private Player Owner => Main.player[Projectile.owner]; // projectile.localAI[1] is the Aura Charge of the red lightning aura - // Minimum value is zero. Maximum value is 200. + // Minimum value is zero. Maximum value is 150. // The aura turns on and begins damaging enemies at 20 charge. // The yoyo "supercharges" at 50 charge. // Its size caps out at 100 charge. @@ -176,7 +176,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos { // The aura's direct damage scales with its charge and with melee stats. float chargeRatio = AuraCharge / MaxCharge; - int auraDamage = TheOracle.AuraBaseDamage + (int)(chargeRatio * (TheOracle.AuraMaxDamage - TheOracle.AuraBaseDamage)); + int auraDamage = (int)(Projectile.damage * MathHelper.Lerp(TheOracle.AuraBaseDamageMult, TheOracle.AuraMaxDamageMult, chargeRatio)); DealAuraDamage(auraRadius, auraDamage); } @@ -301,7 +301,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos } } - private void DealAuraDamage(float radius, int baseDamage) + private void DealAuraDamage(float radius, int damage) { if (Projectile.owner != Main.myPlayer) return; @@ -324,10 +324,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos if (dist <= radius) { target.AddBuff(ModContent.BuffType(), 300); - int finalDamage = (int)owner.GetTotalDamage().ApplyTo(baseDamage); if (Projectile.owner == Main.myPlayer) { - Projectile p = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), finalDamage, 0f, Projectile.owner, target.whoAmI); + Projectile p = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Projectile.owner, target.whoAmI); if (p.whoAmI.WithinBounds(Main.maxProjectiles)) p.DamageType = DamageClass.MeleeNoSpeed; } @@ -338,9 +337,6 @@ namespace CalamityMod.Projectiles.Melee.Yoyos private void FireAuricOrbs() { int numOrbs = 3; - int orbID = ModContent.ProjectileType(); - int orbDamage = Projectile.damage; - float orbKB = 8f; float angleVariance = MathHelper.TwoPi / numOrbs; float spinOffsetAngle = MathHelper.Pi / (2f * numOrbs); Vector2 posVec = new Vector2(2f, 0f).RotatedByRandom(MathHelper.TwoPi); @@ -351,8 +347,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos Vector2 velocity = new Vector2(posVec.X, posVec.Y).RotatedBy(spinOffsetAngle); velocity.Normalize(); velocity *= 18f; - if (Projectile.owner == Main.myPlayer) - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + posVec, velocity, orbID, orbDamage, orbKB, Main.myPlayer, 0.0f, 0.0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + posVec, velocity, ModContent.ProjectileType(), Projectile.damage, 8f, Main.myPlayer, 0.0f, 0.0f); } } public override void OnKill(int timeLeft) diff --git a/Projectiles/Ranged/SepticSkewerHarpoon.cs b/Projectiles/Ranged/SepticSkewerHarpoon.cs index 313c2bdfee..4652d1f3ca 100644 --- a/Projectiles/Ranged/SepticSkewerHarpoon.cs +++ b/Projectiles/Ranged/SepticSkewerHarpoon.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Ranged public bool strongEnemy = false; public bool normalHit = false; - public bool pullCheckValid => ((chosenTarget != null && chosenTarget.life < Projectile.damage * 20f && !calledToPull && chosenTarget.realLife == -1 && !normalHit && (CalamityPlayer.areThereAnyDamnBosses ? chosenTarget.life <= chosenTarget.lifeMax / 4 : true)) || Main.zenithWorld); + public bool pullCheckValid => chosenTarget != null && chosenTarget.life < Projectile.damage * 20f && !calledToPull && chosenTarget.realLife == -1 && !normalHit && (CalamityPlayer.areThereAnyDamnBosses ? chosenTarget.life <= chosenTarget.lifeMax / 4 : true); public override void SetStaticDefaults() { ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; @@ -94,12 +94,6 @@ namespace CalamityMod.Projectiles.Ranged if (Projectile.velocity.Length() < 7) collideWithTiles = false; - if (Main.zenithWorld) - { - returnTime = 90; - Projectile.extraUpdates = 7; - } - if (time >= returnTime * (pullCheckValid ? strongEnemy ? 1.5f : 0.9f : stuckInTarget ? 5 : 1) || ripped) { stuckInTarget = false; @@ -256,11 +250,6 @@ namespace CalamityMod.Projectiles.Ranged closestTarget = Main.npc[index]; } } - if (Main.zenithWorld && Main.npc[index] != null && index < 80 && Main.npc[index].realLife == -1 && Owner.ownedProjectileCounts[Type] < 80) - { - closestTarget = Main.npc[index]; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center, ((closestTarget.Center - Owner.Center + closestTarget.velocity * 1.5f).SafeNormalize(Vector2.UnitX) * 18), Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner, 0, Projectile.ai[1] + 1); - } } if (closestTarget != null) { @@ -302,7 +291,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.velocity *= 0.95f; } - if (collideWithTiles && Collision.SolidCollision(Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX) * 30, 4, 4) && !Main.zenithWorld && Projectile.ai[1] < 1) + if (collideWithTiles && Collision.SolidCollision(Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX) * 30, 4, 4) && Projectile.ai[1] < 1) { hasHitTile = true; Projectile.velocity *= -0.5f; diff --git a/Projectiles/Rogue/AntumbraShardProjectile.cs b/Projectiles/Rogue/AntumbraShardProjectile.cs index bd944e8832..d35823a7da 100644 --- a/Projectiles/Rogue/AntumbraShardProjectile.cs +++ b/Projectiles/Rogue/AntumbraShardProjectile.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Rogue public bool jitter = false; public Vector2 portalSpot; public Vector2 shadowPlacement; - public int clones = 9; // This is just a counter for the clones, it will not change how many spawn + public int clones = 6; // This is the number of clones spawned by the stealth strike NPC closestTarget; public override void SetDefaults() { @@ -162,7 +162,7 @@ namespace CalamityMod.Projectiles.Rogue if (closestTarget == null) closestTarget = Projectile.Center.ClosestNPCAt(2000); - if (Projectile.Calamity().stealthStrike && time % 20 == 0) + if (Projectile.Calamity().stealthStrike && time % 20 == 0 && clones > 0) { Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + Main.rand.NextVector2CircularEdge(450, 450) * Main.rand.NextFloat(0.7f, 1.3f), Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 1, 5); clones--; @@ -260,7 +260,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { if (Projectile.numHits > 0) - Projectile.damage = (int)(Projectile.damage * 0.83f); + Projectile.damage = (int)(Projectile.damage * 0.8f); if (Projectile.damage < 1) Projectile.damage = 1; diff --git a/Projectiles/Rogue/ExorcismProj.cs b/Projectiles/Rogue/ExorcismProj.cs index 80d124066f..6ea396fde9 100644 --- a/Projectiles/Rogue/ExorcismProj.cs +++ b/Projectiles/Rogue/ExorcismProj.cs @@ -168,12 +168,11 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.velocity.Length() < storedStealthVel.Length()) Projectile.velocity += Utils.DirectionTo(Projectile.Center, Owner.Center) * 0.1f; Projectile.velocity *= 0.99f; - // CIT 26JUN2025: Removing its ability to deal damage again because it's overpowered - /*if (time == 180) + if (time == 180) // Allow it to hit on the return trip { for (int i = 0; i < Main.maxNPCs; i++) Projectile.localNPCImmunity[i] = 0; - }*/ + } if (Projectile.timeLeft <= 240) { impaleDist = Vector2.One; // This is so the projectile stops dealing damage @@ -308,7 +307,7 @@ namespace CalamityMod.Projectiles.Rogue float minMult = 0.35f; int hitsToMinMult = 10; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= damageMult; + modifiers.SourceDamage *= damageMult / 2; } else if (!falling || Projectile.numHits != 0) modifiers.SourceDamage *= 0.1f; @@ -344,11 +343,17 @@ namespace CalamityMod.Projectiles.Rogue { if (Main.zenithWorld) { + // All is cleansed by The Lord for (int index = 0; index < Main.npc.Length; index++) - { - NPC searchedTarget = Main.npc[index]; - searchedTarget.active = false; - } + { NPC searchedTarget = Main.npc[index]; searchedTarget.active = false; } + for (int x = 0; x < Main.maxProjectiles; x++) + { Projectile projectile = Main.projectile[x]; if (projectile.active && projectile.type != ModContent.ProjectileType() && projectile.type != ModContent.ProjectileType()) { projectile.active = false; } } + for (int x = 0; x < Main.maxItems; x++) + { Item item = Main.item[x]; if (item.active) { item.active = false; } } + for (int x = 0; x < Main.maxDust; x++) + { Dust dust = Main.dust[x]; if (dust.active) { dust.active = false; } } + for (int x = 0; x < Main.maxGore; x++) + { Gore gore = Main.gore[x]; if (gore.active) { gore.active = false; } } SoundStyle gong = new("CalamityMod/Sounds/Custom/GFB/Jesus"); for (int i = 0; i < 2; i++) diff --git a/Projectiles/Rogue/SlickCaneProjectile.cs b/Projectiles/Rogue/SlickCaneProjectile.cs index 2f3d5524ad..54599b649a 100644 --- a/Projectiles/Rogue/SlickCaneProjectile.cs +++ b/Projectiles/Rogue/SlickCaneProjectile.cs @@ -67,9 +67,9 @@ namespace CalamityMod.Projectiles.Rogue float f2 = Projectile.rotation - MathHelper.PiOver4 * Math.Sign(Projectile.velocity.X) + (Projectile.spriteDirection == -1).ToInt() * MathHelper.Pi; float velocityMagnitude = 0f; - float scaleFactor = 35f; + float scaleFactor = 18f; if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), - Projectile.Center, Projectile.Center + f2.ToRotationVector2() * scaleFactor, + Main.player[Projectile.owner].Center, Projectile.Center + f2.ToRotationVector2() * scaleFactor, (TravelSpeed + 1f) * Projectile.scale, ref velocityMagnitude)) { return true; diff --git a/Projectiles/Typeless/AmuletEnergy.cs b/Projectiles/Typeless/AmuletEnergy.cs index e0e37cc736..fb3ec36405 100644 --- a/Projectiles/Typeless/AmuletEnergy.cs +++ b/Projectiles/Typeless/AmuletEnergy.cs @@ -28,8 +28,6 @@ namespace CalamityMod.Projectiles.Typeless public ref float energyNumber => ref Projectile.ai[1]; // The number assigned to this energy, ranging from 1 to the max number of energies public bool idle => Projectile.ai[2] == 0; // Floating around the player public bool healing = false; // If the energies should heal the player. If false they will attack - public int soundCooldown = 0; // A cooldown after making a sound. Also used for some of the visuals when a sound is made - public SlotId soundSlot; public NPC targeted; public override void SetStaticDefaults() { @@ -51,12 +49,11 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { - bool spoke = (soundCooldown >= 250 * Projectile.MaxUpdates); int startTime = 100; // Time after launch when it will begin attacking/healing int endTime = 300; // Time after launch when it's movement code reaches it's cap on strength - // Color is in blues if idle or healing, but becomes orange breifley if they speak or constantly if they are attacking - float colorShift = spoke ? Utils.GetLerpValue(250 * Projectile.MaxUpdates, 300 * Projectile.MaxUpdates, soundCooldown) : (idle || healing ? 0 : Utils.GetLerpValue(0, startTime, time)); + // Color is in blues if idle or healing, but becomes orange if they are attacking + float colorShift = (idle || healing ? 0 : Utils.GetLerpValue(0, startTime, time)); float rate = Main.GlobalTimeWrappedHourly * 5; List eColors = new List() { @@ -86,9 +83,6 @@ namespace CalamityMod.Projectiles.Typeless // Emit some light Lighting.AddLight(Projectile.Center, bColor.ToVector3() * 0.65f); - if (SoundEngine.TryGetActiveSound(soundSlot, out var sound) && sound.IsPlaying) - sound.Position = Projectile.Center; - if (idle) // Following Ai { if (time == 0 && visuals) // On spawn fx @@ -124,22 +118,12 @@ namespace CalamityMod.Projectiles.Typeless Projectile.velocity *= 0.985f; if (!outOfRange) Projectile.velocity = Projectile.velocity.RotatedBy(0.0065f * (energyNumber % 2 == 0 ? -1 : 1)) * 1.004f; - - if (soundCooldown == 0 && Main.rand.NextBool(4500 * Projectile.MaxUpdates) && visuals && time > 18000 * Projectile.MaxUpdates && !Main.dedServ) // Sounds are an easter egg that only plays if they've been alive for over 5 minutes - { - SoundStyle certainlyNotADeadChild = new("CalamityMod/Sounds/Item/AmuletVox", 6); - soundSlot = SoundEngine.PlaySound(certainlyNotADeadChild with { Volume = 0.3f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f), MaxInstances = -1 }, Projectile.Center); - soundCooldown = 800 * Projectile.MaxUpdates; - } - if (soundCooldown > 0) - soundCooldown--; } else Projectile.velocity *= 0.99f; } else // Attack/Healing Ai { - soundCooldown = 0; if (Projectile.ai[2] == 5) // Effects for the moment they stop being idle { Projectile.netUpdate = true; @@ -209,13 +193,13 @@ namespace CalamityMod.Projectiles.Typeless GeneralParticleHandler.SpawnParticle(fadeInfx); } - Projectile.scale = MathHelper.Lerp(Projectile.scale, spoke ? 0.9f : 0.5f, 0.1f); + Projectile.scale = MathHelper.Lerp(Projectile.scale, 0.5f, 0.1f); Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; time++; } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - target.AddBuff(ModContent.BuffType(), 420); + target.AddBuff(ModContent.BuffType(), 540); Projectile.netUpdate = true; } public override void OnKill(int timeLeft) diff --git a/Projectiles/Typeless/PlaguePulse.cs b/Projectiles/Typeless/PlaguePulse.cs index fb430aa6e8..61c02f920e 100644 --- a/Projectiles/Typeless/PlaguePulse.cs +++ b/Projectiles/Typeless/PlaguePulse.cs @@ -64,6 +64,11 @@ namespace CalamityMod.Projectiles.Typeless } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + Player Owner = Main.player[Projectile.owner]; + bool crit = Main.rand.Next(0, 100 + 1) < Owner.GetTotalCritChance(Owner.GetBestClass()); + if (crit) + modifiers.SetCrit(); + float minMult = 0.4f; int hitsToMinMult = 6; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); diff --git a/Sounds/Item/AmuletVox1.ogg b/Sounds/Item/AmuletVox1.ogg deleted file mode 100644 index af09bedf93..0000000000 Binary files a/Sounds/Item/AmuletVox1.ogg and /dev/null differ diff --git a/Sounds/Item/AmuletVox2.ogg b/Sounds/Item/AmuletVox2.ogg deleted file mode 100644 index 631d38c19c..0000000000 Binary files a/Sounds/Item/AmuletVox2.ogg and /dev/null differ diff --git a/Sounds/Item/AmuletVox3.ogg b/Sounds/Item/AmuletVox3.ogg deleted file mode 100644 index 933fea04ad..0000000000 Binary files a/Sounds/Item/AmuletVox3.ogg and /dev/null differ diff --git a/Sounds/Item/AmuletVox4.ogg b/Sounds/Item/AmuletVox4.ogg deleted file mode 100644 index 6d3ec52bcb..0000000000 Binary files a/Sounds/Item/AmuletVox4.ogg and /dev/null differ diff --git a/Sounds/Item/AmuletVox5.ogg b/Sounds/Item/AmuletVox5.ogg deleted file mode 100644 index 77888a2106..0000000000 Binary files a/Sounds/Item/AmuletVox5.ogg and /dev/null differ diff --git a/Sounds/Item/AmuletVox6.ogg b/Sounds/Item/AmuletVox6.ogg deleted file mode 100644 index 7f7ae9060d..0000000000 Binary files a/Sounds/Item/AmuletVox6.ogg and /dev/null differ diff --git a/build.txt b/build.txt index 5d37989673..047b87641a 100644 --- a/build.txt +++ b/build.txt @@ -1,5 +1,5 @@ author = The Calamity Dev Team -version = 2.1 +version = 2.1.1 displayName = Calamity Mod modReferences = CalamityModMusic homepage = https://calamitymod.com