diff --git a/Items/Weapons/Rogue/EpidemicShredder.cs b/Items/Weapons/Rogue/EpidemicShredder.cs new file mode 100644 index 0000000000..00b571af9b --- /dev/null +++ b/Items/Weapons/Rogue/EpidemicShredder.cs @@ -0,0 +1,47 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Rogue; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class EpidemicShredder : RogueWeapon + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Epidemic Shredder"); + } + + public override void SafeSetDefaults() + { + item.width = 34; + item.height = 34; + item.damage = 75; + item.noMelee = true; + item.noUseGraphic = true; + item.autoReuse = true; + item.useAnimation = 12; + item.useTime = 12; + item.useStyle = ItemUseStyleID.SwingThrow; + item.knockBack = 4.5f; + item.UseSound = SoundID.Item1; + item.value = Item.buyPrice(0, 80, 0, 0); + item.rare = 8; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 18f; + item.Calamity().rogue = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ChlorophyteBar, 20); + recipe.AddIngredient(ItemID.Nanites, 150); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} \ No newline at end of file diff --git a/Items/Weapons/Rogue/EpidemicShredder.png b/Items/Weapons/Rogue/EpidemicShredder.png new file mode 100644 index 0000000000..22c9f4381a Binary files /dev/null and b/Items/Weapons/Rogue/EpidemicShredder.png differ diff --git a/Projectiles/Rogue/EpidemicShredderProjectile.cs b/Projectiles/Rogue/EpidemicShredderProjectile.cs new file mode 100644 index 0000000000..78b3169a84 --- /dev/null +++ b/Projectiles/Rogue/EpidemicShredderProjectile.cs @@ -0,0 +1,84 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Projectiles.Melee; +using CalamityMod.Buffs.DamageOverTime; + +namespace CalamityMod.Projectiles.Rogue +{ + public class EpidemicShredderProjectile : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Epidemic Shredder"); + } + + public override void SetDefaults() + { + projectile.width = 34; + projectile.height = 34; + projectile.friendly = true; + projectile.penetrate = 6; + projectile.timeLeft = 600; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 4; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + projectile.rotation += Math.Sign(projectile.velocity.X) * MathHelper.ToRadians(10f); + if (projectile.ai[0] > 0f) + { + projectile.ai[0] -= 1f; + } + if (projectile.timeLeft < 580f) + { + projectile.velocity = (projectile.velocity * 18f + projectile.DirectionTo(Main.player[projectile.owner].Center) * 18f) / 19f; + if (Main.player[projectile.owner].Hitbox.Intersects(projectile.Hitbox)) + { + projectile.Kill(); + } + } + } + public override bool OnTileCollide(Vector2 oldVelocity) + { + if (projectile.penetrate > 1) + { + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + if (projectile.ai[0] == 0f) + { + Projectile.NewProjectile(projectile.Center, projectile.velocity, mod.ProjectileType("PlagueSeeker"), (int)(projectile.damage * 0.1f), 2f, projectile.owner); + projectile.ai[0] = 12f; //0.2th of a second cooldown + } + projectile.penetrate--; + } + else + { + projectile.penetrate = -1; + projectile.tileCollide = false; + } + return false; + } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (projectile.ai[0] == 0f) + { + int projectileIndex = Projectile.NewProjectile(projectile.Center, projectile.velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.1f), 2f, projectile.owner); + Main.projectile[projectileIndex].Calamity().forceRogue = true; + projectile.ai[0] = 12f; //0.2th of a second cooldown + } + target.AddBuff(ModContent.BuffType(), 300); + } + } +} \ No newline at end of file diff --git a/Projectiles/Rogue/EpidemicShredderProjectile.png b/Projectiles/Rogue/EpidemicShredderProjectile.png new file mode 100644 index 0000000000..22c9f4381a Binary files /dev/null and b/Projectiles/Rogue/EpidemicShredderProjectile.png differ