diff --git a/Items/Weapons/Rogue/TerrorTalons.cs b/Items/Weapons/Rogue/TerrorTalons.cs new file mode 100644 index 0000000000..a81ccebe16 --- /dev/null +++ b/Items/Weapons/Rogue/TerrorTalons.cs @@ -0,0 +1,61 @@ +using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class TerrorTalons : RogueWeapon + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Terror Talons"); + Tooltip.SetDefault("Fires small wavering claws\n" + + "Stealth strikes launch a bigger, faster claw that flies straight and pierces indefinitely"); + } + + public override void SafeSetDefaults() + { + item.width = 40; + item.damage = 118; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 11; + item.useStyle = 1; + item.useTime = 11; + item.knockBack = 3f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 24; + item.value = Item.buyPrice(0, 48, 0, 0); + item.rare = 6; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 12.5f; + item.Calamity().rogue = true; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + { + float stealthDamageMult = 1.1f; + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), (int)(damage * stealthDamageMult), knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth].Calamity().stealthStrike = true; + return false; + } + return true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.FeralClaws); + recipe.AddIngredient(ItemID.ChlorophyteBar, 5); + recipe.AddIngredient(ItemID.SoulofFright, 10); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Rogue/TerrorTalons.png b/Items/Weapons/Rogue/TerrorTalons.png new file mode 100644 index 0000000000..f539c20f88 Binary files /dev/null and b/Items/Weapons/Rogue/TerrorTalons.png differ diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 0c6a01bd3a..e61523dd45 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -771,7 +771,10 @@ namespace CalamityMod.Projectiles { if (projectile.owner == Main.myPlayer) { - if (projectile.Calamity().rogue && projectile.Calamity().stealthStrike && Main.player[projectile.owner].Calamity().dragonScales && CalamityUtils.CountProjectiles(ModContent.ProjectileType()) < 2) + if (rogue && stealthStrike && Main.player[projectile.owner].Calamity().stealthStrikeAlwaysCrits) + crit = true; + + if (rogue && stealthStrike && Main.player[projectile.owner].Calamity().dragonScales && CalamityUtils.CountProjectiles(ModContent.ProjectileType()) < 2) { int projTileX = (int)(projectile.Center.X / 16f); int projTileY = (int)(projectile.Center.Y / 16f); diff --git a/Projectiles/Rogue/TalonLargeProj.cs b/Projectiles/Rogue/TalonLargeProj.cs new file mode 100644 index 0000000000..be21329979 --- /dev/null +++ b/Projectiles/Rogue/TalonLargeProj.cs @@ -0,0 +1,66 @@ +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 TalonLargeProj : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Talon"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 8; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.timeLeft = 600; + projectile.Calamity().rogue = true; + projectile.extraUpdates = 1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + } + + public override void AI() + { + if (Main.rand.Next(5) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 85, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + if (Main.rand.Next(10) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 111, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + projectile.ai[0]++; + if (projectile.ai[0] > 2f) + { + projectile.tileCollide = true; + } + projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); + projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i <= 10; i++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 85, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.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/TalonLargeProj.png b/Projectiles/Rogue/TalonLargeProj.png new file mode 100644 index 0000000000..1f0ed8e7dd Binary files /dev/null and b/Projectiles/Rogue/TalonLargeProj.png differ diff --git a/Projectiles/Rogue/TalonSmallProj.cs b/Projectiles/Rogue/TalonSmallProj.cs new file mode 100644 index 0000000000..ff49dbafe1 --- /dev/null +++ b/Projectiles/Rogue/TalonSmallProj.cs @@ -0,0 +1,78 @@ +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 TalonSmallProj : ModProjectile + { + private int x; + private double speed = 10; + private float startSpeedY = 0f; + private int angle = 4; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Talon"); + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.tileCollide = false; + projectile.timeLeft = 600; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + if (projectile.ai[0] == 0f) //only happens once + angle = Main.rand.Next(4,11); + if (Main.rand.Next(5) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 85, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + projectile.ai[0]++; + if (projectile.ai[0] > 2f) + { + projectile.tileCollide = true; + } + if (projectile.localAI[0] == 0f) + { + projectile.velocity.X = projectile.velocity.X + (Main.player[projectile.owner].velocity.X * 0.5f); + startSpeedY = projectile.velocity.Y + (Main.player[projectile.owner].velocity.Y * 0.5f); + projectile.velocity.Y = startSpeedY; + } + projectile.localAI[0] += 1f; + if (projectile.localAI[0] >= 5f) + { + x++; + speed += 0.05; + projectile.velocity.Y = startSpeedY + (float)(speed * Math.Sin(x / angle)); + } + projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); + projectile.rotation = projectile.velocity.ToRotation(); + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i <= 5; i++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 85, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + } +} diff --git a/Projectiles/Rogue/TalonSmallProj.png b/Projectiles/Rogue/TalonSmallProj.png new file mode 100644 index 0000000000..4287b06a35 Binary files /dev/null and b/Projectiles/Rogue/TalonSmallProj.png differ