From ebe0b6a5913ff82c0009a2e19ace7e2011ba29bf Mon Sep 17 00:00:00 2001 From: Storm2103 Date: Wed, 13 Sep 2023 23:03:14 -0600 Subject: [PATCH] More stuff for Old Reaper --- CalamityLists.cs | 1 + Items/Weapons/Rogue/TheOldReaper.cs | 6 +- ...Mods.CalamityMod.Items.Weapons.Rogue.hjson | 2 +- Projectiles/Rogue/ReaperProjectile.cs | 63 +++++++++---------- 4 files changed, 34 insertions(+), 38 deletions(-) diff --git a/CalamityLists.cs b/CalamityLists.cs index 031a8077a5..eddcc27405 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -1996,6 +1996,7 @@ namespace CalamityMod ProjectileType(), ProjectileType(), ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), diff --git a/Items/Weapons/Rogue/TheOldReaper.cs b/Items/Weapons/Rogue/TheOldReaper.cs index 37480ed23e..cf8a340823 100644 --- a/Items/Weapons/Rogue/TheOldReaper.cs +++ b/Items/Weapons/Rogue/TheOldReaper.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetDefaults() { Item.width = 106; - Item.damage = 143; + Item.damage = 157; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 22; @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.autoReuse = true; Item.height = 104; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 20f; + Item.shootSpeed = 14f; Item.DamageType = RogueDamageClass.Instance; Item.value = CalamityGlobalItem.Rarity13BuyPrice; @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Rogue int spread = 15; for (int i = 0; i < 3; i++) { - Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-3,4), velocity.Y + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread)); + Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-2,3), velocity.Y + Main.rand.Next(-2,3)).RotatedBy(MathHelper.ToRadians(spread)); int proj = Projectile.NewProjectile(source, position, perturbedspeed, type, damage, knockback, player.whoAmI); if (proj.WithinBounds(Main.maxProjectiles)) { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 5410504bb3..4529ea1314 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -1238,7 +1238,7 @@ TheOldReaper: { Tooltip: ''' Throws a homing reaper scythe that shreds enemies - Stealth strikes throw four at once + Stealth strikes throw three at once 'Slice 'n dice' ''' } diff --git a/Projectiles/Rogue/ReaperProjectile.cs b/Projectiles/Rogue/ReaperProjectile.cs index 1d461a3b1e..0e39f76276 100644 --- a/Projectiles/Rogue/ReaperProjectile.cs +++ b/Projectiles/Rogue/ReaperProjectile.cs @@ -5,6 +5,9 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Particles; +using Terraria.Graphics.Shaders; +using Microsoft.Xna.Framework.Graphics; namespace CalamityMod.Projectiles.Rogue { @@ -15,27 +18,28 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; + ProjectileID.Sets.TrailingMode[Projectile.type] = 2; } public override void SetDefaults() { - Projectile.width = 60; - Projectile.height = 60; + Projectile.width = 100; + Projectile.height = 100; Projectile.friendly = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.penetrate = -1; Projectile.extraUpdates = 2; - Projectile.timeLeft = Projectile.MaxUpdates * 90; + Projectile.timeLeft = Projectile.MaxUpdates * 120; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 18; // can't hit too fast, but can hit many many times + Projectile.localNPCHitCooldown = Projectile.MaxUpdates * 9; // can't hit too fast, but can hit many many times Projectile.DamageType = RogueDamageClass.Instance; } public override void AI() { + Projectile.rotation += 0.4f; if (Projectile.soundDelay == 0) { Projectile.soundDelay = 8; @@ -51,11 +55,12 @@ namespace CalamityMod.Projectiles.Rogue Projectile.localAI[0] = 1f; Projectile.ai[1] = 0f; Projectile.netUpdate = true; + //Projectile.velocity *= 1.1f; } // Initial homing before landing a hit. else - CalamityUtils.HomeInOnNPC(Projectile, true, 250f, 12f, 14f); + CalamityUtils.HomeInOnNPC(Projectile, true, 250f, 14f, 14f); } // Homing after landing a hit. This homing repeatedly turns on and off. @@ -97,57 +102,47 @@ namespace CalamityMod.Projectiles.Rogue } } + if (foundTarget && Projectile.ai[0] == 0f) { - Vector2 delta = homingTarget - Projectile.Center; - float distance = delta.Length(); - delta /= distance; - - if (distance > 200f) - { - float homingScalar = 11f; - delta *= homingScalar; - Projectile.velocity = (Projectile.velocity * 40f + delta) / 41f; - } - else - { - float homingScalar = 3.6f; - delta *= -homingScalar; // yes this is intentionally backwards - Projectile.velocity = (Projectile.velocity * 40f + delta) / 41f; - } + float angularTurnSpeed = 0.35f; + float angleToTargetCoords = Projectile.AngleTo(homingTarget); + Projectile.velocity = Projectile.velocity.ToRotation().AngleTowards(angleToTargetCoords, angularTurnSpeed).ToRotationVector2() * Main.rand.NextFloat(14f, 18f); } if (Projectile.ai[1] > 0f) - { - Projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (Projectile.ai[1] > 40f) + Projectile.ai[1] += (float)Main.rand.Next(1, 5); + if (Projectile.ai[1] > 30f) { Projectile.ai[1] = 0f; Projectile.netUpdate = true; } + if (Projectile.ai[0] == 0f) { if (Projectile.ai[1] == 0f && foundTarget && homingRange < 500f) { Projectile.ai[1] += 1f; if (Main.myPlayer == Projectile.owner) - { Projectile.ai[0] = 1f; - Vector2 value20 = homingTarget - Projectile.Center; - value20.Normalize(); - Projectile.velocity = value20 * 8f; - Projectile.netUpdate = true; - } } } } - Projectile.rotation += 0.3f; } public override bool PreDraw(ref Color lightColor) { CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + + //Outline WIP + Main.spriteBatch.EnterShaderRegion(); + GameShaders.Misc["CalamityMod:BasicTint"].UseColor(Main.hslToRgb(82f, 1f, 0.50f)); //Using RGB directly fails, gotta use HSL + GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(Main.rand.NextFloat(0.3f, 0.7f)); + GameShaders.Misc["CalamityMod:BasicTint"].Apply(); + var texture = ModContent.Request("CalamityMod/Items/Weapons/Rogue/TheOldReaper").Value; + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, Color.LimeGreen, Projectile.rotation, Projectile.Size / 2f, Projectile.scale, Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); + Main.spriteBatch.ExitShaderRegion(); + return false; }