From 7b8a0ef2a3079b76d2ceb245794eeccd045c2f8f Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 3 Apr 2022 20:20:29 -0500 Subject: [PATCH] Projectile source definitions for all spears --- Projectiles/Melee/Spears/AmidiasTridentProj.cs | 4 ++-- Projectiles/Melee/Spears/AstralPikeProj.cs | 3 +-- Projectiles/Melee/Spears/BansheeHookProj.cs | 12 +++++++----- Projectiles/Melee/Spears/BrimlanceProj.cs | 6 +++--- Projectiles/Melee/Spears/DiseasedPikeSpear.cs | 4 ++-- Projectiles/Melee/Spears/EarthenPikeSpear.cs | 4 ++-- .../Melee/Spears/ExsanguinationLanceProjectile.cs | 4 ++-- Projectiles/Melee/Spears/GildedProboscisProj.cs | 3 ++- Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs | 7 ++----- .../Melee/Spears/HellionFlowerSpearProjectile.cs | 4 ++-- Projectiles/Melee/Spears/InsidiousImpalerProj.cs | 5 ++--- Projectiles/Melee/Spears/MarniteSpearProjectile.cs | 4 +++- Projectiles/Melee/Spears/NadirSpear.cs | 4 ++-- Projectiles/Melee/Spears/SausageMakerSpear.cs | 4 ++-- Projectiles/Melee/Spears/SpatialLanceProjectile.cs | 5 ++--- Projectiles/Melee/Spears/StarnightLanceProjectile.cs | 4 ++-- Projectiles/Melee/Spears/StreamGougeProj.cs | 6 +++--- Projectiles/Melee/Spears/TenebreusTidesProjectile.cs | 5 +++-- Projectiles/Melee/Spears/TerraLanceProjectile.cs | 5 +++-- Projectiles/Melee/Spears/UrchinSpearProjectile.cs | 4 ++-- Projectiles/Melee/Spears/YateveoBloomSpear.cs | 4 +++- 21 files changed, 52 insertions(+), 49 deletions(-) diff --git a/Projectiles/Melee/Spears/AmidiasTridentProj.cs b/Projectiles/Melee/Spears/AmidiasTridentProj.cs index 83895a1eca..af4b90f513 100644 --- a/Projectiles/Melee/Spears/AmidiasTridentProj.cs +++ b/Projectiles/Melee/Spears/AmidiasTridentProj.cs @@ -1,4 +1,4 @@ -using System; +using System; using Terraria; using Terraria.ModLoader; using CalamityMod.Projectiles.BaseProjectiles; @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override float ForwardSpeed => 0.75f; public override Action EffectBeforeReelback => (proj) => { - Projectile.NewProjectile(Projectile.Center.X + Projectile.velocity.X, Projectile.Center.Y + Projectile.velocity.Y, Projectile.velocity.X * 0.8f, Projectile.velocity.Y * 0.8f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * 0.85f, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetProjectileSource_FromThis(), Projectile.Center, Projectile.velocity * 0.8f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * 0.85f, Projectile.owner, 0f, 0f); }; } } diff --git a/Projectiles/Melee/Spears/AstralPikeProj.cs b/Projectiles/Melee/Spears/AstralPikeProj.cs index 22f6eaf00e..fe8425f67b 100644 --- a/Projectiles/Melee/Spears/AstralPikeProj.cs +++ b/Projectiles/Melee/Spears/AstralPikeProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Projectiles.Typeless; using Terraria; @@ -56,7 +56,6 @@ namespace CalamityMod.Projectiles.Melee.Spears star.ai[0] = 3f; } } - } } } diff --git a/Projectiles/Melee/Spears/BansheeHookProj.cs b/Projectiles/Melee/Spears/BansheeHookProj.cs index 7fce49c330..964d7c7722 100644 --- a/Projectiles/Melee/Spears/BansheeHookProj.cs +++ b/Projectiles/Melee/Spears/BansheeHookProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -36,7 +36,8 @@ namespace CalamityMod.Projectiles.Melee.Spears public override float TravelSpeed => 22f; public override Action EffectBeforeReelback => (proj) => { - Projectile.NewProjectile(Projectile.Center + Projectile.velocity * 0.5f, + Projectile.NewProjectile(Projectile.GetProjectileSource_FromThis(), + Projectile.Center + Projectile.velocity * 0.5f, Projectile.velocity * 0.8f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * 0.85f, Projectile.owner, 0f, 0f); }; @@ -90,7 +91,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override bool PreDraw(ref Color lightColor) { Vector2 drawPosition = Projectile.position + new Vector2(Projectile.width, Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; - Texture2D alternateHookTexture = Projectile.spriteDirection == -1 ? ModContent.Request("CalamityMod/Projectiles/Melee/Spears/BansheeHookAlt") : ModContent.Request(Texture).Value; + Texture2D alternateHookTexture = Projectile.spriteDirection == -1 ? ModContent.Request("CalamityMod/Projectiles/Melee/Spears/BansheeHookAlt").Value : ModContent.Request(Texture).Value; Vector2 origin = new Vector2(Projectile.spriteDirection == 1 ? alternateHookTexture.Width + 8f : -8f, -8f); Main.EntitySpriteDraw(alternateHookTexture, drawPosition, null, new Color(255, 255, 255, 127), Projectile.rotation, @@ -101,7 +102,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override void PostDraw(Color lightColor) { Vector2 drawPosition = Projectile.position + new Vector2(Projectile.width, Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; - Texture2D texture = Projectile.spriteDirection == -1 ? ModContent.Request("CalamityMod/Projectiles/Melee/Spears/BansheeHookAltGlow") : ModContent.Request("CalamityMod/Projectiles/Melee/Spears/BansheeHookGlow"); + Texture2D texture = Projectile.spriteDirection == -1 ? ModContent.Request("CalamityMod/Projectiles/Melee/Spears/BansheeHookAltGlow").Value : ModContent.Request("CalamityMod/Projectiles/Melee/Spears/BansheeHookGlow").Value; Vector2 origin = new Vector2(Projectile.spriteDirection == 1 ? texture.Width - -8f : -8f, -8f); //-8 -8 Main.EntitySpriteDraw(texture, drawPosition, null, Color.White, Projectile.rotation, origin, 1f, SpriteEffects.None, 0); } @@ -125,7 +126,8 @@ namespace CalamityMod.Projectiles.Melee.Spears { if (Projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(target.Center, Vector2.Zero, + Projectile.NewProjectile(Projectile.GetProjectileSource_FromThis(), + target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(damage * 0.25), 10f, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); } diff --git a/Projectiles/Melee/Spears/BrimlanceProj.cs b/Projectiles/Melee/Spears/BrimlanceProj.cs index 20ce126a3b..5d89992a40 100644 --- a/Projectiles/Melee/Spears/BrimlanceProj.cs +++ b/Projectiles/Melee/Spears/BrimlanceProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -46,11 +46,11 @@ namespace CalamityMod.Projectiles.Melee.Spears target.immune[Projectile.owner] = 7; if (Projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.65), knockback, Main.myPlayer); + Projectile.NewProjectile(Projectile.GetProjectileSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.65), knockback, Main.myPlayer); for (int i = 0; i < 3; i++) { Vector2 fireVelocity = new Vector2(0f, Main.rand.NextFloat(7f, 10f)).RotatedByRandom(MathHelper.TwoPi); - Projectile.NewProjectile(target.Center, fireVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4), 0f, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetProjectileSource_FromThis(), target.Center, fireVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4), 0f, Projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/Melee/Spears/DiseasedPikeSpear.cs b/Projectiles/Melee/Spears/DiseasedPikeSpear.cs index d1233fa1d1..1d8ccb318d 100644 --- a/Projectiles/Melee/Spears/DiseasedPikeSpear.cs +++ b/Projectiles/Melee/Spears/DiseasedPikeSpear.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Terraria; using Terraria.ModLoader; using CalamityMod.Projectiles.BaseProjectiles; @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Melee.Spears { for (int i = 0; i < 4; i++) { - int proj = Projectile.NewProjectile(Projectile.Center, Projectile.velocity * 0.5f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75), Projectile.knockBack, Projectile.owner); + int proj = Projectile.NewProjectile(Projectile.GetProjectileSource_FromThis(), Projectile.Center, Projectile.velocity * 0.5f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75), Projectile.knockBack, Projectile.owner); Main.projectile[proj].extraUpdates += i; } } diff --git a/Projectiles/Melee/Spears/EarthenPikeSpear.cs b/Projectiles/Melee/Spears/EarthenPikeSpear.cs index eca700144e..1d23ee63a4 100644 --- a/Projectiles/Melee/Spears/EarthenPikeSpear.cs +++ b/Projectiles/Melee/Spears/EarthenPikeSpear.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Projectiles.Ranged; using Terraria; using Terraria.ModLoader; @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Melee.Spears float velocityY = Projectile.velocity.Y * 1.25f; if (velocityY < 0.1f) velocityY = 0.1f; - int proj = Projectile.NewProjectile(Projectile.Center.X + Projectile.velocity.X, Projectile.Center.Y + Projectile.velocity.Y, + int proj = Projectile.NewProjectile(Projectile.GetProjectileSource_FromThis(), Projectile.Center.X + Projectile.velocity.X, Projectile.Center.Y + Projectile.velocity.Y, Projectile.velocity.X * 1.25f, velocityY, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5), 0f, Projectile.owner, 0f, 0f); if (proj.WithinBounds(Main.maxProjectiles)) Main.projectile[proj].Calamity().forceMelee = true; diff --git a/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs b/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs index 8b8226aad1..cd91e1ee50 100644 --- a/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs +++ b/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Melee.Spears { if (Projectile.owner == Main.myPlayer) { - int boom = Projectile.NewProjectile(Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + int boom = Projectile.NewProjectile(Projectile.GetProjectileSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); if (boom.WithinBounds(Main.maxProjectiles)) Main.projectile[boom].Calamity().forceMelee = true; } diff --git a/Projectiles/Melee/Spears/GildedProboscisProj.cs b/Projectiles/Melee/Spears/GildedProboscisProj.cs index 39e23f1c9e..13aa493a11 100644 --- a/Projectiles/Melee/Spears/GildedProboscisProj.cs +++ b/Projectiles/Melee/Spears/GildedProboscisProj.cs @@ -1,5 +1,6 @@ -using Terraria; +using Terraria; using CalamityMod.Projectiles.BaseProjectiles; +using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee.Spears { diff --git a/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs b/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs index bb2af257de..ac2f3a9268 100644 --- a/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs +++ b/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; using CalamityMod.Projectiles.BaseProjectiles; namespace CalamityMod.Projectiles.Melee.Spears @@ -37,10 +37,7 @@ namespace CalamityMod.Projectiles.Melee.Spears { Projectile.localAI[0] = 0f; if (Main.myPlayer == Projectile.owner) - { - Projectile.NewProjectile(Projectile.Center.X + Projectile.velocity.X, Projectile.Center.Y + Projectile.velocity.Y, - Projectile.velocity.X, Projectile.velocity.Y, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4), 0f, Projectile.owner, 0f, 0f); - } + Projectile.NewProjectile(Projectile.GetProjectileSource_FromThis(), Projectile.Center + Projectile.velocity, Projectile.velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4), 0f, Projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs b/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs index ed0c86b375..af3eee9409 100644 --- a/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs +++ b/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override float ForwardSpeed => 0.95f; public override Action EffectBeforeReelback => (proj) => { - Projectile.NewProjectile(Projectile.Center.X + Projectile.velocity.X, Projectile.Center.Y + Projectile.velocity.Y, Projectile.velocity.X * 2.4f, Projectile.velocity.Y * 2.4f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.65), Projectile.knockBack * 0.85f, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetProjectileSource_FromThis(), Projectile.Center, Projectile.velocity * 2.4f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.65), Projectile.knockBack * 0.85f, Projectile.owner, 0f, 0f); }; public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/Spears/InsidiousImpalerProj.cs b/Projectiles/Melee/Spears/InsidiousImpalerProj.cs index b6001d2a21..eead08453b 100644 --- a/Projectiles/Melee/Spears/InsidiousImpalerProj.cs +++ b/Projectiles/Melee/Spears/InsidiousImpalerProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using System; using Terraria; using Terraria.ID; @@ -35,8 +35,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override float ForwardSpeed => 0.95f; public override Action EffectBeforeReelback => (proj) => { - Projectile.NewProjectile(Projectile.Center.X + Projectile.velocity.X, Projectile.Center.Y + Projectile.velocity.Y, - Projectile.velocity.X * 3.5f, Projectile.velocity.Y * 3.5f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5), Projectile.knockBack * 0.85f, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetProjectileSource_FromThis(), Projectile.Center + Projectile.velocity, Projectile.velocity * 3.5f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5), Projectile.knockBack * 0.85f, Projectile.owner); }; public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/Spears/MarniteSpearProjectile.cs b/Projectiles/Melee/Spears/MarniteSpearProjectile.cs index dda3410b47..43b524a66c 100644 --- a/Projectiles/Melee/Spears/MarniteSpearProjectile.cs +++ b/Projectiles/Melee/Spears/MarniteSpearProjectile.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.BaseProjectiles; +using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Melee.Spears { public class MarniteSpearProjectile : BaseSpearProjectile diff --git a/Projectiles/Melee/Spears/NadirSpear.cs b/Projectiles/Melee/Spears/NadirSpear.cs index 93a02ea729..041d974100 100644 --- a/Projectiles/Melee/Spears/NadirSpear.cs +++ b/Projectiles/Melee/Spears/NadirSpear.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee.Spears Vector2 projPos = Projectile.Center + Projectile.velocity; Vector2 projVel = Projectile.velocity * 0.75f; if (Projectile.owner == Main.myPlayer) - Projectile.NewProjectile(projPos, projVel, ModContent.ProjectileType(), damage, kb, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetProjectileSource_FromThis(), projPos, projVel, ModContent.ProjectileType(), damage, kb, Projectile.owner, 0f, 0f); // Play a screaming soul sound effect (unused Shadowflame Hex Doll noise) SoundEngine.PlaySound(SoundID.Item104, Projectile.Center); diff --git a/Projectiles/Melee/Spears/SausageMakerSpear.cs b/Projectiles/Melee/Spears/SausageMakerSpear.cs index ceeb761cc8..38ba43b737 100644 --- a/Projectiles/Melee/Spears/SausageMakerSpear.cs +++ b/Projectiles/Melee/Spears/SausageMakerSpear.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; using CalamityMod.Projectiles.BaseProjectiles; namespace CalamityMod.Projectiles.Melee.Spears @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Melee.Spears { for (int i = 0; i < 2; i++) { - Projectile.NewProjectile(Projectile.Center, Projectile.velocity * 1.2f, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack * 0.5f, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetProjectileSource_FromThis(), Projectile.Center, Projectile.velocity * 1.2f, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack * 0.5f, Projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/Melee/Spears/SpatialLanceProjectile.cs b/Projectiles/Melee/Spears/SpatialLanceProjectile.cs index c40c23add7..557fd86ab5 100644 --- a/Projectiles/Melee/Spears/SpatialLanceProjectile.cs +++ b/Projectiles/Melee/Spears/SpatialLanceProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; @@ -36,8 +36,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override float ForwardSpeed => 0.6f; public override Action EffectBeforeReelback => (proj) => { - Projectile.NewProjectile(Projectile.Center.X + Projectile.velocity.X, Projectile.Center.Y + Projectile.velocity.Y, - Projectile.velocity.X, Projectile.velocity.Y, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetProjectileSource_FromThis(), Projectile.Center + Projectile.velocity, Projectile.velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); }; public override void ExtraBehavior() { diff --git a/Projectiles/Melee/Spears/StarnightLanceProjectile.cs b/Projectiles/Melee/Spears/StarnightLanceProjectile.cs index acb72b72b8..0eec6363a4 100644 --- a/Projectiles/Melee/Spears/StarnightLanceProjectile.cs +++ b/Projectiles/Melee/Spears/StarnightLanceProjectile.cs @@ -1,4 +1,4 @@ -using System; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override float ForwardSpeed => 0.95f; public override Action EffectBeforeReelback => (proj) => { - Projectile.NewProjectile(Projectile.Center.X + Projectile.velocity.X, Projectile.Center.Y + Projectile.velocity.Y, + Projectile.NewProjectile(Projectile.GetProjectileSource_FromThis(), Projectile.Center.X + Projectile.velocity.X, Projectile.Center.Y + Projectile.velocity.Y, Projectile.velocity.X * 2.4f, Projectile.velocity.Y * 2.4f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.8), Projectile.knockBack * 0.85f, Projectile.owner, 0f, 0f); }; public override void ExtraBehavior() diff --git a/Projectiles/Melee/Spears/StreamGougeProj.cs b/Projectiles/Melee/Spears/StreamGougeProj.cs index 4b038ffd7c..be56612f53 100644 --- a/Projectiles/Melee/Spears/StreamGougeProj.cs +++ b/Projectiles/Melee/Spears/StreamGougeProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Weapons.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.Kill(); } - public void DrawPortal(SpriteBatch spriteBatch, Vector2 drawPosition, float opacity) + public void DrawPortal(Vector2 drawPosition, float opacity) { Texture2D portalTexture = ModContent.Request("CalamityMod/Projectiles/Melee/StreamGougePortal").Value; Vector2 origin = portalTexture.Size() * 0.5f; @@ -179,7 +179,7 @@ namespace CalamityMod.Projectiles.Melee.Spears Main.spriteBatch.ExitShaderRegion(); // Draw the portal once ready. - DrawPortal(Main.spriteBatch, portalDrawPosition, portalOpacity); + DrawPortal(portalDrawPosition, portalOpacity); return false; } diff --git a/Projectiles/Melee/Spears/TenebreusTidesProjectile.cs b/Projectiles/Melee/Spears/TenebreusTidesProjectile.cs index 98dacc4938..0a325f2226 100644 --- a/Projectiles/Melee/Spears/TenebreusTidesProjectile.cs +++ b/Projectiles/Melee/Spears/TenebreusTidesProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; @@ -36,7 +36,8 @@ namespace CalamityMod.Projectiles.Melee.Spears public override float ForwardSpeed => 0.95f; public override Action EffectBeforeReelback => (proj) => { - Projectile.NewProjectile(Projectile.Center.X + Projectile.velocity.X, Projectile.Center.Y + Projectile.velocity.Y, Projectile.velocity.X * 2.4f, Projectile.velocity.Y * 2.4f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.65), Projectile.knockBack * 0.85f, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetProjectileSource_FromThis(), Projectile.Center.X + Projectile.velocity.X, Projectile.Center.Y + Projectile.velocity.Y, Projectile.velocity.X * 2.4f, Projectile.velocity.Y * 2.4f, + ModContent.ProjectileType(), (int)(Projectile.damage * 0.65), Projectile.knockBack * 0.85f, Projectile.owner, 0f, 0f); }; public override void ExtraBehavior() { diff --git a/Projectiles/Melee/Spears/TerraLanceProjectile.cs b/Projectiles/Melee/Spears/TerraLanceProjectile.cs index e2fde262db..92c89b76a9 100644 --- a/Projectiles/Melee/Spears/TerraLanceProjectile.cs +++ b/Projectiles/Melee/Spears/TerraLanceProjectile.cs @@ -1,4 +1,4 @@ -using System; +using System; using Terraria; using Terraria.ModLoader; using CalamityMod.Projectiles.BaseProjectiles; @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override float ForwardSpeed => 0.95f; public override Action EffectBeforeReelback => (proj) => { - Projectile.NewProjectile(Projectile.Center.X + Projectile.velocity.X, Projectile.Center.Y + Projectile.velocity.Y, + Projectile.NewProjectile(Projectile.GetProjectileSource_FromThis(), Projectile.Center.X + Projectile.velocity.X, Projectile.Center.Y + Projectile.velocity.Y, Projectile.velocity.X * 1.4f, Projectile.velocity.Y * 1.4f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.7), Projectile.knockBack * 0.7f, Projectile.owner, 0f, 0f); }; public override void ExtraBehavior() @@ -40,6 +40,7 @@ namespace CalamityMod.Projectiles.Melee.Spears Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 107, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); } + // TODO -- Use proper immunity variables to achieve this instead. public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.immune[Projectile.owner] = 5; diff --git a/Projectiles/Melee/Spears/UrchinSpearProjectile.cs b/Projectiles/Melee/Spears/UrchinSpearProjectile.cs index 8273a51915..c65a7d9d5a 100644 --- a/Projectiles/Melee/Spears/UrchinSpearProjectile.cs +++ b/Projectiles/Melee/Spears/UrchinSpearProjectile.cs @@ -1,4 +1,4 @@ -using System; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override float ForwardSpeed => 0.95f; public override Action EffectBeforeReelback => (proj) => { - Projectile.NewProjectile(Projectile.Center.X + Projectile.velocity.X, Projectile.Center.Y + Projectile.velocity.Y, + Projectile.NewProjectile(Projectile.GetProjectileSource_FromThis(), Projectile.Center.X + Projectile.velocity.X, Projectile.Center.Y + Projectile.velocity.Y, Projectile.velocity.X * 1.6f, Projectile.velocity.Y * 1.6f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * 0.5f, Projectile.owner, 0f, 0f); }; diff --git a/Projectiles/Melee/Spears/YateveoBloomSpear.cs b/Projectiles/Melee/Spears/YateveoBloomSpear.cs index 913e3ec167..ddc4f7a7e2 100644 --- a/Projectiles/Melee/Spears/YateveoBloomSpear.cs +++ b/Projectiles/Melee/Spears/YateveoBloomSpear.cs @@ -1,6 +1,8 @@ -using Terraria; +using Terraria; using Terraria.ID; using CalamityMod.Projectiles.BaseProjectiles; +using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Melee.Spears { public class YateveoBloomSpear : BaseSpearProjectile