From cd6df0faf615c4e140925f31c45a1adefb5e117d Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 29 Sep 2019 21:54:04 -0400 Subject: [PATCH] Added Bloodsoaked Crasher. --- .../BloodsoakedCrasher.cs | 59 +++++++++ .../BloodsoakedCrasher.png | Bin 0 -> 1218 bytes Projectiles/Rogue/BloodsoakedCrashax.cs | 114 ++++++++++++++++++ Projectiles/Rogue/BloodsoakedCrashax.png | Bin 0 -> 1218 bytes 4 files changed, 173 insertions(+) create mode 100644 Items/CalamityCustomThrowingDamage/BloodsoakedCrasher.cs create mode 100644 Items/CalamityCustomThrowingDamage/BloodsoakedCrasher.png create mode 100644 Projectiles/Rogue/BloodsoakedCrashax.cs create mode 100644 Projectiles/Rogue/BloodsoakedCrashax.png diff --git a/Items/CalamityCustomThrowingDamage/BloodsoakedCrasher.cs b/Items/CalamityCustomThrowingDamage/BloodsoakedCrasher.cs new file mode 100644 index 0000000000..4e42409446 --- /dev/null +++ b/Items/CalamityCustomThrowingDamage/BloodsoakedCrasher.cs @@ -0,0 +1,59 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class BloodsoakedCrasher : ModItem //This weapon has been coded by Achilles|Termi|Ben + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bloodsoaked Crasher"); + Tooltip.SetDefault("Slows down when hitting an enemy. Speeds up otherwise\n" + + "Heals on enemy hits\n" + + "Stealth strikes spawn homing blood on enemy hits"); + } + + public override void SetDefaults() + { + item.width = 66; + item.damage = 400; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 18; + item.useStyle = 1; + item.useTime = 18; + item.knockBack = 3f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 64; + item.value = Item.buyPrice(1, 40, 0, 0); + item.rare = 10; + item.GetGlobalItem(mod).postMoonLordRarity = 13; + item.shoot = mod.ProjectileType("BloodsoakedCrashax"); + item.shootSpeed = 15f; + item.GetGlobalItem(mod).rogue = true; + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.GetCalamityPlayer().StealthStrikeAvailable()) //setting the stealth strike + { + Projectile.NewProjectile(position, new Vector2(speedX, speedY), mod.ProjectileType("BloodsoakedCrashax"), damage, knockBack, player.whoAmI, 0f, 1f); + return false; + } + return true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); //post-Prov rogue weapon + recipe.AddIngredient(mod.ItemType("CrushsawCrasher"), 1); + recipe.AddIngredient(mod.ItemType("BloodstoneCore"), 12); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/BloodsoakedCrasher.png b/Items/CalamityCustomThrowingDamage/BloodsoakedCrasher.png new file mode 100644 index 0000000000000000000000000000000000000000..9406101582faf993d3460d95b28a269aa71a0e29 GIT binary patch literal 1218 zcmV;z1U>tSP)$Bh!Xn~O%gGvXj5Q|^Sx)h-^}rjGCykP+1$>( zGvlT6-0$a{8^M3d#j@(P_2WI+zM<_xB-=NTX=uWe>M{U8-RK+uZ-gZ$+c%IYvqd5teOhMA*!?UamI(7{FSh>tQBnyb(gi zjL?#k>A&wTXAfeo*_ey67N*oOD#jSw;(Blyg=zcu5q8I7Jh0RT9;{0RWC z^5IY5yk%fC;oqYPBVXPH#u{&gkhQEaS$hfqa976N{cQk%>n*p}fOVz_RfUHE0MW*v z3HJww0%K+yoh{-_XgY6>k6!@rMp!at1hWKV!(^#BzLaOb84?RFlmJK&1B8XKnZWn@ zbBfG`T61J97+)<00MuMFGe6SXXU0B8Y)r;u1fTteiCF+Z{n?`cVl%DL1~fO;n+tA)(F9U5{TcvpuQ=a~<-D#OyQWQSs4PI>yo;$k z)4O;hgtQsq$^taO#)iS5A@=(pmx5nBz7IewJ9Mq)0*GY?8bEZtV9k(<^5&IJ0Ko9_ zYy|K|SW<3;?H;9@WZj^%17SCbLUZVoE>d@)y}4#Rqed!HW(8J|Ji4%kNVZ^Xz_N)& z-UuOWb%gF7nH~Ci1_1yM%cJH(xjEE5GBG7=Ra$2OZHDV}euXMY(zf@h&CuN>*AZ;@ zC~z-wcy2V|y}4GWX+%fGzQi}AvPGw43*wCs(iS6hZ$SeXD|l>R%(!vYd{B&V5i=!d zhBhH?jna`Vh&MvmvJtL*3Yx%5(bYZbUVp65Xm{-UuPo2wR&= zg~oM+7RH3J?A-WPV}T2Agplp$b&=ZzZ-kI^jNrI!@2|k;xWeR(*d@eOmij#gnqYUYg;aNc*~S|o zSR?eBBljh^>dbwI-4YWt-UuP$>NUu2s~22&BZPk_xcZ1=58ZtL000tnMObu2SV=}Y gPjYExZggREX>V=-F@#v`?*IS*07*qoM6N<$f|buSJ^%m! literal 0 HcmV?d00001 diff --git a/Projectiles/Rogue/BloodsoakedCrashax.cs b/Projectiles/Rogue/BloodsoakedCrashax.cs new file mode 100644 index 0000000000..0b078cb740 --- /dev/null +++ b/Projectiles/Rogue/BloodsoakedCrashax.cs @@ -0,0 +1,114 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class BloodsoakedCrashax : ModProjectile + { + private int bounce = 3; //number of times it bounces + private int grind = 0; //used to know when to slow down + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bloodsoaked Crasher"); + } + + public override void SetDefaults() + { + projectile.width = 30; + projectile.height = 30; + projectile.friendly = true; + projectile.penetrate = 10; + projectile.aiStyle = 2; + projectile.timeLeft = 600; //10 seconds and counting + aiType = 48; //Throwing Knife AI + projectile.GetGlobalProjectile(mod).rogue = true; + projectile.usesIDStaticNPCImmunity = true; //afaik, no Calamity projectiles use this and only 1 vanilla projectile + projectile.idStaticNPCHitCooldown = 5; + projectile.extraUpdates = 1; + } + + public override void AI() + { + grind--; + if (grind <= 0) + { + grind = 0; + } + if (grind >= 1) + { + projectile.extraUpdates = 0; //stop, you're touching an enemy + projectile.velocity.X *= 0.75f; + projectile.velocity.Y *= 0.75f; + } + else + { + projectile.velocity.X *= 1.005f; //you broke up, time to yeet yourself out + projectile.velocity.Y *= 1.005f; + if (projectile.velocity.X > 16f) + { + projectile.velocity.X = 16f; + } + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } + projectile.extraUpdates = 1; + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + bounce--; + if (bounce <= 0) + { + projectile.Kill(); //you can only bounce so much 'til death + } + else + { + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + } + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + grind += 5; //THE GRIND NEVER STOPS + if (grind >= 10) + { + grind = 10; + } + Player player = Main.player[projectile.owner]; + target.AddBuff(mod.BuffType("BrimstoneFlames"), 300); + if (projectile.ai[1] == 1f && projectile.owner == Main.myPlayer && grind >= 1) //stealth strike attack + { + int stealth = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, calamity.ProjectileType("Blood"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Main.projectile[stealth].GetGlobalProjectile(mod).forceRogue = true; + } + if (!target.canGhostHeal) //canGhostHeal be like lol + { + return; + } + if (Main.rand.NextBool(2)) + { + player.statLife += 1; //Trello said 2 hp per hit. Sounds like a fat balancing problem. + player.HealEffect(1); + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) //afterimages + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + } +} diff --git a/Projectiles/Rogue/BloodsoakedCrashax.png b/Projectiles/Rogue/BloodsoakedCrashax.png new file mode 100644 index 0000000000000000000000000000000000000000..9406101582faf993d3460d95b28a269aa71a0e29 GIT binary patch literal 1218 zcmV;z1U>tSP)$Bh!Xn~O%gGvXj5Q|^Sx)h-^}rjGCykP+1$>( zGvlT6-0$a{8^M3d#j@(P_2WI+zM<_xB-=NTX=uWe>M{U8-RK+uZ-gZ$+c%IYvqd5teOhMA*!?UamI(7{FSh>tQBnyb(gi zjL?#k>A&wTXAfeo*_ey67N*oOD#jSw;(Blyg=zcu5q8I7Jh0RT9;{0RWC z^5IY5yk%fC;oqYPBVXPH#u{&gkhQEaS$hfqa976N{cQk%>n*p}fOVz_RfUHE0MW*v z3HJww0%K+yoh{-_XgY6>k6!@rMp!at1hWKV!(^#BzLaOb84?RFlmJK&1B8XKnZWn@ zbBfG`T61J97+)<00MuMFGe6SXXU0B8Y)r;u1fTteiCF+Z{n?`cVl%DL1~fO;n+tA)(F9U5{TcvpuQ=a~<-D#OyQWQSs4PI>yo;$k z)4O;hgtQsq$^taO#)iS5A@=(pmx5nBz7IewJ9Mq)0*GY?8bEZtV9k(<^5&IJ0Ko9_ zYy|K|SW<3;?H;9@WZj^%17SCbLUZVoE>d@)y}4#Rqed!HW(8J|Ji4%kNVZ^Xz_N)& z-UuOWb%gF7nH~Ci1_1yM%cJH(xjEE5GBG7=Ra$2OZHDV}euXMY(zf@h&CuN>*AZ;@ zC~z-wcy2V|y}4GWX+%fGzQi}AvPGw43*wCs(iS6hZ$SeXD|l>R%(!vYd{B&V5i=!d zhBhH?jna`Vh&MvmvJtL*3Yx%5(bYZbUVp65Xm{-UuPo2wR&= zg~oM+7RH3J?A-WPV}T2Agplp$b&=ZzZ-kI^jNrI!@2|k;xWeR(*d@eOmij#gnqYUYg;aNc*~S|o zSR?eBBljh^>dbwI-4YWt-UuP$>NUu2s~22&BZPk_xcZ1=58ZtL000tnMObu2SV=}Y gPjYExZggREX>V=-F@#v`?*IS*07*qoM6N<$f|buSJ^%m! literal 0 HcmV?d00001