diff --git a/Items/Weapons/Ranged/AcesHigh.cs b/Items/Weapons/Ranged/AcesHigh.cs index f6152e10a7..02b9c4d72b 100644 --- a/Items/Weapons/Ranged/AcesHigh.cs +++ b/Items/Weapons/Ranged/AcesHigh.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Typeless; using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; diff --git a/Items/Weapons/Ranged/ArterialAssault.cs b/Items/Weapons/Ranged/ArterialAssault.cs index 20766ae2a9..79856f0ca1 100644 --- a/Items/Weapons/Ranged/ArterialAssault.cs +++ b/Items/Weapons/Ranged/ArterialAssault.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Weapons.Ranged shotArrow.tileCollide = false; (shotArrow.ModProjectile as BloodfireArrowProj).DisableEffects = true; shotArrow.Calamity().conditionalHomingRange = 175f; - shotArrow.Calamity().BloodstoneOrbValue = 1; + shotArrow.Calamity().BloodstoneOrbValue = 20; shotNum++; if (shotNum > 4) shotNum = 0; return false; diff --git a/Items/Weapons/Ranged/BloodBoiler.cs b/Items/Weapons/Ranged/BloodBoiler.cs index 2a6a2f5255..894f37aa5e 100644 --- a/Items/Weapons/Ranged/BloodBoiler.cs +++ b/Items/Weapons/Ranged/BloodBoiler.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 60; Item.height = 30; - Item.damage = 115; + Item.damage = 135; Item.DamageType = DamageClass.Ranged; Item.useTime = 5; Item.useAnimation = 25; @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { shotReturn = !shotReturn; - if (Main.rand.NextFloat() > 0.60f) + if (Main.rand.NextFloat() > 0.20f) player.statLife -= 1; if (player.statLife <= 0) { diff --git a/Items/Weapons/Ranged/ClaretCannon.cs b/Items/Weapons/Ranged/ClaretCannon.cs deleted file mode 100644 index 2fa1f265cf..0000000000 --- a/Items/Weapons/Ranged/ClaretCannon.cs +++ /dev/null @@ -1,58 +0,0 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Ranged; -using CalamityMod.Rarities; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Ranged -{ - public class ClaretCannon : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Weapons.Ranged"; - public override void SetDefaults() - { - Item.width = 48; - Item.height = 30; - Item.damage = 148; - Item.DamageType = DamageClass.Ranged; - Item.useTime = 3; - Item.useAnimation = 9; - Item.reuseDelay = 10; - Item.useLimitPerAnimation = 3; - Item.useStyle = ItemUseStyleID.Shoot; - Item.noMelee = true; - Item.knockBack = 5.5f; - Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; - Item.rare = ModContent.RarityType(); - Item.UseSound = SoundID.Item40; - Item.autoReuse = true; - Item.shootSpeed = 24f; - Item.shoot = ModContent.ProjectileType(); - Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; - } - - public override Vector2? HoldoutOffset() => new Vector2(-5, 0); - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(4). - AddTile(TileID.LunarCraftingStation). - Register(); - } - - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) - { - if (type == ProjectileID.Bullet) - Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); - else - Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); - - return false; - } - } -} diff --git a/Items/Weapons/Typeless/ClaretCannon.cs b/Items/Weapons/Typeless/ClaretCannon.cs new file mode 100644 index 0000000000..3903e15e5c --- /dev/null +++ b/Items/Weapons/Typeless/ClaretCannon.cs @@ -0,0 +1,109 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Typeless; +using CalamityMod.Rarities; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Microsoft.Xna.Framework.Graphics; +using Terraria.ModLoader; +using System; + +namespace CalamityMod.Items.Weapons.Typeless +{ + public class ClaretCannon : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Weapons.Typeless"; + + public int ClaretCooldown = 0; + + public static int ClaretCooldownMax = 300; + + public float baseUseDir = 0; + public override void SetDefaults() + { + Item.width = 48; + Item.height = 30; + Item.damage = 500; + Item.DamageType = AverageDamageClass.Instance; + Item.useTime = 10; + Item.useAnimation = 10; + Item.useLimitPerAnimation = 1; + Item.useStyle = ItemUseStyleID.Shoot; + Item.noMelee = true; + Item.knockBack = 5.5f; + Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; + Item.rare = ModContent.RarityType(); + Item.UseSound = SoundID.Item40; + Item.autoReuse = true; + Item.shootSpeed = 12f; + Item.shoot = ModContent.ProjectileType(); + } + + public override Vector2? HoldoutOffset() => new Vector2(-5, 0); + + public override void UpdateInventory(Player player) + { + ClaretCooldown--; + if (ClaretCooldown < 0) + ClaretCooldown = 0; + } + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddTile(TileID.LunarCraftingStation). + Register(); + } + + public override bool CanUseItem(Player player) + { + if (ClaretCooldown > 0) + return false; + return true; + } + + public override void UseAnimation(Player player) + { + } + + public override void UseItemFrame(Player player) + { + float comp = 1 - player.itemTime / (float)player.itemTimeMax; + float lerpValue1 = MathHelper.Lerp(0, 90, MathF.Pow(comp, 0.3f)); + float lerpValue2 = MathHelper.Lerp(90, 0, MathF.Pow(comp, 2)); + player.itemRotation = baseUseDir - MathHelper.ToRadians(Math.Min(lerpValue1, lerpValue2)) * player.direction; + } + + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + baseUseDir = player.itemRotation; + ClaretCooldown = ClaretCooldownMax; + Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); + return false; + } + + public override void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) + { + float fill = ClaretCooldown / (float)ClaretCooldownMax; + if (fill <= 0) + return; + + float barScale = 1.5f; + + var barBG = ModContent.Request("CalamityMod/UI/MiscTextures/GenericBarBack").Value; + var barFG = ModContent.Request("CalamityMod/UI/MiscTextures/GenericBarFront").Value; + + Vector2 barOrigin = barBG.Size() * 0.5f; + float yOffset = 5f; + Vector2 drawPos = position + Vector2.UnitY * scale * (frame.Height - yOffset); + Rectangle frameCrop = new Rectangle(0, 0, (int)((fill) * barFG.Width), barFG.Height); + Color colorBG = Color.Crimson; + Color colorFG = Color.Lerp(Color.OrangeRed, Color.DarkOrange, fill); + + spriteBatch.Draw(barBG, drawPos, null, colorBG, 0f, barOrigin, scale * barScale, 0f, 0f); + spriteBatch.Draw(barFG, drawPos, frameCrop, colorFG, 0f, barOrigin, scale * barScale, 0f, 0f); + } + + } +} diff --git a/Items/Weapons/Ranged/ClaretCannon.png b/Items/Weapons/Typeless/ClaretCannon.png similarity index 100% rename from Items/Weapons/Ranged/ClaretCannon.png rename to Items/Weapons/Typeless/ClaretCannon.png diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 5040e2be9c..d1821b8880 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -272,15 +272,6 @@ ClamorRifle: { Tooltip: Converts musket balls into homing energy bolts } -ClaretCannon: { - DisplayName: Claret Cannon - Tooltip: - ''' - Fires strings of 3 bullets - Converts musket balls into bloody tears that drain enemy health - ''' -} - CleansingBlaze: { DisplayName: Cleansing Blaze Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson index cad73bc9d5..0de017e498 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson @@ -7,6 +7,19 @@ Aestheticus: { ''' } +ClaretCannon: { + DisplayName: Claret Cannon + Tooltip: + ''' + Fires a hypercondensed claret round + The round explodes upon striking an enemy and releases blood orbs + The explosion shreds enemies, inflicting [Laceration] and dramatically reducing their defense + Picking up the blood orbs will reduce [Potion Sickness] when possible + If you do not have [Potion Sickness], your natural regeneration will be enhanced + Can only fire once every 5 seconds + ''' +} + EyeofMagnus: { DisplayName: Eye of Magnus Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index 07a9b5dd8a..97efe5b804 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -46,7 +46,6 @@ ChromaticFlare.DisplayName: Chromatic Flare CinderArrowProj.DisplayName: Cinder Arrow ClamorRifleProj.DisplayName: Clamor Bolt ClamorRifleProjSplit.DisplayName: Clamor Bolt -ClaretCannonProj.DisplayName: Claret Cannon CondemnationArrow.DisplayName: Condemning Arrow CondemnationArrowHoming.DisplayName: Condemning Echo ContagionArrow.DisplayName: Contagion Arrow diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index 078e9577d4..06fbcda6ad 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -32,6 +32,7 @@ BossRushTierAnimation.DisplayName: Boss Rush Tier Animation ChaoticGeyser.DisplayName: Chaotic Geyser ChlorophyteLifePulse.DisplayName: Life Pulse ChronoClock.DisplayName: Chrono Clock +ClaretCannonProj.DisplayName: Claret Round CoralBubble.DisplayName: Bubble CoralBubbleSmall.DisplayName: Bubble CosmicDashExplosion.DisplayName: Cosmic Dash Explosion diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index cf00086d09..9cbf6a12c9 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -4225,10 +4225,9 @@ namespace CalamityMod.Projectiles #region On Hit NPC public override void OnHitNPC(Projectile projectile, NPC target, NPC.HitInfo hit, int damageDone) { - for (var i = 0; i < BloodstoneOrbValue; i++) + if (BloodstoneOrbValue > 0) { - Projectile.NewProjectile(projectile.GetSource_OnHit(target), projectile.Center, projectile.velocity.SafeNormalize(Vector2.Zero) * Math.Min(((projectile.velocity.Length() * projectile.MaxUpdates) / 4f), 4f) * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), 1, 0f, Main.player[projectile.owner].whoAmI); - + Projectile.NewProjectile(projectile.GetSource_OnHit(target), projectile.Center, projectile.velocity.SafeNormalize(Vector2.Zero) * Math.Min(((projectile.velocity.Length() * projectile.MaxUpdates) / 4f), 4f) * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), BloodstoneOrbValue, 0f, Main.player[projectile.owner].whoAmI); } // Hyperius Overflow if (projectile.type != ProjectileType() && projectile.type != ProjectileType() && projectile.type != ProjectileType() && projectile.type != ProjectileType() && target.Calamity().hyperiusMarked) diff --git a/Projectiles/Healing/BloodstoneHealOrb.cs b/Projectiles/Healing/BloodstoneHealOrb.cs index d448b5cc4a..6edd4ff6f5 100644 --- a/Projectiles/Healing/BloodstoneHealOrb.cs +++ b/Projectiles/Healing/BloodstoneHealOrb.cs @@ -88,19 +88,19 @@ namespace CalamityMod.Projectiles.Healing float playerDist = playerVector.Length(); if (playerDist < 50f && Projectile.position.X < player.position.X + player.width && Projectile.position.X + Projectile.width > player.position.X && Projectile.position.Y < player.position.Y + player.height && Projectile.position.Y + Projectile.height > player.position.Y) { - AdjustedHeal(player, heal); + Heal(player, heal); Projectile.Kill(); } Projectile.velocity = (Projectile.velocity * 5 + (playerVector.SafeNormalize(Vector2.Zero) * 5)) / 6f; //Move towards player. Range is determined in the AI(); } - public void AdjustedHeal(Player player, int heal) + public static void Heal(Player player, int PotionTime) { var cplayer = player.Calamity(); if (player.potionDelay > 0) { - player.potionDelay -= 20; + player.potionDelay -= PotionTime; if (player.potionDelay < 0) player.potionDelay = 0; if (player.HasBuff(BuffID.PotionSickness)) @@ -116,8 +116,11 @@ namespace CalamityMod.Projectiles.Healing } else { - player.lifeRegenTime += 60; //if Potion Sickness is full, each orb speeds up natural regen by 1 second + player.lifeRegenTime += 3*PotionTime; //if Potion Sickness is full, each orb speeds up natural regen } + + Particle ring = new CustomPulse(player.Center, Vector2.Zero, new Color(255, 32, 32)*0.75f, "CalamityMod/Particles/DustyCircleHardEdge", Vector2.One, 0, 0.01f, 0.05f, 20); + GeneralParticleHandler.SpawnParticle(ring); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Magic/SanguineFlareProj.cs b/Projectiles/Magic/SanguineFlareProj.cs index 68cf88d7a9..589fb92147 100644 --- a/Projectiles/Magic/SanguineFlareProj.cs +++ b/Projectiles/Magic/SanguineFlareProj.cs @@ -130,7 +130,7 @@ namespace CalamityMod.Projectiles.Magic float orbCount = MathHelper.Lerp(0, 20, (dmgMult-1) / 4f); for (var i = 0; i < orbCount; i++) { - Projectile.NewProjectile(Projectile.GetSource_OnHit(target), Projectile.Center, Projectile.velocity.RotatedByRandom(1) * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), 1, 0f, player.whoAmI); + Projectile.NewProjectile(Projectile.GetSource_OnHit(target), Projectile.Center, Projectile.velocity.RotatedByRandom(1) * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), 20, 0f, player.whoAmI); } if (dmgMult > 1) { diff --git a/Projectiles/Magic/VisceraBeam.cs b/Projectiles/Magic/VisceraBeam.cs index b0194dba22..636c4f426f 100644 --- a/Projectiles/Magic/VisceraBeam.cs +++ b/Projectiles/Magic/VisceraBeam.cs @@ -10,6 +10,7 @@ using Terraria.Audio; using CalamityMod.Balancing; using System; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Projectiles.Healing; namespace CalamityMod.Projectiles.Magic { @@ -93,15 +94,13 @@ namespace CalamityMod.Projectiles.Magic dust.noGravity = true; } } + if (Projectile.ai[2] < 1){ + for (int i = 0; i < 2; i++) { + Projectile.NewProjectile(Projectile.GetSource_OnHit(target), Projectile.Center, -Projectile.velocity.SafeNormalize(Vector2.Zero).RotatedByRandom(0.5f) * Main.rand.NextFloat(3, 5), ModContent.ProjectileType(), 5, 0f, Projectile.owner); + } + Projectile.ai[2]++; + } - int heal = (int)Math.Round(hit.Damage * 0.05); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); } public override void AI() diff --git a/Projectiles/Melee/TheMutilatorHoldoutProjectile.cs b/Projectiles/Melee/TheMutilatorHoldoutProjectile.cs index 40e88e0f1d..4a86c09dd1 100644 --- a/Projectiles/Melee/TheMutilatorHoldoutProjectile.cs +++ b/Projectiles/Melee/TheMutilatorHoldoutProjectile.cs @@ -93,14 +93,13 @@ namespace CalamityMod.Projectiles.Melee if (modItem.Charge > TheMutilator.MaximumCharge) { modItem.Charge = 0; - int healAmount = 1; int orbAmount = 30; if (orbAmount > 0) { float spreadAmount = MathHelper.ToRadians(360); for (var i = 0; i < orbAmount; i++) { - Projectile.NewProjectile(Projectile.GetSource_OnHit(target), target.Center, -angle.RotatedByRandom(spreadAmount) * 3.5f * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), healAmount, 0f, player.whoAmI); + Projectile.NewProjectile(Projectile.GetSource_OnHit(target), target.Center, -angle.RotatedByRandom(spreadAmount) * 3.5f * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), 22, 0f, player.whoAmI); } Particle bloodsplosion2 = new CustomPulse(target.Center, Vector2.Zero, new Color(255, 32, 32) * 0.75f, "CalamityMod/Particles/DustyCircleHardEdge", Vector2.One, Main.rand.NextFloat(-15f, 15f), 0.03f, 0.155f, 40); diff --git a/Projectiles/Ranged/BloodBoilerFire.cs b/Projectiles/Ranged/BloodBoilerFire.cs index af3ed087d8..5a1869b20e 100644 --- a/Projectiles/Ranged/BloodBoilerFire.cs +++ b/Projectiles/Ranged/BloodBoilerFire.cs @@ -7,6 +7,7 @@ using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Projectiles.Healing; namespace CalamityMod.Projectiles.Ranged { @@ -195,19 +196,9 @@ namespace CalamityMod.Projectiles.Ranged { if (Projectile.Hitbox.Intersects(player.Hitbox)) { - if (!Main.player[Projectile.owner].moonLeech) + if (improvedHeal) { - int bonusHeal = Main.rand.NextBool(3) ? 5 : 3; - int heal = improvedHeal ? bonusHeal : 2; - - if (Main.LocalPlayer.lifeSteal <= 0f) - { - Projectile.Kill(); - return; - } - - Main.LocalPlayer.lifeSteal -= heal; - player.HealPlayer(heal); + BloodstoneHealOrb.Heal(player, 8); } Projectile.Kill(); diff --git a/Projectiles/Ranged/ClaretCannonProj.cs b/Projectiles/Ranged/ClaretCannonProj.cs deleted file mode 100644 index d37c4265a0..0000000000 --- a/Projectiles/Ranged/ClaretCannonProj.cs +++ /dev/null @@ -1,77 +0,0 @@ -using CalamityMod.Balancing; -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Ranged -{ - public class ClaretCannonProj : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Ranged"; - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Type] = 10; - ProjectileID.Sets.TrailingMode[Type] = 0; - } - - public override void SetDefaults() - { - Projectile.width = 14; - Projectile.height = 14; - Projectile.friendly = true; - Projectile.alpha = 255; - Projectile.penetrate = 1; - Projectile.timeLeft = 600; - Projectile.DamageType = DamageClass.Ranged; - Projectile.extraUpdates = 1; - Projectile.aiStyle = ProjAIStyleID.Arrow; - AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; - } - - public override void AI() - { - Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0f / 255f); - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - Collision.HitTiles(Projectile.position, Projectile.velocity, Projectile.width, Projectile.height); - SoundEngine.PlaySound(SoundID.Dig, Projectile.position); - return true; - } - - public override void OnKill(int timeLeft) - { - for (int k = 0; k < 2; k++) - { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, Projectile.oldVelocity.X * 0.15f, Projectile.oldVelocity.Y * 0.15f); - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 120); - - int heal = (int)Math.Round(hit.Damage * 0.02); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); - } - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); - return false; - } - } -} diff --git a/Projectiles/Rogue/BloodsoakedCrashax.cs b/Projectiles/Rogue/BloodsoakedCrashax.cs index b894edd6e7..090ef8dd38 100644 --- a/Projectiles/Rogue/BloodsoakedCrashax.cs +++ b/Projectiles/Rogue/BloodsoakedCrashax.cs @@ -127,7 +127,7 @@ namespace CalamityMod.Projectiles.Rogue float spreadAmount = MathHelper.ToRadians(360); for (var i = 0; i < orbAmount; i++) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.One.RotatedByRandom(spreadAmount) * 2f * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), 1, 0f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.One.RotatedByRandom(spreadAmount) * 2f * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), 20, 0f, Projectile.owner); } } diff --git a/Projectiles/Summon/BloodSpit.cs b/Projectiles/Summon/BloodSpit.cs index 057b6387c2..89167493d4 100644 --- a/Projectiles/Summon/BloodSpit.cs +++ b/Projectiles/Summon/BloodSpit.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 6; Projectile.DamageType = DamageClass.Summon; - Projectile.Calamity().BloodstoneOrbValue = 1; //Bloodstone Orb lifesteal. May want to go back to regular lifesteal. + Projectile.Calamity().BloodstoneOrbValue = 20; //Bloodstone Orb lifesteal. May want to go back to regular lifesteal. } public override void AI() @@ -50,16 +50,6 @@ namespace CalamityMod.Projectiles.Summon blood.velocity = Main.rand.NextVector2Circular(1f, 2f); blood.noGravity = true; } - //regular lifesteal code. Not sure if we wanna go back to it so I left it here. - /*int heal = (int)Math.Round(hit.Damage * 0.01); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); - */ } } } diff --git a/Projectiles/Typeless/ClaretCannonProj.cs b/Projectiles/Typeless/ClaretCannonProj.cs new file mode 100644 index 0000000000..06276d5180 --- /dev/null +++ b/Projectiles/Typeless/ClaretCannonProj.cs @@ -0,0 +1,92 @@ +using CalamityMod.Balancing; +using System; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items.Weapons.Typeless; +using CalamityMod.Projectiles.Healing; +using CalamityMod.Particles; + +namespace CalamityMod.Projectiles.Typeless +{ + public class ClaretCannonProj : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; + } + + public override void SetDefaults() + { + Projectile.width = 14; + Projectile.height = 14; + Projectile.friendly = true; + Projectile.alpha = 0; + Projectile.penetrate = 1; + Projectile.timeLeft = 600; + Projectile.DamageType = AverageDamageClass.Instance; + Projectile.extraUpdates = 1; + Projectile.aiStyle = 0; + } + + public override void AI() + { + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0f / 255f); + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(Projectile.position, Projectile.velocity, Projectile.width, Projectile.height); + SoundEngine.PlaySound(SoundID.Dig, Projectile.position); + return true; + } + + public override void OnKill(int timeLeft) + { + if (Projectile.penetrate != -1) + return; + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/NPCKilled/PerfLargeDeath") { Volume = 0.5f }, Projectile.Center); + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/BloodPactCrit") { Volume = 0.5f }, Projectile.Center); + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), ClaretCannon.ClaretCooldownMax); + target.AddBuff(BuffID.BetsysCurse, ClaretCannon.ClaretCooldownMax*2); + if (Projectile.penetrate == -1) + return; + var player = Main.player[Projectile.owner]; + float orbCount = 20; + for (var i = 0; i < orbCount; i++) + { + Projectile.NewProjectile(Projectile.GetSource_OnHit(target), Projectile.Center, -Projectile.velocity.SafeNormalize(Vector2.Zero).RotatedByRandom(1) * Main.rand.NextFloat(2.75f, 5.25f), ModContent.ProjectileType(), 20, 0f, player.whoAmI); + } + Projectile.position = Projectile.Center; + Projectile.Size = new Vector2(352); + Projectile.Center = Projectile.position; + Projectile.penetrate = -1; + Projectile.extraUpdates = 0; + Projectile.timeLeft = 2; + Projectile.velocity *= 0; + Projectile.damage /= 2; + float particleScale = 8f; + Particle bloodsplosion = new CustomPulse(Projectile.Center, Vector2.Zero, Color.DarkRed, "CalamityMod/Particles/DetailedExplosion", Vector2.One, Main.rand.NextFloat(-15f, 15f), 0.16f*particleScale/5f, 0.87f * particleScale / 5f, (int)(40 * 0.38f), false); + GeneralParticleHandler.SpawnParticle(bloodsplosion); + Particle bloodsplosion2 = new CustomPulse(Projectile.Center, Vector2.Zero, new Color(255, 32, 32), "CalamityMod/Particles/DustyCircleHardEdge", Vector2.One, Main.rand.NextFloat(-15f, 15f), 0.03f * particleScale / 5f, 0.155f * particleScale / 5f, 40); + GeneralParticleHandler.SpawnParticle(bloodsplosion2); + } + + public override bool PreDraw(ref Color lightColor) + { + //CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); + return true; + } + } +} diff --git a/Projectiles/Ranged/ClaretCannonProj.png b/Projectiles/Typeless/ClaretCannonProj.png similarity index 100% rename from Projectiles/Ranged/ClaretCannonProj.png rename to Projectiles/Typeless/ClaretCannonProj.png