From 975cc6b13d678eb9a9904135ceb6df56477311cd Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Mon, 30 Mar 2026 19:47:50 -0500 Subject: [PATCH] paleo / partisan pt 1 --- Items/Weapons/Rogue/ProfanedPartisan.cs | 7 +- Items/Weapons/Rogue/SpearofPaleolith.cs | 5 +- ...Mods.CalamityMod.Items.Weapons.Rogue.hjson | 19 +- .../Mods.CalamityMod.Projectiles.Rogue.hjson | 1 + Projectiles/Rogue/EclipseFragment.png | Bin 5097 -> 5334 bytes Projectiles/Rogue/EclipseSpear.cs | 2 +- Projectiles/Rogue/EclipsesFallSpear.cs | 2 +- Projectiles/Rogue/FossilShardThrown.cs | 29 +++- Projectiles/Rogue/ProfanedPartisanFlare.cs | 124 +++++++++++++ Projectiles/Rogue/ProfanedPartisanProj.cs | 164 ++++++++++++------ Projectiles/Rogue/ProfanedPartisanSpear.cs | 90 ++++------ Projectiles/Rogue/SpearofPaleolithProj.cs | 89 ++++++---- 12 files changed, 380 insertions(+), 152 deletions(-) create mode 100644 Projectiles/Rogue/ProfanedPartisanFlare.cs diff --git a/Items/Weapons/Rogue/ProfanedPartisan.cs b/Items/Weapons/Rogue/ProfanedPartisan.cs index 5814d9db9d..11510f690f 100644 --- a/Items/Weapons/Rogue/ProfanedPartisan.cs +++ b/Items/Weapons/Rogue/ProfanedPartisan.cs @@ -11,19 +11,20 @@ namespace CalamityMod.Items.Weapons.Rogue { public class ProfanedPartisan : RogueWeapon { + public static int ShardBaseDamage => 88; public override void SetDefaults() { Item.width = 68; Item.height = 68; - Item.damage = 222; + Item.damage = 333; Item.crit = 15; Item.knockBack = 8f; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.noUseGraphic = true; - Item.useTime = 18; - Item.useAnimation = 18; + Item.useTime = 21; + Item.useAnimation = 21; Item.UseSound = SoundID.Item1; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); diff --git a/Items/Weapons/Rogue/SpearofPaleolith.cs b/Items/Weapons/Rogue/SpearofPaleolith.cs index 519c1c8cb2..32a36636f4 100644 --- a/Items/Weapons/Rogue/SpearofPaleolith.cs +++ b/Items/Weapons/Rogue/SpearofPaleolith.cs @@ -9,11 +9,12 @@ namespace CalamityMod.Items.Weapons.Rogue { public class SpearofPaleolith : RogueWeapon { + public static int ShardBaseDamage => 25; public override void SetDefaults() { Item.width = 54; Item.height = 54; - Item.damage = 65; + Item.damage = 70; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 27; @@ -25,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 35f; + Item.shootSpeed = 6f; Item.DamageType = RogueDamageClass.Instance; } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 79545b4952..24cfc9a19e 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -358,8 +358,10 @@ EclipsesFall: { DisplayName: Eclipse's Fall Tooltip: ''' - Summons spears from the sky on hit - Stealth strikes impale enemies and summon a constant barrage of spears over time + Throws a javelin that shatters into fragments of primordial light upon enemy hits + If more than 20 fragments exist, the oldest fragments will seek out enemies to attack + Stealth strikes coalsce fragments into an eclipse spear, gaining power based on the number of fragments + The eclipse spear will pierce though any enemy hit by Eclipse's Fall 'When the sun goes dark, you will know judgement' ''' } @@ -865,8 +867,10 @@ ProfanedPartisan: { DisplayName: Profaned Partisan Tooltip: ''' - Fires an unholy spear that explodes on enemy hits - Stealth strikes spawn smaller spears to fly along side it + Throws a profaned spear that splits into miniature spears upon hitting an enemy + Stealth strikes remain impaled in an enemy for 10 seconds + While an enemy is impaled, all spears that strike them instead erupt into homing fireballs + Inflicts [cbuff:CalamityMod/HolyFlames] ''' } @@ -1086,9 +1090,10 @@ SpearofPaleolith: { DisplayName: Spear of Paleolith Tooltip: ''' - Throws an ancient spear that shatters enemy armor - Spears rain fossil shards as they travel - Stealth strikes travel slower but further, raining more fossil shards + Throws an ancient spear that shatters into fossil shards upon hitting an enemy + Stealth strikes remain impaled in the enemy for 10 seconds + While an enemy is impaled, all spears that strike them erupt into even more fossil shards + Inflicts [cbuff:CalamityMod/ArmorCrunch] ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson index 4a9d6a9c32..74ea651bdb 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson @@ -339,3 +339,4 @@ EclipseGuandao.DisplayName: Eclipse Guandao EclipsesFallSpear.DisplayName: Eclipses Fall Spear EclipseSpark.DisplayName: Eclipse Spark EclipseSpear.DisplayName: Eclipse Spear +ProfanedPartisanFlare.DisplayName: Profaned Partisan Flare diff --git a/Projectiles/Rogue/EclipseFragment.png b/Projectiles/Rogue/EclipseFragment.png index 93296c6a1e958f87d706f2e6c3d1322550eea3dc..fc489108d07fce3d76d96c5523b5ab3ce9a1fe14 100644 GIT binary patch delta 5101 zcmVI(iuxktoFlY50~hjP{LCx??J_X?ae znftg7-90)GHF00BS* zko$8y<+%5{DOazPa<2oq1IFZD3!FN+`>GwvwNUS=lZ!nf-E|=rha~sWkH4Yg!RXPC zzaa;ho*q@X`!@E+2jk>p88=36q>e`Kk2H$!y%6u3ivR%BqNMt%SlWoS4FKfwJOW6= z#UG=c0SdrAOg+!SRSkS(^nY)CsB;LD1ONwvhlhIF18n~H@AzRqRW}`7GH?YiRj z=1aT%G`a1~6&=~cjJ}*pYE}@e0YGz`{Py9F(8=TP+ORLb`d5aZRDbBOKelJE*-n<+ z(L)U6y8Z#IFT?Kx;h5cfU5oWwPdv=_=1c0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/EclipseSpear.cs +++ b/Projectiles/Rogue/EclipseSpear.cs @@ -149,7 +149,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - Projectile.ai[0] = -1; + //Projectile.ai[0] = -1; Projectile.netUpdate = true; } diff --git a/Projectiles/Rogue/EclipsesFallSpear.cs b/Projectiles/Rogue/EclipsesFallSpear.cs index f6857c153e..80da75fd77 100644 --- a/Projectiles/Rogue/EclipsesFallSpear.cs +++ b/Projectiles/Rogue/EclipsesFallSpear.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetDefaults() { - Projectile.width = Projectile.height = 40; + Projectile.width = Projectile.height = 50; Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.tileCollide = false; diff --git a/Projectiles/Rogue/FossilShardThrown.cs b/Projectiles/Rogue/FossilShardThrown.cs index dc34689d70..4dce7a9c4e 100644 --- a/Projectiles/Rogue/FossilShardThrown.cs +++ b/Projectiles/Rogue/FossilShardThrown.cs @@ -1,4 +1,6 @@ using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Items.Weapons.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -14,17 +16,30 @@ namespace CalamityMod.Projectiles.Rogue Projectile.width = 10; Projectile.height = 10; Projectile.friendly = true; - Projectile.penetrate = 1; - Projectile.aiStyle = ProjAIStyleID.Arrow; - Projectile.timeLeft = 90; - AIType = ProjectileID.WoodenArrowFriendly; + Projectile.penetrate = 4; + Projectile.aiStyle = ProjAIStyleID.GroundProjectile; + Projectile.timeLeft = 600; + AIType = ProjectileID.SpikyBall; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.localNPCHitCooldown = 15; + Projectile.usesLocalNPCImmunity = true; } - public override void AI() + public override bool PreAI() { - Projectile.rotation += Projectile.velocity.Y; - Projectile.velocity.Y *= 1.05f; + if (Projectile.originalDamage == 0) + { + Projectile.originalDamage = SpearofPaleolith.ShardBaseDamage; + Projectile.ContinuouslyUpdateDamageStats = true; + } + + Projectile.velocity.X *= 0.975f; + return true; + } + public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) + { + fallThrough = false; + return true; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 60); diff --git a/Projectiles/Rogue/ProfanedPartisanFlare.cs b/Projectiles/Rogue/ProfanedPartisanFlare.cs new file mode 100644 index 0000000000..231f372217 --- /dev/null +++ b/Projectiles/Rogue/ProfanedPartisanFlare.cs @@ -0,0 +1,124 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.NPCs.Providence; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Boss; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Graphics.PackedVector; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class ProfanedPartisanFlare : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Rogue"; + public int timer = 0; + public override string Texture => "CalamityMod/Projectiles/Boss/HolyFire"; + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 4; + ProjectileID.Sets.CultistIsResistantTo[Type] = true; + } + public override void SetDefaults() + { + Projectile.width = 20; + Projectile.height = 20; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.penetrate = 3; + Projectile.extraUpdates = 0; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 30; + Projectile.timeLeft = 600; + Projectile.tileCollide = false; + } + + public override bool? CanHitNPC(NPC target) + { + return true; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 120); + } + + NPC target = null; + public override void AI() + { + + if (Projectile.originalDamage == 0) + { + Projectile.originalDamage = ProfanedPartisan.ShardBaseDamage; + Projectile.ContinuouslyUpdateDamageStats = true; + } + if (target != null && Projectile.localNPCImmunity[target.whoAmI] <= 0 && target.active && !target.dontTakeDamage) + { + Projectile.Calamity().HomingTarget = target.whoAmI; + var dis = Projectile.Distance(target.Center); + Projectile.velocity = Projectile.velocity.ToRotation().AngleLerp(Projectile.DirectionTo(target.Center).ToRotation(), (Projectile.Distance(target.Center) < 160 ? 0.1f + (1 - dis/160)*0.4f : 0.1f)).ToRotationVector2() * Projectile.velocity.Length(); + } + else + { + target = GetTargetInRange(2000); + } + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + } + public override void OnKill(int timeLeft) + { + Color hiColor = new Color(255, 155, 25, 255); + Color loColor = new Color(255, 0, 0, 0); + + for (int i = 0; i < 25; i++) + { + GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center, new Vector2(Main.rand.NextFloat(10), 0).RotatedByRandom(MathHelper.TwoPi), false, 10, Main.rand.NextFloat(0.8f, 1.2f), hiColor)); + } + + GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomCircle", Vector2.One, 0f, 0.5f, 0.1f, 4)); + + for (float i = 0; i < 1; i += 0.25f) + { + GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, hiColor, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.02f * i, 0.075f * i, 24)); + } + GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, hiColor, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.02f, 0.045f, 16)); + + SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact.WithPitchOffset(0.6f), Projectile.Center); + SoundEngine.PlaySound(SoundID.Item100.WithPitchOffset(0.4f), Projectile.Center); + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + var frame = tex.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, frame.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + return false; + } + + NPC GetTargetInRange(float range) + { + var player = Main.player[Projectile.owner]; + { + NPC gotTarget = null; + float currentDistance = range; + foreach (var npc in Main.ActiveNPCs) + { + if (Projectile.localNPCImmunity[npc.whoAmI] > 0) + continue; + var myDistance = npc.Distance(Projectile.Center); + + if (npc.CanBeChasedBy() && myDistance < currentDistance) + { + currentDistance = myDistance; + gotTarget = npc; + } + } + return gotTarget; + } + } + } +} diff --git a/Projectiles/Rogue/ProfanedPartisanProj.cs b/Projectiles/Rogue/ProfanedPartisanProj.cs index b7c056a4ad..68b13ed38f 100644 --- a/Projectiles/Rogue/ProfanedPartisanProj.cs +++ b/Projectiles/Rogue/ProfanedPartisanProj.cs @@ -1,5 +1,8 @@ -using CalamityMod.Buffs.DamageOverTime; +using System.Linq; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Boss; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -13,10 +16,13 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/ProfanedPartisan"; + + public static int Lifetime => 600; + public int ExplodeTime => 60 * Projectile.MaxUpdates; public override void SetStaticDefaults() { ProjectileID.Sets.TrailCacheLength[Type] = 6; - ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.TrailingMode[Type] = -1; } public override void SetDefaults() @@ -24,47 +30,91 @@ namespace CalamityMod.Projectiles.Rogue Projectile.width = 20; Projectile.height = 20; Projectile.friendly = true; - Projectile.penetrate = 9; - Projectile.timeLeft = 600; - Projectile.extraUpdates = 3; - Projectile.tileCollide = false; + Projectile.penetrate = 1; + Projectile.extraUpdates = 5; + Projectile.timeLeft = Lifetime * Projectile.MaxUpdates; Projectile.ignoreWater = true; Projectile.DamageType = RogueDamageClass.Instance; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 12; + Projectile.stopsDealingDamageAfterPenetrateHits = true; + } + public float StuckEnemyID + { + get { return Projectile.ai[0]; } + set { Projectile.ai[0] = value; } + } + public float StuckEnemyDistance + { + get { return Projectile.ai[1]; } + set { Projectile.ai[1] = value; } + } + public float StuckEnemyRotation + { + get { return Projectile.ai[2]; } + set { Projectile.ai[2] = value; } } public override void AI() { - if (Projectile.ai[0] < 0.4f) + Lighting.AddLight(Projectile.Center, 1f, 0.8f, 0.2f); + if (StuckEnemyID > 0) { - Projectile.ai[0] += 0.1f; + Projectile.tileCollide = false; + if (!Main.npc[(int)StuckEnemyID - 1].active) + { + StuckEnemyID = 0; + Projectile.velocity = -Vector2.UnitY.RotatedByRandom(0.25f) * Main.rand.NextFloat(0, 1f); + Projectile.tileCollide = true; + return; + } + Projectile.Center = Main.npc[(int)StuckEnemyID - 1].Center + Vector2.UnitX.RotatedBy(StuckEnemyRotation) * StuckEnemyDistance; + return; } - else + else if (Projectile.damage == 0) //after running out of penetrate hits, if not impaled or dead { - Projectile.tileCollide = true; + Projectile.velocity *= 0.975f; + float intensity = 1 - Projectile.timeLeft / (float)ExplodeTime; + Projectile.position += Main.rand.NextVector2CircularEdge(intensity, intensity); + + if (Projectile.timeLeft == 1) + { + + Color hiColor = new Color(255, 155, 25, 255); + Color loColor = new Color(255, 0, 0, 0); + + for (int i = 0; i < 25; i++) + { + GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center, new Vector2(Main.rand.NextFloat(10), 0).RotatedByRandom(MathHelper.TwoPi), false, 10, Main.rand.NextFloat(0.8f, 1.2f), hiColor)); + } + + GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomCircle", Vector2.One, 0f, 0.5f, 0.1f, 4)); + + for (float i = 0; i < 1; i += 0.25f) + { + GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, hiColor, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.02f * i, 0.075f * i, 24)); + } + GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, hiColor, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.02f, 0.045f, 16)); + + SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact.WithPitchOffset(0.6f), Projectile.Center); + SoundEngine.PlaySound(SoundID.Item100.WithPitchOffset(0.4f), Projectile.Center); + if (Main.myPlayer == Projectile.owner) + { + for (var i = 0; i < 3; i++) + { + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, (Projectile.rotation - MathHelper.PiOver4).ToRotationVector2().RotatedBy((i - 1) * 0.25f + Main.rand.NextFloat(-0.1f, 0.1f)) * 24f, ModContent.ProjectileType(), 0, Projectile.knockBack, Projectile.owner, 0f, 0f); + } + } + } + return; } - //Backwards projectile fix - Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); - Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); - //Rotating 45 degrees if shooting right - if (Projectile.spriteDirection == 1) - { - Projectile.rotation += MathHelper.ToRadians(45f); - DrawOffsetX = -26; - DrawOriginOffsetX = 13; - DrawOriginOffsetY = 2; - } - //Rotating 45 degrees if shooting right - if (Projectile.spriteDirection == -1) - { - Projectile.rotation -= MathHelper.ToRadians(45f); - DrawOffsetX = 2; - DrawOriginOffsetX = -13; - DrawOriginOffsetY = 2; - } + Projectile.velocity *= 0.998f; + if (Projectile.timeLeft < (Lifetime - 45)*Projectile.MaxUpdates) + Projectile.velocity.Y += 0.02f; + + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; if (Main.rand.NextBool(3)) { int d = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.ProfanedFire, Projectile.velocity.X, Projectile.velocity.Y, 100, default, 1.1f); @@ -72,20 +122,6 @@ namespace CalamityMod.Projectiles.Rogue Main.dust[d].velocity *= 0.3f; Main.dust[d].velocity += Projectile.velocity * 0.85f; } - Lighting.AddLight(Projectile.Center, 1f, 0.8f, 0.2f); - - if (Projectile.Calamity().stealthStrike) //Stealth strike - { - Vector2 spearPosition = new Vector2(Projectile.Center.X + Main.rand.NextFloat(-15f, 15f), Projectile.Center.Y + Main.rand.NextFloat(-15f, 15f)); - Vector2 spearSpeed = Projectile.velocity; - if (Projectile.timeLeft % 18 == 0) - { - int projID = ModContent.ProjectileType(); - int spearDamage = (int)(Projectile.damage * 0.4f); - float spearKB = 1f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), spearPosition, spearSpeed, projID, spearDamage, spearKB, Projectile.owner); - } - } } public override void OnKill(int timeLeft) @@ -95,20 +131,48 @@ namespace CalamityMod.Projectiles.Rogue Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 50, default, 2.6f); } SoundEngine.PlaySound(SoundID.Item45, Projectile.position); - - int projID = ModContent.ProjectileType(); - int explosionDamage = (int)(Projectile.damage * 0.8f); - float explosionKB = 8f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, projID, explosionDamage, explosionKB, Projectile.owner); } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); + float glowIntensity = Projectile.damage == 0 && StuckEnemyID == 0 ? 4f * (1-(Projectile.timeLeft/(float)ExplodeTime)) : 0f; + Projectile.DrawProjectileWithBackglow(Color.Yellow, lightColor, glowIntensity); return false; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + Projectile.tileCollide = false; + if (Projectile.Calamity().stealthStrike) + { + StuckEnemyID = target.whoAmI + 1; + StuckEnemyDistance = Projectile.Distance(target.Center); + StuckEnemyRotation = Projectile.DirectionFrom(target.Center).ToRotation(); + Projectile.timeLeft = Lifetime * Projectile.MaxUpdates; + } + else + { + Projectile.timeLeft = ExplodeTime; + } + bool strongSplit = Main.projectile.Any(x => x.active && x.owner == Projectile.owner && x.type == Projectile.type && x.ai[0] == (target.whoAmI + 1)); + int splitType = strongSplit ? ModContent.ProjectileType() : ModContent.ProjectileType(); + if (!strongSplit) + for (var i = 0; i < 3; i++) + { + var p = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, (Projectile.rotation - MathHelper.PiOver4).ToRotationVector2().RotatedBy((i-1)*0.25f + Main.rand.NextFloat(-0.1f,0.1f)) * 10, splitType, (int)(Projectile.damage * 0.25), Projectile.knockBack, Projectile.owner, 0f, 0f); + p.hostile = false; + p.friendly = true; + p.DamageType = Projectile.DamageType; + if (strongSplit) + p.Calamity().conditionalHomingRange = 600; + p.localNPCImmunity[target.whoAmI] = 60; + } + target.AddBuff(ModContent.BuffType(), 180); + if (!strongSplit) + { + Projectile.Kill(); + } + } public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); } diff --git a/Projectiles/Rogue/ProfanedPartisanSpear.cs b/Projectiles/Rogue/ProfanedPartisanSpear.cs index 0f9ab63c40..0c9a9b8ab3 100644 --- a/Projectiles/Rogue/ProfanedPartisanSpear.cs +++ b/Projectiles/Rogue/ProfanedPartisanSpear.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.NPCs.Providence; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -10,9 +11,6 @@ namespace CalamityMod.Projectiles.Rogue public class ProfanedPartisanSpear : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; - public int timer = 0; - - public override void SetStaticDefaults() => ProjectileID.Sets.CultistIsResistantTo[Type] = true; public override void SetDefaults() { Projectile.width = 10; @@ -20,72 +18,60 @@ namespace CalamityMod.Projectiles.Rogue Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.DamageType = RogueDamageClass.Instance; - Projectile.penetrate = -1; - Projectile.extraUpdates = 3; + Projectile.penetrate = 5; + Projectile.extraUpdates = 0; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; + Projectile.localNPCHitCooldown = -1; Projectile.timeLeft = 600; } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - if (Projectile.ai[1] != 1f) - { - if (Projectile.velocity.X != oldVelocity.X) - { - Projectile.velocity.X = -oldVelocity.X; - } - if (Projectile.velocity.Y != oldVelocity.Y) - { - Projectile.velocity.Y = -oldVelocity.Y; - } - Projectile.ai[1] = 1f; - Projectile.ai[0] = 1f; - Projectile.extraUpdates = 2; - if (Projectile.timeLeft > 280) - Projectile.timeLeft = 280; - } - return false; - } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 180); - OnHitEffects(); } public override void OnHitPlayer(Player target, Player.HurtInfo info) { target.AddBuff(ModContent.BuffType(), 180); - OnHitEffects(); - } - - private void OnHitEffects() - { - if (Projectile.ai[1] != 1f) - { - Projectile.velocity.X *= -1f; - Projectile.velocity.Y *= -1f; - Projectile.ai[1] = 1f; - Projectile.ai[0] = 1f; - Projectile.extraUpdates = 2; - if (Projectile.timeLeft > 280) - Projectile.timeLeft = 280; - } } public override void AI() { - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - - if (Projectile.ai[0] == 1f) - timer++; - if (timer >= 5) - Projectile.penetrate = 1; - if (timer >= 10) + float timeGateValue = 30f; + if (Projectile.ai[0] <= 0f) //Copied from HolySpear.cs { - CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 7f, 20f); + Projectile.ai[1] += 1f; + + float slowGateValue = 25f; + float fastGateValue = 10f; + float minVelocity = 2f; + float maxVelocity = minVelocity * 5f; + float extremeVelocity = maxVelocity * 2f; + float deceleration = 0.9f; + float acceleration = 2f; + + if (Projectile.localAI[1] >= timeGateValue) + { + if (Projectile.velocity.Length() < extremeVelocity) + Projectile.velocity *= acceleration; + } + else + { + if (Projectile.ai[1] <= slowGateValue) + { + if (Projectile.velocity.Length() > minVelocity) + Projectile.velocity *= deceleration; + } + else if (Projectile.ai[1] < slowGateValue + fastGateValue) + { + if (Projectile.velocity.Length() < maxVelocity) + Projectile.velocity *= acceleration; + } + else + Projectile.ai[1] = 0f; + } } + + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Rogue/SpearofPaleolithProj.cs b/Projectiles/Rogue/SpearofPaleolithProj.cs index 1ddf1453bf..f818062d6a 100644 --- a/Projectiles/Rogue/SpearofPaleolithProj.cs +++ b/Projectiles/Rogue/SpearofPaleolithProj.cs @@ -1,4 +1,5 @@ -using CalamityMod.Buffs.StatDebuffs; +using System.Linq; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -11,14 +12,7 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/SpearofPaleolith"; - private bool stealthInit = false; - - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Type] = 6; - ProjectileID.Sets.TrailingMode[Type] = 0; - } - + public static int Lifetime => 600; public override void SetDefaults() { Projectile.width = 12; @@ -26,33 +20,51 @@ namespace CalamityMod.Projectiles.Rogue Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.penetrate = 1; - Projectile.aiStyle = ProjAIStyleID.StickProjectile; - Projectile.timeLeft = 600; - AIType = ProjectileID.BoneJavelin; + Projectile.extraUpdates = 5; + Projectile.timeLeft = Lifetime * Projectile.MaxUpdates; Projectile.DamageType = RogueDamageClass.Instance; } - + public float StuckEnemyID + { + get { return Projectile.ai[0]; } + set { Projectile.ai[0] = value; } + } + public float StuckEnemyDistance + { + get { return Projectile.ai[1]; } + set { Projectile.ai[1] = value; } + } + public float StuckEnemyRotation + { + get { return Projectile.ai[2]; } + set { Projectile.ai[2] = value; } + } public override void AI() { - if (Projectile.Calamity().stealthStrike && !stealthInit) + if (StuckEnemyID > 0) { - Projectile.velocity *= 0.5f; - Projectile.timeLeft = 1800; - stealthInit = true; + Projectile.tileCollide = false; + if (!Main.npc[(int)StuckEnemyID - 1].active) + { + StuckEnemyID = 0; + Projectile.velocity = -Vector2.UnitY.RotatedByRandom(0.25f) * Main.rand.NextFloat(0, 1f); + Projectile.tileCollide = true; + return; + } + Projectile.Center = Main.npc[(int)StuckEnemyID - 1].Center + Vector2.UnitX.RotatedBy(StuckEnemyRotation) * StuckEnemyDistance; + return; } - if (Main.rand.NextBool(4)) + Projectile.velocity *= 0.998f; + if (Projectile.timeLeft < (Lifetime - 25) * Projectile.MaxUpdates) + Projectile.velocity.Y += 0.02f; + + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; + if (Main.rand.NextBool(20)) { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Teleporter, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); } - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.ToRadians(45f); - if (Projectile.timeLeft % 3 == 0) - { - if (Projectile.owner == Main.myPlayer) - { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5), Projectile.knockBack, Projectile.owner, 0f, 0f); - } - } + } public override bool PreDraw(ref Color lightColor) @@ -63,13 +75,32 @@ namespace CalamityMod.Projectiles.Rogue public override void OnKill(int timeLeft) { - for (int i = 0; i <= 10; i++) + for (int i = 0; i <= 5; i++) { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Teleporter, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Teleporter, Projectile.oldVelocity.X*2.5f, Projectile.oldVelocity.Y*2.5f); } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (Projectile.Calamity().stealthStrike) + { + Projectile.stopsDealingDamageAfterPenetrateHits = true; + StuckEnemyID = target.whoAmI + 1; + StuckEnemyDistance = Projectile.Distance(target.Center); + StuckEnemyRotation = Projectile.DirectionFrom(target.Center).ToRotation(); + Projectile.timeLeft = Lifetime * Projectile.MaxUpdates; + } + + bool strongSplit = Main.projectile.Any(x => x.active && x.owner == Projectile.owner && x.type == Projectile.type && x.ai[0] == (target.whoAmI + 1)); + int shardCount = strongSplit ? 5 : 3; + for (var i = 0; i < shardCount; i++) + { + var p = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, new Vector2(0,-1).RotatedByRandom(1) * (strongSplit ? 10 : 7.5f), ModContent.ProjectileType(), 0 /*Shard dmg is set in its AI*/, Projectile.knockBack, Projectile.owner, 0f, 0f); + p.localNPCImmunity[target.whoAmI] = 30; + } + target.AddBuff(ModContent.BuffType(), 120); + } public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); }