diff --git a/Items/Weapons/Melee/RoyalKnivesMelee.cs b/Items/Weapons/Melee/RoyalKnivesMelee.cs deleted file mode 100644 index a54dc4ae65..0000000000 --- a/Items/Weapons/Melee/RoyalKnivesMelee.cs +++ /dev/null @@ -1,113 +0,0 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Hybrid; -using CalamityMod.Tiles.Furniture.CraftingStations; -using Microsoft.Xna.Framework; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Melee -{ - public class RoyalKnivesMelee : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Illustrious Knives"); - Tooltip.SetDefault("Throws a flurry of homing knives that can heal the user"); - } - - public override void SetDefaults() - { - item.width = 18; - item.damage = 2000; - item.melee = true; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 12; - item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 12; - item.knockBack = 3f; - item.UseSound = SoundID.Item39; - item.autoReuse = true; - item.height = 20; - item.value = Item.buyPrice(5, 0, 0, 0); - item.rare = 10; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 9f; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; - } - - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); - Vector2 vector3 = Main.MouseWorld - vector2; - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - num78 *= num80; - num79 *= num80; - int num146 = 4; - if (Main.rand.NextBool(2)) - { - num146++; - } - if (Main.rand.NextBool(4)) - { - num146++; - } - if (Main.rand.NextBool(6)) - { - num146++; - } - if (Main.rand.NextBool(8)) - { - num146++; - } - for (int num147 = 0; num147 < num146; num147++) - { - float num148 = num78; - float num149 = num79; - float num150 = 0.05f * (float)num147; - num148 += (float)Main.rand.Next(-35, 36) * num150; - num149 += (float)Main.rand.Next(-35, 36) * num150; - num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); - num80 = num72 / num80; - num148 *= num80; - num149 *= num80; - float x4 = vector2.X; - float y4 = vector2.Y; - int knife = Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 0f); - Main.projectile[knife].Calamity().forceMelee = true; - } - return false; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ModContent.ItemType(), 3); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddTile(ModContent.TileType()); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} diff --git a/Items/Weapons/Melee/RoyalKnivesMelee.png b/Items/Weapons/Melee/RoyalKnivesMelee.png deleted file mode 100644 index 4d31893202..0000000000 Binary files a/Items/Weapons/Melee/RoyalKnivesMelee.png and /dev/null differ diff --git a/Items/Weapons/Rogue/RoyalKnives.cs b/Items/Weapons/Rogue/RoyalKnives.cs index abd66c9e20..a567802bf4 100644 --- a/Items/Weapons/Rogue/RoyalKnives.cs +++ b/Items/Weapons/Rogue/RoyalKnives.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Hybrid; +using CalamityMod.Projectiles.Rogue; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using System; @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class RoyalKnives : RogueWeapon + public class RoyalKnives : RogueWeapon { public override void SetStaticDefaults() { @@ -30,8 +30,8 @@ namespace CalamityMod.Items.Weapons.Rogue item.UseSound = SoundID.Item39; item.autoReuse = true; item.height = 20; - item.value = Item.buyPrice(5, 0, 0, 0); - item.rare = 10; + item.value = Item.buyPrice(platinum: 5); + item.rare = ItemRarityID.Red; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 9f; item.Calamity().rogue = true; diff --git a/Projectiles/Hybrid/IllustriousKnife.cs b/Projectiles/Hybrid/IllustriousKnife.cs deleted file mode 100644 index af48e7b922..0000000000 --- a/Projectiles/Hybrid/IllustriousKnife.cs +++ /dev/null @@ -1,105 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Projectiles.Healing; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Hybrid -{ - public class IllustriousKnife : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Knife"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } - - public override void SetDefaults() - { - projectile.width = 18; - projectile.height = 18; - projectile.friendly = true; - projectile.penetrate = 1; - projectile.timeLeft = 300; - projectile.Calamity().rogue = true; - } - - public override void AI() - { - projectile.ai[0] += 1f; - if (projectile.ai[0] >= 240f) - { - projectile.alpha += 4; - projectile.damage = (int)((double)projectile.damage * 0.95); - projectile.knockBack = (float)(int)((double)projectile.knockBack * 0.95); - } - if (projectile.ai[0] < 240f) - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - } - else - { - projectile.rotation += 0.5f; - } - CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 800f, 35f, 20f); - if (Main.rand.NextBool(6)) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 20, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } - } - - public override void Kill(int timeLeft) - { - for (int num303 = 0; num303 < 3; num303++) - { - int num304 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 20, 0f, 0f, 100, default, 0.8f); - Main.dust[num304].noGravity = true; - Main.dust[num304].velocity *= 1.2f; - Main.dust[num304].velocity -= projectile.oldVelocity * 0.3f; - } - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 600); - if (target.type == NPCID.TargetDummy) - { - return; - } - float healAmt = (float)damage * 0.015f; - if ((int)healAmt == 0) - { - return; - } - if (Main.player[Main.myPlayer].lifeSteal <= 0f) - { - return; - } - CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ModContent.ProjectileType(), 1200f, 1.5f); - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - target.AddBuff(ModContent.BuffType(), 600); - float healAmt = (float)damage * 0.015f; - if ((int)healAmt == 0) - { - return; - } - if (Main.player[Main.myPlayer].lifeSteal <= 0f) - { - return; - } - CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ModContent.ProjectileType(), 1200f, 1.5f); - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - } -} diff --git a/Projectiles/Rogue/IllustriousKnife.cs b/Projectiles/Rogue/IllustriousKnife.cs new file mode 100644 index 0000000000..92706977f5 --- /dev/null +++ b/Projectiles/Rogue/IllustriousKnife.cs @@ -0,0 +1,92 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Projectiles.Healing; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class IllustriousKnife : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Illustrious Knife"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 18; + projectile.height = 18; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 300; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + projectile.ai[0] += 1f; + if (projectile.ai[0] >= 240f) + { + projectile.alpha += 4; + projectile.damage = (int)(projectile.damage * 0.95); + projectile.knockBack = (int)(projectile.knockBack * 0.95); + } + if (projectile.ai[0] < 240f) + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f; + else + { + projectile.rotation += 0.5f; + } + CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 800f, 35f, 20f); + if (Main.rand.NextBool(6)) + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 20, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + + public override void Kill(int timeLeft) + { + for (int num303 = 0; num303 < 3; num303++) + { + int num304 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 20, 0f, 0f, 100, default, 0.8f); + Main.dust[num304].noGravity = true; + Main.dust[num304].velocity *= 1.2f; + Main.dust[num304].velocity -= projectile.oldVelocity * 0.3f; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 600); + if (target.type == NPCID.TargetDummy) + return; + float healAmt = damage * 0.015f; + if ((int)healAmt == 0) + return; + if (Main.player[Main.myPlayer].lifeSteal <= 0f) + return; + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ModContent.ProjectileType(), 1200f, 1.5f); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 600); + float healAmt = damage * 0.015f; + if ((int)healAmt == 0) + return; + if (Main.player[Main.myPlayer].lifeSteal <= 0f) + return; + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ModContent.ProjectileType(), 1200f, 1.5f); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + } +} diff --git a/Projectiles/Hybrid/IllustriousKnife.png b/Projectiles/Rogue/IllustriousKnife.png similarity index 100% rename from Projectiles/Hybrid/IllustriousKnife.png rename to Projectiles/Rogue/IllustriousKnife.png