From 6886466f498d97d740baadeecdbff4ea8bcd39b7 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Thu, 3 Jul 2025 15:18:05 -0400 Subject: [PATCH] Post-Plantera Calamity rogue --- Balancing/BalancingChangesManager.cs | 6 +- Items/Weapons/Rogue/Apoctolith.cs | 2 +- Items/Weapons/Rogue/BallisticPoisonBomb.cs | 2 +- Items/Weapons/Rogue/DefectiveSphere.cs | 23 ++----- Items/Weapons/Rogue/DuststormInABottle.cs | 8 +-- Items/Weapons/Rogue/FantasyTalisman.cs | 31 +++------ Items/Weapons/Rogue/FrostcrushValari.cs | 9 +-- Items/Weapons/Rogue/HeavenfallenStardisk.cs | 26 ++----- Items/Weapons/Rogue/LeonidProgenitor.cs | 30 +++----- Items/Weapons/Rogue/LeviathanTeeth.cs | 28 +++----- Items/Weapons/Rogue/PhantasmalRuin.cs | 5 +- Items/Weapons/Rogue/StellarKnife.cs | 5 +- Items/Weapons/Rogue/Whitewater.cs | 6 +- ...Mods.CalamityMod.Items.Weapons.Rogue.hjson | 1 - Projectiles/Ranged/Flash.cs | 68 +++---------------- Projectiles/Rogue/AuroradicalStar.cs | 43 ++++++------ Projectiles/Rogue/BallisticPoisonBombProj.cs | 41 ++--------- Projectiles/Rogue/DuststormCloud.cs | 1 - Projectiles/Rogue/DuststormCloudHitbox.cs | 8 ++- Projectiles/Rogue/DuststormInABottleProj.cs | 5 +- Projectiles/Rogue/FantasyTalismanProj.cs | 15 ++-- Projectiles/Rogue/FantasyTalismanStealth.cs | 17 ++--- Projectiles/Rogue/HeavenfallenEnergy.cs | 18 ++--- .../Rogue/HeavenfallenStardiskBoomerang.cs | 5 +- Projectiles/Rogue/LeonidCometSmall.cs | 41 +++++------ .../Rogue/LeonidProgenitorBombshell.cs | 36 ++++------ Projectiles/Rogue/LeviathanTooth.cs | 22 +++--- .../Rogue/MangroveChakramProjectile.cs | 7 +- Projectiles/Rogue/SamsaraSlicerProjectile.cs | 3 - Projectiles/Rogue/ValariBoomerang.cs | 1 - Projectiles/Rogue/WhitewaterProj.cs | 4 +- Projectiles/Rogue/WhitewaterSpear.cs | 2 +- 32 files changed, 161 insertions(+), 358 deletions(-) diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index 8747f98a41..9cb5eb02f0 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -216,9 +216,6 @@ namespace CalamityMod.Balancing // 35% resist to Aerial Bane. NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2BetsyArrow)))); - // 35% resist to Ballistic Poison Bomb's clouds. - NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); - // 35% resist to Icicle Arrows. NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); @@ -228,6 +225,9 @@ namespace CalamityMod.Balancing // 30% resist to Flak Kraken. NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + // 20% resist to Ballistic Poison Bomb's clouds. + NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); + // 20% resist to Cluster Rocket fragments. NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.ClusterFragmentsI, ProjectileID.ClusterFragmentsII)))); #endregion diff --git a/Items/Weapons/Rogue/Apoctolith.cs b/Items/Weapons/Rogue/Apoctolith.cs index aa889bdab6..ea514d1562 100644 --- a/Items/Weapons/Rogue/Apoctolith.cs +++ b/Items/Weapons/Rogue/Apoctolith.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 66; Item.height = 64; - Item.damage = 238; + Item.damage = 185; Item.shootSpeed = 18f; Item.shoot = ModContent.ProjectileType(); Item.useAnimation = Item.useTime = 26; diff --git a/Items/Weapons/Rogue/BallisticPoisonBomb.cs b/Items/Weapons/Rogue/BallisticPoisonBomb.cs index a5adb023be..f35c9df13b 100644 --- a/Items/Weapons/Rogue/BallisticPoisonBomb.cs +++ b/Items/Weapons/Rogue/BallisticPoisonBomb.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 30; Item.height = 38; - Item.damage = 72; + Item.damage = 57; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 26; diff --git a/Items/Weapons/Rogue/DefectiveSphere.cs b/Items/Weapons/Rogue/DefectiveSphere.cs index d9a4719ab1..2fc9f55986 100644 --- a/Items/Weapons/Rogue/DefectiveSphere.cs +++ b/Items/Weapons/Rogue/DefectiveSphere.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 42; Item.height = 44; - Item.damage = 116; + Item.damage = 85; Item.knockBack = 5f; Item.useAnimation = 13; Item.useTime = 13; @@ -37,22 +37,9 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool CanUseItem(Player player) { - if (player.Calamity().StealthStrikeAvailable()) - { - return true; - } - else if ((player.ownedProjectileCounts[Item.shoot] + player.ownedProjectileCounts[ProjectileType()] + player.ownedProjectileCounts[ProjectileType()] + player.ownedProjectileCounts[ProjectileType()]) >= 5) - { - return false; - } - else - { - return true; - } + return player.Calamity().StealthStrikeAvailable() || (player.ownedProjectileCounts[Item.shoot] + player.ownedProjectileCounts[ProjectileType()] + player.ownedProjectileCounts[ProjectileType()] + player.ownedProjectileCounts[ProjectileType()]) <= 4; } - public override float StealthDamageMultiplier => 0.9f; - public override void ModifyStatsExtra(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) { type = Utils.SelectRandom(Main.rand, new int[] @@ -72,13 +59,13 @@ namespace CalamityMod.Items.Weapons.Rogue { // This is done to allow looping when creating projectiles, instead of having to create many projectile/velocity variables all at once, // which this shoot code used to do. - int[] projectilesToShoot = new int[] - { + int[] projectilesToShoot = + [ ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType() - }; + ]; foreach (int projectileType in projectilesToShoot) { diff --git a/Items/Weapons/Rogue/DuststormInABottle.cs b/Items/Weapons/Rogue/DuststormInABottle.cs index cb31651c19..c2fcaf1af4 100644 --- a/Items/Weapons/Rogue/DuststormInABottle.cs +++ b/Items/Weapons/Rogue/DuststormInABottle.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 20; Item.height = 24; - Item.damage = 74; + Item.damage = 65; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 28; @@ -30,18 +30,16 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public static float StealthDmgMult = 0.6f; //So I can edit it directly via DragonLens instead of having to do math with CalTestHelpers - public override float StealthDamageMultiplier => StealthDmgMult; + public override float StealthDamageMultiplier => 0.6f; public static int CloudLifetime = 200; public static float DustRadius = 11f; - public static int StealthIframes = 9; //Cloud hitbox size manipulation public static float MaxSize = 3.2f; public static float MaxSizeStealth = 3.6f; public static float GrowthRate = 0.025f; - public static float StealthGrowhRate = 0.035f; + public static float StealthGrowthRate = 0.035f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Rogue/FantasyTalisman.cs b/Items/Weapons/Rogue/FantasyTalisman.cs index aad9aeb1d9..8b7f5a9494 100644 --- a/Items/Weapons/Rogue/FantasyTalisman.cs +++ b/Items/Weapons/Rogue/FantasyTalisman.cs @@ -14,11 +14,10 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 30; Item.height = 30; - Item.damage = 52; + Item.damage = 45; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = 25; - Item.useTime = 25; + Item.useTime = Item.useAnimation = 25; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 6f; Item.UseSound = SoundID.Item1; @@ -29,28 +28,18 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shootSpeed = 18f; Item.DamageType = RogueDamageClass.Instance; } - public override float StealthDamageMultiplier => 0.7f; + public override float StealthDamageMultiplier => 0.75f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (!player.Calamity().StealthStrikeAvailable()) + for (int i = -1; i <= 1; i++) { - for (int i = -1; i <= 1; i++) - { - Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i * 6f)); - Projectile.NewProjectile(source, position, perturbedSpeed, type, damage, knockback, player.whoAmI); - } + Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i * (player.Calamity().StealthStrikeAvailable() ? 5f : 6f))); + int shootCard = player.Calamity().StealthStrikeAvailable() ? ModContent.ProjectileType() : type; + int card = Projectile.NewProjectile(source, position, perturbedSpeed, shootCard, damage, knockback, player.whoAmI); + if (card.WithinBounds(Main.maxProjectiles) && player.Calamity().StealthStrikeAvailable()) + Main.projectile[card].Calamity().stealthStrike = true; } - else if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike - { - for (int i = -1; i <= 1; i++) - { - Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i * 5f)); - int stealth = Projectile.NewProjectile(source, position, perturbedSpeed, ModContent.ProjectileType(), damage, knockback, player.whoAmI); - if (stealth.WithinBounds(Main.maxProjectiles)) - Main.projectile[stealth].Calamity().stealthStrike = true; - } - } - return true; + return false; } public override void AddRecipes() diff --git a/Items/Weapons/Rogue/FrostcrushValari.cs b/Items/Weapons/Rogue/FrostcrushValari.cs index 43953e042c..b8342c3b62 100644 --- a/Items/Weapons/Rogue/FrostcrushValari.cs +++ b/Items/Weapons/Rogue/FrostcrushValari.cs @@ -18,9 +18,9 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 32; Item.height = 46; - Item.damage = 89; + Item.damage = 81; Item.DamageType = RogueDamageClass.Instance; - Item.useTime = Item.useAnimation = 17; + Item.useTime = Item.useAnimation = 19; Item.knockBack = 12; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; @@ -37,9 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 16; - public override float StealthDamageMultiplier => 0.9f; - public override float StealthKnockbackMultiplier => 0.3333f; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) @@ -48,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Rogue if (proj.WithinBounds(Main.maxProjectiles)) { Main.projectile[proj].Calamity().stealthStrike = true; - Main.projectile[proj].penetrate = 5; + Main.projectile[proj].penetrate = 4; } return false; } diff --git a/Items/Weapons/Rogue/HeavenfallenStardisk.cs b/Items/Weapons/Rogue/HeavenfallenStardisk.cs index 92de798ec1..6d7330fa64 100644 --- a/Items/Weapons/Rogue/HeavenfallenStardisk.cs +++ b/Items/Weapons/Rogue/HeavenfallenStardisk.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 44; Item.height = 48; - Item.damage = 165; + Item.damage = 160; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 40; @@ -32,26 +32,10 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - { - int proj = Projectile.NewProjectile(source, position, velocity.Length() * -Vector2.UnitY, type, damage, knockback, player.whoAmI); - if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); - if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike - { - int spread = 15; - for (int i = 0; i < 2; i++) - { - Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-8, 8), velocity.Y + Main.rand.Next(-2, 3)).RotatedBy(MathHelper.ToRadians(spread)); - Projectile.NewProjectile(source, position, perturbedspeed.Length() * -Vector2.UnitY, type, (int)(damage * 0.3), knockback, player.whoAmI); - if (proj.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); - } - spread -= Main.rand.Next(5, 8); - } - } - return false; - } + int proj = Projectile.NewProjectile(source, position, velocity.Length() * -Vector2.UnitY, type, damage, knockback, player.whoAmI); + if (proj.WithinBounds(Main.maxProjectiles)) + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; } } } diff --git a/Items/Weapons/Rogue/LeonidProgenitor.cs b/Items/Weapons/Rogue/LeonidProgenitor.cs index 7918e2eded..26a17019bd 100644 --- a/Items/Weapons/Rogue/LeonidProgenitor.cs +++ b/Items/Weapons/Rogue/LeonidProgenitor.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 32; Item.height = 48; - Item.damage = 64; + Item.damage = 57; Item.DamageType = RogueDamageClass.Instance; Item.knockBack = 3f; Item.useAnimation = Item.useTime = 15; @@ -38,9 +38,9 @@ namespace CalamityMod.Items.Weapons.Rogue Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; } + public override float StealthDamageMultiplier => 1.25f; public override bool AltFunctionUse(Player player) => true; - public override bool CanUseItem(Player player) { if (player.Calamity().StealthStrikeAvailable() || player.altFunctionUse != 2) @@ -56,35 +56,23 @@ namespace CalamityMod.Items.Weapons.Rogue return base.CanUseItem(player); } - public override float UseSpeedMultiplier(Player player) - { - if (player.Calamity().StealthStrikeAvailable() || player.altFunctionUse != 2) - return 1f; - return 0.8f; - } - - public override float StealthDamageMultiplier => 1.25f; - - public override void ModifyStatsExtra(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) - { - if (!player.Calamity().StealthStrikeAvailable() && player.altFunctionUse == 2) - damage = (int)(damage * 0.5f); - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable() || player.altFunctionUse != 2) { int bomb = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); - if (bomb.WithinBounds(Main.maxProjectiles)) - Main.projectile[bomb].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + if (bomb.WithinBounds(Main.maxProjectiles) && player.Calamity().StealthStrikeAvailable()) + { + Main.projectile[bomb].Calamity().stealthStrike = true; + Main.projectile[bomb].extraUpdates = 1; + } return false; } else { - for (float i = -2.5f; i < 3f; ++i) + for (int i = 0; i < 2; i++) { - Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i)); + Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians((i - 0.5f) * 2)); Projectile.NewProjectile(source, position, perturbedSpeed, type, damage, knockback, player.whoAmI); } } diff --git a/Items/Weapons/Rogue/LeviathanTeeth.cs b/Items/Weapons/Rogue/LeviathanTeeth.cs index adc05255a4..8ea4e320a3 100644 --- a/Items/Weapons/Rogue/LeviathanTeeth.cs +++ b/Items/Weapons/Rogue/LeviathanTeeth.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 36; Item.height = 38; - Item.damage = 44; + Item.damage = 43; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 9; @@ -21,7 +21,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.knockBack = 1f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; - Item.maxStack = 1; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; Item.shoot = ModContent.ProjectileType(); @@ -31,25 +30,16 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - bool stealthStrike = false; - if (player.Calamity().StealthStrikeAvailable()) - stealthStrike = true; - for (int i = 0; i < 2; i++) { - if (stealthStrike) - { - Projectile tooth = Projectile.NewProjectileDirect(source, position, velocity * 1.5f, type, damage, knockback * 12, player.whoAmI); - tooth.Calamity().stealthStrike = true; - tooth.timeLeft = 140; - tooth.ai[1] = 4; - return false; // This makes it not fire 2 with the for loop, thanks Angel lol - } - else - { - Projectile tooth = Projectile.NewProjectileDirect(source, position, velocity.RotatedByRandom(0.05f + i * 0.15f) * Main.rand.NextFloat(0.7f, 1f), type, damage, knockback, player.whoAmI); - tooth.ai[1] = Main.rand.Next(1, 3 + 1); - } + Projectile tooth = Projectile.NewProjectileDirect(source, position, velocity * 1.5f, type, damage, knockback * 12, player.whoAmI, 0f, 4f); + tooth.Calamity().stealthStrike = true; + tooth.timeLeft = 140; + } + else + { + for (int i = 0; i < 2; i++) + Projectile.NewProjectile(source, position, velocity.RotatedByRandom(0.05f + i * 0.15f) * Main.rand.NextFloat(0.7f, 1f), type, damage, knockback, player.whoAmI, 0f, Main.rand.Next(1, 3+1)); } return false; } diff --git a/Items/Weapons/Rogue/PhantasmalRuin.cs b/Items/Weapons/Rogue/PhantasmalRuin.cs index c00e7059f6..59195398eb 100644 --- a/Items/Weapons/Rogue/PhantasmalRuin.cs +++ b/Items/Weapons/Rogue/PhantasmalRuin.cs @@ -16,13 +16,12 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 108; Item.height = 114; - Item.damage = 152; + Item.damage = 140; Item.knockBack = 8f; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.noUseGraphic = true; - Item.useTime = 30; - Item.useAnimation = 30; + Item.useTime = Item.useAnimation = 30; Item.autoReuse = true; Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Rogue/StellarKnife.cs b/Items/Weapons/Rogue/StellarKnife.cs index b8f8e6eb71..abe77f582a 100644 --- a/Items/Weapons/Rogue/StellarKnife.cs +++ b/Items/Weapons/Rogue/StellarKnife.cs @@ -15,12 +15,11 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 32; Item.height = 34; - Item.damage = 82; + Item.damage = 69; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = 9; + Item.useTime = Item.useAnimation = 9; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 9; Item.knockBack = 4f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Weapons/Rogue/Whitewater.cs b/Items/Weapons/Rogue/Whitewater.cs index b8831ffa01..2f34530323 100644 --- a/Items/Weapons/Rogue/Whitewater.cs +++ b/Items/Weapons/Rogue/Whitewater.cs @@ -15,10 +15,10 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 36; Item.height = 40; - Item.damage = 120; + Item.damage = 80; Item.noMelee = true; Item.noUseGraphic = true; - Item.useTime = Item.useAnimation = 42; + Item.useTime = Item.useAnimation = 34; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 6.5f; Item.UseSound = SoundID.Item106 with { Volume = 0.7f }; @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override float StealthDamageMultiplier => 0.85f; + public override float StealthDamageMultiplier => 0.9f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 32d2bd1bff..0953bb0a49 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -449,7 +449,6 @@ FrostcrushValari: { ''' Fires a long ranged frosty boomerang that chips off homing icicles on hit Stealth strikes throw a boomerang which follows the cursor - This boomerang creates a freezing blast and chips off homing icicles on every hit ''' } diff --git a/Projectiles/Ranged/Flash.cs b/Projectiles/Ranged/Flash.cs index a5eb54f88e..861de2d98c 100644 --- a/Projectiles/Ranged/Flash.cs +++ b/Projectiles/Ranged/Flash.cs @@ -23,73 +23,21 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = -1; Projectile.timeLeft = 5; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; + Projectile.localNPCHitCooldown = -1; } public override void AI() { Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0.5f / 255f); Color dustColor = Projectile.ai[1] == 1f ? CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f) : default; - bool xflag = false; - bool yflag = false; - if (Projectile.velocity.X < 0f && Projectile.position.X < Projectile.ai[0]) - { - xflag = true; - } - if (Projectile.velocity.X > 0f && Projectile.position.X > Projectile.ai[0]) - { - xflag = true; - } - if (Projectile.velocity.Y < 0f && Projectile.position.Y < Projectile.ai[1]) - { - yflag = true; - } - if (Projectile.velocity.Y > 0f && Projectile.position.Y > Projectile.ai[1]) - { - yflag = true; - } - if (xflag && yflag) - { - Projectile.Kill(); - } - float projTimer = 25f; - if (Projectile.ai[0] > 180f) - { - projTimer -= (Projectile.ai[0] - 180f) / 2f; - } - if (projTimer <= 0f) - { - projTimer = 0f; - Projectile.Kill(); - } - projTimer *= 0.7f; - Projectile.ai[0] += 4f; - int timerCounter = 0; - while ((float)timerCounter < projTimer) - { - float rand1 = (float)Main.rand.Next(-30, 31); - float rand2 = (float)Main.rand.Next(-30, 31); - float rand3 = (float)Main.rand.Next(9, 27); - float randAdjust = (float)Math.Sqrt((double)(rand1 * rand1 + rand2 * rand2)); - randAdjust = rand3 / randAdjust; - rand1 *= randAdjust; - rand2 *= randAdjust; - int flashDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.PortalBoltTrail, 0f, 0f, 100, dustColor, 2f); - Dust dust = Main.dust[flashDust]; - dust.noGravity = true; - dust.position.X = Projectile.Center.X; - dust.position.Y = Projectile.Center.Y; - dust.position.X += (float)Main.rand.Next(-10, 11); - dust.position.Y += (float)Main.rand.Next(-10, 11); - dust.velocity.X = rand1; - dust.velocity.Y = rand2; - timerCounter++; - } - } + float randRot = Main.rand.NextFloat(MathHelper.TwoPi); - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(BuffID.Confused, 300); + for (int i = 0; i < 4; i++) + { + Vector2 dustVel = Vector2.UnitX.RotatedBy(MathHelper.PiOver2 * i + randRot) * 3f; + Dust flashDust = Dust.NewDustPerfect(Projectile.Center, DustID.PortalBoltTrail, dustVel, 100, dustColor, 1.5f); + flashDust.noGravity = true; + } } } } diff --git a/Projectiles/Rogue/AuroradicalStar.cs b/Projectiles/Rogue/AuroradicalStar.cs index ce88e9d5ee..3bded3c1c6 100644 --- a/Projectiles/Rogue/AuroradicalStar.cs +++ b/Projectiles/Rogue/AuroradicalStar.cs @@ -12,11 +12,11 @@ namespace CalamityMod.Projectiles.Rogue public class AuroradicalStar : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; - public int[] dustTypes = new int[] - { + public int[] dustTypes = + [ ModContent.DustType(), ModContent.DustType() - }; + ]; public override void SetStaticDefaults() { @@ -107,27 +107,23 @@ namespace CalamityMod.Projectiles.Rogue } } - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); - return false; - } - - public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, Projectile.alpha); - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 180); - OnHitEffect(target.Center, target.width); + OnHitEffect(target); } - - private void OnHitEffect(Vector2 targetPos, int width) + public override void OnHitPlayer(Player target, Player.HurtInfo info) + { + target.AddBuff(ModContent.BuffType(), 180); + OnHitEffect(target); + } + private void OnHitEffect(Entity target) { if (Projectile.Calamity().stealthStrike && Main.myPlayer == Projectile.owner) { - Vector2 pos = new Vector2(targetPos.X + width * 0.5f + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); - Vector2 velocity = (targetPos - pos) / 40f; - int comet = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 1.25), Projectile.knockBack, Projectile.owner); + Vector2 pos = new Vector2(target.Center.X + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); + Vector2 meteorVel = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(pos, target, 20f, 3); + int comet = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, meteorVel, ModContent.ProjectileType(), (int)(Projectile.damage * 1.25f), Projectile.knockBack, Projectile.owner); if (comet.WithinBounds(Main.maxProjectiles)) { Main.projectile[comet].DamageType = RogueDamageClass.Instance; @@ -136,12 +132,6 @@ namespace CalamityMod.Projectiles.Rogue } } - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(ModContent.BuffType(), 180); - OnHitEffect(target.Center, target.width); - } - public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item9, Projectile.position); @@ -166,5 +156,12 @@ namespace CalamityMod.Projectiles.Rogue } } } + + public override bool PreDraw(ref Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); + return false; + } + public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, Projectile.alpha); } } diff --git a/Projectiles/Rogue/BallisticPoisonBombProj.cs b/Projectiles/Rogue/BallisticPoisonBombProj.cs index f4d204e888..7300ceacc7 100644 --- a/Projectiles/Rogue/BallisticPoisonBombProj.cs +++ b/Projectiles/Rogue/BallisticPoisonBombProj.cs @@ -60,10 +60,9 @@ namespace CalamityMod.Projectiles.Rogue { Projectile.ExpandHitboxBy(128); SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - int spikeAmt = Main.rand.Next(3, 4+1); if (Projectile.owner == Main.myPlayer) { - for (int s = 0; s < spikeAmt; s++) + for (int s = 0; s < 3; s++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, 0f, Projectile.owner); @@ -72,7 +71,7 @@ namespace CalamityMod.Projectiles.Rogue for (int c = 0; c < cloudAmt; c++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 10f, 200f, 0.01f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75), 0f, Projectile.owner, 0f, Projectile.Calamity().stealthStrike ? 1f : 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.6f), 0f, Projectile.owner, 0f, Projectile.Calamity().stealthStrike ? 1f : 0f); } } for (int d = 0; d < 5; d++) @@ -99,42 +98,13 @@ namespace CalamityMod.Projectiles.Rogue Vector2 goreSource = Projectile.Center; int goreAmt = 3; Vector2 source = new Vector2(goreSource.X - 24f, goreSource.Y - 24f); - for (int goreIndex = 0; goreIndex < goreAmt; goreIndex++) + for (int goreIndex = 1; goreIndex <= goreAmt; goreIndex++) { - float velocityMult = 0.33f; - if (goreIndex < (goreAmt / 3)) - { - velocityMult = 0.66f; - } - if (goreIndex >= (2 * goreAmt / 3)) - { - velocityMult = 1f; - } - Mod mod = ModContent.GetInstance(); + float velocityMult = 0.33f * goreIndex; int type = Main.rand.Next(61, 64); - int smoke = Gore.NewGore(Projectile.GetSource_Death(), source, default, type, 1f); + int smoke = Gore.NewGore(Projectile.GetSource_Death(), source, Main.rand.NextVector2CircularEdge(2f, 2f), type, 1f); Gore gore = Main.gore[smoke]; gore.velocity *= velocityMult; - gore.velocity.X += 1f; - gore.velocity.Y += 1f; - type = Main.rand.Next(61, 64); - smoke = Gore.NewGore(Projectile.GetSource_Death(), source, default, type, 1f); - gore = Main.gore[smoke]; - gore.velocity *= velocityMult; - gore.velocity.X -= 1f; - gore.velocity.Y += 1f; - type = Main.rand.Next(61, 64); - smoke = Gore.NewGore(Projectile.GetSource_Death(), source, default, type, 1f); - gore = Main.gore[smoke]; - gore.velocity *= velocityMult; - gore.velocity.X += 1f; - gore.velocity.Y -= 1f; - type = Main.rand.Next(61, 64); - smoke = Gore.NewGore(Projectile.GetSource_Death(), source, default, type, 1f); - gore = Main.gore[smoke]; - gore.velocity *= velocityMult; - gore.velocity.X -= 1f; - gore.velocity.Y -= 1f; } } } @@ -144,7 +114,6 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Venom, 180); Projectile.Kill(); } - public override void OnHitPlayer(Player target, Player.HurtInfo info) { target.AddBuff(BuffID.Venom, 180); diff --git a/Projectiles/Rogue/DuststormCloud.cs b/Projectiles/Rogue/DuststormCloud.cs index 9c4201d233..6a920352e8 100644 --- a/Projectiles/Rogue/DuststormCloud.cs +++ b/Projectiles/Rogue/DuststormCloud.cs @@ -4,7 +4,6 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - [PierceResistException(onlyForSingleHitbox: true)] public class DuststormCloud : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; diff --git a/Projectiles/Rogue/DuststormCloudHitbox.cs b/Projectiles/Rogue/DuststormCloudHitbox.cs index 9629e274f1..2284071282 100644 --- a/Projectiles/Rogue/DuststormCloudHitbox.cs +++ b/Projectiles/Rogue/DuststormCloudHitbox.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.NPCs; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -9,6 +10,7 @@ using Terraria.Utilities; namespace CalamityMod.Projectiles.Rogue { + [PierceResistExceptionAttribute(true)] public class DuststormCloudHitbox : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; @@ -25,15 +27,15 @@ namespace CalamityMod.Projectiles.Rogue Projectile.timeLeft = DuststormInABottle.CloudLifetime; Projectile.DamageType = RogueDamageClass.Instance; Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 10; + Projectile.idStaticNPCHitCooldown = 12; } public override void AI() { if (Projectile.scale < (Projectile.ai[1] == 1 ? DuststormInABottle.MaxSizeStealth : DuststormInABottle.MaxSize)) { - Projectile.scale += (Projectile.ai[1] == 1 ? DuststormInABottle.StealthGrowhRate : DuststormInABottle.GrowthRate); - Projectile.ExpandHitboxBy(1 + (Projectile.ai[1] == 1 ? DuststormInABottle.StealthGrowhRate : DuststormInABottle.GrowthRate)); + Projectile.scale += Projectile.ai[1] == 1 ? DuststormInABottle.StealthGrowthRate : DuststormInABottle.GrowthRate; + Projectile.ExpandHitboxBy(1 + (Projectile.ai[1] == 1 ? DuststormInABottle.StealthGrowthRate : DuststormInABottle.GrowthRate)); } } diff --git a/Projectiles/Rogue/DuststormInABottleProj.cs b/Projectiles/Rogue/DuststormInABottleProj.cs index 7a012612b4..61d51c1462 100644 --- a/Projectiles/Rogue/DuststormInABottleProj.cs +++ b/Projectiles/Rogue/DuststormInABottleProj.cs @@ -68,11 +68,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, stealth ? velocity * 1.2f : velocity, ModContent.ProjectileType(), 0, 0, Projectile.owner, stealth ? 1f : 0f, (float)Main.rand.Next(-45, 1)); } int hitbox = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * 0.5f, Projectile.owner); - if (hitbox.WithinBounds(Main.maxProjectiles) && Projectile.Calamity().stealthStrike) //Inherit stealth flag and less iframes - { + if (hitbox.WithinBounds(Main.maxProjectiles) && Projectile.Calamity().stealthStrike) //Inherit stealth flag Main.projectile[hitbox].ai[1] = 1; - Main.projectile[hitbox].idStaticNPCHitCooldown = DuststormInABottle.StealthIframes; - } } } } diff --git a/Projectiles/Rogue/FantasyTalismanProj.cs b/Projectiles/Rogue/FantasyTalismanProj.cs index 378c484662..382f3e0603 100644 --- a/Projectiles/Rogue/FantasyTalismanProj.cs +++ b/Projectiles/Rogue/FantasyTalismanProj.cs @@ -43,16 +43,13 @@ namespace CalamityMod.Projectiles.Rogue Projectile.StickyProjAI(4); if (Projectile.ai[0] == 1f) { - if (Projectile.timeLeft % 10 == 0) + if (Projectile.timeLeft % 40 == 0) { - if (Main.rand.NextBool(8)) + Projectile ghost = CalamityUtils.SpawnOrb(Projectile, (int)(Projectile.damage * 0.3f), ProjectileID.SpectreWrath, 1000f, 4f); + if (ghost.whoAmI.WithinBounds(Main.maxProjectiles)) { - Projectile ghost = CalamityUtils.SpawnOrb(Projectile, (int)(Projectile.damage * 0.4f), ProjectileID.SpectreWrath, 1000f, 4f); - if (ghost.whoAmI.WithinBounds(Main.maxProjectiles)) - { - ghost.DamageType = RogueDamageClass.Instance; - ghost.penetrate = 1; - } + ghost.DamageType = RogueDamageClass.Instance; + ghost.penetrate = 1; } } } @@ -64,7 +61,7 @@ namespace CalamityMod.Projectiles.Rogue return false; } - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => Projectile.ModifyHitNPCSticky(12); + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => Projectile.ModifyHitNPCSticky(9); public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { diff --git a/Projectiles/Rogue/FantasyTalismanStealth.cs b/Projectiles/Rogue/FantasyTalismanStealth.cs index 9be29c003d..35b90af917 100644 --- a/Projectiles/Rogue/FantasyTalismanStealth.cs +++ b/Projectiles/Rogue/FantasyTalismanStealth.cs @@ -45,16 +45,13 @@ namespace CalamityMod.Projectiles.Rogue Projectile.StickyProjAI(4); if (Projectile.ai[0] == 1f) { - if (Projectile.timeLeft % 4 == 0) + if (Projectile.timeLeft % 20 == 0) { - if (Main.rand.NextBool(3)) + Projectile ghost = CalamityUtils.SpawnOrb(Projectile, (int)(Projectile.damage * 0.3f), ProjectileID.SpectreWrath, 1000f, 4f); + if (ghost.whoAmI.WithinBounds(Main.maxProjectiles)) { - Projectile ghost = CalamityUtils.SpawnOrb(Projectile, (int)(Projectile.damage * 0.2f), ProjectileID.SpectreWrath, 1000f, 4f); - if (ghost.whoAmI.WithinBounds(Main.maxProjectiles)) - { - ghost.DamageType = RogueDamageClass.Instance; - ghost.penetrate = 1; - } + ghost.DamageType = RogueDamageClass.Instance; + ghost.penetrate = 1; } } } @@ -66,7 +63,7 @@ namespace CalamityMod.Projectiles.Rogue return false; } - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => Projectile.ModifyHitNPCSticky(9); + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => Projectile.ModifyHitNPCSticky(6); public override void OnKill(int timeLeft) { @@ -74,7 +71,7 @@ namespace CalamityMod.Projectiles.Rogue { for (int j = 0; j <= 3; j++) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Main.rand.NextVector2Circular(12f, 12f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Main.rand.NextVector2Circular(12f, 12f), ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/Rogue/HeavenfallenEnergy.cs b/Projectiles/Rogue/HeavenfallenEnergy.cs index 74056c7f34..a9668c1d72 100644 --- a/Projectiles/Rogue/HeavenfallenEnergy.cs +++ b/Projectiles/Rogue/HeavenfallenEnergy.cs @@ -20,41 +20,31 @@ namespace CalamityMod.Projectiles.Rogue Projectile.height = 8; Projectile.friendly = true; Projectile.ignoreWater = true; - Projectile.penetrate = 1; - Projectile.timeLeft = 300; + Projectile.tileCollide = false; + Projectile.timeLeft = 240; Projectile.DamageType = RogueDamageClass.Instance; } public override void AI() { - int constant = 14; int coolDust; Projectile.ai[0]++; if (Projectile.ai[0] % 2 == 0) { - if (Projectile.ai[0] % 4 == 0) - { - coolDust = Dust.NewDust(Projectile.position, Projectile.width - constant * 2, Projectile.height - constant * 2, ModContent.DustType(), 0f, 0f, 100, default, 1.5f); - } - else - { - coolDust = Dust.NewDust(Projectile.position, Projectile.width - constant * 2, Projectile.height - constant * 2, ModContent.DustType(), 0f, 0f, 100, default, 1.5f); - } + int dustType = Projectile.ai[0] % 4 == 0 ? ModContent.DustType() : ModContent.DustType(); + coolDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, Alpha: 100, Scale: 1.5f); Main.dust[coolDust].noGravity = true; Main.dust[coolDust].velocity *= 0.1f; Main.dust[coolDust].velocity += Projectile.velocity * 0.5f; } float homingRange = raining ? 480f : 240f; - if (Projectile.ai[0] >= 15f || raining) CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, homingRange, 12f, 20f); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); - public override bool? CanDamage() => Projectile.ai[0] >= 15f || raining; } } diff --git a/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs b/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs index aa6704c88a..caa3ce9873 100644 --- a/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs +++ b/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs @@ -36,8 +36,8 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (Projectile.Calamity().stealthStrike && Projectile.timeLeft % 20f == 4f) // every 5 frames - CalamityUtils.ProjectileRain(Projectile.GetSource_FromThis(), Projectile.Center, 400f, 100f, 500f, 800f, 29f, ModContent.ProjectileType(), Projectile.damage / 6, Projectile.knockBack * 0.5f, Projectile.owner); + if (Projectile.Calamity().stealthStrike && Projectile.timeLeft % 20f == 4f) + CalamityUtils.ProjectileRain(Projectile.GetSource_FromThis(), Projectile.Center, 400f, 100f, 500f, 800f, 29f, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack * 0.5f, Projectile.owner); if (Projectile.alpha > 0) { @@ -136,7 +136,6 @@ namespace CalamityMod.Projectiles.Rogue } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 240); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 240); public override void OnKill(int timeLeft) diff --git a/Projectiles/Rogue/LeonidCometSmall.cs b/Projectiles/Rogue/LeonidCometSmall.cs index 9bcf7cc54e..6835ca8f01 100644 --- a/Projectiles/Rogue/LeonidCometSmall.cs +++ b/Projectiles/Rogue/LeonidCometSmall.cs @@ -28,19 +28,6 @@ namespace CalamityMod.Projectiles.Rogue Projectile.alpha = 255; } - public override bool PreDraw(ref Color lightColor) - { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), Projectile.rotation, tex.Size() / 2, Projectile.scale, SpriteEffects.None, 0); - return false; - } - - public override void PostDraw(Color lightColor) - { - Texture2D tex = ModContent.Request("CalamityMod/Items/Weapons/Rogue/LeonidProgenitorGlow").Value; - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, tex.Size() / 2, Projectile.scale, SpriteEffects.None, 0); - } - public override void AI() { Projectile.alpha -= 25; @@ -55,15 +42,10 @@ namespace CalamityMod.Projectiles.Rogue }); if (Main.rand.NextBool()) { - int index = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), 1.6f); + int index = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), 1.3f); Main.dust[index].noGravity = true; } - if (Main.rand.NextBool()) - { - int index = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Smoke, 0f, 0f, 100, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), 1.6f); - Main.dust[index].noGravity = true; - } - int index1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), 1.2f); + int index1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f)); Main.dust[index1].noGravity = true; Main.dust[index1].velocity *= 2f; Main.dust[index1].velocity += Projectile.velocity; @@ -84,11 +66,14 @@ namespace CalamityMod.Projectiles.Rogue Projectile.rotation += Projectile.velocity.X * 0.1f; } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnKill(int timeLeft) { if (Projectile.owner != Main.myPlayer) return; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage / 3, 0f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage / 2, 0f, Projectile.owner); Projectile.ai[1] = -1f; Projectile.position = Projectile.Center; Projectile.width = Projectile.height = 40; @@ -124,8 +109,16 @@ namespace CalamityMod.Projectiles.Rogue } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); - - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), Projectile.rotation, tex.Size() / 2, Projectile.scale, SpriteEffects.None, 0); + return false; + } + public override void PostDraw(Color lightColor) + { + Texture2D tex = ModContent.Request("CalamityMod/Items/Weapons/Rogue/LeonidProgenitorGlow").Value; + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, tex.Size() / 2, Projectile.scale, SpriteEffects.None, 0); + } } } diff --git a/Projectiles/Rogue/LeonidProgenitorBombshell.cs b/Projectiles/Rogue/LeonidProgenitorBombshell.cs index 507789ee06..606bf24ff4 100644 --- a/Projectiles/Rogue/LeonidProgenitorBombshell.cs +++ b/Projectiles/Rogue/LeonidProgenitorBombshell.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.netUpdate = true; } } - Projectile.velocity.Y += 0.2f; + Projectile.velocity.Y += 0.2f / (float)Projectile.MaxUpdates; } Projectile.rotation += Projectile.velocity.X * 0.1f; } @@ -76,45 +76,35 @@ namespace CalamityMod.Projectiles.Rogue { int flash = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, 0f, Projectile.owner, 0f, 1f); if (flash.WithinBounds(Main.maxProjectiles)) - { Main.projectile[flash].DamageType = RogueDamageClass.Instance; - } - - Vector2 pos = new Vector2(Projectile.Center.X + Projectile.width * 0.5f + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); - Vector2 velocity = (Projectile.Center - pos) / 40f; - int dmg = Projectile.damage / 2; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, velocity, ModContent.ProjectileType(), dmg, Projectile.knockBack, Projectile.owner, 0f, 0.5f + (float)Main.rand.NextDouble() * 0.3f); } } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 240); - StealthStrikeEffect(); + SpawnExtraProjectiles(target); } public override void OnHitPlayer(Player target, Player.HurtInfo info) { target.AddBuff(ModContent.BuffType(), 240); - StealthStrikeEffect(); + SpawnExtraProjectiles(target); } - private void StealthStrikeEffect() + private void SpawnExtraProjectiles(Entity target) { - if (!Projectile.Calamity().stealthStrike || Main.myPlayer != Projectile.owner) - return; - - Vector2 spinningpoint = new Vector2(0f, 6f); - float radian45 = MathHelper.ToRadians(45f); - int cometAmt = 5; - float cometSpread = -(radian45 * 2f) / (cometAmt - 1f); - for (int projIndex = 0; projIndex < cometAmt; ++projIndex) + Vector2 pos = new Vector2(target.Center.X + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); + Vector2 meteorVel = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(pos, target, 20f, 3); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, meteorVel, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f, 0.5f + Main.rand.NextFloat() * 0.3f); + + if (Projectile.Calamity().stealthStrike) { - int index2 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, spinningpoint.RotatedBy((double)radian45 + (double)cometSpread * (double)projIndex, new Vector2()), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, -1f); - Projectile proj = Main.projectile[index2]; - for (int index3 = 0; index3 < Projectile.localNPCImmunity.Length; ++index3) + for (int i = 0; i < 5; i++) { - proj.localNPCImmunity[index3] = Projectile.localNPCImmunity[index3]; + Vector2 cometPos = new Vector2(target.Center.X + Main.rand.Next(-100, 101), target.Center.Y - 150f - Main.rand.Next(30)); + Vector2 cometVel = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(pos, target, 18f, 2); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), cometPos, cometVel, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, -1f); } } } diff --git a/Projectiles/Rogue/LeviathanTooth.cs b/Projectiles/Rogue/LeviathanTooth.cs index 2851230620..fee710f9ef 100644 --- a/Projectiles/Rogue/LeviathanTooth.cs +++ b/Projectiles/Rogue/LeviathanTooth.cs @@ -151,14 +151,16 @@ namespace CalamityMod.Projectiles.Rogue { if (time % 3 == 0) { - Projectile tooth = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), spawnPos, jawVel, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack / 12, Projectile.owner, 0, 0, Projectile.velocity.X > 0 ? 1 : -1); - tooth.Calamity().stealthStrike = true; - tooth.timeLeft = 120; - tooth.extraUpdates = 0; - tooth.usesIDStaticNPCImmunity = true; - tooth.usesLocalNPCImmunity = false; - tooth.idStaticNPCHitCooldown = 5; - tooth.ai[1] = Main.rand.Next(1, 3 + 1); + if (Main.myPlayer == Projectile.owner) + { + Projectile tooth = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), spawnPos, jawVel, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack / 12, Projectile.owner, 0, Main.rand.Next(1, 3 + 1), Projectile.velocity.X > 0 ? 1 : -1); + tooth.Calamity().stealthStrike = true; + tooth.timeLeft = 120; + tooth.extraUpdates = 0; + tooth.usesLocalNPCImmunity = false; + tooth.usesIDStaticNPCImmunity = true; + tooth.idStaticNPCHitCooldown = 8; + } jawline = !jawline; } if (time % 2 == 0) @@ -229,9 +231,7 @@ namespace CalamityMod.Projectiles.Rogue public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - if (Projectile.Calamity().stealthStrike) - modifiers.SourceDamage *= Projectile.ai[1] == 4 ? 0.6f : 0.5f; - else + if (!Projectile.Calamity().stealthStrike) modifiers.SourceDamage *= target == chosenTarget ? 1 : (canStick ? 0.2f : 0.5f); } public override bool? CanDamage() => canDamage ? null : false; diff --git a/Projectiles/Rogue/MangroveChakramProjectile.cs b/Projectiles/Rogue/MangroveChakramProjectile.cs index 81f4212305..4bed2c6456 100644 --- a/Projectiles/Rogue/MangroveChakramProjectile.cs +++ b/Projectiles/Rogue/MangroveChakramProjectile.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Rogue Lighting.AddLight(Projectile.Center, 0f, 0.25f, 0f); if (Main.rand.NextBool(5)) - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.JungleSpore, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.ChlorophyteWeapon, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); if (Projectile.Calamity().stealthStrike) { @@ -39,8 +39,8 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.timeLeft < 240) Projectile.Kill(); - Projectile.localAI[0] += Main.rand.Next(0, 3); - if (Projectile.localAI[0] >= 10f) + Projectile.localAI[0] += Main.rand.Next(1, 3); + if (Projectile.localAI[0] >= 20f) { Projectile.localAI[0] = 0f; Vector2 flowerSpawnPosition = Projectile.Center + Main.rand.NextVector2Square(-10f, 10f); @@ -58,7 +58,6 @@ namespace CalamityMod.Projectiles.Rogue } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Venom, 120); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Venom, 120); } } diff --git a/Projectiles/Rogue/SamsaraSlicerProjectile.cs b/Projectiles/Rogue/SamsaraSlicerProjectile.cs index 1433f615a4..6d50d7f4ce 100644 --- a/Projectiles/Rogue/SamsaraSlicerProjectile.cs +++ b/Projectiles/Rogue/SamsaraSlicerProjectile.cs @@ -54,7 +54,6 @@ namespace CalamityMod.Projectiles.Rogue { width = 20; height = 20; - return base.TileCollideStyle(ref width, ref height, ref fallThrough, ref hitboxCenterFrac); } @@ -219,8 +218,6 @@ namespace CalamityMod.Projectiles.Rogue } else { - //Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Items/Weapons/Rogue/SamsaraSlicerGlow").Value, Projectile.Center - Main.screenPosition + randVec, tex.Frame(), new Color(0f, 1f, 0f, 0f), Projectile.rotation, tex.Frame().Center(), 1f, SpriteEffects.None); - Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Items/Weapons/Rogue/SamsaraSlicerGlow").Value, Projectile.Center - Main.screenPosition + randVec, tex.Frame(), new Color(0f, 1f, 0f, 0f), Projectile.rotation, tex.Frame().Center(), 1f, SpriteEffects.None); } return false; diff --git a/Projectiles/Rogue/ValariBoomerang.cs b/Projectiles/Rogue/ValariBoomerang.cs index 3107b69692..f285f7f0ae 100644 --- a/Projectiles/Rogue/ValariBoomerang.cs +++ b/Projectiles/Rogue/ValariBoomerang.cs @@ -145,7 +145,6 @@ namespace CalamityMod.Projectiles.Rogue Projectile.velocity.Y -= acceleration; } - // Delete the projectile if it touches its owner. if (Main.myPlayer == Projectile.owner) if (Projectile.Hitbox.Intersects(owner.Hitbox)) diff --git a/Projectiles/Rogue/WhitewaterProj.cs b/Projectiles/Rogue/WhitewaterProj.cs index cd84b2652d..35c966e664 100644 --- a/Projectiles/Rogue/WhitewaterProj.cs +++ b/Projectiles/Rogue/WhitewaterProj.cs @@ -164,7 +164,6 @@ namespace CalamityMod.Projectiles.Rogue { if (Projectile.Hitbox.Intersects(Owner.Hitbox)) { - Projectile.Kill(); if (Projectile.Calamity().stealthStrike) { foreach (Projectile p in Main.ActiveProjectiles) @@ -175,8 +174,9 @@ namespace CalamityMod.Projectiles.Rogue p.timeLeft = 30; } } - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.3f), Projectile.knockBack, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.25f), Projectile.knockBack, Projectile.owner, 0f, 0f); } + Projectile.Kill(); } } } diff --git a/Projectiles/Rogue/WhitewaterSpear.cs b/Projectiles/Rogue/WhitewaterSpear.cs index c16a59f091..c0967afa4f 100644 --- a/Projectiles/Rogue/WhitewaterSpear.cs +++ b/Projectiles/Rogue/WhitewaterSpear.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.extraUpdates = 5; Projectile.DamageType = RogueDamageClass.Instance; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 15 * Projectile.MaxUpdates; + Projectile.localNPCHitCooldown = 20 * Projectile.MaxUpdates; } public override void AI()