diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 28dffb79b1..75ddc0033c 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -512,6 +512,7 @@ namespace CalamityMod.CalPlayer public int ascendantInsigniaBuffTime = 0; public int ascendantInsigniaCooldown = 0; public bool ascendantTrail = false; + public bool frozenWingsCold = false; public bool magmaStoneVisuals = true; public bool eGauntlet = false; public bool eGauntletVisuals = true; // Used to control dust spawned when swinging @@ -1738,6 +1739,7 @@ namespace CalamityMod.CalPlayer cryogenSoul = false; ascendantInsignia = false; ascendantTrail = false; + frozenWingsCold = false; magmaStoneVisuals = true; eGauntlet = false; eGauntletVisuals = true; diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index e724297fec..fddbf4e15d 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -2531,10 +2531,6 @@ namespace CalamityMod.CalPlayer if (hurtInfo.Damage > 0) { SoundEngine.PlaySound(SoundID.Item93, Player.Center); - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(Player.velocity.X, Player.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; // Start with base damage, then apply the best damage class you can int sDamage = 6; @@ -2545,32 +2541,17 @@ namespace CalamityMod.CalPlayer if (Player.whoAmI == Main.myPlayer) { - for (int i = 0; i < (transformer ? 5 : 4); i++) + float sparkCount = transformer ? 10f : 8f; + for (float i = 0f; i < sparkCount; i++) { - offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - int spark1 = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), sDamage, 1.25f, Player.whoAmI, 0f, 0f); - int spark2 = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), sDamage, 1.25f, Player.whoAmI, 0f, 0f); - if (spark1.WithinBounds(Main.maxProjectiles)) + Vector2 velocity = (MathHelper.TwoPi * i / sparkCount).ToRotationVector2() * 5f; + Projectile spark = Projectile.NewProjectileDirect(source, Player.Center, velocity, ModContent.ProjectileType(), sDamage, 1.25f, Player.whoAmI); + spark.timeLeft = 120; + if (transformer) { - Main.projectile[spark1].timeLeft = 120; - Main.projectile[spark1].DamageType = DamageClass.Generic; - if (transformer) - { - Main.projectile[spark1].timeLeft = 240; - Main.projectile[spark1].extraUpdates = 1; - Main.projectile[spark1].penetrate = 10; - } - } - if (spark2.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[spark2].timeLeft = 120; - Main.projectile[spark2].DamageType = DamageClass.Generic; - if (transformer) - { - Main.projectile[spark2].timeLeft = 240; - Main.projectile[spark2].extraUpdates = 1; - Main.projectile[spark2].penetrate = 10; - } + spark.timeLeft = 240; + spark.extraUpdates = 1; + spark.penetrate = 10; } } } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index ba743f5ccc..0e083e7e7b 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3327,13 +3327,9 @@ namespace CalamityMod.CalPlayer if (Main.rand.NextBool(10)) { Vector2 velocity = CalamityUtils.RandomVelocity(50f, 30f, 60f); - int spark = Projectile.NewProjectile(source, npc.Center, velocity, ModContent.ProjectileType(), damage / 2, 0f, Player.whoAmI); - if (spark.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[spark].DamageType = DamageClass.Generic; - Main.projectile[spark].localNPCHitCooldown = -2; - Main.projectile[spark].penetrate = 5; - } + Projectile spark = Projectile.NewProjectileDirect(source, npc.Center, velocity, ModContent.ProjectileType(), damage / 2, 0f, Player.whoAmI); + spark.localNPCHitCooldown = -2; + spark.timeLeft = 30; } } } diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index a00e5a4ff0..c8dae6d018 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -71,6 +71,7 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffType(), VulnerabilityHex.AflameDuration); target.Calamity().IncreasedColdEffects_EskimoSet = eskimoSet; + target.Calamity().IncreasedColdEffects_FrozenWings = frozenWingsCold; target.Calamity().IncreasedColdEffects_CryoStone = CryoStone; target.Calamity().IncreasedElectricityEffects_Transformer = transformer; @@ -212,6 +213,7 @@ namespace CalamityMod.CalPlayer witheringDamageDone += (int)(damageDone * (hit.Crit ? 2D : 1D)); cgn.IncreasedColdEffects_EskimoSet = eskimoSet; + cgn.IncreasedColdEffects_FrozenWings = frozenWingsCold; cgn.IncreasedColdEffects_CryoStone = CryoStone; cgn.IncreasedElectricityEffects_Transformer = transformer; diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index c2fa066fe6..47319bfbf7 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1418,10 +1418,9 @@ namespace CalamityMod.Items player.noFallDmg = true; if (player.head == ArmorIDs.Head.FrostHelmet && player.body == ArmorIDs.Body.FrostBreastplate && player.legs == ArmorIDs.Legs.FrostLeggings) { - player.GetDamage() += 0.02f; - player.GetDamage() += 0.02f; - player.GetCritChance() += 1; - player.GetCritChance() += 1; + player.GetDamage() += 0.04f; + player.GetDamage() += 0.04f; + player.Calamity().frozenWingsCold = true; } } else if (item.type == ItemID.FlameWings) // Bonus to melee stats diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index f444e8be4c..0c4058647f 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -1301,9 +1301,8 @@ namespace CalamityMod.Items AddWingStats(7.5f, 1f, 1, 160, "5% increased melee damage and critical strike chance"); if (item.type == ItemID.FrozenWings) - AddWingStats(6.75f, 1f, 1, 130, "2% increased melee and ranged damage\n" + - "and 1% increased melee and ranged critical strike chance\n" + - "while wearing the Frost Armor"); + AddWingStats(6.75f, 1f, 1, 130, "4% increased melee and ranged damage\n" + + "and multiplies all cold debuff damage by 1.25x while wearing Frost armor"); if (item.type == ItemID.GhostWings) AddWingStats(7.5f, 1f, 1, 170, "+10 defense and 5% increased damage reduction while wearing the Spectre Hood set\n" + diff --git a/Items/Weapons/Melee/HolyCollider.png b/Items/Weapons/Melee/HolyCollider.png index 713bd1e425..44fc67fa01 100644 Binary files a/Items/Weapons/Melee/HolyCollider.png and b/Items/Weapons/Melee/HolyCollider.png differ diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index cf339d0bda..435f7da56d 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -107,7 +107,6 @@ EonBolt.DisplayName: Eon Bolt EssenceFlame2.DisplayName: Essence Flame EssenceScythe.DisplayName: Essence Scythe EutrophicScimitarProj.DisplayName: Scimitar Zap -EutrophicSpark.DisplayName: Eutrophic Spark ExcelsusBlue.DisplayName: Excelsus ExcelsusMain.DisplayName: Excelsus ExcelsusPink.DisplayName: Excelsus @@ -230,7 +229,6 @@ SolarNeedle.DisplayName: Solar Needle SolsticeBeam.DisplayName: Solstice Beam SoulScythe.DisplayName: Soul Scythe SoulScytheExplosion.DisplayName: Soul Explosion -Spark.DisplayName: Spark SpatialSpear.DisplayName: Elemental Spear SpatialSpear2.DisplayName: Elemental Spear SpatialSpear3.DisplayName: Elemental Spear diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index 9466199407..54849a57f6 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -59,6 +59,7 @@ FlameLickedHellblast.DisplayName: Flame Licked Hellblast FuckYou.DisplayName: Explosion FungalClumpMinion.DisplayName: Fungal Clump GemTechArmorGem.DisplayName: Trireme's Gem +GenericElectricSpark.DisplayName: Electric Spark GhostlyBolt.DisplayName: Bolt GodKiller.DisplayName: God Killer GodSlayerShrapnel.DisplayName: Flame diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index e10b14bd7c..21421bce2c 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -117,14 +117,15 @@ namespace CalamityMod.NPCs public const double VulnerableToDoTDamageMult = 2D; public const double VulnerableToDoTDamageMult_Worms_SlimeGod = 1.5; - // Eskimo Set and Cryo Stone effects + // Cold debuff effects public bool IncreasedColdEffects_EskimoSet = false; + public bool IncreasedColdEffects_FrozenWings = false; public bool IncreasedColdEffects_CryoStone = false; // Transformer effect public bool IncreasedElectricityEffects_Transformer = false; - // Fireball, Cinnamon Roll and Hellfire Treads effects + // Heat debuff effects public bool IncreasedHeatEffects_Fireball = false; public bool IncreasedHeatEffects_CinnamonRoll = false; public bool IncreasedHeatEffects_FlameWakerBoots = false; @@ -411,6 +412,7 @@ namespace CalamityMod.NPCs myClone.VulnerableToWater = VulnerableToWater; myClone.IncreasedColdEffects_EskimoSet = IncreasedColdEffects_EskimoSet; + myClone.IncreasedColdEffects_FrozenWings = IncreasedColdEffects_FrozenWings; myClone.IncreasedColdEffects_CryoStone = IncreasedColdEffects_CryoStone; myClone.IncreasedElectricityEffects_Transformer = IncreasedElectricityEffects_Transformer; myClone.IncreasedHeatEffects_Fireball = IncreasedHeatEffects_Fireball; @@ -842,6 +844,8 @@ namespace CalamityMod.NPCs if (IncreasedColdEffects_EskimoSet) coldDamageMult += 0.25; + if (IncreasedColdEffects_FrozenWings) + coldDamageMult += 0.25; if (IncreasedColdEffects_CryoStone) coldDamageMult += 0.5; diff --git a/Projectiles/Melee/EutrophicSpark.cs b/Projectiles/Melee/EutrophicSpark.cs deleted file mode 100644 index c305f82456..0000000000 --- a/Projectiles/Melee/EutrophicSpark.cs +++ /dev/null @@ -1,88 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Melee -{ - public class EutrophicSpark : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Melee"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 6; - Projectile.height = 12; - Projectile.friendly = true; - Projectile.penetrate = 2; - Projectile.timeLeft = 30; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 15; - Projectile.DamageType = DamageClass.Melee; - } - - public override void AI() - { - if (Projectile.velocity.X != Projectile.velocity.X) - { - Projectile.velocity.X = Projectile.velocity.X * -0.1f; - } - if (Projectile.velocity.X != Projectile.velocity.X) - { - Projectile.velocity.X = Projectile.velocity.X * -0.5f; - } - if (Projectile.velocity.Y != Projectile.velocity.Y && Projectile.velocity.Y > 1f) - { - Projectile.velocity.Y = Projectile.velocity.Y * -0.5f; - } - Projectile.ai[0] += 1f; - if (Projectile.ai[0] > 5f) - { - Projectile.ai[0] = 5f; - if (Projectile.velocity.Y == 0f && Projectile.velocity.X != 0f) - { - Projectile.velocity.X = Projectile.velocity.X * 0.97f; - if ((double)Projectile.velocity.X > -0.01 && (double)Projectile.velocity.X < 0.01) - { - Projectile.velocity.X = 0f; - Projectile.netUpdate = true; - } - } - Projectile.velocity.Y = Projectile.velocity.Y + 0.2f; - } - Projectile.rotation += Projectile.velocity.X * 0.1f; - int eutrophicDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, 0f, 0f, 100, default, 1f); - Dust expr_8976_cp_0 = Main.dust[eutrophicDust]; - expr_8976_cp_0.position.X -= 2f; - Dust expr_8994_cp_0 = Main.dust[eutrophicDust]; - expr_8994_cp_0.position.Y += 2f; - Main.dust[eutrophicDust].scale += (float)Main.rand.Next(50) * 0.01f; - Main.dust[eutrophicDust].noGravity = true; - Dust expr_89E7_cp_0 = Main.dust[eutrophicDust]; - expr_89E7_cp_0.velocity.Y -= 2f; - if (Main.rand.NextBool()) - { - int eutrophicDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, 0f, 0f, 100, default, 1f); - Dust expr_8A4E_cp_0 = Main.dust[eutrophicDust2]; - expr_8A4E_cp_0.position.X -= 2f; - Dust expr_8A6C_cp_0 = Main.dust[eutrophicDust2]; - expr_8A6C_cp_0.position.Y += 2f; - Main.dust[eutrophicDust2].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; - Main.dust[eutrophicDust2].noGravity = true; - Main.dust[eutrophicDust2].velocity *= 0.1f; - } - if ((double)Projectile.velocity.Y < 0.25 && (double)Projectile.velocity.Y > 0.15) - { - Projectile.velocity.X = Projectile.velocity.X * 0.8f; - } - Projectile.rotation = -Projectile.velocity.X * 0.05f; - if (Projectile.velocity.Y > 16f) - { - Projectile.velocity.Y = 16f; - } - } - - public override bool OnTileCollide(Vector2 oldVelocity) => false; - } -} diff --git a/Projectiles/Melee/Shortswords/SubmarineShockerProj.cs b/Projectiles/Melee/Shortswords/SubmarineShockerProj.cs index d14369a186..20871afe34 100644 --- a/Projectiles/Melee/Shortswords/SubmarineShockerProj.cs +++ b/Projectiles/Melee/Shortswords/SubmarineShockerProj.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -48,16 +49,15 @@ namespace CalamityMod.Projectiles.Melee.Shortswords Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Electric); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - var source = Projectile.GetSource_FromThis(); - Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.7f), Projectile.knockBack, Main.myPlayer); - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => SpawnSparks(target); - public override void OnHitPlayer(Player target, Player.HurtInfo info) + public override void OnHitPlayer(Player target, Player.HurtInfo info) => SpawnSparks(target); + + public void SpawnSparks(Entity target) { var source = Projectile.GetSource_FromThis(); - Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.7f), Projectile.knockBack, Main.myPlayer); + Projectile spark = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.7f), Projectile.knockBack, Main.myPlayer); + spark.DamageType = DamageClass.Melee; } } } diff --git a/Projectiles/Melee/Spark.cs b/Projectiles/Melee/Spark.cs deleted file mode 100644 index 682e49ad7d..0000000000 --- a/Projectiles/Melee/Spark.cs +++ /dev/null @@ -1,93 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Melee -{ - public class Spark : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Melee"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 6; - Projectile.height = 12; - Projectile.friendly = true; - Projectile.penetrate = 5; - Projectile.timeLeft = 60; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 15; - Projectile.DamageType = DamageClass.Melee; - } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 120); - } - - public override void AI() - { - if (Projectile.velocity.X != Projectile.velocity.X) - { - Projectile.velocity.X = Projectile.velocity.X * -0.1f; - } - if (Projectile.velocity.X != Projectile.velocity.X) - { - Projectile.velocity.X = Projectile.velocity.X * -0.5f; - } - if (Projectile.velocity.Y != Projectile.velocity.Y && Projectile.velocity.Y > 1f) - { - Projectile.velocity.Y = Projectile.velocity.Y * -0.5f; - } - Projectile.ai[0] += 1f; - if (Projectile.ai[0] > 5f) - { - Projectile.ai[0] = 5f; - if (Projectile.velocity.Y == 0f && Projectile.velocity.X != 0f) - { - Projectile.velocity.X = Projectile.velocity.X * 0.97f; - if ((double)Projectile.velocity.X > -0.01 && (double)Projectile.velocity.X < 0.01) - { - Projectile.velocity.X = 0f; - Projectile.netUpdate = true; - } - } - Projectile.velocity.Y = Projectile.velocity.Y + 0.2f; - } - Projectile.rotation += Projectile.velocity.X * 0.1f; - int sparky = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, 0f, 0f, 100, default, 1f); - Dust expr_8976_cp_0 = Main.dust[sparky]; - expr_8976_cp_0.position.X -= 2f; - Dust expr_8994_cp_0 = Main.dust[sparky]; - expr_8994_cp_0.position.Y += 2f; - Main.dust[sparky].scale += (float)Main.rand.Next(50) * 0.01f; - Main.dust[sparky].noGravity = true; - Dust expr_89E7_cp_0 = Main.dust[sparky]; - expr_89E7_cp_0.velocity.Y -= 2f; - if (Main.rand.NextBool()) - { - int sparkier = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, 0f, 0f, 100, default, 1f); - Dust expr_8A4E_cp_0 = Main.dust[sparkier]; - expr_8A4E_cp_0.position.X -= 2f; - Dust expr_8A6C_cp_0 = Main.dust[sparkier]; - expr_8A6C_cp_0.position.Y += 2f; - Main.dust[sparkier].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; - Main.dust[sparkier].noGravity = true; - Main.dust[sparkier].velocity *= 0.1f; - } - if ((double)Projectile.velocity.Y < 0.25 && (double)Projectile.velocity.Y > 0.15) - { - Projectile.velocity.X = Projectile.velocity.X * 0.8f; - } - Projectile.rotation = -Projectile.velocity.X * 0.05f; - if (Projectile.velocity.Y > 16f) - { - Projectile.velocity.Y = 16f; - } - } - - public override bool OnTileCollide(Vector2 oldVelocity) => false; - } -} diff --git a/Projectiles/Summon/StormjawBaby.cs b/Projectiles/Summon/StormjawBaby.cs index 1b27ab23b2..e196726c0a 100644 --- a/Projectiles/Summon/StormjawBaby.cs +++ b/Projectiles/Summon/StormjawBaby.cs @@ -1,6 +1,5 @@ using System; using CalamityMod.Buffs.Summon; -using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -280,7 +279,7 @@ namespace CalamityMod.Projectiles.Summon for (int i = 0; i < Main.rand.Next(1, 4); i++) { Vector2 sparkS = new Vector2(Main.rand.NextFloat(-5f, 5f), Main.rand.NextFloat(-5f, 5f)); - int spark = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkS, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkS, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); } sparkCounter = 0; } @@ -313,17 +312,7 @@ namespace CalamityMod.Projectiles.Summon for (int j = 0; j < Main.rand.Next(1, 4); j++) { Vector2 sparkS = new Vector2(Main.rand.NextFloat(-5f, 5f), Main.rand.NextFloat(-5f, 5f)); - int spark = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkS, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); - if (spark.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[spark].DamageType = DamageClass.Summon; - Main.projectile[spark].originalDamage = Projectile.originalDamage; - Main.projectile[spark].timeLeft = 120; - Main.projectile[spark].penetrate = 3; - Main.projectile[spark].usesIDStaticNPCImmunity = true; - Main.projectile[spark].idStaticNPCHitCooldown = 10; - Main.projectile[spark].usesLocalNPCImmunity = false; - } + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkS, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); } sparkCounter = 0; } diff --git a/Projectiles/Summon/StormjawSpark.cs b/Projectiles/Summon/StormjawSpark.cs index 0758cf42e9..6c06785a0a 100644 --- a/Projectiles/Summon/StormjawSpark.cs +++ b/Projectiles/Summon/StormjawSpark.cs @@ -1,4 +1,6 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -9,7 +11,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - //literally had to make another projectile cuz whips exist + // Clone of Typeless/GenericElectricSpark but specfically benefits from whips public override void SetStaticDefaults() => ProjectileID.Sets.MinionShot[Projectile.type] = true; public override void SetDefaults() @@ -24,65 +26,48 @@ namespace CalamityMod.Projectiles.Summon Projectile.DamageType = DamageClass.Summon; } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void AI() { if (Projectile.velocity.X != Projectile.velocity.X) - { - Projectile.velocity.X = Projectile.velocity.X * -0.1f; - } - if (Projectile.velocity.X != Projectile.velocity.X) - { - Projectile.velocity.X = Projectile.velocity.X * -0.5f; - } + Projectile.velocity.X *= -0.1f; if (Projectile.velocity.Y != Projectile.velocity.Y && Projectile.velocity.Y > 1f) - { - Projectile.velocity.Y = Projectile.velocity.Y * -0.5f; - } - Projectile.ai[0] += 1f; + Projectile.velocity.Y *= -0.5f; + + Projectile.ai[0]++; if (Projectile.ai[0] > 5f) { Projectile.ai[0] = 5f; if (Projectile.velocity.Y == 0f && Projectile.velocity.X != 0f) { - Projectile.velocity.X = Projectile.velocity.X * 0.97f; - if ((double)Projectile.velocity.X > -0.01 && (double)Projectile.velocity.X < 0.01) + Projectile.velocity.X *= 0.97f; + if (MathF.Abs(Projectile.velocity.X) < 0.01f) { Projectile.velocity.X = 0f; Projectile.netUpdate = true; } } - Projectile.velocity.Y = Projectile.velocity.Y + 0.2f; + Projectile.velocity.Y += 0.2f; } - Projectile.rotation += Projectile.velocity.X * 0.1f; - int sparky = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, 0f, 0f, 100, default, 1f); - Dust expr_8976_cp_0 = Main.dust[sparky]; - expr_8976_cp_0.position.X -= 2f; - Dust expr_8994_cp_0 = Main.dust[sparky]; - expr_8994_cp_0.position.Y += 2f; - Main.dust[sparky].scale += (float)Main.rand.Next(50) * 0.01f; - Main.dust[sparky].noGravity = true; - Dust expr_89E7_cp_0 = Main.dust[sparky]; - expr_89E7_cp_0.velocity.Y -= 2f; + Dust spark = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, Alpha: 100); + spark.position.X -= 2f; + spark.position.Y += 2f; + spark.scale += Main.rand.NextFloat(0f, 0.5f); + spark.noGravity = true; + spark.velocity.Y -= 2f; if (Main.rand.NextBool()) { - int sparkier = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, 0f, 0f, 100, default, 1f); - Dust expr_8A4E_cp_0 = Main.dust[sparkier]; - expr_8A4E_cp_0.position.X -= 2f; - Dust expr_8A6C_cp_0 = Main.dust[sparkier]; - expr_8A6C_cp_0.position.Y += 2f; - Main.dust[sparkier].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; - Main.dust[sparkier].noGravity = true; - Main.dust[sparkier].velocity *= 0.1f; + spark = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, Alpha: 100); + spark.position.X -= 2f; + spark.position.Y += 2f; + spark.scale += Main.rand.NextFloat(0.3f, 0.8f); + spark.noGravity = true; + spark.velocity *= 0.1f; } - if ((double)Projectile.velocity.Y < 0.25 && (double)Projectile.velocity.Y > 0.15) - { - Projectile.velocity.X = Projectile.velocity.X * 0.8f; - } - Projectile.rotation = -Projectile.velocity.X * 0.05f; + if (Projectile.velocity.Y > 16f) - { Projectile.velocity.Y = 16f; - } } public override bool OnTileCollide(Vector2 oldVelocity) => false; diff --git a/Projectiles/Typeless/GenericElectricSpark.cs b/Projectiles/Typeless/GenericElectricSpark.cs new file mode 100644 index 0000000000..607550060d --- /dev/null +++ b/Projectiles/Typeless/GenericElectricSpark.cs @@ -0,0 +1,72 @@ +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class GenericElectricSpark : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void SetDefaults() + { + Projectile.width = 6; + Projectile.height = 12; + Projectile.friendly = true; + Projectile.penetrate = 5; + Projectile.timeLeft = 60; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 15; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + + public override void AI() + { + if (Projectile.velocity.X != Projectile.velocity.X) + Projectile.velocity.X *= -0.1f; + if (Projectile.velocity.Y != Projectile.velocity.Y && Projectile.velocity.Y > 1f) + Projectile.velocity.Y *= -0.5f; + + Projectile.ai[0]++; + if (Projectile.ai[0] > 5f) + { + Projectile.ai[0] = 5f; + if (Projectile.velocity.Y == 0f && Projectile.velocity.X != 0f) + { + Projectile.velocity.X *= 0.97f; + if (MathF.Abs(Projectile.velocity.X) < 0.01f) + { + Projectile.velocity.X = 0f; + Projectile.netUpdate = true; + } + } + Projectile.velocity.Y += 0.2f; + } + Dust spark = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, Alpha: 100); + spark.position.X -= 2f; + spark.position.Y += 2f; + spark.scale += Main.rand.NextFloat(0f, 0.5f); + spark.noGravity = true; + spark.velocity.Y -= 2f; + if (Main.rand.NextBool()) + { + spark = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, Alpha: 100); + spark.position.X -= 2f; + spark.position.Y += 2f; + spark.scale += Main.rand.NextFloat(0.3f, 0.8f); + spark.noGravity = true; + spark.velocity *= 0.1f; + } + + if (Projectile.velocity.Y > 16f) + Projectile.velocity.Y = 16f; + } + + public override bool OnTileCollide(Vector2 oldVelocity) => false; + } +} diff --git a/Tiles/Ores/AstralOre.cs b/Tiles/Ores/AstralOre.cs index b882d20a33..0b1f23af65 100644 --- a/Tiles/Ores/AstralOre.cs +++ b/Tiles/Ores/AstralOre.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Tiles.Ores TileID.Sets.Ore[Type] = true; TileID.Sets.OreMergesWithMud[Type] = true; - MinPick = 210; + MinPick = 110; DustType = 173; AddMapEntry(new Color(255, 153, 255), CreateMapEntryName()); MineResist = 3f; @@ -38,7 +38,7 @@ namespace CalamityMod.Tiles.Ores TileID.Sets.Ore[Type] = true; TileID.Sets.ChecksForMerge[Type] = true; - TileID.Sets.DoesntGetReplacedWithTileReplacement[Type] = true; + // TileID.Sets.DoesntGetReplacedWithTileReplacement[Type] = true; TileID.Sets.AvoidedByMeteorLanding[Type] = true; this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/AstralDirtMerge");