From d2aa0ad29e18493969ddfade3302fe81a1b7d42e Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 10 Dec 2019 22:05:11 -0500 Subject: [PATCH] added terror talons --- Items/Weapons/Rogue/TerrorTalons.cs | 61 ++++++++++++++++++ Items/Weapons/Rogue/TerrorTalons.png | Bin 0 -> 697 bytes Projectiles/CalamityGlobalProjectile.cs | 5 +- Projectiles/Rogue/TalonLargeProj.cs | 66 ++++++++++++++++++++ Projectiles/Rogue/TalonLargeProj.png | Bin 0 -> 595 bytes Projectiles/Rogue/TalonSmallProj.cs | 78 ++++++++++++++++++++++++ Projectiles/Rogue/TalonSmallProj.png | Bin 0 -> 469 bytes 7 files changed, 209 insertions(+), 1 deletion(-) create mode 100644 Items/Weapons/Rogue/TerrorTalons.cs create mode 100644 Items/Weapons/Rogue/TerrorTalons.png create mode 100644 Projectiles/Rogue/TalonLargeProj.cs create mode 100644 Projectiles/Rogue/TalonLargeProj.png create mode 100644 Projectiles/Rogue/TalonSmallProj.cs create mode 100644 Projectiles/Rogue/TalonSmallProj.png 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 0000000000000000000000000000000000000000..f539c20f886e8d91c1b155987ef2bd68584d690d GIT binary patch literal 697 zcmV;q0!ICbP)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00IX|L_t(Y$K}_*OB-Pv$MN@5MAA#s zrdkd42PR;r76iemR$2%Dgf3mBL;nTWLKi`BtIiJU>U@Z`gNTFBI-1Z1OPZ#p2Co*u z>u`R}eIM>(Hc$O5N%%gwgBPFYei*F0-d`jtUuISTsJeT8)cm27F#v~NL(Ly&90Ty9 z;i>i2N||#|2n2tCxKuJtZ4jF(YcMpKKV^0CtEeA3c6Rbb<8fw0<{Z$<&)tNE? zJ-GpOvN+M?3x=djc+l5*W&qyxp9b^k5g*{*&tn7dael)OOLgbF0B|=EId!6ZUjcy9 zK~ahJbU#w(wIvfTXxi=I`@%mpd^5TXK<<3iq$H(-qWYA)d_EzPepphHc)_R++II>A zke*uuU~Oeb?OwSKN(bFdy$dVn9@4oB(c*XY+wNpGlQq{vP`Zn@ngyV@tJepZ z>UY#!Bqh?#xa;A>i=cbo%DR&xdvfYsGr`O9WcV2X^+sKFR77l1TP`lLi|t4kZ;qh- z^x>q^0OZms0E)Gm-|GKy*F}jfdGiG0V#|gSDJoL3TU*>&fZHHwCr&hb{{aB?qdz{V z=R*LTyTQAQ_t#VMw@)xGA}hP!J2{TL=i5oV;D12$xS@m)jV1s901|XXSad~LNk%$P fa%p95bYXO9Z*BlFgjnqF00000NkvXXu0mjfS9LAh literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..1f0ed8e7dd81bf3928b05e451b29c6a59e374e68 GIT binary patch literal 595 zcmV-Z0<8UsP)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00E&%L_t(Y$JLg@#$hKCZ#l(@A<)ukg54dAKURqM3Dpw+C6eBXrEg8p0D*5kp@ z#Cr4#fV1Kq0Oz|W7QpuMl2mtJGXS`4=nUoy<%(1{H94gLn4hLJt`hSlA@R*MC1(Nb zWj_Ge(Src!n}+~w%!dGoWu~P`#nNz(RO`AFCt`68pw($hqaWgiw>6G#05FdqEP$laWpb&IM6BsN(T!9; z{vicGG#u6ZO~_5@^dbO;`987_sl-lS4T*$MRezDjMQrwrF(u@6mU(qpC?Y94^+ znw%G2@*SbTFKQ*4vtipSg>q#mxv+C~^_;j`*X_D1hnV6mq46W+{{PbV)=(e5DW|&V zGiJ~BnCR4ND|vqt^4w*AEwO78u{Z#&PFwPz?+ASZ{{fGX`Lq3w0000IbVXQnMOaBj hI!|(GWo~p~bZKvH05ODE?C$^o002ovPDHLkV1gI)0k8l7 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..4287b06a35e49d813c6e75495bb0327946e104a9 GIT binary patch literal 469 zcmeAS@N?(olHy`uVBq!ia0vp^Vn8gw!3HFS-u9~jDVB6cUq=Rpjs4tz5?O(K#^NA% zCx&(BWL^R}3dtTpz6=aiK!pu03=F@3LJcn%7)lKo7+xhXFj&oCU=S~uvn$XBD8ZKG z?e4+oi2c!8MWO6kc3O@?YsL0=)${QVL{Nd?VW&8Kpj?X49 zzbVFW{jap6oSx{uaFaFH!^@{_nSFy(Z(>V#^-pewxqqGA^9~6;cU25}c%^8``lT~Y zeE;=h1^a=`)1E&p{xf@%Mi9f|mplzcW~>WlF8S8D)98b-tYhc@t1te?y}ir4d&L<> zi5ClJ*hqX-SI>@{`uOzV~Ge3{PuqEQnd!Q_Xr>mdK II;Vst03SKL9smFU literal 0 HcmV?d00001