diff --git a/Items/Weapons/Melee/CosmicShiv.cs b/Items/Weapons/Melee/CosmicShiv.cs index 518e84bb8c..1b47f5e4f5 100644 --- a/Items/Weapons/Melee/CosmicShiv.cs +++ b/Items/Weapons/Melee/CosmicShiv.cs @@ -20,16 +20,16 @@ namespace CalamityMod.Items.Weapons.Melee Item.noUseGraphic = true; Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Rapier; - Item.damage = 300; + Item.damage = 240; Item.DamageType = DamageClass.Melee; - Item.useAnimation = Item.useTime = 38; + Item.useAnimation = Item.useTime = 40; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 2.4f; Item.knockBack = 9f; Item.UseSound = SoundID.Item1; Item.value = CalamityGlobalItem.Rarity14BuyPrice; Item.rare = ModContent.RarityType(); - Item.Calamity().donorItem = true; // revertusernamechange on Discord (Yatagarasu) + Item.Calamity().donorItem = true; // revertusernamechange on Discord (Yatagarasu) } public override bool MeleePrefix() => true; @@ -43,4 +43,4 @@ namespace CalamityMod.Items.Weapons.Melee Register(); } } -} \ No newline at end of file +} diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 40dd176f1a..84b22f4560 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -288,8 +288,9 @@ CosmicShiv: { DisplayName: Cosmic Shiv Tooltip: ''' - Fires a cosmic beam that homes in on enemies - Upon hitting an enemy, a barrage of offscreen objects home in on the enemy as well as raining stars + Fires a cosmic star that homes in on enemies + Upon hitting an enemy, a barrage of blades will persistently strike + Landing more stars causes more blades to strike ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index bd6fe3dde3..d91c560b7c 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -65,8 +65,10 @@ CosmicBolt.DisplayName: Cosmic Bolt CosmicDischargeFlail.DisplayName: Cosmic Discharge CosmicIceBurst.DisplayName: Cosmic Ice CosmicOrb.DisplayName: Cosmic Orb +CosmicShivAura.DisplayName: Cosmic Shiv Aura CosmicShivBall.DisplayName: Cosmic Energy CosmicShivBlade.DisplayName: Cosmic Beam +CosmicShivTrail.DisplayName: Cosmic Shiv Trail CosmicSpiritBomb1.DisplayName: Cosmic Bomb CosmicSpiritBomb2.DisplayName: Cosmic Bomb CosmicSpiritBomb3.DisplayName: Cosmic Bomb diff --git a/Projectiles/Melee/CosmicShivAura.cs b/Projectiles/Melee/CosmicShivAura.cs index 39e903edfb..fbfe918ea9 100644 --- a/Projectiles/Melee/CosmicShivAura.cs +++ b/Projectiles/Melee/CosmicShivAura.cs @@ -1,71 +1,71 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using CalamityMod.Buffs.DamageOverTime; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Melee -{ - public class CosmicShivAura : ModProjectile - { - public new string LocalizationCategory => "Projectiles.Melee"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public readonly int SwordsAverageDelay = 40; - public readonly int SwordsRandomOffset = 15; - public int CurrentSwordTimer; - public NPC target; - - public override void SetDefaults() - { - Projectile.width = 2; - Projectile.height = 2; - Projectile.tileCollide = false; - Projectile.ignoreWater = true; - Projectile.penetrate = -1; - Projectile.timeLeft = 300; - } - - public override void OnSpawn(IEntitySource source) - { - if (Main.npc[(int)Projectile.ai[0]] is not null || Main.npc[(int)Projectile.ai[0]].active) - target = Main.npc[(int)Projectile.ai[0]]; // Convert target.whoAmI to object - } - - // ai[0] for ID of target to follow until the end of projectile's lifespan or the target cannot be found - // ai[1] for sword timer - public override void AI() - { - // Unexist with target - if (target is null || !target.active) { - Projectile.Kill(); - } - - Projectile.Center = Main.npc[(int)Projectile.ai[0]].Center; // Stay with target - - if (Projectile.ai[1] == CurrentSwordTimer) - { - Vector2 randomDirection = Main.rand.NextFloat(0, MathHelper.TwoPi).ToRotationVector2(); - randomDirection.Normalize(); - int randomDistance = Main.rand.Next(200, 426); - Vector2 spawnPos = Projectile.Center + (randomDirection * randomDistance); - Vector2 velocity = Vector2.Normalize(Projectile.Center - spawnPos) * Utils.GetLerpValue(-100, 426, randomDistance, clamped: true) * 20f; // Sword moves a bit slower if spawned closer, moves faster if spawned further - Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos.X, spawnPos.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * 0.8f, Projectile.owner, randomDistance); - Projectile.ai[1] = 0; // Reset timer - CurrentSwordTimer = Main.rand.Next(SwordsAverageDelay - SwordsRandomOffset, SwordsAverageDelay + SwordsRandomOffset); // Determine when next sword will spawn - } - - Projectile.ai[1]++; - } - - // The aura itself should not do contact damage - public override bool? CanDamage() => false; - } -} +using System; +using System.Collections.Generic; +using System.Configuration; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class CosmicShivAura : ModProjectile + { + public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public readonly int SwordsAverageDelay = 40; + public readonly int SwordsRandomOffset = 15; + public int CurrentSwordTimer; + public NPC target; + + public override void SetDefaults() + { + Projectile.width = 2; + Projectile.height = 2; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.penetrate = -1; + Projectile.timeLeft = 240; + } + + public override void OnSpawn(IEntitySource source) + { + if (Main.npc[(int)Projectile.ai[0]] is not null || Main.npc[(int)Projectile.ai[0]].active) + target = Main.npc[(int)Projectile.ai[0]]; // Convert target.whoAmI to object + } + + // ai[0] for ID of target to follow until the end of projectile's lifespan or the target cannot be found + // ai[1] for sword timer + public override void AI() + { + // Unexist with target + if (target is null || !target.active) { + Projectile.Kill(); + } + + Projectile.Center = Main.npc[(int)Projectile.ai[0]].Center; // Stay with target + + if (Projectile.ai[1] == CurrentSwordTimer) + { + Vector2 randomDirection = Main.rand.NextFloat(0, MathHelper.TwoPi).ToRotationVector2(); + randomDirection.Normalize(); + int randomDistance = Main.rand.Next(200, 426); + Vector2 spawnPos = Projectile.Center + (randomDirection * randomDistance); + Vector2 velocity = Vector2.Normalize(Projectile.Center - spawnPos) * Utils.GetLerpValue(-100, 426, randomDistance, clamped: true) * 20f; // Sword moves a bit slower if spawned closer, moves faster if spawned further + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos.X, spawnPos.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * 0.8f, Projectile.owner, randomDistance); + Projectile.ai[1] = 0; // Reset timer + CurrentSwordTimer = Main.rand.Next(SwordsAverageDelay - SwordsRandomOffset, SwordsAverageDelay + SwordsRandomOffset); // Determine when next sword will spawn + } + + Projectile.ai[1]++; + } + + // The aura itself should not do contact damage + public override bool? CanDamage() => false; + } +} diff --git a/Projectiles/Melee/CosmicShivBlade.cs b/Projectiles/Melee/CosmicShivBlade.cs index 29b208bbbe..22c1daba21 100644 --- a/Projectiles/Melee/CosmicShivBlade.cs +++ b/Projectiles/Melee/CosmicShivBlade.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.timeLeft = 6000; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.extraUpdates = 2; + Projectile.extraUpdates = 3; Projectile.alpha = 0; Projectile.scale = 1.2f; }