diff --git a/Buffs/StatBuffs/ProfanedCrystalBuff.cs b/Buffs/StatBuffs/ProfanedCrystalBuff.cs index 117d631c72..02dfd8bd2d 100644 --- a/Buffs/StatBuffs/ProfanedCrystalBuff.cs +++ b/Buffs/StatBuffs/ProfanedCrystalBuff.cs @@ -17,14 +17,6 @@ namespace CalamityMod.Buffs.StatBuffs BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } - public override void Update(Player player, ref int buffIndex) - { - if (DownedBossSystem.downedSCal && DownedBossSystem.downedExoMechs && (player.maxMinions - player.slotsMinions) >= 10 && !player.Calamity().profanedCrystalForce) - { - player.Calamity().profanedCrystalBuffs = true; - } - } - public override void ModifyBuffTip(ref string tip, ref int rare) { Player player = Main.player[Main.myPlayer]; diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 917a061019..780fee4e6f 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -8031,7 +8031,8 @@ namespace CalamityMod.CalPlayer Vector2 velocity = new Vector2(posVec.X, posVec.Y).RotatedBy(spinOffsetAngle); velocity.Normalize(); velocity *= 8f; - Projectile.NewProjectile(source, Main.projectile[i].Center + posVec, velocity, ModContent.ProjectileType(), dam, 0f, Player.whoAmI, 0f, 0f); + int proj = Projectile.NewProjectile(source, Main.projectile[i].Center + posVec, velocity, ModContent.ProjectileType(), dam, 0f, Player.whoAmI, 0f, 0f); + Main.projectile[proj].originalDamage = dam; } spearsFired++; } @@ -8079,6 +8080,7 @@ namespace CalamityMod.CalPlayer public override void PostUpdate() //needs to be here else it doesn't work properly, otherwise i'd have stuck it with the wing anim stuffs { + ProfanedSoulCrystal.DetermineTransformationEligibility(Player); if ((profanedCrystal || profanedCrystalForce) && !profanedCrystalHide && Player.legs == EquipLoader.GetEquipSlot(Mod, "ProfanedSoulCrystal", EquipType.Legs)) { bool usingCarpet = Player.carpetTime > 0 && Player.controlJump; //doesn't make sense for carpet to use jump frame since you have solid ground diff --git a/Items/Accessories/ProfanedSoulCrystal.cs b/Items/Accessories/ProfanedSoulCrystal.cs index 57bd96a1ed..bb18c5810c 100644 --- a/Items/Accessories/ProfanedSoulCrystal.cs +++ b/Items/Accessories/ProfanedSoulCrystal.cs @@ -11,6 +11,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using System.Linq; +using CalamityMod.Buffs.StatBuffs; namespace CalamityMod.Items.Accessories { @@ -87,7 +88,7 @@ namespace CalamityMod.Items.Accessories } - else if (Main.player[Main.myPlayer].Calamity().profanedCrystalBuffs) + else { TooltipLine line = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip1"); int manaCost = (int)(100 * Main.player[Main.myPlayer].manaCost); @@ -119,6 +120,14 @@ namespace CalamityMod.Items.Accessories modPlayer.profanedCrystalHide = true; } + internal static void DetermineTransformationEligibility(Player player) + { + if (DownedBossSystem.downedSCal && DownedBossSystem.downedExoMechs && (player.maxMinions - player.slotsMinions) >= 10 && !player.Calamity().profanedCrystalForce && player.HasBuff()) + { + player.Calamity().profanedCrystalBuffs = true; + } + } + // Moved from CalamityGlobalItem since it's just a function called in one place. internal static bool TransformItemUsage(Item item, Player player) { @@ -192,12 +201,18 @@ namespace CalamityMod.Items.Accessories case 2: //boomer int proj = Projectile.NewProjectile(source, player.Center, perturbedspeed, ModContent.ProjectileType(), boomDamage, 0f, player.whoAmI, projType == 1 ? 1f : 0f); if (proj.WithinBounds(Main.maxProjectiles)) + { Main.projectile[proj].Calamity().forceMinion = true; + Main.projectile[proj].originalDamage = boomBaseDamage; + } break; case 3: //bab boomer int proj2 = Projectile.NewProjectile(source, player.Center, perturbedspeed, ModContent.ProjectileType(), boomDamage, 0f, player.whoAmI, 0f); if (proj2.WithinBounds(Main.maxProjectiles)) + { Main.projectile[proj2].Calamity().forceMinion = true; + Main.projectile[proj2].originalDamage = boomBaseDamage; + } break; } if (projType > 1) @@ -235,7 +250,10 @@ namespace CalamityMod.Items.Accessories } int proj = Projectile.NewProjectile(source, player.position, correctedVelocity, ModContent.ProjectileType(), magefireDamage, 1f, player.whoAmI, enrage ? 1f : 0f); if (proj.WithinBounds(Main.maxProjectiles)) + { Main.projectile[proj].Calamity().forceMinion = true; + Main.projectile[proj].originalDamage = magefireBaseDamage; + } player.Calamity().profanedSoulWeaponUsage = enrage ? 20 : 25; } if (player.Calamity().profanedSoulWeaponUsage > 0) @@ -257,7 +275,10 @@ namespace CalamityMod.Items.Accessories int shardDamage = (int)player.GetDamage().ApplyTo(shardBaseDamage); int proj = Projectile.NewProjectile(source, player.Center, angle.ToRotationVector2() * 8f, ModContent.ProjectileType(), shardDamage, 1f, player.whoAmI, 0f, 0f); if (proj.WithinBounds(Main.maxProjectiles)) + { Main.projectile[proj].Calamity().forceMinion = true; + Main.projectile[proj].originalDamage = shardBaseDamage; + } SoundEngine.PlaySound(SoundID.Item20, player.Center); } player.Calamity().profanedSoulWeaponUsage = 0; @@ -269,7 +290,10 @@ namespace CalamityMod.Items.Accessories int shardDamage = (int)player.GetDamage().ApplyTo(shardBaseDamage); int proj = Projectile.NewProjectile(source, player.Center, angle.ToRotationVector2() * 8f, ModContent.ProjectileType(), shardDamage, 1f, player.whoAmI, 1f, 0f); if (proj.WithinBounds(Main.maxProjectiles)) + { Main.projectile[proj].Calamity().forceMinion = true; + Main.projectile[proj].originalDamage = shardBaseDamage; + } SoundEngine.PlaySound(SoundID.Item20, player.Center); } player.Calamity().profanedSoulWeaponUsage += enrage ? 1 : 2; diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index c5178195d9..35186a0f01 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -797,6 +797,7 @@ namespace CalamityMod.Items } // Conversion for Profaned Soul Crystal + ProfanedSoulCrystal.DetermineTransformationEligibility(player); if (modPlayer.profanedCrystalBuffs && item.pick == 0 && item.axe == 0 && item.hammer == 0 && item.autoReuse && (item.CountsAsClass() || item.CountsAsClass() || item.CountsAsClass() || item.CountsAsClass())) return player.altFunctionUse == 0 ? ProfanedSoulCrystal.TransformItemUsage(item, player) : AltFunctionUse(item, player); diff --git a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs index ad996db2bd..a854f63a78 100644 --- a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs +++ b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs @@ -51,7 +51,10 @@ namespace CalamityMod.Projectiles.Summon velocity *= 8f; int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + outerPosVec, velocity, ModContent.ProjectileType(), damage, Projectile.knockBack, Projectile.owner, 0f, 0f); if (proj.WithinBounds(Main.maxProjectiles)) + { + Main.projectile[proj].originalDamage = damage; Main.projectile[proj].Calamity().forceMinion = true; + } if (innerSplits > 0) //only runs if there's still inner splits to create { innerPosVec = innerPosVec.RotatedBy(innerAngleVariance); @@ -60,7 +63,10 @@ namespace CalamityMod.Projectiles.Summon velocity *= 5f; proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + innerPosVec, velocity, ModContent.ProjectileType(), damage, Projectile.knockBack, Projectile.owner, 0f, 0f); if (proj.WithinBounds(Main.maxProjectiles)) + { + Main.projectile[proj].originalDamage = damage; Main.projectile[proj].Calamity().forceMinion = true; + } } innerSplits--; } @@ -626,7 +632,10 @@ namespace CalamityMod.Projectiles.Summon correctedVelocity *= 25f; int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, correctedVelocity, ModContent.ProjectileType(), (int)((double)Projectile.damage * 1.5f), Projectile.knockBack, Projectile.owner, 2); if (proj.WithinBounds(Main.maxProjectiles)) + { + Main.projectile[proj].originalDamage = (int)(Projectile.originalDamage * 1.5); Main.projectile[proj].Calamity().forceMinion = true; + } ((ProfanedCrystalRangedHuges)Main.projectile[proj].ModProjectile).boomerSwarm = true; } }