From 93460aa1e09b38fad78b1eebb989c3e31f37bbc0 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 21 Nov 2020 21:49:34 -0500 Subject: [PATCH 01/26] fixed latcher mine fire not doing any dmg --- Projectiles/Rogue/LatcherMineProjectile.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Projectiles/Rogue/LatcherMineProjectile.cs b/Projectiles/Rogue/LatcherMineProjectile.cs index 5b59d81b0b..68c4cd1c37 100644 --- a/Projectiles/Rogue/LatcherMineProjectile.cs +++ b/Projectiles/Rogue/LatcherMineProjectile.cs @@ -7,6 +7,7 @@ namespace CalamityMod.Projectiles.Rogue { public class LatcherMineProjectile : ModProjectile { + private int projdmg = 0; public override void SetStaticDefaults() { DisplayName.SetDefault("Latcher Mine"); @@ -113,6 +114,7 @@ namespace CalamityMod.Projectiles.Rogue } public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { + projdmg = projectile.damage; projectile.ModifyHitNPCSticky(6, false); } @@ -138,12 +140,12 @@ namespace CalamityMod.Projectiles.Rogue if (Main.rand.NextBool(2) && projectile.Calamity().stealthStrike) { Vector2 shrapnelVelocity = (Vector2.UnitY * (-16f + Main.rand.NextFloat(-3, 12f))).RotatedByRandom((double)MathHelper.ToRadians(40f)); - Projectile.NewProjectile(projectile.Top, shrapnelVelocity, ModContent.ProjectileType(), projectile.damage, 3f, projectile.owner); + Projectile.NewProjectile(projectile.Top, shrapnelVelocity, ModContent.ProjectileType(), projdmg, 3f, projectile.owner); } else { Vector2 fireVelocity = (Vector2.UnitY * (-16f + Main.rand.NextFloat(-3, 12f))).RotatedByRandom((double)MathHelper.ToRadians(40f)); - int fireIndex = Projectile.NewProjectile(projectile.Top, fireVelocity, ModContent.ProjectileType(), projectile.damage / 3, 1f, projectile.owner); + int fireIndex = Projectile.NewProjectile(projectile.Top, fireVelocity, ModContent.ProjectileType(), projdmg / 3, 1f, projectile.owner); Main.projectile[fireIndex].localNPCHitCooldown = -2; } } From dc7d9ef266640bf622666422feb23ee1881115a1 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sat, 21 Nov 2020 21:39:07 -0500 Subject: [PATCH 02/26] removed melee seashell boomerang --- Items/Weapons/Melee/SeashellBoomerangMelee.cs | 44 ------------------ .../Weapons/Melee/SeashellBoomerangMelee.png | Bin 492 -> 0 bytes Items/Weapons/Rogue/SeashellBoomerang.cs | 3 +- .../SeashellBoomerangProjectile.cs | 7 +-- 4 files changed, 5 insertions(+), 49 deletions(-) delete mode 100644 Items/Weapons/Melee/SeashellBoomerangMelee.cs delete mode 100644 Items/Weapons/Melee/SeashellBoomerangMelee.png rename Projectiles/{Hybrid => Rogue}/SeashellBoomerangProjectile.cs (81%) diff --git a/Items/Weapons/Melee/SeashellBoomerangMelee.cs b/Items/Weapons/Melee/SeashellBoomerangMelee.cs deleted file mode 100644 index d226d3ca7a..0000000000 --- a/Items/Weapons/Melee/SeashellBoomerangMelee.cs +++ /dev/null @@ -1,44 +0,0 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Hybrid; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Melee -{ - public class SeashellBoomerangMelee : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Seashell Boomerang"); - } - - public override void SetDefaults() - { - item.width = 18; - item.damage = 15; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 15; - item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 15; - item.knockBack = 5.5f; - item.UseSound = SoundID.Item1; - item.melee = true; - item.height = 34; - item.value = Item.buyPrice(0, 2, 0, 0); - item.rare = 2; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 11.5f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 2); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} diff --git a/Items/Weapons/Melee/SeashellBoomerangMelee.png b/Items/Weapons/Melee/SeashellBoomerangMelee.png deleted file mode 100644 index 4e0fba13e0ecd022defaa94e0170a4e0e8c0f857..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 492 zcmV<`Z1=o#4qwha=XYNuv5~}Xmfg>dwyL%g)x*XqfI-g(W?xa1Bx)t1c!n%VXC4KYqQbKww zKHmrv@`Yjqje4zX!7K>#ZK%tG){E(Ybjuvpt6<@O&Ee*zbn4)}fd}Zl%imkE`eeS# zThu0ZyaXQ3C!apYs&cltACznBZT{+E`X*&ZSQ;OV;Qr8LM=vMC$V9;x9ZfxfN@ez@ i?EZIoQ!#e!zs(<`wy2d_jo2dq0000 Date: Sat, 21 Nov 2020 21:49:05 -0500 Subject: [PATCH 03/26] removed melee kelvin catalyst --- CalamityLists.cs | 3 +- Items/Weapons/Melee/KelvinCatalystMelee.cs | 72 ------- Items/Weapons/Melee/KelvinCatalystMelee.png | Bin 2405 -> 0 bytes Items/Weapons/Rogue/KelvinCatalyst.cs | 10 +- Projectiles/Hybrid/KelvinCatalystBoomerang.cs | 200 ------------------ Projectiles/Rogue/KelvinCatalystBoomerang.cs | 190 +++++++++++++++++ 6 files changed, 196 insertions(+), 279 deletions(-) delete mode 100644 Items/Weapons/Melee/KelvinCatalystMelee.cs delete mode 100644 Items/Weapons/Melee/KelvinCatalystMelee.png delete mode 100644 Projectiles/Hybrid/KelvinCatalystBoomerang.cs create mode 100644 Projectiles/Rogue/KelvinCatalystBoomerang.cs diff --git a/CalamityLists.cs b/CalamityLists.cs index da77561182..807b248cd0 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -69,7 +69,7 @@ using Terraria.ModLoader; namespace CalamityMod { - public class CalamityLists + public class CalamityLists { public static IList donatorList; public static List trueMeleeProjectileList; // DO NOT, EVER, DELETE THIS LIST, OR I WILL COME FOR YOU :D @@ -831,7 +831,6 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), diff --git a/Items/Weapons/Melee/KelvinCatalystMelee.cs b/Items/Weapons/Melee/KelvinCatalystMelee.cs deleted file mode 100644 index cbc7739b66..0000000000 --- a/Items/Weapons/Melee/KelvinCatalystMelee.cs +++ /dev/null @@ -1,72 +0,0 @@ -using CalamityMod.Items.Accessories; -using CalamityMod.Items.Accessories.Wings; -using CalamityMod.Items.Materials; -using CalamityMod.Items.Weapons.Magic; -using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.Projectiles.Hybrid; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Melee -{ - public class KelvinCatalystMelee : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Kelvin Catalyst"); - Tooltip.SetDefault("Throws an icy blade that splits into multiple ice stars on enemy hits"); - } - - public override void SetDefaults() - { - item.width = 20; - item.damage = 70; - item.noMelee = true; - item.noUseGraphic = true; - item.autoReuse = true; - item.useAnimation = 30; - item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 30; - item.knockBack = 4f; - item.UseSound = SoundID.Item1; - item.height = 20; - item.value = Item.buyPrice(0, 48, 0, 0); - item.rare = 6; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 8f; - item.melee = true; - item.Calamity().customRarity = CalamityRarity.Dedicated; - } - - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); - return false; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 200); - recipe.AddIngredient(ItemID.FrozenKey); - recipe.AddIngredient(ModContent.ItemType(), 20); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType(), 2); - recipe.AddIngredient(ModContent.ItemType(), 2); - recipe.AddIngredient(ModContent.ItemType(), 2); - recipe.AddIngredient(ModContent.ItemType(), 2); - recipe.AddIngredient(ModContent.ItemType(), 2); - recipe.AddIngredient(ModContent.ItemType(), 2); - recipe.AddIngredient(ModContent.ItemType(), 2); - recipe.AddIngredient(ModContent.ItemType(), 2); - recipe.AddIngredient(ItemID.FrostCore, 2); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} diff --git a/Items/Weapons/Melee/KelvinCatalystMelee.png b/Items/Weapons/Melee/KelvinCatalystMelee.png deleted file mode 100644 index 86a074d8012b6414022a8155904e173fb31d7fd5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2405 zcmV-r37YnaP)Px;A4x<(RCt{2oK0+8R~5&9FL9kXc>I;vsb!Pqi(+V-1d}w8DI%hgBEbUaq9CEF zLIjX1B!buwv98h$qKgWtYN80CN>K4B#3GU_rAiy6O=XhMfYrK5Y8<(>Q`b&Row{*` z#ht%r?wNNzb3Kzt!255k_x;BA_s%`{oO5r&|A+>*9R{Fn<5mEsFOTHSDG9)-^M`7B z&Wf6@{y$W5yKbx&x4L=jeQ*0#ehz@fmAwFry!-2_?msc{5AQjatp4x(5P+d$&$#nv zPA34@=H5!ZPqoSji&VoMc!p<78dj_Y;NSDF0`Q5(-2klYSeXEH%x(i+01 zH+f&htwu+vB}*zHHr1xZDkCgXcY-jWyyd6P>;s@hrR8d&0heZyW?H}&JF)* z=?52-5f-Vs`C%e!-R1`YxO(xmJir%!;QLi->5T_=0&wlzECA;Rj{vZ3-vRG@`BBm$ zi3RnxJ_Nw!HwIJRYvcXCt&~nayJ#a5$OyY_s@aB#tnU5+0LF(-d1P5atZfOArQR+? zh^`x(dD%P9lBVMw_}5DvJ?@JbDENbw#+n&nky$l zmMlrOOUGp!MX(4AspJdD1GH`2ng9&o#-<_CGQuJi-AgW)tegM30l?m;e+m@+rAo3k zPd3r+x3Yeh6e3pl6=~C#M}TtDGQuLYY#V0D3Q4wxR`*9_h5RW=y4%~XBB8hM;RIl8_(h;Rv#c1pR4F2R;5QclIC1c)JV4Lq_j!Ji9qW~R5#HA`HZthF z-wTI#d!&i%(LcD~_2VD8-+9#Zni*k{syX6XEm>CUHb0mEoP72%&(?@I>v@+%IhGvj zRf^4b&AsovuO&@{A3d=%_4<~i)&oW2ENSw{ zEonr?^z8eENV9}X8DWuXDCt!^iG-UA^8k!by$QgPZ`}vLrak);fJ>*31MziMCCUTb zxb|M^LD`g+?ddjUxw7vozfq(WYc>4mW`sqm0pk%juIWtxy1G6K!0g;&#h_;^>Oht! zn-fr^H55;iY(-=LblTC*k29;aP)-RRtx|2 ziEpHyf7i;M+F!0j?d{IL)BnLnf-}M*74*Z}+x@6Pt)yKq*uq@X+SJ-rk@Wj5u2*W? z;`VEdH$Lck>DDz}3Ba1wZ9r8~i>g%Z@5=~_R2gCVX00u&RW}zt0*d~evO&r>E>`0_ z@v?WF%}36BI03+0mrpF~J=FVG(mlOjP5>?pJ?VWB8DWuXP@TNuPqHOa=Z1c7d%3pk z#{AONIwDD)y|PP{vPacQWNq5BAAn1zk9*`aH?4J5+3%bLyttkBg=K_As?3I|S9)}p z^K3P?(x_glwbzsfU!I9B^v;Ds!sd22@|gW#Y+26{S-pJ^14XhF$(4VnsEibft7U{m zs*Etje`L!PAF3B=U0u6UJ!zZYw9l0~*KbRpa(%reYi#(%)NGMt<9#7zghi^1u}aA%9Q)S8KP6f6a`$;~8OfR>SnjXzBq~t%x*LwW#($ zQvOgasBQJ8_x61)0k}T#&(!16{EcbvzP3horsE|5KD_xcP$bJnL_-yj+HY$@swGRx z2#eIBAEsIbWt3&hM3hDVb|j#dvn{KZS3Jp9>1a;3t=E^Wve_cV(I{lOELl=0+oa6- z^ZV0nSGCFri`1g8q!mUwcQ{fe&km=q17Qi1?2HS$-`17cIYS~tb@-b9D9NTt)t>jz zPY!z9CE2H_nYdC$Sft9l@k(piSjEm7lR~r7>~70i6AW>ht#t2*;uO=_rKU%i)X zk$N#ppq=F(n#X8WY0kI^tT$OwMp&fkKAWx53MCQjgRXr0# zEoG};LS)Gkm#q<5T3Jr(e}!WBk|nQ_AE))o>P?oE5f-WF+OHDAs*0tHxLb{LTC)&< zT>B;fu77YT^*$ZVF2k)X(8AP09?DneOi^7{1P&=9EK;@1W=jBCnmz?USL+^+l+ao> zDYY1>lxwxkjwv@QX?|fW0a(@G#gg XsBCTc_=95g00000NkvXXu0mjfPIR+~ diff --git a/Items/Weapons/Rogue/KelvinCatalyst.cs b/Items/Weapons/Rogue/KelvinCatalyst.cs index 0f170ce3fa..29b36f3240 100644 --- a/Items/Weapons/Rogue/KelvinCatalyst.cs +++ b/Items/Weapons/Rogue/KelvinCatalyst.cs @@ -4,7 +4,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Projectiles.Hybrid; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -33,8 +33,8 @@ namespace CalamityMod.Items.Weapons.Rogue item.knockBack = 4f; item.UseSound = SoundID.Item1; item.height = 20; - item.value = Item.buyPrice(0, 48, 0, 0); - item.rare = 6; + item.value = Item.buyPrice(gold: 48); + item.rare = ItemRarityID.Purple; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 8f; item.Calamity().rogue = true; @@ -43,8 +43,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f); - Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Projectiles/Hybrid/KelvinCatalystBoomerang.cs b/Projectiles/Hybrid/KelvinCatalystBoomerang.cs deleted file mode 100644 index e0b44ec221..0000000000 --- a/Projectiles/Hybrid/KelvinCatalystBoomerang.cs +++ /dev/null @@ -1,200 +0,0 @@ -using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.IO; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Hybrid -{ - public class KelvinCatalystBoomerang : ModProjectile - { - public override string Texture => "CalamityMod/Items/Weapons/Rogue/KelvinCatalyst"; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Kelvin Catalyst"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 12; - ProjectileID.Sets.TrailingMode[projectile.type] = 1; - } - - public override void SetDefaults() - { - projectile.width = 30; - projectile.height = 30; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.extraUpdates = 1; - projectile.melee = true; - projectile.coldDamage = true; - } - - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(projectile.localAI[0]); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - projectile.localAI[0] = reader.ReadSingle(); - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, Main.DiscoR * 0.3f / 255f, Main.DiscoR * 0.4f / 255f, Main.DiscoR * 0.5f / 255f); - - if (projectile.ai[1] == 1f) - { - projectile.melee = false; - projectile.Calamity().rogue = true; - } - - if (projectile.soundDelay == 0) - { - projectile.soundDelay = 8; - Main.PlaySound(SoundID.Item7, projectile.position); - } - - if (projectile.ai[0] == 0f) - { - projectile.localAI[0] += 1f; - if (projectile.localAI[0] >= 75f) - { - projectile.ai[0] = 1f; - projectile.localAI[0] = 0f; - projectile.width = projectile.height = 60; - projectile.tileCollide = false; - projectile.netUpdate = true; - } - } - else - { - float num42 = 20f; - float num43 = 2f; - Vector2 vector2 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num44 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector2.X; - float num45 = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - vector2.Y; - float num46 = (float)Math.Sqrt((double)(num44 * num44 + num45 * num45)); - - if (num46 > 3000f) - projectile.Kill(); - - num46 = num42 / num46; - num44 *= num46; - num45 *= num46; - - if (projectile.velocity.X < num44) - { - projectile.velocity.X = projectile.velocity.X + num43; - if (projectile.velocity.X < 0f && num44 > 0f) - projectile.velocity.X = projectile.velocity.X + num43; - } - else if (projectile.velocity.X > num44) - { - projectile.velocity.X = projectile.velocity.X - num43; - if (projectile.velocity.X > 0f && num44 < 0f) - projectile.velocity.X = projectile.velocity.X - num43; - } - if (projectile.velocity.Y < num45) - { - projectile.velocity.Y = projectile.velocity.Y + num43; - if (projectile.velocity.Y < 0f && num45 > 0f) - projectile.velocity.Y = projectile.velocity.Y + num43; - } - else if (projectile.velocity.Y > num45) - { - projectile.velocity.Y = projectile.velocity.Y - num43; - if (projectile.velocity.Y > 0f && num45 < 0f) - projectile.velocity.Y = projectile.velocity.Y - num43; - } - if (Main.myPlayer == projectile.owner) - { - Rectangle rectangle = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); - Rectangle value2 = new Rectangle((int)Main.player[projectile.owner].position.X, (int)Main.player[projectile.owner].position.Y, Main.player[projectile.owner].width, Main.player[projectile.owner].height); - if (rectangle.Intersects(value2)) - projectile.Kill(); - } - } - - int dust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 67, 0f, 0f, 100, default, 1f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0f; - - projectile.rotation += 0.25f; - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - projectile.ai[0] = 1f; - projectile.localAI[0] = 0f; - projectile.width = projectile.height = 60; - projectile.tileCollide = false; - projectile.netUpdate = true; - 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) - { - target.AddBuff(BuffID.Frostburn, 240); - if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 25) - { - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int i; - for (i = 0; i < 4; i++) - { - offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 4f), (float)(Math.Cos(offsetAngle) * 4f), - ModContent.ProjectileType(), projectile.damage / 6, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f); - - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 4f), (float)(-Math.Cos(offsetAngle) * 4f), - ModContent.ProjectileType(), projectile.damage / 6, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f); - } - } - Main.PlaySound(SoundID.Item30, projectile.position); - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - target.AddBuff(BuffID.Frostburn, 240); - if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 25) - { - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int i; - for (i = 0; i < 4; i++) - { - offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 4f), (float)(Math.Cos(offsetAngle) * 4f), - ModContent.ProjectileType(), projectile.damage / 6, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f); - - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 4f), (float)(-Math.Cos(offsetAngle) * 4f), - ModContent.ProjectileType(), projectile.damage / 6, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f); - } - } - Main.PlaySound(SoundID.Item30, projectile.position); - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); - return false; - } - } -} diff --git a/Projectiles/Rogue/KelvinCatalystBoomerang.cs b/Projectiles/Rogue/KelvinCatalystBoomerang.cs new file mode 100644 index 0000000000..b57810296a --- /dev/null +++ b/Projectiles/Rogue/KelvinCatalystBoomerang.cs @@ -0,0 +1,190 @@ +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.IO; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class KelvinCatalystBoomerang : ModProjectile + { + public override string Texture => "CalamityMod/Items/Weapons/Rogue/KelvinCatalyst"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Kelvin Catalyst"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 12; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + } + + public override void SetDefaults() + { + projectile.width = 30; + projectile.height = 30; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.extraUpdates = 1; + projectile.Calamity().rogue = true; + projectile.coldDamage = true; + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(projectile.localAI[0]); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + projectile.localAI[0] = reader.ReadSingle(); + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, Main.DiscoR * 0.3f / 255f, Main.DiscoR * 0.4f / 255f, Main.DiscoR * 0.5f / 255f); + + if (projectile.soundDelay == 0) + { + projectile.soundDelay = 8; + Main.PlaySound(SoundID.Item7, projectile.position); + } + + if (projectile.ai[0] == 0f) + { + projectile.localAI[0] += 1f; + if (projectile.localAI[0] >= 75f) + { + projectile.ai[0] = 1f; + projectile.localAI[0] = 0f; + projectile.width = projectile.height = 60; + projectile.tileCollide = false; + projectile.netUpdate = true; + } + } + else + { + float num42 = 20f; + float num43 = 2f; + Vector2 vector2 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); + float num44 = Main.player[projectile.owner].position.X + Main.player[projectile.owner].width / 2 - vector2.X; + float num45 = Main.player[projectile.owner].position.Y + Main.player[projectile.owner].height / 2 - vector2.Y; + float num46 = (float)Math.Sqrt(num44 * num44 + num45 * num45); + + if (num46 > 3000f) + projectile.Kill(); + + num46 = num42 / num46; + num44 *= num46; + num45 *= num46; + + if (projectile.velocity.X < num44) + { + projectile.velocity.X = projectile.velocity.X + num43; + if (projectile.velocity.X < 0f && num44 > 0f) + projectile.velocity.X = projectile.velocity.X + num43; + } + else if (projectile.velocity.X > num44) + { + projectile.velocity.X = projectile.velocity.X - num43; + if (projectile.velocity.X > 0f && num44 < 0f) + projectile.velocity.X = projectile.velocity.X - num43; + } + if (projectile.velocity.Y < num45) + { + projectile.velocity.Y = projectile.velocity.Y + num43; + if (projectile.velocity.Y < 0f && num45 > 0f) + projectile.velocity.Y = projectile.velocity.Y + num43; + } + else if (projectile.velocity.Y > num45) + { + projectile.velocity.Y = projectile.velocity.Y - num43; + if (projectile.velocity.Y > 0f && num45 < 0f) + projectile.velocity.Y = projectile.velocity.Y - num43; + } + if (Main.myPlayer == projectile.owner) + { + Rectangle rectangle = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); + Rectangle value2 = new Rectangle((int)Main.player[projectile.owner].position.X, (int)Main.player[projectile.owner].position.Y, Main.player[projectile.owner].width, Main.player[projectile.owner].height); + if (rectangle.Intersects(value2)) + projectile.Kill(); + } + } + + int dust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 67, 0f, 0f, 100, default, 1f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 0f; + + projectile.rotation += 0.25f; + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + projectile.ai[0] = 1f; + projectile.localAI[0] = 0f; + projectile.width = projectile.height = 60; + projectile.tileCollide = false; + projectile.netUpdate = true; + 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) + { + target.AddBuff(BuffID.Frostburn, 240); + if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 25) + { + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + for (i = 0; i < 4; i++) + { + offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; + + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 4f), (float)(Math.Cos(offsetAngle) * 4f), + ModContent.ProjectileType(), projectile.damage / 6, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f); + + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 4f), (float)(-Math.Cos(offsetAngle) * 4f), + ModContent.ProjectileType(), projectile.damage / 6, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f); + } + } + Main.PlaySound(SoundID.Item30, projectile.position); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Frostburn, 240); + if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 25) + { + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + for (i = 0; i < 4; i++) + { + offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; + + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 4f), (float)(Math.Cos(offsetAngle) * 4f), + ModContent.ProjectileType(), projectile.damage / 6, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f); + + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 4f), (float)(-Math.Cos(offsetAngle) * 4f), + ModContent.ProjectileType(), projectile.damage / 6, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f); + } + } + Main.PlaySound(SoundID.Item30, projectile.position); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); + return false; + } + } +} From ca1b03d51b6d18499d29a7263f33166fde22fc4e Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sat, 21 Nov 2020 22:11:21 -0500 Subject: [PATCH 04/26] removed melee mangrove chakram --- Items/Weapons/Melee/MangroveChakramMelee.cs | 45 -------------- Items/Weapons/Melee/MangroveChakramMelee.png | Bin 1187 -> 0 bytes Items/Weapons/Rogue/MangroveChakram.cs | 9 ++- .../Hybrid/MangroveChakramProjectile.cs | 57 ------------------ .../Rogue/MangroveChakramProjectile.cs | 55 +++++++++++++++++ 5 files changed, 59 insertions(+), 107 deletions(-) delete mode 100644 Items/Weapons/Melee/MangroveChakramMelee.cs delete mode 100644 Items/Weapons/Melee/MangroveChakramMelee.png delete mode 100644 Projectiles/Hybrid/MangroveChakramProjectile.cs create mode 100644 Projectiles/Rogue/MangroveChakramProjectile.cs diff --git a/Items/Weapons/Melee/MangroveChakramMelee.cs b/Items/Weapons/Melee/MangroveChakramMelee.cs deleted file mode 100644 index c0be4942a7..0000000000 --- a/Items/Weapons/Melee/MangroveChakramMelee.cs +++ /dev/null @@ -1,45 +0,0 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Hybrid; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Melee -{ - public class MangroveChakramMelee : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mangrove Chakram"); - } - - public override void SetDefaults() - { - item.width = 38; - item.damage = 84; - item.noMelee = true; - item.noUseGraphic = true; - item.autoReuse = true; - item.useAnimation = 14; - item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 14; - item.knockBack = 7.5f; - item.UseSound = SoundID.Item1; - item.melee = true; - item.height = 38; - item.value = Item.buyPrice(0, 60, 0, 0); - item.rare = 7; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 16f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 7); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} diff --git a/Items/Weapons/Melee/MangroveChakramMelee.png b/Items/Weapons/Melee/MangroveChakramMelee.png deleted file mode 100644 index 5e0ab11e473d385fccc081deaabb42f6a9f7e24b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1187 zcmV;U1YG-xP)Px(T}ebiR9J=WnN4g|RTRg6_f4lWQ>N1nwoJv+8mNd8O$aT4NK9FXu3Wfq0j)sX zXiQv~7-Nkjeqo4-VPoRPsDLE0aACqijIkzY3{wM9D^iPC+O!>7=?9&5+Ud-5app|t zzDy~wVi^CMdH3Vp`|kgq`#o-+Z8i1a;DF9}iIRK_tX8>>}(=I?@ z{c3Bx`Mz#n-ydS><4N!YbF-iC&u-G2wKb)K3hhyjxLbjH`{SUMs_&toaRq<~PL? zo_P9I03K_59a!>+M|N!jpmpsa039b60ob@<9RPio2CWI}YO)64kAKDE&bnEkoEU$x zx*dS{b=&s({lfsf_0vLD9Pw2ld zVgQ^#g$r=FS)x8w6~%Jua{So}s~r#HKw5Lpj zMUDv#CIM*OVcYiGzuXHzUw#M3{mN85!}dIjm5z>Y*|ryY2FcyHN|y2b@(MhbrJw$0 z>60Fi^8NmR)lZpJDB}vRnke*4OgB~-fTRhy0A0to0r26+-vE$069phVA8V=s3A(G5_Vki}q-q*k#MUDgc@r{088M%QHE@VegcxSxY*o zRW3kVbx{1sO)Tz?#4X>j^(<5wS@Xm9_y8E6a;&qloX1ohKXOKNd}Q4!0Dg?W55S(U zKLB9h9f|j!zxs&O=Wb~GFN^}^$T%MLi8hMu`NwmOVQC&4pSSvH#!GSd&=#wl*eyB9 zmF~dh%XpDIi3P7G^k%*k$J%}cme1#S@jv4$!JAvuSZME8j|1>tr`%c9mQ_6>KFQB` zbD8DGc(^SLz)V~`pQ=U7lOINe4b=ef=j=k!+x=a`_(); item.shootSpeed = 16f; item.Calamity().rogue = true; @@ -37,7 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceRogue = true; Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Projectiles/Hybrid/MangroveChakramProjectile.cs b/Projectiles/Hybrid/MangroveChakramProjectile.cs deleted file mode 100644 index 34daf53f50..0000000000 --- a/Projectiles/Hybrid/MangroveChakramProjectile.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Hybrid -{ - public class MangroveChakramProjectile : ModProjectile - { - public override string Texture => "CalamityMod/Items/Weapons/Rogue/MangroveChakram"; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chakram"); - } - - public override void SetDefaults() - { - projectile.width = 30; - projectile.height = 30; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.aiStyle = 3; - projectile.timeLeft = 600; - aiType = ProjectileID.WoodenBoomerang; - projectile.melee = true; - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, 0f, 0.25f, 0f); - if (Main.rand.NextBool(5)) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 44, projectile.velocity.X * 0.5f, projectile.velocity.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; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.immune[projectile.owner] = 6; - target.AddBuff(BuffID.CursedInferno, 120); - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - target.AddBuff(BuffID.CursedInferno, 120); - } - } -} diff --git a/Projectiles/Rogue/MangroveChakramProjectile.cs b/Projectiles/Rogue/MangroveChakramProjectile.cs new file mode 100644 index 0000000000..d278b0bdd7 --- /dev/null +++ b/Projectiles/Rogue/MangroveChakramProjectile.cs @@ -0,0 +1,55 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class MangroveChakramProjectile : ModProjectile + { + public override string Texture => "CalamityMod/Items/Weapons/Rogue/MangroveChakram"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mangrove Chakram"); + } + + public override void SetDefaults() + { + projectile.width = 30; + projectile.height = 30; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.aiStyle = 3; + projectile.timeLeft = 600; + aiType = ProjectileID.WoodenBoomerang; + projectile.melee = true; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, 0f, 0.25f, 0f); + if (Main.rand.NextBool(5)) + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 44, projectile.velocity.X * 0.5f, projectile.velocity.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; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.immune[projectile.owner] = 6; + target.AddBuff(BuffID.CursedInferno, 120); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.CursedInferno, 120); + } + } +} From 405a11913576abf2bbc2df24700b21c2ba0aa19a Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sat, 21 Nov 2020 22:29:11 -0500 Subject: [PATCH 05/26] removed melee subduction slicer --- Items/Weapons/Melee/FlameScytheMelee.cs | 46 ----------- Items/Weapons/Melee/FlameScytheMelee.png | Bin 1466 -> 0 bytes Items/Weapons/Rogue/FlameScythe.cs | 15 ++-- Projectiles/Hybrid/FlameScytheProjectile.cs | 82 -------------------- Projectiles/Rogue/FlameScytheProjectile.cs | 74 ++++++++++++++++++ 5 files changed, 81 insertions(+), 136 deletions(-) delete mode 100644 Items/Weapons/Melee/FlameScytheMelee.cs delete mode 100644 Items/Weapons/Melee/FlameScytheMelee.png delete mode 100644 Projectiles/Hybrid/FlameScytheProjectile.cs create mode 100644 Projectiles/Rogue/FlameScytheProjectile.cs diff --git a/Items/Weapons/Melee/FlameScytheMelee.cs b/Items/Weapons/Melee/FlameScytheMelee.cs deleted file mode 100644 index 7d8d78e68c..0000000000 --- a/Items/Weapons/Melee/FlameScytheMelee.cs +++ /dev/null @@ -1,46 +0,0 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Hybrid; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Melee -{ - public class FlameScytheMelee : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Subduction Slicer"); - Tooltip.SetDefault("Throws a scythe that explodes on enemy hits"); - } - - public override void SetDefaults() - { - item.width = 50; - item.damage = 90; - item.noMelee = true; - item.noUseGraphic = true; - item.autoReuse = true; - item.useAnimation = 20; - item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 20; - item.knockBack = 8.5f; - item.UseSound = SoundID.Item1; - item.melee = true; - item.height = 48; - item.value = Item.buyPrice(0, 80, 0, 0); - item.rare = 8; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 16f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 9); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} diff --git a/Items/Weapons/Melee/FlameScytheMelee.png b/Items/Weapons/Melee/FlameScytheMelee.png deleted file mode 100644 index 2fb615a05368a974c8e12a0a068df78f870cf2bd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1466 zcmV;r1x5OaP)Px)bV)=(RA_UXh>nKgVagy%xZX6OEevw2}Y-`}%Zyzyi2@r7hZ5 zh)NS4>fQeba*g)}3s%1Yz~n9O*#JpTmskLEGP(e`c(Tt1I9fdnz>5cx#{0;qlpq+X zZf^PnfI0QGHo(P`eE@9xZn187;3ohI)0A%prau9|1ef}+C%ARO{$TZ=xVb8ir)Mffb_OY0DQG*4*;*9ehq+cYP(iD-LInM&n-8*0doPR%Av#;IK4nWPOd~LkAO6AM>%U5XQogJ+J z^!N6Me7-x`Z2|c2`GL_%#y&xBW*z|jy;mZdFhbC%WUAkO3xL)SztrrzRxi}f&mBJo zK-R1r0CIdq5j{5q*@!Bkm?t>yJh;v`1ArZ$ZwKIL^?d+7+M!3q;%DXokbU?J08P&L z)_j#0C8`S9mE~)+`9g5y#a-&v<%xk_x8t;Bf%f)++*~&UG_Nw(MO61fy%q z`3q{kLC%}$mH83_{xuUM2!>NuO0oq|*Ky4TSXjLcfSvWV0Mt|{yPaod0+8eL0nnum zcpWlpPpI>K91r;%Gs-qM{T$VMCJ34uiB`dUsA>Jes{nK!RL8mw)g6>%`a;?Zp^fe8 zIDfes7vC$NI8n22HgDimR1l|8H0oMZB>87juKMS1U2j#L`^zd1hU?rVZ;FKYhQ3Mw zdYhF~mR=gv>}D*=0^ry38UW57-UYyX*B=(Zxq#{`TaWG6=EXe0F-KAH#X@6TqNX?V zjy5iNul|lcUgwaW?fBllWj*T0GIcO3BGHjj6-~>Ume>I0xwkEVf^{1KI8?V4NDz!% zW?qzvBj`)&QH>~)tGZm;c!zT)z9{;l`g;I!DpWsNxu;%Tn5qs!azkHb$jT<>36436 znlk&ulF}tWuzT3-tc!||UOU|lK))x=0{F%Mr`BKoSQYx?%K!9hAh@=ZQ=y!~GvHaTgrnwma>^zeda=tz2_-Ly7nigcK`>fm> z(1=R6G2HMO5F{z*lS|40ID2@P=8Fk}k!oJIZ38sT^=ji%YwmW|Vnk)612FY3l?Si% zUw5wLiiriVq+|*J#Z`?qJV;VBG;6N@+~Ipbf?#-UUb+;3^ub;LT3haG*QFciZtGNb z9*+eusrMEDm)+_gF7)f`s6mpBoc7_R=cZfmAW2gNGu0R1+uvYA91x5;4@%Tb^{N_i zYJtawU{@e{Zg=zV0Hma)S^&eh?*btRMW{TlB2%#}8-OF{Zm3<~-)4RQz&mSB0dYXkWfDvGcmNn0Q2TxU zyDDGFo`JbmBIL3INftoYLndcx;*+Hoz;87#s4vWjs1qXxl|?dsK|v|6Ot$j@e)Pzyty_6iOD{mxw|9z&5V+wM@7z*MANm-8ck2LON;jL zL(r5EHTUPjk$hYPMN%W1iVK3;fSCtJBZ*TDJ#K>G6#E3t0U>JU$I(); item.shootSpeed = 16f; item.Calamity().rogue = true; @@ -38,8 +38,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceRogue = true; - Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Projectiles/Hybrid/FlameScytheProjectile.cs b/Projectiles/Hybrid/FlameScytheProjectile.cs deleted file mode 100644 index e8957da349..0000000000 --- a/Projectiles/Hybrid/FlameScytheProjectile.cs +++ /dev/null @@ -1,82 +0,0 @@ -using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Hybrid -{ - public class FlameScytheProjectile : ModProjectile - { - public override string Texture => "CalamityMod/Items/Weapons/Rogue/FlameScythe"; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Scythe"); - } - - public override void SetDefaults() - { - projectile.width = 30; - projectile.height = 30; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.aiStyle = 3; - projectile.extraUpdates = 1; - projectile.timeLeft = 600; - projectile.alpha = 55; - aiType = ProjectileID.WoodenBoomerang; - projectile.melee = true; - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, 0.25f, 0.15f, 0f); - if (Main.rand.NextBool(5)) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, Main.rand.NextBool(3) ? 16 : 127, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } - Vector2 goreVec = new Vector2(projectile.position.X + (float)(projectile.width / 2) + projectile.velocity.X, projectile.position.Y + (float)(projectile.height / 2) + projectile.velocity.Y); - if (Main.rand.NextBool(8)) - { - int smoke = Gore.NewGore(goreVec, default, Main.rand.Next(375, 378), 0.75f); - Main.gore[smoke].behindTiles = true; - } - } - - 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; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.immune[projectile.owner] = 6; - target.AddBuff(BuffID.OnFire, 300); - if (projectile.owner == Main.myPlayer) - { - int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - if (projectile.melee) - Main.projectile[proj].Calamity().forceMelee = true; - else - Main.projectile[proj].Calamity().forceRogue = true; - } - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - target.AddBuff(BuffID.OnFire, 300); - if (projectile.owner == Main.myPlayer) - { - int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - if (projectile.melee) - Main.projectile[proj].Calamity().forceMelee = true; - else - Main.projectile[proj].Calamity().forceRogue = true; - } - } - } -} diff --git a/Projectiles/Rogue/FlameScytheProjectile.cs b/Projectiles/Rogue/FlameScytheProjectile.cs new file mode 100644 index 0000000000..f87b05b64a --- /dev/null +++ b/Projectiles/Rogue/FlameScytheProjectile.cs @@ -0,0 +1,74 @@ +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class FlameScytheProjectile : ModProjectile + { + public override string Texture => "CalamityMod/Items/Weapons/Rogue/FlameScythe"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Scythe"); + } + + public override void SetDefaults() + { + projectile.width = 30; + projectile.height = 30; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.aiStyle = 3; + projectile.extraUpdates = 1; + projectile.timeLeft = 600; + projectile.alpha = 55; + aiType = ProjectileID.WoodenBoomerang; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, 0.25f, 0.15f, 0f); + if (Main.rand.NextBool(5)) + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, Main.rand.NextBool(3) ? 16 : 127, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + Vector2 goreVec = new Vector2(projectile.position.X + projectile.width / 2 + projectile.velocity.X, projectile.position.Y + projectile.height / 2 + projectile.velocity.Y); + if (Main.rand.NextBool(8)) + { + int smoke = Gore.NewGore(goreVec, default, Main.rand.Next(375, 378), 0.75f); + Main.gore[smoke].behindTiles = true; + } + } + + 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; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.immune[projectile.owner] = 6; + target.AddBuff(BuffID.OnFire, 300); + if (projectile.owner == Main.myPlayer) + { + int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Main.projectile[proj].Calamity().forceRogue = true; + } + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.OnFire, 300); + if (projectile.owner == Main.myPlayer) + { + int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Main.projectile[proj].Calamity().forceRogue = true; + } + } + } +} From 770652370b00f78748cb3d0bd064b6145087ed3e Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sat, 21 Nov 2020 23:45:16 -0500 Subject: [PATCH 06/26] removed melee terra disk --- Items/Weapons/Melee/TerraDiskMelee.cs | 77 --------- Items/Weapons/Melee/TerraDiskMelee.png | Bin 1071 -> 0 bytes Items/Weapons/Rogue/TerraDisk.cs | 24 +-- Projectiles/Hybrid/TerraDiskProjectile.cs | 200 +++++++++++----------- 4 files changed, 109 insertions(+), 192 deletions(-) delete mode 100644 Items/Weapons/Melee/TerraDiskMelee.cs delete mode 100644 Items/Weapons/Melee/TerraDiskMelee.png diff --git a/Items/Weapons/Melee/TerraDiskMelee.cs b/Items/Weapons/Melee/TerraDiskMelee.cs deleted file mode 100644 index cdcfb0e8b1..0000000000 --- a/Items/Weapons/Melee/TerraDiskMelee.cs +++ /dev/null @@ -1,77 +0,0 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.Projectiles.Hybrid; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Melee -{ - public class TerraDiskMelee : ModItem - { - public static int BaseDamage = 100; - public static float Speed = 12f; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Terra Disk"); - Tooltip.SetDefault(@"Throws a disk that has a chance to generate several disks if enemies are near it -A max of three disks can be active at a time"); - } - - public override void SetDefaults() - { - item.width = 46; - item.height = 46; - item.damage = BaseDamage; - item.knockBack = 4f; - item.useAnimation = 16; - item.useTime = 16; - item.autoReuse = true; - item.noMelee = true; - item.noUseGraphic = true; - - item.useStyle = ItemUseStyleID.SwingThrow; - item.UseSound = SoundID.Item1; - - item.value = Item.buyPrice(0, 80, 0, 0); - item.rare = 8; - - item.melee = true; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = Speed; - } - - public override bool CanUseItem(Player player) - { - if (player.ownedProjectileCounts[item.shoot] >= 3) - { - return false; - } - else - { - return 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) - { - int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceMelee = true; - return false; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.SetResult(this); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ItemID.ThornChakram); - recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddTile(TileID.MythrilAnvil); - recipe.AddRecipe(); - } - } -} diff --git a/Items/Weapons/Melee/TerraDiskMelee.png b/Items/Weapons/Melee/TerraDiskMelee.png deleted file mode 100644 index 32b39a6f1e1774179573d39b8fc54461cca1d507..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1071 zcmV+~1kn45P)cXo@s+()d_?7|q=pG`6O@s!ZM2K1z)cjm zk!sN{Xi?EdNZJGi(XM@2K}HcoBo@{9sHhaJq%w6(3Z})mpLfogdmUc|cl>W=?m6e4 z^YOpm`G4Q}j)fOi*8vbH%miRnK^_3(-Gecf5V_$}3t+7KqiXo^U{3F?SV|-QC#-}P zo9WQ*-vIPHOp5_z?A!oAMN2&ZM=Gu?YT@gB#{hV7;-;);+3TqRNtjOo#yyz6boVC! z$7>pAov7nk=b{X0Ysk@UN>#=K3uRguK6ARvZYk6He?9;5PYw4i<5uq8!vKtRf7F;Z z;V`R^zi%3V*2Yf&w0D*O@ZsVZ0JT;R028Z*>f;ux>tX;qE*}IO zeHNYVyLu0Be0Jl>Ty26q*M_v`n#yVI`NrcxXD#6A_wP$$xNjK`m<{5~zn-gzRvpT+ z0A4{1pzX;!076Yw0BrAS0^sGXJ^-$^zXu>P`c|8FO{R*7wdA=PGT$%ZTgGR6T#y}B zDzKtoF;+Pli2+bpSH$4j?OpT7O-IN+#{Aefc`Ky98< zo4GRYTgDUeacsRda~3m_UI@O?`i0>&nQ0clw@LNo%C@ZsVBqyvO`S}=AByE$07Dea zZn5nlzGXb%)e(0hv7sWVWPR)^1|0Pe#)at_Uw!R9zwC|3sCpivAX)W5J0GVMY700GvBNV7I8>r1cgXzGd8+?+X&)uzlStA_`2Omc7w+ zv`B0Jd|$Q8Nvp6tXaNlOM_uRjE#ra3P7s&n0gf+=zMFZv=yyxbN`0dJYHOVAR&k(-QJrk}~Vo{sr!?+hr zwJ~+u^mS8Jqypwuhd1>-g&FralbXn80)UdBQjM%Br2(); @@ -44,21 +44,21 @@ A max of three disks can be active at a time"); public override bool CanUseItem(Player player) { - if (player.ownedProjectileCounts[item.shoot] >= 3) - { - return false; - } - else - { - return true; - } + if (player.ownedProjectileCounts[item.shoot] >= 3) + { + return false; + } + else + { + return 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) { int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); Main.projectile[proj].Calamity().forceRogue = true; - Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Projectiles/Hybrid/TerraDiskProjectile.cs b/Projectiles/Hybrid/TerraDiskProjectile.cs index d199352d85..b6251e6744 100644 --- a/Projectiles/Hybrid/TerraDiskProjectile.cs +++ b/Projectiles/Hybrid/TerraDiskProjectile.cs @@ -1,3 +1,4 @@ +using CalamityMod.Projectiles.Hybrid; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -5,112 +6,105 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Hybrid +namespace CalamityMod.Projectiles.Rogue { - public class TerraDiskProjectile : ModProjectile - { - public override string Texture => "CalamityMod/Items/Weapons/Rogue/TerraDisk"; + public class TerraDiskProjectile : ModProjectile + { + public override string Texture => "CalamityMod/Items/Weapons/Rogue/TerraDisk"; - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Terra Disk"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; - ProjectileID.Sets.TrailingMode[projectile.type] = 1; - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Terra Disk"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + } - public override void SetDefaults() - { - projectile.width = 46; - projectile.height = 46; - projectile.friendly = true; - projectile.tileCollide = false; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; - projectile.penetrate = -1; - projectile.aiStyle = 3; - projectile.timeLeft = 180; - aiType = ProjectileID.WoodenBoomerang; - } + public override void SetDefaults() + { + projectile.width = 46; + projectile.height = 46; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.penetrate = -1; + projectile.aiStyle = 3; + projectile.timeLeft = 180; + aiType = ProjectileID.WoodenBoomerang; + projectile.Calamity().rogue = true; + } - public override void AI() - { - Lighting.AddLight(projectile.Center, 0f, (255 - projectile.alpha) * 0.75f / 255f, 0f); - if (Main.rand.NextBool(5)) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 107, projectile.velocity.X, projectile.velocity.Y); - } - int[] array = new int[20]; - int num428 = 0; - float num429 = 300f; - bool flag14 = false; - for (int num430 = 0; num430 < 200; num430++) - { - if (Main.npc[num430].CanBeChasedBy(projectile, false)) - { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); - if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) - { - if (num428 < 20) - { - array[num428] = num430; - num428++; - } - flag14 = true; - } - } - } - if (flag14) - { - int num434 = Main.rand.Next(num428); - num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); - projectile.localAI[0] += 1f; - if (projectile.localAI[0] > 8f) - { - projectile.localAI[0] = 0f; - float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - value10 += projectile.velocity * 4f; - float num438 = num435 - value10.X; - float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); - num440 = num437 / num440; - if (Main.rand.NextBool(5)) - { - if (projectile.owner == Main.myPlayer) - { - float spread = 60f * 0.0174f; - double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; - double deltaAngle = spread / 6f; - double offsetAngle; - int i; - for (i = 0; i < 3; i++) - { - offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - if (projectile.melee) - Main.projectile[proj].Calamity().forceMelee = true; - else - Main.projectile[proj].Calamity().forceRogue = true; - int proj2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage / 2, projectile.knockBack, projectile.owner, 0f, 0f); - if (projectile.melee) - Main.projectile[proj2].Calamity().forceMelee = true; - else - Main.projectile[proj2].Calamity().forceRogue = true; - } - } - } - } - } - } + public override void AI() + { + Lighting.AddLight(projectile.Center, 0f, (255 - projectile.alpha) * 0.75f / 255f, 0f); + if (Main.rand.NextBool(5)) + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 107, projectile.velocity.X, projectile.velocity.Y); + int[] array = new int[20]; + int num428 = 0; + float num429 = 300f; + bool flag14 = false; + for (int num430 = 0; num430 < 200; num430++) + { + if (Main.npc[num430].CanBeChasedBy(projectile, false)) + { + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); + if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) + { + if (num428 < 20) + { + array[num428] = num430; + num428++; + } + flag14 = true; + } + } + } + if (flag14) + { + int num434 = Main.rand.Next(num428); + num434 = array[num434]; + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > 8f) + { + projectile.localAI[0] = 0f; + float num437 = 6f; + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); + value10 += projectile.velocity * 4f; + float num438 = num435 - value10.X; + float num439 = num436 - value10.Y; + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); + num440 = num437 / num440; + if (Main.rand.NextBool(5)) + { + if (projectile.owner == Main.myPlayer) + { + float spread = 60f * 0.0174f; + double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; + double deltaAngle = spread / 6f; + double offsetAngle; + int i; + for (i = 0; i < 3; i++) + { + offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; + int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + Main.projectile[proj].Calamity().forceRogue = true; + int proj2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage / 2, projectile.knockBack, projectile.owner, 0f, 0f); + Main.projectile[proj2].Calamity().forceRogue = true; + } + } + } + } + } + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); - return false; - } - } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); + return false; + } + } } From a1a0e10eede46ef46131a4b9cded59cdb9fcc38c Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 22 Nov 2020 00:17:45 -0500 Subject: [PATCH 07/26] removed melee corpus avertor --- Items/Weapons/Melee/CorpusAvertorMelee.cs | 53 ---------- Items/Weapons/Melee/CorpusAvertorMelee.png | Bin 480 -> 0 bytes Items/Weapons/Rogue/CorpusAvertor.cs | 6 +- Projectiles/Hybrid/CorpusAvertorClone.cs | 104 -------------------- Projectiles/Hybrid/CorpusAvertorProj.cs | 109 --------------------- Projectiles/Rogue/CorpusAvertorClone.cs | 102 +++++++++++++++++++ Projectiles/Rogue/CorpusAvertorProj.cs | 109 +++++++++++++++++++++ 7 files changed, 214 insertions(+), 269 deletions(-) delete mode 100644 Items/Weapons/Melee/CorpusAvertorMelee.cs delete mode 100644 Items/Weapons/Melee/CorpusAvertorMelee.png delete mode 100644 Projectiles/Hybrid/CorpusAvertorClone.cs delete mode 100644 Projectiles/Hybrid/CorpusAvertorProj.cs create mode 100644 Projectiles/Rogue/CorpusAvertorClone.cs create mode 100644 Projectiles/Rogue/CorpusAvertorProj.cs diff --git a/Items/Weapons/Melee/CorpusAvertorMelee.cs b/Items/Weapons/Melee/CorpusAvertorMelee.cs deleted file mode 100644 index eb7dc11672..0000000000 --- a/Items/Weapons/Melee/CorpusAvertorMelee.cs +++ /dev/null @@ -1,53 +0,0 @@ -using CalamityMod.Projectiles.Hybrid; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Melee -{ - public class CorpusAvertorMelee : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Corpus Avertor"); - Tooltip.SetDefault("Seems like it has worn down over time\n" + - "Attacks grant lifesteal based on damage dealt\n" + - "The lower your HP the more damage this weapon does and heals the player on enemy hits"); - } - - public override void SetDefaults() - { - item.width = 18; - item.height = 32; - item.damage = 98; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 15; - item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 15; - item.knockBack = 3f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.value = Item.buyPrice(gold: 80); - item.rare = 8; - item.Calamity().customRarity = CalamityRarity.Dedicated; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 5f; - item.melee = true; - } - - // Gains 10% of missing health as base damage. - public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) - { - int lifeAmount = player.statLifeMax2 - player.statLife; - flat += lifeAmount * 0.1f * player.MeleeDamage(); - } - - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); - return false; - } - } -} diff --git a/Items/Weapons/Melee/CorpusAvertorMelee.png b/Items/Weapons/Melee/CorpusAvertorMelee.png deleted file mode 100644 index 1d32c48c941073985a2397c9b1c12b5baa6d7293..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 480 zcmeAS@N?(olHy`uVBq!ia0vp^LO`s*!3HGdYcxIrDVB6cUq=Rpjs4tz5?O(K#^NA% zCx&(BWL|<)CVK?=GB8xBF)%c=FfjZA3N^f7U???UV0e|lz+g3lfkC`r&aOZkpaffz zx4R3&e-K=-cll(X2xoyuWHAE+-(e7DJf6QI1t|E%)5S5whxA}#jyT!Pa? z1sx*f+_ZH~Ub)@5`hm&sd&G(7&f=4Bmz zTB`S3YNyuENhR#e4BuXF)d{>h{m4{_i|5^u`{956XMZ)1o$gV}Q_hR=VEoW<(;b!M)f8&)ArXF$E|$~M+$jr z@=j~TWKTVpJ8_W)(}Nv%pG|5}FA8;0@+)DjI_YCtW+%A==zqx)*NBqf{Irtt#G+J& zg2c?c61}|C5(N`I13g1y6XxhDpdulVBG(8{H!J_5%+$P+#FEVXJO;y-h&S(nvJ9TC KelF{r5}E+NrmbQC diff --git a/Items/Weapons/Rogue/CorpusAvertor.cs b/Items/Weapons/Rogue/CorpusAvertor.cs index 9733ced190..db72a018ce 100644 --- a/Items/Weapons/Rogue/CorpusAvertor.cs +++ b/Items/Weapons/Rogue/CorpusAvertor.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Hybrid; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -29,8 +29,8 @@ namespace CalamityMod.Items.Weapons.Rogue item.knockBack = 3f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.value = Item.buyPrice(0, 80, 0, 0); - item.rare = 8; + item.value = Item.buyPrice(gold: 80); + item.rare = ItemRarityID.Yellow; item.Calamity().customRarity = CalamityRarity.Dedicated; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 5f; diff --git a/Projectiles/Hybrid/CorpusAvertorClone.cs b/Projectiles/Hybrid/CorpusAvertorClone.cs deleted file mode 100644 index 381deb98f8..0000000000 --- a/Projectiles/Hybrid/CorpusAvertorClone.cs +++ /dev/null @@ -1,104 +0,0 @@ -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 CorpusAvertorClone : ModProjectile - { - public override string Texture => "CalamityMod/Items/Weapons/Rogue/CorpusAvertor"; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Corpus Avertor"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } - - public override void SetDefaults() - { - projectile.width = 24; - projectile.height = 24; - projectile.friendly = true; - projectile.penetrate = 1; - projectile.timeLeft = 180; - projectile.melee = true; - projectile.tileCollide = false; - } - - public override void AI() - { - if (projectile.ai[1] == 1f) - { - projectile.melee = false; - projectile.Calamity().rogue = true; - } - - projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.04f; - - projectile.velocity.X *= 1.005f; - projectile.velocity.Y *= 1.005f; - - switch ((int)projectile.ai[0]) - { - case 20: - projectile.scale = 0.7f; - break; - case 40: - projectile.scale = 0.8f; - break; - case 60: - projectile.scale = 0.9f; - break; - default: - break; - } - projectile.width = projectile.height = (int)(24f * projectile.scale); - - CalamityGlobalProjectile.HomeInOnNPC(projectile, true, 300f, 16f, 20f); - } - - public override Color? GetAlpha(Color lightColor) - { - if (projectile.timeLeft < 85) - { - return new Color((int)(150f * ((float)projectile.timeLeft / 85f)), 0, 0, projectile.timeLeft / 5 * 3); - } - return new Color(150, 0, 0, 50); - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if (target.type == NPCID.TargetDummy) - return; - - float heal = (float)damage * 0.05f; - if ((int)heal == 0) - return; - if (Main.player[Main.myPlayer].lifeSteal <= 0f) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 1.5f); - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - float heal = (float)damage * 0.05f; - if ((int)heal == 0) - return; - if (Main.player[Main.myPlayer].lifeSteal <= 0f) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 1.5f); - } - } -} diff --git a/Projectiles/Hybrid/CorpusAvertorProj.cs b/Projectiles/Hybrid/CorpusAvertorProj.cs deleted file mode 100644 index e1f0e8c8fb..0000000000 --- a/Projectiles/Hybrid/CorpusAvertorProj.cs +++ /dev/null @@ -1,109 +0,0 @@ -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 CorpusAvertorProj : ModProjectile - { - public override string Texture => "CalamityMod/Items/Weapons/Rogue/CorpusAvertor"; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Corpus Avertor"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } - - public override void SetDefaults() - { - projectile.width = 24; - projectile.height = 24; - projectile.friendly = true; - projectile.penetrate = 1; - projectile.timeLeft = 300; - projectile.melee = true; - } - - public override void AI() - { - if (projectile.ai[1] == 1f) - { - projectile.melee = false; - projectile.Calamity().rogue = true; - } - - projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.02f; - - if (projectile.ai[0] < 120f) - projectile.ai[0] += 1f; - - if (projectile.ai[0] < 61f) - { - if (projectile.ai[0] % 20f == 0f) - { - Vector2 velocity = new Vector2(projectile.velocity.X, projectile.velocity.Y); - float mult = projectile.ai[0] / 80f; // Ranges from 0.25 to 0.5 to 0.75 - velocity *= mult; - - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), - (int)(projectile.damage * mult), projectile.knockBack * mult, projectile.owner, projectile.ai[0], projectile.melee ? 0f : 1f); - } - } - else - { - projectile.velocity.X *= 1.01f; - projectile.velocity.Y *= 1.01f; - - int scale = (int)((projectile.ai[0] - 60f) * 4.25f); - int dust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, new Color(scale, 0, 0, 50), 2f); - Main.dust[dust].velocity *= 0f; - Main.dust[dust].noGravity = true; - } - } - - public override Color? GetAlpha(Color lightColor) - { - if (projectile.ai[0] >= 61f) - { - int scale = (int)((projectile.ai[0] - 60f) * 4.25f); - return new Color(scale, 0, 0, 50); - } - return new Color(0, 0, 0, 50); - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if (target.type == NPCID.TargetDummy) - return; - - float heal = (float)damage * 0.05f; - if ((int)heal == 0) - return; - if (Main.player[Main.myPlayer].lifeSteal <= 0f) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 1.5f); - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - float heal = (float)damage * 0.05f; - if ((int)heal == 0) - return; - if (Main.player[Main.myPlayer].lifeSteal <= 0f) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 1.5f); - } - } -} diff --git a/Projectiles/Rogue/CorpusAvertorClone.cs b/Projectiles/Rogue/CorpusAvertorClone.cs new file mode 100644 index 0000000000..02fe2e20d2 --- /dev/null +++ b/Projectiles/Rogue/CorpusAvertorClone.cs @@ -0,0 +1,102 @@ +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 CorpusAvertorClone : ModProjectile + { + public override string Texture => "CalamityMod/Items/Weapons/Rogue/CorpusAvertor"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Corpus Avertor"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 24; + projectile.height = 24; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 180; + projectile.melee = true; + projectile.tileCollide = false; + } + + public override void AI() + { + if (projectile.ai[1] == 1f) + { + projectile.melee = false; + projectile.Calamity().rogue = true; + } + + projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.04f; + + projectile.velocity.X *= 1.005f; + projectile.velocity.Y *= 1.005f; + + switch ((int)projectile.ai[0]) + { + case 20: + projectile.scale = 0.7f; + break; + case 40: + projectile.scale = 0.8f; + break; + case 60: + projectile.scale = 0.9f; + break; + default: + break; + } + projectile.width = projectile.height = (int)(24f * projectile.scale); + + CalamityGlobalProjectile.HomeInOnNPC(projectile, true, 300f, 16f, 20f); + } + + public override Color? GetAlpha(Color lightColor) + { + if (projectile.timeLeft < 85) + return new Color((int)(150f * (projectile.timeLeft / 85f)), 0, 0, projectile.timeLeft / 5 * 3); + return new Color(150, 0, 0, 50); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (target.type == NPCID.TargetDummy) + return; + + float heal = damage * 0.05f; + if ((int)heal == 0) + return; + if (Main.player[Main.myPlayer].lifeSteal <= 0f) + return; + + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 1.5f); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + float heal = damage * 0.05f; + if ((int)heal == 0) + return; + if (Main.player[Main.myPlayer].lifeSteal <= 0f) + return; + + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 1.5f); + } + } +} diff --git a/Projectiles/Rogue/CorpusAvertorProj.cs b/Projectiles/Rogue/CorpusAvertorProj.cs new file mode 100644 index 0000000000..ee280c481a --- /dev/null +++ b/Projectiles/Rogue/CorpusAvertorProj.cs @@ -0,0 +1,109 @@ +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 CorpusAvertorProj : ModProjectile + { + public override string Texture => "CalamityMod/Items/Weapons/Rogue/CorpusAvertor"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Corpus Avertor"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 24; + projectile.height = 24; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 300; + projectile.melee = true; + } + + public override void AI() + { + if (projectile.ai[1] == 1f) + { + projectile.melee = false; + projectile.Calamity().rogue = true; + } + + projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.02f; + + if (projectile.ai[0] < 120f) + projectile.ai[0] += 1f; + + if (projectile.ai[0] < 61f) + { + if (projectile.ai[0] % 20f == 0f) + { + Vector2 velocity = new Vector2(projectile.velocity.X, projectile.velocity.Y); + float mult = projectile.ai[0] / 80f; // Ranges from 0.25 to 0.5 to 0.75 + velocity *= mult; + + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), + (int)(projectile.damage * mult), projectile.knockBack * mult, projectile.owner, projectile.ai[0], projectile.melee ? 0f : 1f); + } + } + else + { + projectile.velocity.X *= 1.01f; + projectile.velocity.Y *= 1.01f; + + int scale = (int)((projectile.ai[0] - 60f) * 4.25f); + int dust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, new Color(scale, 0, 0, 50), 2f); + Main.dust[dust].velocity *= 0f; + Main.dust[dust].noGravity = true; + } + } + + public override Color? GetAlpha(Color lightColor) + { + if (projectile.ai[0] >= 61f) + { + int scale = (int)((projectile.ai[0] - 60f) * 4.25f); + return new Color(scale, 0, 0, 50); + } + return new Color(0, 0, 0, 50); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (target.type == NPCID.TargetDummy) + return; + + float heal = damage * 0.05f; + if ((int)heal == 0) + return; + if (Main.player[Main.myPlayer].lifeSteal <= 0f) + return; + + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 1.5f); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + float heal = damage * 0.05f; + if ((int)heal == 0) + return; + if (Main.player[Main.myPlayer].lifeSteal <= 0f) + return; + + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 1.5f); + } + } +} From 164bc15ef914c0c7275ce917c3b070eeac3ef006 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 22 Nov 2020 00:40:44 -0500 Subject: [PATCH 08/26] removed melee elemental disk --- Items/Weapons/Melee/AccretionDiskMelee.cs | 52 -------------- Items/Weapons/Melee/AccretionDiskMelee.png | Bin 1780 -> 0 bytes Items/Weapons/Rogue/AccretionDisk.cs | 9 ++- Projectiles/Hybrid/AccretionDisk2.cs | 67 ----------------- Projectiles/Rogue/AccretionDisk2.cs | 68 ++++++++++++++++++ .../{Hybrid => Rogue}/AccretionDiskProj.cs | 20 +++--- 6 files changed, 80 insertions(+), 136 deletions(-) delete mode 100644 Items/Weapons/Melee/AccretionDiskMelee.cs delete mode 100644 Items/Weapons/Melee/AccretionDiskMelee.png delete mode 100644 Projectiles/Hybrid/AccretionDisk2.cs create mode 100644 Projectiles/Rogue/AccretionDisk2.cs rename Projectiles/{Hybrid => Rogue}/AccretionDiskProj.cs (82%) diff --git a/Items/Weapons/Melee/AccretionDiskMelee.cs b/Items/Weapons/Melee/AccretionDiskMelee.cs deleted file mode 100644 index ca848e670e..0000000000 --- a/Items/Weapons/Melee/AccretionDiskMelee.cs +++ /dev/null @@ -1,52 +0,0 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Hybrid; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Melee -{ - public class AccretionDiskMelee : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Elemental Disk"); - Tooltip.SetDefault("Throws a disk that has a chance to generate several disks if enemies are near it"); - } - - public override void SetDefaults() - { - item.width = 38; - item.damage = 118; - item.noMelee = true; - item.noUseGraphic = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 15; - item.knockBack = 9f; - item.UseSound = SoundID.Item1; - item.melee = true; - item.height = 38; - item.value = Item.buyPrice(1, 20, 0, 0); - item.rare = 10; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 13f; - item.Calamity().customRarity = CalamityRarity.Turquoise; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ItemID.LunarBar, 5); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} diff --git a/Items/Weapons/Melee/AccretionDiskMelee.png b/Items/Weapons/Melee/AccretionDiskMelee.png deleted file mode 100644 index e131c1a252657ca7953ad3e6e4af5e302ab07c9c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1780 zcmViG2n}MLn=lS6l0@6j2a0TqKQO|!Arnf z6I6m=1dQ<#(NGm0K%0UU3btIfwMA@;t+^L}yR7#tv2JHYH>srQu|SxZmMbZh5>#!NkuCjYo-+XD zW)uKt>VpnI!l=BiCz9OH0Ng%rI}n}RWnwB_kJ>s)B!-lrmPd0G=~GS`fcJN20dO>~ zK}gMc9Drd{&H=D+LU;s##V_}fH+#z*fcP}Yrqi!o4#2kE%dPg_C6+U%AY#RVjjJ!I zV>c;v6rUDn0#G|f+&%|?1EP~st$OMd0I%)Jk@*#@)?Grx%;jj@_1t73R`cYB?(whyy7ga*)(4-pxIJM`n1CX;?#!*tQ?eYOo zx#oa1(blpH+n0Ho7y!9eh@eKfc>1hU_t-3zq2lFg3lQXBl0k~%My#VYh_y_=B zda41){HYdz8SxDOB$fHBn7nW6FII<2@UOQX24M0Uf5d^WnD;U8&uk~eqGd&uwmVQD zSvzIgL<4ZTUSeIHh*N`xE}${LAnW4dP_|SLNhq6pmY7*s_$>g3DjTd=TeR#e0FrXA0N`w%WG{_9btt(%NNm+K z90lOln05!kF{Pxw`+i%*YmK>n=K=;GUw5>ngkHEyR(>VdXK@+;F-5X3D%~t6x`}={W2asm!0G+_taVOfY~F)U0I=@8 z*8yk>)>spnczQkn<1z;tfNzdUwmUOEMcTW(rLJRcuc_obOROU+_D=3&0Gdjx9DpUE zn9`V2Ey~=~@J)|n(N7?z#_FV@+$+0?%lsXM) zx%k=B`OIF`bBO7gy{>0&a*JG9@yH?DAq?@2FaQ&KOSUXISZA+S8Z%KyZEq0AlFxW4 za5<9hs^<_>xyhyW&oltd&2?70#J=)daZ9K?X}^@${^?kx)Ik()k?fjZ7|MDfB5rT! zF4uipNzfiYnmkLa+yC>3rbn_qw5~J!NdWwMyvcF`Q~S$~JQ}GCf0BuGpPSS>6?3~a zugk>TQc_u|vJ0qaw7q3C*Iuzg{$)^nSYj<9t=#}@EkE4lc-f|V9 z+Uu0McU5Yl?1&rd(); item.shootSpeed = 13f; item.Calamity().rogue = true; @@ -39,7 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceRogue = true; Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Projectiles/Hybrid/AccretionDisk2.cs b/Projectiles/Hybrid/AccretionDisk2.cs deleted file mode 100644 index 9cc7565758..0000000000 --- a/Projectiles/Hybrid/AccretionDisk2.cs +++ /dev/null @@ -1,67 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Hybrid -{ - public class AccretionDisk2 : ModProjectile - { - public override string Texture => "CalamityMod/Items/Weapons/Rogue/AccretionDisk"; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Accretion Disk"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; - ProjectileID.Sets.TrailingMode[projectile.type] = 1; - } - - public override void SetDefaults() - { - projectile.width = 56; - projectile.height = 56; - projectile.alpha = 120; - projectile.friendly = true; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.aiStyle = 3; - projectile.timeLeft = 60; - aiType = ProjectileID.WoodenBoomerang; - projectile.Calamity().rogue = true; - } - - public override void AI() - { - if (Main.rand.NextBool(10)) - { - int num250 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 66, (float)(projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 0.5f); - Main.dust[num250].noGravity = true; - Main.dust[num250].velocity *= 0f; - } - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); - return false; - } - } -} diff --git a/Projectiles/Rogue/AccretionDisk2.cs b/Projectiles/Rogue/AccretionDisk2.cs new file mode 100644 index 0000000000..ff42dcebd1 --- /dev/null +++ b/Projectiles/Rogue/AccretionDisk2.cs @@ -0,0 +1,68 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class AccretionDisk2 : ModProjectile + { + public override string Texture => "CalamityMod/Items/Weapons/Rogue/AccretionDisk"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Accretion Disk"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + } + + public override void SetDefaults() + { + projectile.width = 56; + projectile.height = 56; + projectile.alpha = 120; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.aiStyle = 3; + projectile.timeLeft = 60; + aiType = ProjectileID.WoodenBoomerang; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + if (Main.rand.NextBool(10)) + { + int num250 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 66, projectile.direction * 2, 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 0.5f); + Main.dust[num250].noGravity = true; + Main.dust[num250].velocity *= 0f; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); + return false; + } + } +} diff --git a/Projectiles/Hybrid/AccretionDiskProj.cs b/Projectiles/Rogue/AccretionDiskProj.cs similarity index 82% rename from Projectiles/Hybrid/AccretionDiskProj.cs rename to Projectiles/Rogue/AccretionDiskProj.cs index 10bc5adf44..4ab27f7b64 100644 --- a/Projectiles/Hybrid/AccretionDiskProj.cs +++ b/Projectiles/Rogue/AccretionDiskProj.cs @@ -7,11 +7,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Hybrid +namespace CalamityMod.Projectiles.Rogue { public class AccretionDiskProj : ModProjectile { - public override string Texture => "CalamityMod/Items/Weapons/Rogue/AccretionDisk"; + public override string Texture => "CalamityMod/Items/Weapons/Rogue/AccretionDisk"; public override void SetStaticDefaults() { @@ -32,14 +32,14 @@ namespace CalamityMod.Projectiles.Hybrid projectile.aiStyle = 3; projectile.timeLeft = 400; aiType = ProjectileID.WoodenBoomerang; - projectile.melee = true; + projectile.Calamity().rogue = true; } public override void AI() { if (Main.rand.NextBool(3)) { - int rainbow = Dust.NewDust(projectile.position, projectile.width, projectile.height, 66, (float)(projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.3f); + int rainbow = Dust.NewDust(projectile.position, projectile.width, projectile.height, 66, projectile.direction * 2, 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.3f); Main.dust[rainbow].noGravity = true; Main.dust[rainbow].velocity *= 0f; } @@ -54,13 +54,13 @@ namespace CalamityMod.Projectiles.Hybrid NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(projectile, false)) { - float extraDistance = (npc.width / 2) + (npc.height / 2); + float extraDistance = npc.width / 2 + npc.height / 2; bool canHit = true; if (extraDistance < maxDistance) canHit = Collision.CanHit(projectile.Center, 1, 1, npc.Center, 1, 1); - if (Vector2.Distance(npc.Center, projectile.Center) < (maxDistance + extraDistance) && canHit) + if (Vector2.Distance(npc.Center, projectile.Center) < maxDistance + extraDistance && canHit) { homeIn = true; break; @@ -69,9 +69,7 @@ namespace CalamityMod.Projectiles.Hybrid } if (!projectile.friendly) - { homeIn = false; - } if (homeIn) { @@ -88,11 +86,9 @@ namespace CalamityMod.Projectiles.Hybrid { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; int disk = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), splitProj, projectile.damage, projectile.knockBack, projectile.owner); - Main.projectile[disk].Calamity().forceMelee = projectile.melee; - Main.projectile[disk].Calamity().forceRogue = projectile.Calamity().rogue; + Main.projectile[disk].Calamity().forceRogue = true; int disk2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), splitProj, projectile.damage, projectile.knockBack, projectile.owner); - Main.projectile[disk2].Calamity().forceMelee = projectile.melee; - Main.projectile[disk2].Calamity().forceRogue = projectile.Calamity().rogue; + Main.projectile[disk2].Calamity().forceRogue = true; } } } From 11621b42c7aad6b25242a010e6d969c38f8433be Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 22 Nov 2020 00:43:16 -0500 Subject: [PATCH 09/26] removed melee eradicator --- Items/Weapons/Melee/EradicatorMelee.cs | 44 ------------- Items/Weapons/Melee/EradicatorMelee.png | Bin 1791 -> 0 bytes Items/Weapons/Melee/EradicatorMeleeGlow.png | Bin 1381 -> 0 bytes Items/Weapons/Rogue/Eradicator.cs | 5 +- Projectiles/CalamityGlobalProjectile.cs | 3 +- Projectiles/Hybrid/EradicatorProjectile.cs | 66 -------------------- Projectiles/Rogue/EradicatorProjectile.cs | 66 ++++++++++++++++++++ 7 files changed, 69 insertions(+), 115 deletions(-) delete mode 100644 Items/Weapons/Melee/EradicatorMelee.cs delete mode 100644 Items/Weapons/Melee/EradicatorMelee.png delete mode 100644 Items/Weapons/Melee/EradicatorMeleeGlow.png delete mode 100644 Projectiles/Hybrid/EradicatorProjectile.cs create mode 100644 Projectiles/Rogue/EradicatorProjectile.cs diff --git a/Items/Weapons/Melee/EradicatorMelee.cs b/Items/Weapons/Melee/EradicatorMelee.cs deleted file mode 100644 index 76807f2b24..0000000000 --- a/Items/Weapons/Melee/EradicatorMelee.cs +++ /dev/null @@ -1,44 +0,0 @@ -using CalamityMod.Projectiles.Hybrid; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Melee -{ - public class EradicatorMelee : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Eradicator"); - Tooltip.SetDefault("Throws a disk that fires lasers at nearby enemies"); - } - - public override void SetDefaults() - { - item.width = 38; - item.damage = 300; - item.noMelee = true; - item.noUseGraphic = true; - item.autoReuse = true; - item.useAnimation = 19; - item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 19; - item.knockBack = 7f; - item.UseSound = SoundID.Item1; - item.melee = true; - item.height = 54; - item.value = Item.buyPrice(1, 40, 0, 0); - item.rare = 10; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 12f; - item.Calamity().customRarity = CalamityRarity.PureGreen; - } - - public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) - { - item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/EradicatorMeleeGlow")); - } - } -} diff --git a/Items/Weapons/Melee/EradicatorMelee.png b/Items/Weapons/Melee/EradicatorMelee.png deleted file mode 100644 index e028ca0e83772ee36bc93200fcf9e0282489ca1b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1791 zcmVe)#>839un+#*pmqtf>UxnFpsC03H4w0It{F z0-(fy9e}qFtcl3(h#@`A|3F5h9dyE^C=(@BEjF?-PsZMr2h`R3lOisjuqelR0CoGY zJ-{PAn0hvz1fa4#0KlQ9t6>q=34KxX-GKLbJ?jO+vFm1k)!cLgAm>H`0I}N_JNEO4 zyGclg$aHEKF45s?Fpm%qFwzYJz-&~HtCRPL>l%!-8{yv8OLynVEX9nUHsEzP4-oQb zf1{B1i0cX=9ueuK&%On~;>?_3J=n?GDgcW2?XaDX)B{A7?EwSeP}5bwBi>)5lE|57q&&ZR;jmf44E^&4TxV zAo;$PUQ)6F9`XJ<{?ac1l=!ck0Apj~41l`M4giwl)aY5&dd}LO2cX)2e&8F990S0( zlym^vu2$Q|5Fxp7-FrZP575caobxaM6LRx_;FutGPOaQ*>tE7(J-UgzE`%k^!Safm zy|)3V45;ll#V<#6qx{M905H2d0cg8gZL=?)ke)aWfNfhhnE*>`)hzMc8!LgJ2grFD z8-6}`!12Bk+Y;;I!5(opMOxX=C8RS7@&TwXtI*f_20(e;aUkdsDN|+`0LA-u*xCzu zAuaR$#qz^Ia5R^7hHN)vZML?GyhmKu-6EYjU6B#eYj$n{VDE-4j{PbcPOJXb@wn6} zHuCz4@Y?yaj&@`PC&cww_lS#x)KDd(bK=BF05sQCnE=aQSwCQVxBK5QZ`+O~rrmOZ z(#9eKU}5?)6Z(^vSdU)f54`xP?L^Db-LmUgX%UU~sp@7|pvBfsM&+CBDjycokFK2$ zz^`AQ0)i{6u?foQ^1J(anh6kSxn{G|SZc+zMO;>FGO9Op{v-X3P&-0i6ura;Yascx zNJi1>h6@(y79coU=jBayv?HXaE}00xGFAgnxM!CMkT`L&0nppi4FpMxT~TA{1>3R2 z`U%T}{C89pxU{hdfb5hd20&%twpA5Y{i2$<3D6T4V*n)jW~&Q{J+}E%vY;ncDN-`J ziU<6;yBvVa`F$}4K;fQUw&Ug4V;<{R$oI9gV*2t4W$$uDGXOExb$xWto;(YHi{*z+ zfEu6A0Jw7b7yxT?A2R@U)>KCMTD|Fh6_eRtmYV=wxeE+{8!d`peBvYnLStH~FDtT$ z-?wg#&9JP@d?^zQfSA~kKqy&7RARorC)joNY=g~ib%ToaYZhr4-9z$nd0qpcwfiAL zkE55k>;z_ymt7Mee%yRTKA>uEz0Iof;kI&;Skz-$MrTpd)GPy_X#W8df}^`W&ll}i z`L$b3ZDeZ{H3u*Bf@r<^By}hU_&?38Gz46tvO^>*c*2%|b%{Ku$Yfn2GkXSDkJ7ZMM zEPx^|q(wS8k&sTEo?`$s*Ht<8zgzN%%X}VZ{evB19tg&?NUEOi@(B>Ej?SDl*A{zj zdPtyZ0{yL%M|_b?K_U=qnCKvF|{HR;(Dx0elBZuy}Fr!BJM_hYUUhU z-8>}5Z5}aH(vL4t9utVDS2PoE&lqc~ROqoTlGv6v7Wzs_f72o4x9{F+LjTb`aZQ_h!^)~_cyxUD4@o=SkKwhS*v85)B2B2(zmCX|(m5?oX%BsEjy8t*_ hdjl9cVO>#6{9i(e_2}kG>RA8)002ovPDHLkV1lq?XORE^ diff --git a/Items/Weapons/Melee/EradicatorMeleeGlow.png b/Items/Weapons/Melee/EradicatorMeleeGlow.png deleted file mode 100644 index 152b9ce5ae0586fe19d1d41d25d347115501e74f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1381 zcmV-r1)BPaP)QMupowu(3WB=Ub7Ywjl^4G+oWFF)E8?|lfG!8zWLyjPd@mjCan)f zBe8vH(?;z>L*lhfo0LklS{e&TK?(%9v&(I_9UsmfmO0Ka%mSr4`+pkF%zWp}{=UmO zGY7#c_0gWA05lYZ00`CO0FYml1;EK4|1tpH*t|6*`-ghE0NDHZT>@ZcA`ZYqo) z6Jr3pb?PNob~92M&Hq5c?F~9%N~DRl?okuj%xAOKWPrMEd?Se~PiUx33_y0jVh>0Y zcT)V#3jlOQBLK7x53Pu>PH6AGY5`DHm2bMPzkddRlPCIId5&&>=Y!<}pmxd+K-R~N zmiMKJ+ewjLBE#xBooHo7E&!dK(|~gpwyO?xbpZgb-<$)SJwkbaC>H|27?i`+$)}0y zaw5H$Rf|F<8>!Y+C%LUAiagpgD)MRKx|R^PBwg&w769Y11=D?NP1;T?^#G-=XhZ7?SmOJhq@`ch|GP)yS?Y)cOkqz@eTl6L~f7P&vu7 z#BC{^fB7^3Z4+Y#Kp<1bbnmR3VTH1-o#m7E50>xHmj^(wq+IsXe!|^|9i+#8LvhID znQh}^Y2ubrznrcMW0Lrn=MK8+sJ`N%x~0-r7WN>W)TCv979; zXNfy5npazw73u15JpiXq9ko1vx%WH(Mr;;;RA?o;NfjXKW41?c;?XqK=Qr0dW))O=Tu4W ze)v5AA}+`0UE(Lvd{jVCCTJo%bs``ncL zK7Yd}8D_?A8URb4%TnGYt`78A_xDYkVqIm;wVJuP{Yu)DJTz6AcrY7)!rw*#`19bs z0OX9!E^E)b#8oU$ZZEcs^|G@A20+;Zr2-&a{TYzV0UI!P7Xa~m>8x2ZaRZX1mF7$H zmNnv8;)|JY+u>vSIRoJRr)mIr_q$#onG2K$^i0Sdi|ge9Dz`+d1EzMBgOq13ktv)1 z@%oFFcGJX_6#4tg "CalamityMod/Items/Weapons/Rogue/Eradicator"; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Eradicator"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; - ProjectileID.Sets.TrailingMode[projectile.type] = 1; - } - - public override void SetDefaults() - { - projectile.width = 58; - projectile.height = 58; - projectile.friendly = true; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.aiStyle = 3; - projectile.timeLeft = 180; - aiType = ProjectileID.WoodenBoomerang; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 3; - projectile.melee = true; - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, 0.35f, 0f, 0.25f); - CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 6f, 8f, 6, ModContent.ProjectileType(), 1D, true); - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); - return false; - } - - public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) - { - Vector2 origin = new Vector2(31f, 29f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/EradicatorGlow"), projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, origin, 1f, SpriteEffects.None, 0f); - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.OnFire, 600); - target.AddBuff(BuffID.Frostburn, 600); - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - target.AddBuff(BuffID.OnFire, 600); - target.AddBuff(BuffID.Frostburn, 600); - } - } -} diff --git a/Projectiles/Rogue/EradicatorProjectile.cs b/Projectiles/Rogue/EradicatorProjectile.cs new file mode 100644 index 0000000000..124354d61c --- /dev/null +++ b/Projectiles/Rogue/EradicatorProjectile.cs @@ -0,0 +1,66 @@ +using CalamityMod.Projectiles.Melee; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class EradicatorProjectile : ModProjectile + { + public override string Texture => "CalamityMod/Items/Weapons/Rogue/Eradicator"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eradicator"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + } + + public override void SetDefaults() + { + projectile.width = 58; + projectile.height = 58; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.aiStyle = 3; + projectile.timeLeft = 180; + aiType = ProjectileID.WoodenBoomerang; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 3; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, 0.35f, 0f, 0.25f); + CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 6f, 8f, 6, ModContent.ProjectileType(), 1D, true); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); + return false; + } + + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 origin = new Vector2(31f, 29f); + spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/EradicatorGlow"), projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, origin, 1f, SpriteEffects.None, 0f); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.OnFire, 600); + target.AddBuff(BuffID.Frostburn, 600); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.OnFire, 600); + target.AddBuff(BuffID.Frostburn, 600); + } + } +} From c1e4be28aea3cc996387a6221a57a9f22e9c2a96 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 22 Nov 2020 01:09:49 -0500 Subject: [PATCH 10/26] removed melee empyrean knives --- Items/Weapons/Melee/EmpyreanKnives.cs | 114 --------------- Items/Weapons/Melee/EmpyreanKnives.png | Bin 1189 -> 0 bytes Items/Weapons/Rogue/EmpyreanKnivesThrown.cs | 10 +- Projectiles/Hybrid/EmpyreanKnife.cs | 135 ------------------ Projectiles/Rogue/EmpyreanKnife.cs | 108 ++++++++++++++ .../{Hybrid => Rogue}/EmpyreanKnife.png | Bin 6 files changed, 113 insertions(+), 254 deletions(-) delete mode 100644 Items/Weapons/Melee/EmpyreanKnives.cs delete mode 100644 Items/Weapons/Melee/EmpyreanKnives.png delete mode 100644 Projectiles/Hybrid/EmpyreanKnife.cs create mode 100644 Projectiles/Rogue/EmpyreanKnife.cs rename Projectiles/{Hybrid => Rogue}/EmpyreanKnife.png (100%) diff --git a/Items/Weapons/Melee/EmpyreanKnives.cs b/Items/Weapons/Melee/EmpyreanKnives.cs deleted file mode 100644 index 5e65ceb85b..0000000000 --- a/Items/Weapons/Melee/EmpyreanKnives.cs +++ /dev/null @@ -1,114 +0,0 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Items.Weapons.Rogue; -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 EmpyreanKnives : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Empyrean Knives"); - Tooltip.SetDefault("Throws a flurry of bouncing knives that can heal the user"); - } - - public override void SetDefaults() - { - item.width = 18; - item.damage = 600; - item.melee = true; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 15; - item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 15; - item.knockBack = 3f; - item.UseSound = SoundID.Item39; - item.autoReuse = true; - item.height = 20; - item.value = Item.buyPrice(2, 50, 0, 0); - item.rare = 10; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 15f; - item.Calamity().customRarity = CalamityRarity.Violet; - } - - 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(8)) - { - num146++; - } - if (Main.rand.NextBool(16)) - { - 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(-25, 26) * num150; - num149 += (float)Main.rand.Next(-25, 26) * 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; - Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 0f); - } - return false; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.VampireKnives); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType(), 999); - recipe.AddTile(ModContent.TileType()); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} diff --git a/Items/Weapons/Melee/EmpyreanKnives.png b/Items/Weapons/Melee/EmpyreanKnives.png deleted file mode 100644 index 23985d4fdc4db562723c716bab4967b20b455a5f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1189 zcmV;W1X}xvP)Px(Ur9tkR9J=GnO$gHMHI(>H%+!lHc2sxA^*Gp6=ZL~Mn1OTTdt^-h4?e72n*S`SB z2Qy2}?^MOV8ucHla=9eyYbpbPYuD!i*!x%q0J{%O6aX6I1f}tIKS+P9Pzx-dw10%L z2*S#c&_dXr0~V7?r`!`}azRMC;0_3X@Ag%a)0u)9H}`jO9$@hbcu5$5hwf+xVBpv} zQ7R{9ToIu5{7P2B+O*k+Pfa;olbiTmzd8F#R^3xLo67&GFuHdMP0P2BK?{Ue-C z#R7mMC#Cu|mo?`={I<2?He;X?eD%O609z7rU2}J2WCVamJ2x2PzRu8Vr+nYAxm8`>koNq?|2rF6Di8JzG zclFGLSIqt$+a#wo_duT9&RxB(WNlyG`tmmb>|4Lix}~zD0S^fWtDDyVkWOhX&Kho^ zI&xBSO?^{+S=~d)A0EsB(7(_Ez~*NqUdey(nY>)>+}GNOR@Rih7yKivUmT4w*%#+# zWw-Utb0%S}{+pE&wf)+b5>dCX$##7CHUQ%f zzW~7YzPK@7b5r9NF0XRlkiE~gQI4e6h`kcc4OM>naAk=*0FViRHr1^N046VH3J~R3$IdqaSo?e(06RCn2*AEa zWFGZrjaS+2awP5DVZ2)I;Z1AoN$2O+=;h{a$fz827C+ zuDX7!(Hq< zE*SHdBX6&yzl0rM9Lv(p{ujuee<|{%_gMNn-Vy!>&1<5c(); item.shootSpeed = 15f; item.Calamity().rogue = true; @@ -94,7 +94,7 @@ namespace CalamityMod.Items.Weapons.Rogue float x4 = vector2.X; float y4 = vector2.Y; int knife = Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 1f); - Main.projectile[knife].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + Main.projectile[knife].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); } return false; } diff --git a/Projectiles/Hybrid/EmpyreanKnife.cs b/Projectiles/Hybrid/EmpyreanKnife.cs deleted file mode 100644 index ddd8abd06d..0000000000 --- a/Projectiles/Hybrid/EmpyreanKnife.cs +++ /dev/null @@ -1,135 +0,0 @@ -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 EmpyreanKnife : ModProjectile - { - private int bounce = 3; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Knife"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; - ProjectileID.Sets.TrailingMode[projectile.type] = 1; - } - - public override void SetDefaults() - { - projectile.width = 12; - projectile.height = 12; - projectile.friendly = true; - projectile.penetrate = 1; - projectile.timeLeft = 300; - projectile.melee = true; - projectile.extraUpdates = 1; - } - - public override void AI() - { - if (projectile.ai[1] == 1f) - { - projectile.melee = false; - projectile.Calamity().rogue = true; - } - projectile.ai[0] += 1f; - if (projectile.ai[0] >= 75f) - { - projectile.alpha += 10; - projectile.damage = (int)(projectile.damage * 0.95); - projectile.knockBack = projectile.knockBack * 0.95f; - if (projectile.alpha >= 255) - { - projectile.active = false; - } - } - if (projectile.ai[0] < 75f) - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + MathHelper.PiOver2; - } - else - { - projectile.rotation += 0.5f; - } - CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 250f, 15f, 20f); - if (Main.rand.NextBool(6)) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 58, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f); - } - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - bounce--; - if (bounce <= 0) - { - projectile.Kill(); - } - 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 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, 58, 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) - { - if (target.type == NPCID.TargetDummy) - { - return; - } - float healAmt = (float)damage * 0.005f; - if ((int)healAmt == 0) - { - return; - } - if (Main.player[Main.myPlayer].lifeSteal <= 0f) - { - return; - } - CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ProjectileID.VampireHeal, 1200f, 1.5f); - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - float healAmt = (float)damage * 0.005f; - if ((int)healAmt == 0) - { - return; - } - if (Main.player[Main.myPlayer].lifeSteal <= 0f) - { - return; - } - CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ProjectileID.VampireHeal, 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/EmpyreanKnife.cs b/Projectiles/Rogue/EmpyreanKnife.cs new file mode 100644 index 0000000000..4a780d1f66 --- /dev/null +++ b/Projectiles/Rogue/EmpyreanKnife.cs @@ -0,0 +1,108 @@ +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 EmpyreanKnife : ModProjectile + { + private int bounce = 3; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Empyrean Knife"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + } + + public override void SetDefaults() + { + projectile.width = 12; + projectile.height = 12; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 300; + projectile.extraUpdates = 1; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + projectile.ai[0] += 1f; + if (projectile.ai[0] >= 75f) + { + projectile.alpha += 10; + projectile.damage = (int)(projectile.damage * 0.95); + projectile.knockBack = projectile.knockBack * 0.95f; + if (projectile.alpha >= 255) + projectile.active = false; + } + if (projectile.ai[0] < 75f) + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + MathHelper.PiOver2; + else + { + projectile.rotation += 0.5f; + } + CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 250f, 15f, 20f); + if (Main.rand.NextBool(6)) + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 58, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f); + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + bounce--; + if (bounce <= 0) + projectile.Kill(); + 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 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, 58, 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) + { + if (target.type == NPCID.TargetDummy) + return; + float healAmt = damage * 0.005f; + if ((int)healAmt == 0) + return; + if (Main.player[Main.myPlayer].lifeSteal <= 0f) + return; + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ProjectileID.VampireHeal, 1200f, 1.5f); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + float healAmt = damage * 0.005f; + if ((int)healAmt == 0) + return; + if (Main.player[Main.myPlayer].lifeSteal <= 0f) + return; + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ProjectileID.VampireHeal, 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/EmpyreanKnife.png b/Projectiles/Rogue/EmpyreanKnife.png similarity index 100% rename from Projectiles/Hybrid/EmpyreanKnife.png rename to Projectiles/Rogue/EmpyreanKnife.png From 2cb1f642f99147bdd9a1a094ff2b7f3851e2f81c Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 22 Nov 2020 01:29:34 -0500 Subject: [PATCH 11/26] removed melee SotC --- Items/Weapons/Melee/ScourgeoftheCosmos.cs | 52 ----- Items/Weapons/Melee/ScourgeoftheCosmos.png | Bin 1291 -> 0 bytes Items/Weapons/Rogue/AccretionDisk.cs | 4 +- Items/Weapons/Rogue/Eradicator.cs | 6 +- .../Weapons/Rogue/ScourgeoftheCosmosThrown.cs | 4 +- Projectiles/Hybrid/ScourgeoftheCosmosProj.cs | 178 ------------------ .../ScourgeoftheCosmosMini.cs | 9 +- .../ScourgeoftheCosmosMini.png | Bin .../ScourgeoftheCosmosMiniGlow.png | Bin Projectiles/Rogue/ScourgeoftheCosmosProj.cs | 146 ++++++++++++++ .../ScourgeoftheCosmosProj.png | Bin 11 files changed, 155 insertions(+), 244 deletions(-) delete mode 100644 Items/Weapons/Melee/ScourgeoftheCosmos.cs delete mode 100644 Items/Weapons/Melee/ScourgeoftheCosmos.png delete mode 100644 Projectiles/Hybrid/ScourgeoftheCosmosProj.cs rename Projectiles/{Hybrid => Rogue}/ScourgeoftheCosmosMini.cs (93%) rename Projectiles/{Hybrid => Rogue}/ScourgeoftheCosmosMini.png (100%) rename Projectiles/{Hybrid => Rogue}/ScourgeoftheCosmosMiniGlow.png (100%) create mode 100644 Projectiles/Rogue/ScourgeoftheCosmosProj.cs rename Projectiles/{Hybrid => Rogue}/ScourgeoftheCosmosProj.png (100%) diff --git a/Items/Weapons/Melee/ScourgeoftheCosmos.cs b/Items/Weapons/Melee/ScourgeoftheCosmos.cs deleted file mode 100644 index 543a96349d..0000000000 --- a/Items/Weapons/Melee/ScourgeoftheCosmos.cs +++ /dev/null @@ -1,52 +0,0 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.Projectiles.Hybrid; -using CalamityMod.Tiles.Furniture.CraftingStations; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Melee -{ - public class ScourgeoftheCosmos : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Scourge of the Cosmos"); - Tooltip.SetDefault("Throws a bouncing cosmic scourge that emits tiny homing cosmic scourges on death and tile hits"); - } - - public override void SetDefaults() - { - item.width = 18; - item.damage = 1300; - item.melee = true; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 20; - item.useStyle = ItemUseStyleID.HoldingOut; - item.useTime = 20; - item.knockBack = 5f; - item.UseSound = SoundID.Item109; - item.autoReuse = true; - item.height = 20; - item.value = Item.buyPrice(2, 50, 0, 0); - item.rare = 10; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 15f; - item.Calamity().customRarity = CalamityRarity.Violet; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ScourgeoftheCorruptor); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType(), 200); - recipe.AddTile(ModContent.TileType()); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} diff --git a/Items/Weapons/Melee/ScourgeoftheCosmos.png b/Items/Weapons/Melee/ScourgeoftheCosmos.png deleted file mode 100644 index f5b527abdf6acc9f2ed30ba00f63e66556f8d325..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1291 zcmV+m1@!ufP){0vJo$3b5`@dhAF{sCos|mU;sDA|r|e z(6jY<0OEb^0DS-P`v5eD;|d@#a>0JywF!XhsYxIscGw}pD4_fmP*bM>YC;hUV14g4 zz-9i2Q>OuFjdv@6JBcd*G>7AWTPf->L|_z9>IvwO=-(FW1>ok`kOgi&-*(_70M4DT zeO&IRX6-dXYrGqPJBce6xUs^oZZHa1=`Y;Z{~-XoJJtaZZL9~N|Kt;ZyV?`x`=31s zz`$3>J$5ADH?~9+z-%gM0ZjeV0>F;_F9VRcIN=#5m7>5XV5Pq3-CdsmaO>ZB0G|8u zY0q=<{ZOkN-KWzwlaF*g06?w7=*Epv&p2UTuM33vNas4w`?5xmO0nt{5cpa^m=_#6 zy*KN7dhIX1|Mwq*0Bn6_JFrv%gM;IqYsn50BlP?)6{Ttj83jOqF(6;&{UA|)hvxgj zc;dXh3Y0Z~KsrS_g!zoV0ALglTnzYe-!}j}cJj%4zL(+q05q*x3qabcw*dCMWmkT} z`1M~d0r1q$U4YvcSgaGAwF3)tp3aZX{KfI#0Hc85VnBG+szQfY05i940Iu(U_WDPF zTk}hH(0hJuv0epmb8JZLdDN{lFE9!S%5ZP<>U%z4to+(z08CDd0ZV&!O>5RFfEh<2 z;_EGu9tAMzt{s4-4CjJTKv0HNNA?8c*Y6kK)_Z>v6VQA*l^g~NXIzI-Kv0HN)T@A8 zJ3YdDs6A%;wi6Qs#WL*&qky0ctEm0k=F7Zar4}@*UIEL#7SL<^j69zg^9}nC0r2bF zFE01gvZCr05M)o#0ymoLdEU?GH#eYSAcIF;OFbq+IxA- zr#*RH@6AbfwyADGfg2M9D^=;`Le(oEpBUir_0H~x6u|hzZ2(T49RT3qn=g0`*R@>o5xNdmwpTqI*U@x4@0^@kj05*W+(|3cxel`vDkm?8x|Xg;9WhW3gM?)&anD zdJb^U*z}xr_Te4oWyj{~&^Z8(IlHoz0;2%^hMdt!C5JuTT7jIv(D&gxH*8h_qf<^7 zcRn4+gqIse0rDZ&86Cmyy^njYubr`@zGMfS>atw(z7C@R`QYdK68+_Toz(p2zxx_+ zcV{aVMgijc@;^K|S1-Q*#RuO4OBr9>oz*JFN`p~=oXXbE)$1oP^!@nd+MO*ms$K!A zFS;e`sq8HOx&kVnaUDhhq5y$@+UoztxQ?n|;;yZlM4G002ovPDHLkV1oA^ Bb0`1+ diff --git a/Items/Weapons/Rogue/AccretionDisk.cs b/Items/Weapons/Rogue/AccretionDisk.cs index 570a728aa7..2b997ada20 100644 --- a/Items/Weapons/Rogue/AccretionDisk.cs +++ b/Items/Weapons/Rogue/AccretionDisk.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class AccretionDisk : RogueWeapon + public class AccretionDisk : RogueWeapon { public override void SetStaticDefaults() { @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Items/Weapons/Rogue/Eradicator.cs b/Items/Weapons/Rogue/Eradicator.cs index 0946ec5069..909be89972 100644 --- a/Items/Weapons/Rogue/Eradicator.cs +++ b/Items/Weapons/Rogue/Eradicator.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Eradicator : RogueWeapon + public class Eradicator : RogueWeapon { public override void SetStaticDefaults() { @@ -39,13 +39,13 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/EradicatorGlow")); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/EradicatorGlow")); } } } diff --git a/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs b/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs index a126f5de1d..c46740d878 100644 --- a/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs +++ b/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.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 Terraria; @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class ScourgeoftheCosmosThrown : RogueWeapon + public class ScourgeoftheCosmosThrown : RogueWeapon { public override void SetStaticDefaults() { diff --git a/Projectiles/Hybrid/ScourgeoftheCosmosProj.cs b/Projectiles/Hybrid/ScourgeoftheCosmosProj.cs deleted file mode 100644 index fec3401f15..0000000000 --- a/Projectiles/Hybrid/ScourgeoftheCosmosProj.cs +++ /dev/null @@ -1,178 +0,0 @@ -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 ScourgeoftheCosmosProj : ModProjectile - { - private int bounce = 3; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cosmic Scourge"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } - - public override void SetDefaults() - { - projectile.width = 14; - projectile.height = 14; - projectile.alpha = 255; - projectile.friendly = true; - projectile.melee = true; - projectile.ignoreWater = true; - projectile.penetrate = 1; - projectile.extraUpdates = 1; - } - - public override void AI() - { - if (projectile.ai[1] == 1f) - { - projectile.melee = false; - projectile.Calamity().rogue = true; - } - if (projectile.alpha <= 200) - { - int num3; - for (int num20 = 0; num20 < 2; num20 = num3 + 1) - { - int dustType = Main.rand.NextBool(3) ? 56 : 242; - float num21 = projectile.velocity.X / 4f * (float)num20; - float num22 = projectile.velocity.Y / 4f * (float)num20; - int num23 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f); - Main.dust[num23].position.X = projectile.Center.X - num21; - Main.dust[num23].position.Y = projectile.Center.Y - num22; - Dust dust = Main.dust[num23]; - dust.velocity *= 0f; - Main.dust[num23].scale = 0.7f; - num3 = num20; - } - } - projectile.alpha -= 50; - if (projectile.alpha < 0) - { - projectile.alpha = 0; - } - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f; - projectile.ai[0] += 1f; - if (projectile.ai[0] >= 180f) - { - projectile.velocity.Y = projectile.velocity.Y + 0.4f; - projectile.velocity.X = projectile.velocity.X * 0.97f; - } - if (projectile.velocity.Y > 16f) - { - projectile.velocity.Y = 16f; - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - bounce--; - if (bounce <= 0) - { - projectile.Kill(); - } - else - { - Main.PlaySound(SoundID.NPCHit4, projectile.position); - if (projectile.velocity.X != oldVelocity.X) - { - projectile.velocity.X = -oldVelocity.X; - } - if (projectile.velocity.Y != oldVelocity.Y) - { - projectile.velocity.Y = -oldVelocity.Y; - } - if (projectile.owner == Main.myPlayer) - { - int num626 = 1; - if (Main.rand.NextBool(10)) - { - num626++; - } - int num3; - for (int num627 = 0; num627 < num626; num627 = num3 + 1) - { - float num628 = (float)Main.rand.Next(-35, 36) * 0.02f; - float num629 = (float)Main.rand.Next(-35, 36) * 0.02f; - num628 *= 10f; - num629 *= 10f; - if (!projectile.melee) - { - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, num628, num629, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.7), projectile.knockBack * 0.35f, Main.myPlayer, 0f, 1f); - } - else - { - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, num628, num629, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.7), projectile.knockBack * 0.35f, Main.myPlayer, 0f, 0f); - } - num3 = num627; - } - } - } - return false; - } - - public override void Kill(int timeLeft) - { - Main.PlaySound(SoundID.NPCHit4, projectile.position); - int num3; - for (int num622 = 0; num622 < 10; num622 = num3 + 1) - { - int dustType = Main.rand.NextBool(3) ? 56 : 242; - int num623 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f); - Dust dust = Main.dust[num623]; - dust.scale *= 1.1f; - Main.dust[num623].noGravity = true; - num3 = num622; - } - for (int num624 = 0; num624 < 15; num624 = num3 + 1) - { - int dustType = Main.rand.NextBool(3) ? 56 : 242; - int num625 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f); - Dust dust = Main.dust[num625]; - dust.velocity *= 2.5f; - dust = Main.dust[num625]; - dust.scale *= 0.8f; - Main.dust[num625].noGravity = true; - num3 = num624; - } - if (projectile.owner == Main.myPlayer) - { - int num626 = 3; - if (Main.rand.NextBool(10)) - { - num626++; - } - for (int num627 = 0; num627 < num626; num627 = num3 + 1) - { - float num628 = (float)Main.rand.Next(-35, 36) * 0.02f; - float num629 = (float)Main.rand.Next(-35, 36) * 0.02f; - num628 *= 10f; - num629 *= 10f; - if (!projectile.melee) - { - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, num628, num629, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.7), projectile.knockBack * 0.35f, Main.myPlayer, 0f, 1f); - } - else - { - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, num628, num629, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.7), projectile.knockBack * 0.35f, Main.myPlayer, 0f, 0f); - } - num3 = num627; - } - } - } - } -} diff --git a/Projectiles/Hybrid/ScourgeoftheCosmosMini.cs b/Projectiles/Rogue/ScourgeoftheCosmosMini.cs similarity index 93% rename from Projectiles/Hybrid/ScourgeoftheCosmosMini.cs rename to Projectiles/Rogue/ScourgeoftheCosmosMini.cs index cc1587a8a1..aeab483e36 100644 --- a/Projectiles/Hybrid/ScourgeoftheCosmosMini.cs +++ b/Projectiles/Rogue/ScourgeoftheCosmosMini.cs @@ -23,17 +23,12 @@ namespace CalamityMod.Projectiles.Hybrid projectile.alpha = 255; projectile.penetrate = 1; projectile.timeLeft = 300; - projectile.melee = true; projectile.extraUpdates = 3; + projectile.Calamity().rogue = true; } public override void AI() { - if (projectile.ai[1] == 1f) - { - projectile.melee = false; - projectile.Calamity().rogue = true; - } if (projectile.alpha > 0) { projectile.alpha -= 50; @@ -169,7 +164,7 @@ namespace CalamityMod.Projectiles.Hybrid int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; int y6 = num214 * projectile.frame; Vector2 origin = new Vector2(9f, 10f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Hybrid/ScourgeoftheCosmosMiniGlow"), projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Color.White, projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); + spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Rogue/ScourgeoftheCosmosMiniGlow"), projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Color.White, projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); } } } diff --git a/Projectiles/Hybrid/ScourgeoftheCosmosMini.png b/Projectiles/Rogue/ScourgeoftheCosmosMini.png similarity index 100% rename from Projectiles/Hybrid/ScourgeoftheCosmosMini.png rename to Projectiles/Rogue/ScourgeoftheCosmosMini.png diff --git a/Projectiles/Hybrid/ScourgeoftheCosmosMiniGlow.png b/Projectiles/Rogue/ScourgeoftheCosmosMiniGlow.png similarity index 100% rename from Projectiles/Hybrid/ScourgeoftheCosmosMiniGlow.png rename to Projectiles/Rogue/ScourgeoftheCosmosMiniGlow.png diff --git a/Projectiles/Rogue/ScourgeoftheCosmosProj.cs b/Projectiles/Rogue/ScourgeoftheCosmosProj.cs new file mode 100644 index 0000000000..988a954b0d --- /dev/null +++ b/Projectiles/Rogue/ScourgeoftheCosmosProj.cs @@ -0,0 +1,146 @@ +using CalamityMod.Projectiles.Hybrid; +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 ScourgeoftheCosmosProj : ModProjectile + { + private int bounce = 3; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cosmic Scourge"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 14; + projectile.alpha = 255; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.penetrate = 1; + projectile.extraUpdates = 1; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + if (projectile.alpha <= 200) + { + int num3; + for (int num20 = 0; num20 < 2; num20 = num3 + 1) + { + int dustType = Main.rand.NextBool(3) ? 56 : 242; + float num21 = projectile.velocity.X / 4f * num20; + float num22 = projectile.velocity.Y / 4f * num20; + int num23 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f); + Main.dust[num23].position.X = projectile.Center.X - num21; + Main.dust[num23].position.Y = projectile.Center.Y - num22; + Dust dust = Main.dust[num23]; + dust.velocity *= 0f; + Main.dust[num23].scale = 0.7f; + num3 = num20; + } + } + projectile.alpha -= 50; + if (projectile.alpha < 0) + projectile.alpha = 0; + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 0.785f; + projectile.ai[0] += 1f; + if (projectile.ai[0] >= 180f) + { + projectile.velocity.Y = projectile.velocity.Y + 0.4f; + projectile.velocity.X = projectile.velocity.X * 0.97f; + } + if (projectile.velocity.Y > 16f) + projectile.velocity.Y = 16f; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + bounce--; + if (bounce <= 0) + projectile.Kill(); + else + { + Main.PlaySound(SoundID.NPCHit4, projectile.position); + if (projectile.velocity.X != oldVelocity.X) + projectile.velocity.X = -oldVelocity.X; + if (projectile.velocity.Y != oldVelocity.Y) + projectile.velocity.Y = -oldVelocity.Y; + if (projectile.owner == Main.myPlayer) + { + int num626 = 1; + if (Main.rand.NextBool(10)) + num626++; + int num3; + for (int num627 = 0; num627 < num626; num627 = num3 + 1) + { + float num628 = Main.rand.Next(-35, 36) * 0.02f; + float num629 = Main.rand.Next(-35, 36) * 0.02f; + num628 *= 10f; + num629 *= 10f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, num628, num629, ModContent.ProjectileType(), (int)(projectile.damage * 0.7), projectile.knockBack * 0.35f, Main.myPlayer); + num3 = num627; + } + } + } + return false; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.NPCHit4, projectile.position); + int num3; + for (int num622 = 0; num622 < 10; num622 = num3 + 1) + { + int dustType = Main.rand.NextBool(3) ? 56 : 242; + int num623 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f); + Dust dust = Main.dust[num623]; + dust.scale *= 1.1f; + Main.dust[num623].noGravity = true; + num3 = num622; + } + for (int num624 = 0; num624 < 15; num624 = num3 + 1) + { + int dustType = Main.rand.NextBool(3) ? 56 : 242; + int num625 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f); + Dust dust = Main.dust[num625]; + dust.velocity *= 2.5f; + dust = Main.dust[num625]; + dust.scale *= 0.8f; + Main.dust[num625].noGravity = true; + num3 = num624; + } + if (projectile.owner == Main.myPlayer) + { + int num626 = 3; + if (Main.rand.NextBool(10)) + num626++; + for (int num627 = 0; num627 < num626; num627 = num3 + 1) + { + float num628 = Main.rand.Next(-35, 36) * 0.02f; + float num629 = Main.rand.Next(-35, 36) * 0.02f; + num628 *= 10f; + num629 *= 10f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, num628, num629, ModContent.ProjectileType(), (int)(projectile.damage * 0.7), projectile.knockBack * 0.35f, Main.myPlayer); + num3 = num627; + } + } + } + } +} diff --git a/Projectiles/Hybrid/ScourgeoftheCosmosProj.png b/Projectiles/Rogue/ScourgeoftheCosmosProj.png similarity index 100% rename from Projectiles/Hybrid/ScourgeoftheCosmosProj.png rename to Projectiles/Rogue/ScourgeoftheCosmosProj.png From 5a46899c5635571f7dd923f29a1712194990f213 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 22 Nov 2020 01:34:22 -0500 Subject: [PATCH 12/26] removed melee nanoblack reaper --- Items/Weapons/Melee/NanoblackReaperMelee.cs | 70 ------ Items/Weapons/Melee/NanoblackReaperMelee.png | Bin 1830 -> 0 bytes Items/Weapons/Rogue/NanoblackReaperRogue.cs | 9 +- Projectiles/Hybrid/NanoblackMain.cs | 168 -------------- Projectiles/Hybrid/NanoblackSplit.cs | 212 ----------------- Projectiles/Rogue/NanoblackMain.cs | 165 ++++++++++++++ Projectiles/Rogue/NanoblackSplit.cs | 213 ++++++++++++++++++ .../{Hybrid => Rogue}/NanoblackSplit.png | Bin .../{Hybrid => Rogue}/NanoblackSplitGlow.png | Bin 9 files changed, 382 insertions(+), 455 deletions(-) delete mode 100644 Items/Weapons/Melee/NanoblackReaperMelee.cs delete mode 100644 Items/Weapons/Melee/NanoblackReaperMelee.png delete mode 100644 Projectiles/Hybrid/NanoblackMain.cs delete mode 100644 Projectiles/Hybrid/NanoblackSplit.cs create mode 100644 Projectiles/Rogue/NanoblackMain.cs create mode 100644 Projectiles/Rogue/NanoblackSplit.cs rename Projectiles/{Hybrid => Rogue}/NanoblackSplit.png (100%) rename Projectiles/{Hybrid => Rogue}/NanoblackSplitGlow.png (100%) diff --git a/Items/Weapons/Melee/NanoblackReaperMelee.cs b/Items/Weapons/Melee/NanoblackReaperMelee.cs deleted file mode 100644 index 5332cf626b..0000000000 --- a/Items/Weapons/Melee/NanoblackReaperMelee.cs +++ /dev/null @@ -1,70 +0,0 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.Projectiles.Hybrid; -using CalamityMod.Tiles.Furniture.CraftingStations; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Melee -{ - public class NanoblackReaperMelee : ModItem - { - public static int BaseDamage = 800; - public static float Knockback = 9f; - public static float Speed = 16f; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nanoblack Reaper"); - Tooltip.SetDefault("Unleashes a storm of nanoblack energy blades\nBlades target bosses whenever possible\n'She smothered them in Her hatred'"); - } - - public override void SetDefaults() - { - item.width = 78; - item.height = 64; - item.melee = true; - item.damage = BaseDamage; - item.knockBack = Knockback; - item.useTime = 6; - item.useAnimation = 6; - item.autoReuse = true; - item.noMelee = true; - item.noUseGraphic = true; - - item.useStyle = ItemUseStyleID.SwingThrow; - item.UseSound = SoundID.Item18; - - item.rare = 10; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; - item.value = Item.buyPrice(5, 0, 0, 0); - - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = Speed; - } - - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceMelee = true; - return false; - } - - public override void AddRecipes() - { - ModRecipe r = new ModRecipe(mod); - r.SetResult(this); - r.AddTile(ModContent.TileType()); - r.AddIngredient(ModContent.ItemType()); - r.AddIngredient(ModContent.ItemType()); - r.AddIngredient(ModContent.ItemType()); - r.AddIngredient(ModContent.ItemType(), 5); - r.AddIngredient(ModContent.ItemType(), 40); - r.AddIngredient(ModContent.ItemType(), 10); - r.AddIngredient(ItemID.Nanites, 400); - r.AddRecipe(); - } - } -} diff --git a/Items/Weapons/Melee/NanoblackReaperMelee.png b/Items/Weapons/Melee/NanoblackReaperMelee.png deleted file mode 100644 index a4de09bee1982cfb6bab6d624cd708b4511b0e1a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1830 zcmV+>2if?EP){2@tQ*1Vcm=V-tPAghZkwifBUQ zLD6VH116#Yyd)+fMiWE?Noheqsa#qR(hKymZP$l6-|o(I&t7JC@xuAPEN9M~*|VJA z{^$F?nXN;CHL_wAV$TMXUCfCiHe2doa{O8*&Z`)2jah7s&9U#Huq7e5mQ>Gn|W8ENm-ymG*((JA9ZTlvIUDsLX= z1k^K#_Vh&o234!}t`ss z`7d_9p7i|g&0DnVrN79GGtFv>*ZrF$`ovkPVD&he#oA9bs<_IS6-|i;iszZ6n6sv- zyY5~I^e0uk?Sa)gp-D28l$B&tK5>@HJ8|i}ZvBZM0E3No@xXJ_^fQ&OJOMz1dpzlV zMT!t+N=Oxgy>e&qHuJp1m+59@ptKZ#o{o+vBs^KeyUh4W zG7M38&TUEGN8&y+mlaZiE|KDyA|ZOnbvFb3Gn9jMpOJXKa*Rht;S*=6yc35T4+%jg zIYL@saJd7})7qj|xm;3&2=O#?t-+Mcf?k=1jAIfl{V)9atJW@69J$YuVO0)5cXJaE zC(kF&QUxQ1k#?&#P{j;KiEP`NUbO z5X5CFjWm%NkBLl=5_!d4lAEqrpkKG+a+!L4{B5mW2o&<}uU!Mc)>W|##V0Nw%6mP| zOGzrkK>rG`%${N6`h>kETD!THP&sBi09#kBjH*}FPl%N&%Z4ov0Z9lfPk#S0uE;0O zQhD<@FL`AYW}GKPi6p*~6?&2EYLY!ABCo29yzkJ_V*xnZP^Z2B@@*Tn{z9H)IocQslD8LIp>;zzW z^I-sHe57XCeT!7(dgOxVVz&f7an{P1I3cKfu-b*u(t6s=5VWzpR`$&tF;l`swtGK> zygwR`0`bpNbNeg+>c80&1vtI^HSM|;2h_(BkEWlbDz#P3zNa*AEjdizr5 zps|Z`^ssCtRzut6E=&G)a^8KxwH)+LaiEk(?K+=0OC@?- z%F3;f=Cv|z*2{#nqF_+1Ep&7MnO9K?O{ACC1y05?9j$*Xo^y|V;w%+Nh`WF|QI9^o zMCm0O664IwRY4K?2AN%WVQP{`%3W@l}Vb&&m8ikfEnS-O8E|VZ^u3F zJPE`Jl+`1%)^DyIlxML6S{6vmEO>yV*t#r`x1bIZohNCt9G9_ zOT}hY^S4!^cOQEx>4mbwE*XJ%+kZ`FwIp=tm{uiOGf&mwYG&6s0QKLgZ=6q@rJQk7 zX9CdKcrs-imu?S-RC4#fx(I-Y%iaJqFD&R^Wyn=tI}ti&PICZCzdr!@>#8}+$sn%M zo`B4r;)$)Z#{qD(T3?Wq8olJGnPv|ElrmjQ5&6Vfs$T_I{^v`Esb9-?H#cd&d=|oD z1H8Nm=pWa4dBgujK5>@vBo5;@_ClH$VP3xn{lAeW@`(); @@ -48,8 +48,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceRogue = true; - Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Projectiles/Hybrid/NanoblackMain.cs b/Projectiles/Hybrid/NanoblackMain.cs deleted file mode 100644 index a87b19282a..0000000000 --- a/Projectiles/Hybrid/NanoblackMain.cs +++ /dev/null @@ -1,168 +0,0 @@ -using CalamityMod.Items.Weapons.Melee; -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 NanoblackMain : ModProjectile - { - public override string Texture => "CalamityMod/Items/Weapons/Rogue/NanoblackReaperRogue"; - - private const float RotationIncrement = 0.22f; - private const int Lifetime = 240; - private const float ReboundTime = 50f; - private const int MinBladeTimer = 13; - private const int MaxBladeTimer = 18; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nanoblack Reaper"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 7; - ProjectileID.Sets.TrailingMode[projectile.type] = 2; - } - - public override void SetDefaults() - { - projectile.width = 56; - projectile.height = 56; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.extraUpdates = 2; - projectile.timeLeft = Lifetime; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 2; - } - - public override void AI() - { - drawOffsetX = -11; - drawOriginOffsetY = -4; - drawOriginOffsetX = 0; - - // Initialize the frame counter and random blade delay on the very first frame. - if (projectile.timeLeft == Lifetime) - projectile.ai[1] = GetBladeDelay(); - - // Produces electricity and green firework sparks constantly while in flight. - if (Main.rand.NextBool(3)) - { - int dustType = Main.rand.NextBool(5) ? 226 : 220; - float scale = 0.8f + Main.rand.NextFloat(0.3f); - float velocityMult = Main.rand.NextFloat(0.3f, 0.6f); - int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType); - Main.dust[idx].noGravity = true; - Main.dust[idx].velocity = velocityMult * projectile.velocity; - Main.dust[idx].scale = scale; - } - - // ai[0] is a frame counter. ai[1] is a countdown to spawning the next nanoblack energy blade. - projectile.ai[0] += 1f; - projectile.ai[1] -= 1f; - - // On the frame the scythe begins returning, send a net update. - if (projectile.ai[0] == ReboundTime) - projectile.netUpdate = true; - - // The scythe runs its returning AI if the frame counter is greater than ReboundTime. - if (projectile.ai[0] >= ReboundTime) - { - float returnSpeed = NanoblackReaperMelee.Speed; - float acceleration = 2.4f; - Player owner = Main.player[projectile.owner]; - - // Delete the scythe if it's excessively far away. - Vector2 playerCenter = owner.Center; - float xDist = playerCenter.X - projectile.Center.X; - float yDist = playerCenter.Y - projectile.Center.Y; - float dist = (float)Math.Sqrt(xDist * xDist + yDist * yDist); - if (dist > 3000f) - projectile.Kill(); - - dist = returnSpeed / dist; - xDist *= dist; - yDist *= dist; - - // Home back in on the player. - if (projectile.velocity.X < xDist) - { - projectile.velocity.X = projectile.velocity.X + acceleration; - if (projectile.velocity.X < 0f && xDist > 0f) - projectile.velocity.X += acceleration; - } - else if (projectile.velocity.X > xDist) - { - projectile.velocity.X = projectile.velocity.X - acceleration; - if (projectile.velocity.X > 0f && xDist < 0f) - projectile.velocity.X -= acceleration; - } - if (projectile.velocity.Y < yDist) - { - projectile.velocity.Y = projectile.velocity.Y + acceleration; - if (projectile.velocity.Y < 0f && yDist > 0f) - projectile.velocity.Y += acceleration; - } - else if (projectile.velocity.Y > yDist) - { - projectile.velocity.Y = projectile.velocity.Y - acceleration; - if (projectile.velocity.Y > 0f && yDist < 0f) - projectile.velocity.Y -= acceleration; - } - - // Delete the projectile if it touches its owner. - if (Main.myPlayer == projectile.owner) - if (projectile.Hitbox.Intersects(owner.Hitbox)) - projectile.Kill(); - } - - // Create nanoblack energy blades at a somewhat-random rate while in flight. - if (projectile.ai[1] <= 0f) - { - SpawnEnergyBlade(); - projectile.ai[1] = GetBladeDelay(); - } - - // Rotate the scythe as it flies. - float spin = (projectile.direction <= 0) ? -1f : 1f; - projectile.rotation += spin * RotationIncrement; - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - - private int GetBladeDelay() - { - return Main.rand.Next(MinBladeTimer, MaxBladeTimer + 1); - } - - private void SpawnEnergyBlade() - { - int bladeID = ModContent.ProjectileType(); - int bladeDamage = projectile.damage / 5; - float bladeKB = 3f; - float spin = (projectile.direction <= 0) ? -1f : 1f; - float d = 16f; - float velocityMult = 0.9f; - Vector2 directOffset = new Vector2(Main.rand.NextFloat(-d, d), Main.rand.NextFloat(-d, d)); - Vector2 velocityOffset = Main.rand.NextFloat(-velocityMult, velocityMult) * projectile.velocity; - Vector2 pos = projectile.Center + directOffset + velocityOffset; - if (projectile.owner == Main.myPlayer) - { - int proj = Projectile.NewProjectile(pos, Vector2.Zero, bladeID, bladeDamage, bladeKB, projectile.owner, 0f, spin); - CalamityGlobalProjectile cgp = Main.projectile[proj].Calamity(); - if (projectile.melee) - cgp.forceMelee = true; - else - cgp.forceRogue = true; - } - } - } -} diff --git a/Projectiles/Hybrid/NanoblackSplit.cs b/Projectiles/Hybrid/NanoblackSplit.cs deleted file mode 100644 index 61fb2a7bae..0000000000 --- a/Projectiles/Hybrid/NanoblackSplit.cs +++ /dev/null @@ -1,212 +0,0 @@ -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 NanoblackSplit : ModProjectile - { - private static int SpriteWidth = 52; - private static int Lifetime = 90; - private static float MaxRotationSpeed = 0.25f; - private static float MaxSpeed = 22f; - - private static float HomingStartRange = 600f; - private static float HomingBreakRange = 1000f; - private static float HomingBonusRangeCap = 200f; - private static float BaseHomingFactor = 1.6f; - private static float MaxHomingFactor = 6.6f; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nanoblack Blade"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 3; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } - - public override void SetDefaults() - { - projectile.width = 32; - projectile.height = 32; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.tileCollide = false; - projectile.penetrate = 4; - projectile.extraUpdates = 1; - projectile.timeLeft = Lifetime; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 8; - } - - // ai[0] = Index of current NPC target. If 0 or negative, the projectile has no target - // ai[1] = Current spin speed. Negative speeds are also allowed. - public override void AI() - { - drawOffsetX = -10; - drawOriginOffsetY = 0; - drawOriginOffsetX = 0; - - // On the very first frame, clear any invalid starting target variable and create some dust. - // Also grab the damage type based on ai[0]. - if (projectile.timeLeft == Lifetime) - SpawnDust(); - - // Spin in the specified starting direction and slow down spin over time - // Loses 1.66% of current speed every frame - // Also update current orientation to reflect current spin direction - float currentSpin = projectile.ai[1]; - projectile.direction = (currentSpin <= 0f) ? 1 : -1; - projectile.spriteDirection = projectile.direction; - projectile.rotation += currentSpin * MaxRotationSpeed; - float spinReduction = 0.0166f * currentSpin; - projectile.ai[1] -= spinReduction; - - // If about to disappear, shrink by 8% every frame - if (projectile.timeLeft < 15) - projectile.scale *= 0.92f; - - // Search for and home in on nearby targets - HomingAI(); - } - - private void HomingAI() - { - // If we don't currently have a target, go try and get one! - int targetID = (int)projectile.ai[0] - 1; - if (targetID < 0) - targetID = AcquireTarget(); - - // Save the target, whether we have one or not. - projectile.ai[0] = targetID + 1f; - - // If we don't have a target, then just slow down a bit. - if (targetID < 0) - { - projectile.velocity *= 0.94f; - return; - } - - // Homing behavior depends on how far the blade is from its target. - NPC target = Main.npc[targetID]; - float xDist = projectile.Center.X - target.Center.X; - float yDist = projectile.Center.Y - target.Center.Y; - float dist = (float)Math.Sqrt(xDist * xDist + yDist * yDist); - - // If the target is too far away, stop homing in on it. - if (dist > HomingBreakRange) - { - projectile.ai[0] = 0f; - return; - } - - // Adds a multiple of the towards-target vector to its velocity every frame. - float homingFactor = CalcHomingFactor(dist); - Vector2 posDiff = target.Center - projectile.Center; - posDiff = posDiff.SafeNormalize(Vector2.Zero); - posDiff *= homingFactor; - Vector2 newVelocity = projectile.velocity += posDiff; - - // Caps speed to make sure it doesn't go too fast. - if (newVelocity.Length() >= MaxSpeed) - { - newVelocity = newVelocity.SafeNormalize(Vector2.Zero); - newVelocity *= MaxSpeed; - } - - projectile.velocity = newVelocity; - } - - // Returns the ID of the NPC to be targeted by this energy blade. - // It chooses the closest target which can be chased, ignoring invulnerable NPCs. - // Nanoblack Blades prefer to target bosses whenever possible. - private int AcquireTarget() - { - bool bossFound = false; - int target = -1; - float minDist = HomingStartRange; - for (int i = 0; i < 200; ++i) - { - NPC npc = Main.npc[i]; - if (!npc.active || npc.type == NPCID.TargetDummy) - continue; - - // If we've found a valid boss target, ignore ALL targets which aren't bosses. - if (bossFound && !npc.boss) - continue; - - if (npc.CanBeChasedBy(projectile, false)) - { - float xDist = projectile.Center.X - npc.Center.X; - float yDist = projectile.Center.Y - npc.Center.Y; - float distToNPC = (float)Math.Sqrt(xDist * xDist + yDist * yDist); - if (distToNPC < minDist) - { - // If this target within range is a boss, set the boss found flag. - if (npc.boss) - bossFound = true; - minDist = distToNPC; - target = i; - } - } - } - return target; - } - - // Energy blades home even more aggressively if they are very close to their target. - private float CalcHomingFactor(float dist) - { - float baseFactor = BaseHomingFactor; - float bonus = (MaxHomingFactor - BaseHomingFactor) * (1f - dist / HomingBonusRangeCap); - if (bonus < 0f) - bonus = 0f; - return baseFactor + bonus; - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - - // Draws the energy blade's glowmask. - public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) - { - float fWidthOverTwo = SpriteWidth / 2f; - float fHeightOverTwo = projectile.height / 2f; - - // Make sure the glowmask matches the blade's own orientation - SpriteEffects eff = SpriteEffects.None; - if (projectile.spriteDirection == -1) - eff = SpriteEffects.FlipHorizontally; - Vector2 origin = new Vector2(fWidthOverTwo, fHeightOverTwo); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Hybrid/NanoblackSplitGlow"), - projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, - origin, projectile.scale, eff, 0f); - } - - // Spawns a tiny bit of dust when the energy blade vanishes. - public override void Kill(int timeLeft) - { - SpawnDust(); - } - - // Spawns a small bit of Luminite themed dust. - private void SpawnDust() - { - int dustCount = Main.rand.Next(3, 6); - Vector2 corner = projectile.position; - for (int i = 0; i < dustCount; ++i) - { - int dustType = 229; - float scale = 0.6f + Main.rand.NextFloat(0.4f); - int idx = Dust.NewDust(corner, projectile.width, projectile.height, dustType); - Main.dust[idx].noGravity = true; - Main.dust[idx].velocity *= 3f; - Main.dust[idx].scale = scale; - } - } - } -} diff --git a/Projectiles/Rogue/NanoblackMain.cs b/Projectiles/Rogue/NanoblackMain.cs new file mode 100644 index 0000000000..9c8d5227cd --- /dev/null +++ b/Projectiles/Rogue/NanoblackMain.cs @@ -0,0 +1,165 @@ +using CalamityMod.Items.Weapons.Rogue; +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 NanoblackMain : ModProjectile + { + public override string Texture => "CalamityMod/Items/Weapons/Rogue/NanoblackReaperRogue"; + + private const float RotationIncrement = 0.22f; + private const int Lifetime = 240; + private const float ReboundTime = 50f; + private const int MinBladeTimer = 13; + private const int MaxBladeTimer = 18; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nanoblack Reaper"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 7; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } + + public override void SetDefaults() + { + projectile.width = 56; + projectile.height = 56; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.extraUpdates = 2; + projectile.timeLeft = Lifetime; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 2; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + drawOffsetX = -11; + drawOriginOffsetY = -4; + drawOriginOffsetX = 0; + + // Initialize the frame counter and random blade delay on the very first frame. + if (projectile.timeLeft == Lifetime) + projectile.ai[1] = GetBladeDelay(); + + // Produces electricity and green firework sparks constantly while in flight. + if (Main.rand.NextBool(3)) + { + int dustType = Main.rand.NextBool(5) ? 226 : 220; + float scale = 0.8f + Main.rand.NextFloat(0.3f); + float velocityMult = Main.rand.NextFloat(0.3f, 0.6f); + int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType); + Main.dust[idx].noGravity = true; + Main.dust[idx].velocity = velocityMult * projectile.velocity; + Main.dust[idx].scale = scale; + } + + // ai[0] is a frame counter. ai[1] is a countdown to spawning the next nanoblack energy blade. + projectile.ai[0] += 1f; + projectile.ai[1] -= 1f; + + // On the frame the scythe begins returning, send a net update. + if (projectile.ai[0] == ReboundTime) + projectile.netUpdate = true; + + // The scythe runs its returning AI if the frame counter is greater than ReboundTime. + if (projectile.ai[0] >= ReboundTime) + { + float returnSpeed = NanoblackReaperRogue.Speed; + float acceleration = 2.4f; + Player owner = Main.player[projectile.owner]; + + // Delete the scythe if it's excessively far away. + Vector2 playerCenter = owner.Center; + float xDist = playerCenter.X - projectile.Center.X; + float yDist = playerCenter.Y - projectile.Center.Y; + float dist = (float)Math.Sqrt(xDist * xDist + yDist * yDist); + if (dist > 3000f) + projectile.Kill(); + + dist = returnSpeed / dist; + xDist *= dist; + yDist *= dist; + + // Home back in on the player. + if (projectile.velocity.X < xDist) + { + projectile.velocity.X = projectile.velocity.X + acceleration; + if (projectile.velocity.X < 0f && xDist > 0f) + projectile.velocity.X += acceleration; + } + else if (projectile.velocity.X > xDist) + { + projectile.velocity.X = projectile.velocity.X - acceleration; + if (projectile.velocity.X > 0f && xDist < 0f) + projectile.velocity.X -= acceleration; + } + if (projectile.velocity.Y < yDist) + { + projectile.velocity.Y = projectile.velocity.Y + acceleration; + if (projectile.velocity.Y < 0f && yDist > 0f) + projectile.velocity.Y += acceleration; + } + else if (projectile.velocity.Y > yDist) + { + projectile.velocity.Y = projectile.velocity.Y - acceleration; + if (projectile.velocity.Y > 0f && yDist < 0f) + projectile.velocity.Y -= acceleration; + } + + // Delete the projectile if it touches its owner. + if (Main.myPlayer == projectile.owner) + if (projectile.Hitbox.Intersects(owner.Hitbox)) + projectile.Kill(); + } + + // Create nanoblack energy blades at a somewhat-random rate while in flight. + if (projectile.ai[1] <= 0f) + { + SpawnEnergyBlade(); + projectile.ai[1] = GetBladeDelay(); + } + + // Rotate the scythe as it flies. + float spin = projectile.direction <= 0 ? -1f : 1f; + projectile.rotation += spin * RotationIncrement; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + private int GetBladeDelay() + { + return Main.rand.Next(MinBladeTimer, MaxBladeTimer + 1); + } + + private void SpawnEnergyBlade() + { + int bladeID = ModContent.ProjectileType(); + int bladeDamage = projectile.damage / 5; + float bladeKB = 3f; + float spin = projectile.direction <= 0 ? -1f : 1f; + float d = 16f; + float velocityMult = 0.9f; + Vector2 directOffset = new Vector2(Main.rand.NextFloat(-d, d), Main.rand.NextFloat(-d, d)); + Vector2 velocityOffset = Main.rand.NextFloat(-velocityMult, velocityMult) * projectile.velocity; + Vector2 pos = projectile.Center + directOffset + velocityOffset; + if (projectile.owner == Main.myPlayer) + { + int proj = Projectile.NewProjectile(pos, Vector2.Zero, bladeID, bladeDamage, bladeKB, projectile.owner, 0f, spin); + CalamityGlobalProjectile cgp = Main.projectile[proj].Calamity(); + } + } + } +} diff --git a/Projectiles/Rogue/NanoblackSplit.cs b/Projectiles/Rogue/NanoblackSplit.cs new file mode 100644 index 0000000000..d3ab36ae0d --- /dev/null +++ b/Projectiles/Rogue/NanoblackSplit.cs @@ -0,0 +1,213 @@ +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 NanoblackSplit : ModProjectile + { + private static int SpriteWidth = 52; + private static int Lifetime = 90; + private static float MaxRotationSpeed = 0.25f; + private static float MaxSpeed = 22f; + + private static float HomingStartRange = 600f; + private static float HomingBreakRange = 1000f; + private static float HomingBonusRangeCap = 200f; + private static float BaseHomingFactor = 1.6f; + private static float MaxHomingFactor = 6.6f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nanoblack Blade"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 3; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 32; + projectile.height = 32; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.penetrate = 4; + projectile.extraUpdates = 1; + projectile.timeLeft = Lifetime; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 8; + projectile.Calamity().rogue = true; + } + + // ai[0] = Index of current NPC target. If 0 or negative, the projectile has no target + // ai[1] = Current spin speed. Negative speeds are also allowed. + public override void AI() + { + drawOffsetX = -10; + drawOriginOffsetY = 0; + drawOriginOffsetX = 0; + + // On the very first frame, clear any invalid starting target variable and create some dust. + // Also grab the damage type based on ai[0]. + if (projectile.timeLeft == Lifetime) + SpawnDust(); + + // Spin in the specified starting direction and slow down spin over time + // Loses 1.66% of current speed every frame + // Also update current orientation to reflect current spin direction + float currentSpin = projectile.ai[1]; + projectile.direction = currentSpin <= 0f ? 1 : -1; + projectile.spriteDirection = projectile.direction; + projectile.rotation += currentSpin * MaxRotationSpeed; + float spinReduction = 0.0166f * currentSpin; + projectile.ai[1] -= spinReduction; + + // If about to disappear, shrink by 8% every frame + if (projectile.timeLeft < 15) + projectile.scale *= 0.92f; + + // Search for and home in on nearby targets + HomingAI(); + } + + private void HomingAI() + { + // If we don't currently have a target, go try and get one! + int targetID = (int)projectile.ai[0] - 1; + if (targetID < 0) + targetID = AcquireTarget(); + + // Save the target, whether we have one or not. + projectile.ai[0] = targetID + 1f; + + // If we don't have a target, then just slow down a bit. + if (targetID < 0) + { + projectile.velocity *= 0.94f; + return; + } + + // Homing behavior depends on how far the blade is from its target. + NPC target = Main.npc[targetID]; + float xDist = projectile.Center.X - target.Center.X; + float yDist = projectile.Center.Y - target.Center.Y; + float dist = (float)Math.Sqrt(xDist * xDist + yDist * yDist); + + // If the target is too far away, stop homing in on it. + if (dist > HomingBreakRange) + { + projectile.ai[0] = 0f; + return; + } + + // Adds a multiple of the towards-target vector to its velocity every frame. + float homingFactor = CalcHomingFactor(dist); + Vector2 posDiff = target.Center - projectile.Center; + posDiff = posDiff.SafeNormalize(Vector2.Zero); + posDiff *= homingFactor; + Vector2 newVelocity = projectile.velocity += posDiff; + + // Caps speed to make sure it doesn't go too fast. + if (newVelocity.Length() >= MaxSpeed) + { + newVelocity = newVelocity.SafeNormalize(Vector2.Zero); + newVelocity *= MaxSpeed; + } + + projectile.velocity = newVelocity; + } + + // Returns the ID of the NPC to be targeted by this energy blade. + // It chooses the closest target which can be chased, ignoring invulnerable NPCs. + // Nanoblack Blades prefer to target bosses whenever possible. + private int AcquireTarget() + { + bool bossFound = false; + int target = -1; + float minDist = HomingStartRange; + for (int i = 0; i < 200; ++i) + { + NPC npc = Main.npc[i]; + if (!npc.active || npc.type == NPCID.TargetDummy) + continue; + + // If we've found a valid boss target, ignore ALL targets which aren't bosses. + if (bossFound && !npc.boss) + continue; + + if (npc.CanBeChasedBy(projectile, false)) + { + float xDist = projectile.Center.X - npc.Center.X; + float yDist = projectile.Center.Y - npc.Center.Y; + float distToNPC = (float)Math.Sqrt(xDist * xDist + yDist * yDist); + if (distToNPC < minDist) + { + // If this target within range is a boss, set the boss found flag. + if (npc.boss) + bossFound = true; + minDist = distToNPC; + target = i; + } + } + } + return target; + } + + // Energy blades home even more aggressively if they are very close to their target. + private float CalcHomingFactor(float dist) + { + float baseFactor = BaseHomingFactor; + float bonus = (MaxHomingFactor - BaseHomingFactor) * (1f - dist / HomingBonusRangeCap); + if (bonus < 0f) + bonus = 0f; + return baseFactor + bonus; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + // Draws the energy blade's glowmask. + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + float fWidthOverTwo = SpriteWidth / 2f; + float fHeightOverTwo = projectile.height / 2f; + + // Make sure the glowmask matches the blade's own orientation + SpriteEffects eff = SpriteEffects.None; + if (projectile.spriteDirection == -1) + eff = SpriteEffects.FlipHorizontally; + Vector2 origin = new Vector2(fWidthOverTwo, fHeightOverTwo); + spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Rogue/NanoblackSplitGlow"), + projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, + origin, projectile.scale, eff, 0f); + } + + // Spawns a tiny bit of dust when the energy blade vanishes. + public override void Kill(int timeLeft) + { + SpawnDust(); + } + + // Spawns a small bit of Luminite themed dust. + private void SpawnDust() + { + int dustCount = Main.rand.Next(3, 6); + Vector2 corner = projectile.position; + for (int i = 0; i < dustCount; ++i) + { + int dustType = 229; + float scale = 0.6f + Main.rand.NextFloat(0.4f); + int idx = Dust.NewDust(corner, projectile.width, projectile.height, dustType); + Main.dust[idx].noGravity = true; + Main.dust[idx].velocity *= 3f; + Main.dust[idx].scale = scale; + } + } + } +} diff --git a/Projectiles/Hybrid/NanoblackSplit.png b/Projectiles/Rogue/NanoblackSplit.png similarity index 100% rename from Projectiles/Hybrid/NanoblackSplit.png rename to Projectiles/Rogue/NanoblackSplit.png diff --git a/Projectiles/Hybrid/NanoblackSplitGlow.png b/Projectiles/Rogue/NanoblackSplitGlow.png similarity index 100% rename from Projectiles/Hybrid/NanoblackSplitGlow.png rename to Projectiles/Rogue/NanoblackSplitGlow.png From a46ceb3cf449280049eaff984f32f4fbeaf1e0cd Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 22 Nov 2020 01:38:05 -0500 Subject: [PATCH 13/26] removed melee illustrious knives --- Items/Weapons/Melee/RoyalKnivesMelee.cs | 113 ------------------ Items/Weapons/Melee/RoyalKnivesMelee.png | Bin 503 -> 0 bytes Items/Weapons/Rogue/RoyalKnives.cs | 8 +- Projectiles/Hybrid/IllustriousKnife.cs | 105 ---------------- Projectiles/Rogue/IllustriousKnife.cs | 92 ++++++++++++++ .../{Hybrid => Rogue}/IllustriousKnife.png | Bin 6 files changed, 96 insertions(+), 222 deletions(-) delete mode 100644 Items/Weapons/Melee/RoyalKnivesMelee.cs delete mode 100644 Items/Weapons/Melee/RoyalKnivesMelee.png delete mode 100644 Projectiles/Hybrid/IllustriousKnife.cs create mode 100644 Projectiles/Rogue/IllustriousKnife.cs rename Projectiles/{Hybrid => Rogue}/IllustriousKnife.png (100%) 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 4d31893202d4f90715155f75bfe6c5f0ac48782d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 503 zcmeAS@N?(olHy`uVBq!ia0vp^CO~Y(!3-o%tm#?_q;vy(LR^7#6+_rA5x>WkE?+Mv zDYB|4iFvBJ)EZT-E!uLPTTzzDSV17o(|4i8o_iHb?AL7qYTz#k@(X78j{=_d&RfR7 zz?kLf;uzx5x%FD?>?Q?)wugQUKmYuwWu5tmE?qYj$KyxV`vl)oF74=5yr? zYn`Q0^IgmgmIi&BFgsah>6GGZ%jM-;!cM6(9l6n;^GPLy%h~(n&ajWVoy9E%O*1xh zToPV4_4+XdMW5oHg;A2Tj61Sb!|xpww-P_pR%16}HWXW@UlLgKU`pK41y7c< zzHqx06_K#?v&yA~sqW7nK53s=Y~@iWf9|`YuIAZAo&R6^ho~nR|NP9hgELcjXTVm! rBil~TZ{S`dT$mzsesQi%M;${=kG18wlJir55yIf<>gTe~DWM4fz7pQK 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 From fc576dffc1bc95bb39e26452c317d6856ddc9097 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 22 Nov 2020 01:51:36 -0500 Subject: [PATCH 14/26] fix numerous compile errors --- CalamityLists.cs | 4 --- Items/CalamityGlobalItem.cs | 4 +-- Items/TreasureBags/DevourerofGodsBag.cs | 2 +- Items/TreasureBags/RavagerBag.cs | 3 +- ModSupport/WeakReferenceSupport.cs | 4 +-- NPCs/DevourerofGods/DevourerofGodsHeadS.cs | 2 +- NPCs/SupremeCalamitas/SupremeCalamitas.cs | 41 +++++++++++----------- 7 files changed, 27 insertions(+), 33 deletions(-) diff --git a/CalamityLists.cs b/CalamityLists.cs index 807b248cd0..ac69fd6a07 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -753,7 +753,6 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), @@ -925,7 +924,6 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), @@ -980,7 +978,6 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), @@ -1577,7 +1574,6 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index d5c4783563..795da598f6 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1143,7 +1143,7 @@ namespace CalamityMod.Items tt2.overrideColor = new Color(0, 0, 255); if (item.type == ModContent.ItemType()) tt2.overrideColor = Judgement.GetSyncedLightColor(); - if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) + if (item.type == ModContent.ItemType()) tt2.overrideColor = new Color(0.34f, 0.34f + 0.66f * Main.DiscoG / 255f, 0.34f + 0.5f * Main.DiscoG / 255f); if (item.type == ModContent.ItemType()) tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25), 4f); //alternates between emerald green and amber (BanditHueh) @@ -1169,7 +1169,7 @@ namespace CalamityMod.Items tt2.overrideColor = new Color(207, 17, 117); if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) tt2.overrideColor = new Color(227, 226, 180); - if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) + if (item.type == ModContent.ItemType()) tt2.overrideColor = CalamityUtils.ColorSwap(new Color(154, 255, 151), new Color(228, 151, 255), 4f); if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 132, 22), new Color(221, 85, 7), 4f); diff --git a/Items/TreasureBags/DevourerofGodsBag.cs b/Items/TreasureBags/DevourerofGodsBag.cs index 10b038af18..eb192bfbae 100644 --- a/Items/TreasureBags/DevourerofGodsBag.cs +++ b/Items/TreasureBags/DevourerofGodsBag.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Items.TreasureBags DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - Main.rand.NextBool() ? DropHelper.WeightStack(w) : DropHelper.WeightStack(w) + DropHelper.WeightStack(w) ); DropHelper.DropItemChance(player, ModContent.ItemType(), DropHelper.RareVariantDropRateInt); diff --git a/Items/TreasureBags/RavagerBag.cs b/Items/TreasureBags/RavagerBag.cs index 2b0ec05d65..58d1783f59 100644 --- a/Items/TreasureBags/RavagerBag.cs +++ b/Items/TreasureBags/RavagerBag.cs @@ -56,8 +56,7 @@ namespace CalamityMod.Items.TreasureBags DropHelper.WeightStack(w), DropHelper.WeightStack(w) ); - - DropHelper.DropItemFromSetChance(player, 0.05f, ModContent.ItemType(), ModContent.ItemType()); + DropHelper.DropItemChance(player, ModContent.ItemType(), 0.05f); // Equipment DropHelper.DropItemChance(player, ModContent.ItemType(), 0.5f); diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 2ccbe64a7e..01b37a6d2e 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -514,7 +514,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("DevourerOfGods", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}]"; string despawn = CalamityUtils.ColorMessage("The Devourer of Gods has slain everyone and feasted on their essence.", new Color(0x00, 0xFF, 0xFF)); @@ -542,7 +542,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("SupremeCalamitas", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}]"; string despawn = CalamityUtils.ColorMessage("Please don't waste my time.", new Color(0xFF, 0xA5, 0x00)); diff --git a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs index e3992171e7..b4ef82e02d 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs @@ -1152,7 +1152,7 @@ namespace CalamityMod.NPCs.DevourerofGods DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - Main.rand.NextBool() ? DropHelper.WeightStack(w) : DropHelper.WeightStack(w) + DropHelper.WeightStack(w) ); // Vanity diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 1d3364ef3f..117d8d8552 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -2055,29 +2055,28 @@ namespace CalamityMod.NPCs.SupremeCalamitas DropHelper.DropItem(npc, ModContent.ItemType(), true, essenceMin, essenceMax); // Weapons - - // All non-hybrid weapons are listed twice so that the drop rates are actually equal between each unique weapon + // Rejoice! Hybrid weapons are no more, so this list is no longer cluttered. DropHelper.DropItemFromSetCondition(npc, true, Main.expertMode, - ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), // Illustrious Knives - ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), // Staff of Blushie - ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), // Flamsteed Ring + ModContent.ItemType(), // Illustrious Knives + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), // Staff of Blushie + ModContent.ItemType(), + ModContent.ItemType(), // Temporal Umbrella + ModContent.ItemType(), // The Dance of Light ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), // Voidragon - ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), //Temporal Umbrella - ModContent.ItemType(), ModContent.ItemType() + ModContent.ItemType() // Voidragon ); DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, CalamityWorld.revenge); From 05379c73981ab44446f6bf6faa22d17cbf06a602 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 22 Nov 2020 15:04:33 -0500 Subject: [PATCH 15/26] moved terra disk projectiles to correct folder --- Projectiles/Hybrid/TerraDiskProjectile2.cs | 45 ------------------ .../{Hybrid => Rogue}/TerraDiskProjectile.cs | 7 +-- Projectiles/Rogue/TerraDiskProjectile2.cs | 44 +++++++++++++++++ .../TerraDiskProjectile2.png | Bin 4 files changed, 46 insertions(+), 50 deletions(-) delete mode 100644 Projectiles/Hybrid/TerraDiskProjectile2.cs rename Projectiles/{Hybrid => Rogue}/TerraDiskProjectile.cs (82%) create mode 100644 Projectiles/Rogue/TerraDiskProjectile2.cs rename Projectiles/{Hybrid => Rogue}/TerraDiskProjectile2.png (100%) diff --git a/Projectiles/Hybrid/TerraDiskProjectile2.cs b/Projectiles/Hybrid/TerraDiskProjectile2.cs deleted file mode 100644 index 7bcd55d058..0000000000 --- a/Projectiles/Hybrid/TerraDiskProjectile2.cs +++ /dev/null @@ -1,45 +0,0 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Hybrid -{ - public class TerraDiskProjectile2 : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Terra Disk"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; - ProjectileID.Sets.TrailingMode[projectile.type] = 1; - } - - public override void SetDefaults() - { - projectile.width = 40; - projectile.height = 40; - projectile.alpha = 75; - projectile.friendly = true; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.aiStyle = 3; - projectile.timeLeft = 60; - aiType = ProjectileID.WoodenBoomerang; - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, 0f, (255 - projectile.alpha) * 0.75f / 255f, 0f); - if (Main.rand.NextBool(5)) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 107, projectile.velocity.X, projectile.velocity.Y); - } - } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); - return false; - } - } -} diff --git a/Projectiles/Hybrid/TerraDiskProjectile.cs b/Projectiles/Rogue/TerraDiskProjectile.cs similarity index 82% rename from Projectiles/Hybrid/TerraDiskProjectile.cs rename to Projectiles/Rogue/TerraDiskProjectile.cs index b6251e6744..14ea002e19 100644 --- a/Projectiles/Hybrid/TerraDiskProjectile.cs +++ b/Projectiles/Rogue/TerraDiskProjectile.cs @@ -1,4 +1,3 @@ -using CalamityMod.Projectiles.Hybrid; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -90,10 +89,8 @@ namespace CalamityMod.Projectiles.Rogue for (i = 0; i < 3; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - Main.projectile[proj].Calamity().forceRogue = true; - int proj2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage / 2, projectile.knockBack, projectile.owner, 0f, 0f); - Main.projectile[proj2].Calamity().forceRogue = true; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage / 2, projectile.knockBack, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/Rogue/TerraDiskProjectile2.cs b/Projectiles/Rogue/TerraDiskProjectile2.cs new file mode 100644 index 0000000000..cb4e62c0ce --- /dev/null +++ b/Projectiles/Rogue/TerraDiskProjectile2.cs @@ -0,0 +1,44 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class TerraDiskProjectile2 : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Terra Disk"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + } + + public override void SetDefaults() + { + projectile.width = 40; + projectile.height = 40; + projectile.alpha = 75; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.aiStyle = 3; + projectile.timeLeft = 60; + aiType = ProjectileID.WoodenBoomerang; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, 0f, (255 - projectile.alpha) * 0.75f / 255f, 0f); + if (Main.rand.NextBool(5)) + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 107, projectile.velocity.X, projectile.velocity.Y); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); + return false; + } + } +} diff --git a/Projectiles/Hybrid/TerraDiskProjectile2.png b/Projectiles/Rogue/TerraDiskProjectile2.png similarity index 100% rename from Projectiles/Hybrid/TerraDiskProjectile2.png rename to Projectiles/Rogue/TerraDiskProjectile2.png From 0d1648bec9499781a3ee628bac594d01d52fd4ec Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 22 Nov 2020 15:11:40 -0500 Subject: [PATCH 16/26] removed rogue pwnagehammer --- Items/Weapons/Melee/PwnagehammerMelee.cs | 24 +++---- Items/Weapons/Rogue/Pwnagehammer.cs | 66 ------------------ Items/Weapons/Rogue/Pwnagehammer.png | Bin 584 -> 0 bytes .../PwnagehammerEcho.cs} | 21 +++--- .../PwnagehammerEcho.png} | Bin .../{Hybrid => Melee}/PwnagehammerProj.cs | 34 +++------ 6 files changed, 31 insertions(+), 114 deletions(-) delete mode 100644 Items/Weapons/Rogue/Pwnagehammer.cs delete mode 100644 Items/Weapons/Rogue/Pwnagehammer.png rename Projectiles/{Hybrid/PwnagehammerProjStealthStrike.cs => Melee/PwnagehammerEcho.cs} (87%) rename Projectiles/{Hybrid/PwnagehammerProjStealthStrike.png => Melee/PwnagehammerEcho.png} (100%) rename Projectiles/{Hybrid => Melee}/PwnagehammerProj.cs (85%) diff --git a/Items/Weapons/Melee/PwnagehammerMelee.cs b/Items/Weapons/Melee/PwnagehammerMelee.cs index ee275ed591..6bf1f9640f 100644 --- a/Items/Weapons/Melee/PwnagehammerMelee.cs +++ b/Items/Weapons/Melee/PwnagehammerMelee.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Hybrid; +using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -12,15 +12,15 @@ namespace CalamityMod.Items.Weapons.Melee { DisplayName.SetDefault("Pwnagehammer"); Tooltip.SetDefault("Throws a heavy, gravity-affected hammer that creates a loud blast of hallowed energy when it hits something\n" + - "There is a 20 percent chance for the hammer to home in on a target\n" + - "Homing hammers summon an additional spectral hammer on hit and are guaranteed to land a critical hit"); + "There is a 20 percent chance for the hammer to home in on a target\n" + + "Homing hammers summon an additional spectral hammer on hit and are guaranteed to land a critical hit"); } public override void SetDefaults() { item.width = 68; item.damage = 210; - item.crit = 10; + item.crit = 10; item.noMelee = true; item.noUseGraphic = true; item.autoReuse = true; @@ -30,20 +30,20 @@ namespace CalamityMod.Items.Weapons.Melee item.UseSound = SoundID.Item1; item.melee = true; item.height = 68; - item.value = Item.buyPrice(0, 48, 0, 0); - item.rare = 6; + item.value = Item.buyPrice(gold: 48); + item.rare = ItemRarityID.LightPurple; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 24.4f; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - Vector2 speed = new Vector2(speedX, speedY); - Vector2 yeetOffset = Vector2.Normalize(speed) * 40f; - if (Collision.CanHit(position, 0, 0, position + yeetOffset, 0, 0)) - { - position += yeetOffset; - } + Vector2 speed = new Vector2(speedX, speedY); + Vector2 yeetOffset = Vector2.Normalize(speed) * 40f; + if (Collision.CanHit(position, 0, 0, position + yeetOffset, 0, 0)) + { + position += yeetOffset; + } Projectile.NewProjectile(position, speed, type, damage, knockBack, player.whoAmI, Main.rand.NextBool(5) ? 1f : -1f); return false; } diff --git a/Items/Weapons/Rogue/Pwnagehammer.cs b/Items/Weapons/Rogue/Pwnagehammer.cs deleted file mode 100644 index 76a7b4b3a2..0000000000 --- a/Items/Weapons/Rogue/Pwnagehammer.cs +++ /dev/null @@ -1,66 +0,0 @@ -using CalamityMod.Projectiles.Hybrid; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Rogue -{ - public class Pwnagehammer : RogueWeapon - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pwnagehammer"); - Tooltip.SetDefault("Throws a heavy, gravity-affected hammer that creates a loud blast of hallowed energy when it hits something\n" + - "There is a 20 percent chance for the hammer to home in on a target\n" + - "Homing hammers summon an additional spectral hammer on hit and are guaranteed to land a critical hit"); - } - - public override void SafeSetDefaults() - { - item.width = 68; - item.damage = 210; - item.crit = 10; - item.noMelee = true; - item.noUseGraphic = true; - item.autoReuse = true; - item.useAnimation = item.useTime = 48; - item.useStyle = ItemUseStyleID.SwingThrow; - item.knockBack = 10f; - item.UseSound = SoundID.Item1; - item.Calamity().rogue = true; - item.height = 68; - item.value = Item.buyPrice(0, 48, 0, 0); - item.rare = 6; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 24.4f; - } - - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - Vector2 speed = new Vector2(speedX, speedY); - Vector2 yeetOffset = Vector2.Normalize(speed) * 40f; - if (Collision.CanHit(position, 0, 0, position + yeetOffset, 0, 0)) - { - position += yeetOffset; - } - int proj = Projectile.NewProjectile(position, speed, type, damage, knockBack, player.whoAmI, Main.rand.NextBool(5) ? 1f : -1f); - Main.projectile[proj].Calamity().forceRogue = true; - Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); - return false; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Pwnhammer); - recipe.AddIngredient(ItemID.HallowedBar, 7); - recipe.AddIngredient(ItemID.SoulofMight, 3); - recipe.AddIngredient(ItemID.SoulofSight, 3); - recipe.AddIngredient(ItemID.SoulofFright, 3); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} diff --git a/Items/Weapons/Rogue/Pwnagehammer.png b/Items/Weapons/Rogue/Pwnagehammer.png deleted file mode 100644 index acf7460cf911acb15755f3e6864547f59244398c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 584 zcmeAS@N?(olHy`uVBq!ia0vp^4nSNn{1`jRSl_T!D0vgvpU^(?>_*-#*@$S6CJ36}BpxVakk2yEacdeR-FKlIE}0 zod4$+yw&%wlF$OGPuZ{e7f1<~1o;L3M*|G1YiA|_B{>T`B8wRq_zr_GoYAwV)aLkF7XApEB$oZg zN~MyF!jpg@<*yag;8XML&}KZal4?w)<{-nW~}*FLD&)4RZKQ~D!amR&goYWLh0 z)GM4n8qK+5#X1p(xhF1FH~id849U<@&M My85}Sb4q9e0I?VSHUIzs diff --git a/Projectiles/Hybrid/PwnagehammerProjStealthStrike.cs b/Projectiles/Melee/PwnagehammerEcho.cs similarity index 87% rename from Projectiles/Hybrid/PwnagehammerProjStealthStrike.cs rename to Projectiles/Melee/PwnagehammerEcho.cs index 9027c9b76d..244d4fd9b8 100644 --- a/Projectiles/Hybrid/PwnagehammerProjStealthStrike.cs +++ b/Projectiles/Melee/PwnagehammerEcho.cs @@ -6,13 +6,13 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Hybrid +namespace CalamityMod.Projectiles.Melee { - public class PwnagehammerProjStealthStrike : ModProjectile + public class PwnagehammerEcho : ModProjectile { public override void SetStaticDefaults() { - DisplayName.SetDefault("Spectral Hammer"); + DisplayName.SetDefault("Pwnagehammer Echo"); ProjectileID.Sets.TrailCacheLength[projectile.type] = 7; ProjectileID.Sets.TrailingMode[projectile.type] = 0; } @@ -23,6 +23,7 @@ namespace CalamityMod.Projectiles.Hybrid projectile.height = 40; projectile.aiStyle = 0; projectile.friendly = true; + projectile.melee = true; projectile.penetrate = 1; projectile.tileCollide = false; projectile.ignoreWater = true; @@ -62,9 +63,7 @@ namespace CalamityMod.Projectiles.Hybrid NPC target = Main.npc[(int)projectile.ai[1]]; if (!target.CanBeChasedBy(projectile, false) || !target.active) - { projectile.Kill(); - } else { float velConst = 3f; @@ -77,7 +76,7 @@ namespace CalamityMod.Projectiles.Hybrid { Vector2 offset = new Vector2(7, 0).RotatedByRandom(MathHelper.ToRadians(360f)); Vector2 velOffset = new Vector2(3, 0).RotatedBy(offset.ToRotation()); - Dust dust = Dust.NewDustPerfect(new Vector2(projectile.position.X, projectile.position.Y) + offset, DustID.GoldFlame, new Vector2((projectile.velocity.X * 0.2f) + velOffset.X, (projectile.velocity.Y * 0.2f) + velOffset.Y), 100, new Color(255, 245, 198), 2f); + Dust dust = Dust.NewDustPerfect(new Vector2(projectile.position.X, projectile.position.Y) + offset, DustID.GoldFlame, new Vector2(projectile.velocity.X * 0.2f + velOffset.X, projectile.velocity.Y * 0.2f + velOffset.Y), 100, new Color(255, 245, 198), 2f); dust.noGravity = true; } @@ -85,7 +84,7 @@ namespace CalamityMod.Projectiles.Hybrid { Vector2 offset = new Vector2(7, 0).RotatedByRandom(MathHelper.ToRadians(360f)); Vector2 velOffset = new Vector2(3, 0).RotatedBy(offset.ToRotation()); - Dust dust = Dust.NewDustPerfect(new Vector2(projectile.position.X, projectile.position.Y) + offset, DustID.GoldFlame, new Vector2((projectile.velocity.X * 0.2f) + velOffset.X, (projectile.velocity.Y * 0.2f) + velOffset.Y), 100, new Color(255, 245, 198), 2f); + Dust dust = Dust.NewDustPerfect(new Vector2(projectile.position.X, projectile.position.Y) + offset, DustID.GoldFlame, new Vector2(projectile.velocity.X * 0.2f + velOffset.X, projectile.velocity.Y * 0.2f + velOffset.Y), 100, new Color(255, 245, 198), 2f); dust.noGravity = true; } } @@ -93,9 +92,7 @@ namespace CalamityMod.Projectiles.Hybrid public override bool? CanHitNPC(NPC target) { if (projectile.ai[0] <= 42f) - { return false; - } return null; } @@ -147,9 +144,7 @@ namespace CalamityMod.Projectiles.Hybrid { SpriteEffects spriteEffects = SpriteEffects.None; if (projectile.spriteDirection == -1) - { spriteEffects = SpriteEffects.FlipHorizontally; - } Texture2D texture = Main.projectileTexture[projectile.type]; Rectangle sourceRectangle = new Rectangle(0, 0, texture.Width, texture.Height); Vector2 origin = sourceRectangle.Size() / 2f; @@ -158,8 +153,8 @@ namespace CalamityMod.Projectiles.Hybrid { float rot = MathHelper.ToRadians(22.5f) * Math.Sign(projectile.velocity.X); Vector2 drawPos = projectile.oldPos[i] - Main.screenPosition + origin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - i) / (float)projectile.oldPos.Length); - spriteBatch.Draw(texture, drawPos, new Rectangle?(), color, projectile.rotation - (i * rot), origin, projectile.scale, spriteEffects, 0f); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - i) / (float)projectile.oldPos.Length); + spriteBatch.Draw(texture, drawPos, new Rectangle?(), color, projectile.rotation - i * rot, origin, projectile.scale, spriteEffects, 0f); } return false; } diff --git a/Projectiles/Hybrid/PwnagehammerProjStealthStrike.png b/Projectiles/Melee/PwnagehammerEcho.png similarity index 100% rename from Projectiles/Hybrid/PwnagehammerProjStealthStrike.png rename to Projectiles/Melee/PwnagehammerEcho.png diff --git a/Projectiles/Hybrid/PwnagehammerProj.cs b/Projectiles/Melee/PwnagehammerProj.cs similarity index 85% rename from Projectiles/Hybrid/PwnagehammerProj.cs rename to Projectiles/Melee/PwnagehammerProj.cs index 0a04c375a5..7e75b2b4ec 100644 --- a/Projectiles/Hybrid/PwnagehammerProj.cs +++ b/Projectiles/Melee/PwnagehammerProj.cs @@ -7,11 +7,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Hybrid +namespace CalamityMod.Projectiles.Melee { public class PwnagehammerProj : ModProjectile { - public override string Texture => "CalamityMod/Items/Weapons/Melee/PwnagehammerMelee"; + public override string Texture => "CalamityMod/Items/Weapons/Melee/PwnagehammerMelee"; public override void SetStaticDefaults() { @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Hybrid public override void AI() { - projectile.direction = projectile.spriteDirection = (projectile.velocity.X > 0f) ? 1 : -1; + projectile.direction = projectile.spriteDirection = projectile.velocity.X > 0f ? 1 : -1; projectile.rotation += MathHelper.ToRadians(22.5f) * projectile.direction; if (projectile.ai[0] == 1f) @@ -60,9 +60,7 @@ namespace CalamityMod.Projectiles.Hybrid float distanceTo = vec.Length(); distanceTo -= (float)Math.Sqrt(npc.width * npc.width + npc.height * npc.height) * 0.75f; if (distanceTo < distance && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) - { projectile.ai[1] = i; - } } } } @@ -91,7 +89,7 @@ namespace CalamityMod.Projectiles.Hybrid { Vector2 offset = new Vector2(12, 0).RotatedByRandom(MathHelper.ToRadians(360f)); Vector2 velOffset = new Vector2(4, 0).RotatedBy(offset.ToRotation()); - Dust dust = Dust.NewDustPerfect(new Vector2(projectile.Center.X, projectile.Center.Y) + offset, DustID.GoldFlame, new Vector2((projectile.velocity.X * 0.2f) + velOffset.X, (projectile.velocity.Y * 0.2f) + velOffset.Y), 100, new Color(255, 245, 198), 2f); + Dust dust = Dust.NewDustPerfect(new Vector2(projectile.Center.X, projectile.Center.Y) + offset, DustID.GoldFlame, new Vector2(projectile.velocity.X * 0.2f + velOffset.X, projectile.velocity.Y * 0.2f + velOffset.Y), 100, new Color(255, 245, 198), 2f); dust.noGravity = true; } @@ -99,7 +97,7 @@ namespace CalamityMod.Projectiles.Hybrid { Vector2 offset = new Vector2(12, 0).RotatedByRandom(MathHelper.ToRadians(360f)); Vector2 velOffset = new Vector2(4, 0).RotatedBy(offset.ToRotation()); - Dust dust = Dust.NewDustPerfect(new Vector2(projectile.Center.X, projectile.Center.Y) + offset, DustID.GoldFlame, new Vector2((projectile.velocity.X * 0.2f) + velOffset.X, (projectile.velocity.Y * 0.2f) + velOffset.Y), 100, new Color(255, 245, 198), 2f); + Dust dust = Dust.NewDustPerfect(new Vector2(projectile.Center.X, projectile.Center.Y) + offset, DustID.GoldFlame, new Vector2(projectile.velocity.X * 0.2f + velOffset.X, projectile.velocity.Y * 0.2f + velOffset.Y), 100, new Color(255, 245, 198), 2f); dust.noGravity = true; } } @@ -120,14 +118,14 @@ namespace CalamityMod.Projectiles.Hybrid dust.noGravity = true; dust.velocity = velOffset; dust.scale = 2.5f; - if ((i % 2) == 0) + if (i % 2 == 0) { dust = Dust.NewDustPerfect(projectile.position + offset, 269, new Vector2(velOffset.X, velOffset.Y)); dust.noGravity = true; dust.velocity = velOffset * 2f; dust.scale = 2.5f; } - if ((i % 4) == 0) + if (i % 4 == 0) { dust = Dust.NewDustPerfect(projectile.position + offset, 269, new Vector2(velOffset.X, velOffset.Y)); dust.noGravity = true; @@ -147,20 +145,16 @@ namespace CalamityMod.Projectiles.Hybrid if (distanceTo < distance && npc.CanBeChasedBy(projectile, false) && k != projectile.localAI[0]) { float alldamage = projectile.damage * 1.25f; - double damage = npc.StrikeNPC((int)alldamage, projectile.knockBack, (projectile.velocity.X > 0f) ? 1 : -1); + double damage = npc.StrikeNPC((int)alldamage, projectile.knockBack, projectile.velocity.X > 0f ? 1 : -1); player.addDPS((int)damage); } } SoundEffectInstance sound1 = Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PwnagehammerHoming"), projectile.Center); if (sound1 != null) - { sound1.Volume = 0.3f; - } SoundEffectInstance sound2 = Main.PlaySound(SoundID.Item14, projectile.Center); if (sound2 != null) - { sound2.Volume = 0.22f; - } } else { @@ -188,7 +182,7 @@ namespace CalamityMod.Projectiles.Hybrid if (distanceTo < distance && npc.CanBeChasedBy(projectile, false) && k != projectile.localAI[0]) { float alldamage = projectile.damage * 0.75f; - double damage = npc.StrikeNPC((int)alldamage, projectile.knockBack, (projectile.velocity.X > 0f) ? 1 : -1); + double damage = npc.StrikeNPC((int)alldamage, projectile.knockBack, projectile.velocity.X > 0f ? 1 : -1); player.addDPS((int)damage); } } @@ -200,9 +194,7 @@ namespace CalamityMod.Projectiles.Hybrid } SoundEffectInstance sound2 = Main.PlaySound(SoundID.Item14, projectile.Center); if (sound2 != null) - { sound2.Volume = 0.11f; - } } } @@ -211,10 +203,8 @@ namespace CalamityMod.Projectiles.Hybrid if (projectile.ai[0] == 1f && Main.myPlayer == projectile.owner) { crit = true; - int hammer = Projectile.NewProjectile(projectile.Center, new Vector2(0, -15f), ModContent.ProjectileType(), projectile.damage * 2, projectile.knockBack, projectile.owner, 0f, projectile.ai[1]); + int hammer = Projectile.NewProjectile(projectile.Center, new Vector2(0, -15f), ModContent.ProjectileType(), projectile.damage * 2, projectile.knockBack, projectile.owner, 0f, projectile.ai[1]); Main.projectile[hammer].localAI[0] = Math.Sign(projectile.velocity.X); - Main.projectile[hammer].melee = projectile.melee; - Main.projectile[hammer].Calamity().rogue = projectile.Calamity().rogue; Main.projectile[hammer].netUpdate = true; } } @@ -223,10 +213,8 @@ namespace CalamityMod.Projectiles.Hybrid { if (projectile.ai[0] == 1f && Main.myPlayer == projectile.owner) { - int hammer = Projectile.NewProjectile(projectile.Center, new Vector2(0, -15f), ModContent.ProjectileType(), projectile.damage * 2, projectile.knockBack, projectile.owner, 0f, projectile.ai[1]); + int hammer = Projectile.NewProjectile(projectile.Center, new Vector2(0, -15f), ModContent.ProjectileType(), projectile.damage * 2, projectile.knockBack, projectile.owner, 0f, projectile.ai[1]); Main.projectile[hammer].localAI[0] = Math.Sign(projectile.velocity.X); - Main.projectile[hammer].melee = projectile.melee; - Main.projectile[hammer].Calamity().rogue = projectile.Calamity().rogue; Main.projectile[hammer].netUpdate = true; } } From b1c7781ecacd676d8cb9ad1ccea0a5a8faf1477e Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 22 Nov 2020 15:17:30 -0500 Subject: [PATCH 17/26] removed rogue fallen paladin's hammer --- CalamityLists.cs | 2 +- .../Weapons/Melee/TruePaladinsHammerMelee.cs | 10 +- Items/Weapons/Rogue/TruePaladinsHammer.cs | 59 ------- Items/Weapons/Rogue/TruePaladinsHammer.png | Bin 1046 -> 0 bytes Projectiles/Hybrid/OPHammer.cs | 149 ------------------ Projectiles/Melee/FallenPaladinsHammerProj.cs | 132 ++++++++++++++++ 6 files changed, 138 insertions(+), 214 deletions(-) delete mode 100644 Items/Weapons/Rogue/TruePaladinsHammer.cs delete mode 100644 Items/Weapons/Rogue/TruePaladinsHammer.png delete mode 100644 Projectiles/Hybrid/OPHammer.cs create mode 100644 Projectiles/Melee/FallenPaladinsHammerProj.cs diff --git a/CalamityLists.cs b/CalamityLists.cs index ac69fd6a07..7e08549f4b 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -1473,7 +1473,7 @@ namespace CalamityMod ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), - ModContent.ProjectileType(), + ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), diff --git a/Items/Weapons/Melee/TruePaladinsHammerMelee.cs b/Items/Weapons/Melee/TruePaladinsHammerMelee.cs index bce78402a4..e93aca2520 100644 --- a/Items/Weapons/Melee/TruePaladinsHammerMelee.cs +++ b/Items/Weapons/Melee/TruePaladinsHammerMelee.cs @@ -1,12 +1,12 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Hybrid; +using CalamityMod.Projectiles.Melee; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class TruePaladinsHammerMelee : ModItem + public class TruePaladinsHammerMelee : ModItem { public override void SetStaticDefaults() { @@ -28,9 +28,9 @@ namespace CalamityMod.Items.Weapons.Melee item.UseSound = SoundID.Item1; item.melee = true; item.height = 28; - item.value = Item.buyPrice(0, 80, 0, 0); - item.rare = 8; - item.shoot = ModContent.ProjectileType(); + item.value = Item.buyPrice(gold: 80); + item.rare = ItemRarityID.Yellow; + item.shoot = ModContent.ProjectileType(); item.shootSpeed = 14f; } diff --git a/Items/Weapons/Rogue/TruePaladinsHammer.cs b/Items/Weapons/Rogue/TruePaladinsHammer.cs deleted file mode 100644 index a68434ff8a..0000000000 --- a/Items/Weapons/Rogue/TruePaladinsHammer.cs +++ /dev/null @@ -1,59 +0,0 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Hybrid; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Rogue -{ - public class TruePaladinsHammer : RogueWeapon - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fallen Paladin's Hammer"); - Tooltip.SetDefault("Explodes on enemy hits"); - } - - public override void SafeSetDefaults() - { - item.width = 14; - item.damage = 87; - item.noMelee = true; - item.noUseGraphic = true; - item.autoReuse = true; - item.useAnimation = 13; - item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 13; - item.knockBack = 20f; - item.UseSound = SoundID.Item1; - item.height = 28; - item.value = Item.buyPrice(0, 80, 0, 0); - item.rare = 8; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 14f; - 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) - { - int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceRogue = true; - Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); - return false; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PaladinsHammer); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} diff --git a/Items/Weapons/Rogue/TruePaladinsHammer.png b/Items/Weapons/Rogue/TruePaladinsHammer.png deleted file mode 100644 index 84ff0dfaa43527074a558a224a3c7a9bc123c9eb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1046 zcmV+x1nK*UP)F|9LHxtsR(yB(r^n6`m-646;jqkB8@IlpdLDODhO|OvSVxrVqH3Vs7@XVbfNGP zxgvHbi=|Q`bNfRprR0jcMr5q8!Myj?em`brN1It4d%w$b-psu5=jZ+Y&RC?avNUZw zkh419`~9uYjpr6=|Ea8+;?@2zA$@SmX2a_e^WwUZxpAK&?nT8x`d)b%neWrGhSw*v zbDFYoFDhz;T%(hyD>ULIp~(r@V9&GLYJ@m~>li}ag|rE*4q ziT6_wm!_u4@!pNX)<AkA$w-XA2S%_K2TGdI|9?U^RS z>&FJ4)9X`Th0Xt(@+snOD$Yrp#pgtK*4BEV^QZMOvTv(CcDfJ7&dtW&2AlpTD%T!iHf4J3$e5N}e4%D!elYKOQ9KV?Sm{24+V3@X%#_ zd|h{!_=Lvv0?Ftqi~W|qgdZof)K|Tc?D#~b?RJ;Al=zcd_hgU zG|d}#Wc8LJ=br}Uubi}(0V=QVmf}1|4sH@VV7RB(atFW$(Q}K$vX)UHKJv-%`RK;N z=5Zg7B8s?M3u6a>JfyCwRv#ZQ+eVyT^xlj#ugf`U2)~c#6^eMF9>n7|1SF7=Ax`Hb z&E;xkrR90-4D3Wj+$rHU9Vp!)9>jWNsJkI2Uc59U3@^>e^;hgB^JeefupW;(in!B) zc)cLIpYY}bkGk~n!?)k0gEGu~!SuTniSzj~GUNe$zN{r_Mcl20(FLtKdEAn;UE!G- z$bxh}n^we~R(xkg4e{paiE;9okzUK(9=SMdJtmL2cSrmml|BG!^h;!9ru3R?$hr~k805nm(n2MI0LF^% "CalamityMod/Items/Weapons/Melee/TruePaladinsHammerMelee"; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hammer"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } - - public override void SetDefaults() - { - projectile.width = 62; - projectile.height = 62; - projectile.friendly = true; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.extraUpdates = 2; - projectile.melee = true; - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, 0.35f, 0.35f, 0f); - if (projectile.soundDelay == 0) - { - projectile.soundDelay = 8; - Main.PlaySound(SoundID.Item7, projectile.position); - } - if (projectile.ai[0] == 0f) - { - projectile.ai[1] += 1f; - if (projectile.ai[1] >= 30f) - { - projectile.ai[0] = 1f; - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - } - else - { - projectile.tileCollide = false; - float num42 = 16f; - float num43 = 3.2f; - Vector2 vector2 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num44 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector2.X; - float num45 = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - vector2.Y; - float num46 = (float)Math.Sqrt((double)(num44 * num44 + num45 * num45)); - if (num46 > 3000f) - { - projectile.Kill(); - } - num46 = num42 / num46; - num44 *= num46; - num45 *= num46; - if (projectile.velocity.X < num44) - { - projectile.velocity.X = projectile.velocity.X + num43; - if (projectile.velocity.X < 0f && num44 > 0f) - { - projectile.velocity.X = projectile.velocity.X + num43; - } - } - else if (projectile.velocity.X > num44) - { - projectile.velocity.X = projectile.velocity.X - num43; - if (projectile.velocity.X > 0f && num44 < 0f) - { - projectile.velocity.X = projectile.velocity.X - num43; - } - } - if (projectile.velocity.Y < num45) - { - projectile.velocity.Y = projectile.velocity.Y + num43; - if (projectile.velocity.Y < 0f && num45 > 0f) - { - projectile.velocity.Y = projectile.velocity.Y + num43; - } - } - else if (projectile.velocity.Y > num45) - { - projectile.velocity.Y = projectile.velocity.Y - num43; - if (projectile.velocity.Y > 0f && num45 < 0f) - { - projectile.velocity.Y = projectile.velocity.Y - num43; - } - } - if (Main.myPlayer == projectile.owner) - { - Rectangle rectangle = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); - Rectangle value2 = new Rectangle((int)Main.player[projectile.owner].position.X, (int)Main.player[projectile.owner].position.Y, Main.player[projectile.owner].width, Main.player[projectile.owner].height); - if (rectangle.Intersects(value2)) - { - projectile.Kill(); - } - } - } - projectile.rotation += 0.5f; - } - - public override Color? GetAlpha(Color lightColor) - { - return new Color(250, 250, 250, 50); - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 300); - if (projectile.owner == Main.myPlayer) - { - int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - if (projectile.melee) - Main.projectile[proj].Calamity().forceMelee = true; - else - Main.projectile[proj].Calamity().forceRogue = true; - } - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - target.AddBuff(ModContent.BuffType(), 300); - if (projectile.owner == Main.myPlayer) - { - int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - if (projectile.melee) - Main.projectile[proj].Calamity().forceMelee = true; - else - Main.projectile[proj].Calamity().forceRogue = true; - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - } -} diff --git a/Projectiles/Melee/FallenPaladinsHammerProj.cs b/Projectiles/Melee/FallenPaladinsHammerProj.cs new file mode 100644 index 0000000000..694fa0baa1 --- /dev/null +++ b/Projectiles/Melee/FallenPaladinsHammerProj.cs @@ -0,0 +1,132 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class FallenPaladinsHammerProj : ModProjectile + { + public override string Texture => "CalamityMod/Items/Weapons/Melee/TruePaladinsHammerMelee"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fallen Paladin's Hammer"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 62; + projectile.height = 62; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.extraUpdates = 2; + projectile.melee = true; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, 0.35f, 0.35f, 0f); + if (projectile.soundDelay == 0) + { + projectile.soundDelay = 8; + Main.PlaySound(SoundID.Item7, projectile.position); + } + if (projectile.ai[0] == 0f) + { + projectile.ai[1] += 1f; + if (projectile.ai[1] >= 30f) + { + projectile.ai[0] = 1f; + projectile.ai[1] = 0f; + projectile.netUpdate = true; + } + } + else + { + projectile.tileCollide = false; + float num42 = 16f; + float num43 = 3.2f; + Vector2 vector2 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); + float num44 = Main.player[projectile.owner].position.X + Main.player[projectile.owner].width / 2 - vector2.X; + float num45 = Main.player[projectile.owner].position.Y + Main.player[projectile.owner].height / 2 - vector2.Y; + float num46 = (float)Math.Sqrt(num44 * num44 + num45 * num45); + if (num46 > 3000f) + projectile.Kill(); + num46 = num42 / num46; + num44 *= num46; + num45 *= num46; + if (projectile.velocity.X < num44) + { + projectile.velocity.X = projectile.velocity.X + num43; + if (projectile.velocity.X < 0f && num44 > 0f) + projectile.velocity.X = projectile.velocity.X + num43; + } + else if (projectile.velocity.X > num44) + { + projectile.velocity.X = projectile.velocity.X - num43; + if (projectile.velocity.X > 0f && num44 < 0f) + projectile.velocity.X = projectile.velocity.X - num43; + } + if (projectile.velocity.Y < num45) + { + projectile.velocity.Y = projectile.velocity.Y + num43; + if (projectile.velocity.Y < 0f && num45 > 0f) + projectile.velocity.Y = projectile.velocity.Y + num43; + } + else if (projectile.velocity.Y > num45) + { + projectile.velocity.Y = projectile.velocity.Y - num43; + if (projectile.velocity.Y > 0f && num45 < 0f) + projectile.velocity.Y = projectile.velocity.Y - num43; + } + if (Main.myPlayer == projectile.owner) + { + Rectangle rectangle = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); + Rectangle value2 = new Rectangle((int)Main.player[projectile.owner].position.X, (int)Main.player[projectile.owner].position.Y, Main.player[projectile.owner].width, Main.player[projectile.owner].height); + if (rectangle.Intersects(value2)) + projectile.Kill(); + } + } + projectile.rotation += 0.5f; + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(250, 250, 250, 50); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 300); + if (projectile.owner == Main.myPlayer) + { + int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Main.projectile[proj].Calamity().forceMelee = true; + } + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 300); + if (projectile.owner == Main.myPlayer) + { + int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Main.projectile[proj].Calamity().forceMelee = true; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + } +} From 98247ca38342eee8fa4138a2248ec771661bd467 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 22 Nov 2020 15:24:11 -0500 Subject: [PATCH 18/26] removed rogue stellar contempt --- Items/Weapons/Melee/StellarContemptMelee.cs | 16 +- Items/Weapons/Rogue/StellarContemptRogue.cs | 64 ----- Items/Weapons/Rogue/StellarContemptRogue.png | Bin 1785 -> 0 bytes Projectiles/Hybrid/StellarContemptHammer.cs | 261 ------------------- Projectiles/Melee/StellarContemptHammer.cs | 254 ++++++++++++++++++ 5 files changed, 258 insertions(+), 337 deletions(-) delete mode 100644 Items/Weapons/Rogue/StellarContemptRogue.cs delete mode 100644 Items/Weapons/Rogue/StellarContemptRogue.png delete mode 100644 Projectiles/Hybrid/StellarContemptHammer.cs create mode 100644 Projectiles/Melee/StellarContemptHammer.cs diff --git a/Items/Weapons/Melee/StellarContemptMelee.cs b/Items/Weapons/Melee/StellarContemptMelee.cs index 793eb2f920..f339a04d03 100644 --- a/Items/Weapons/Melee/StellarContemptMelee.cs +++ b/Items/Weapons/Melee/StellarContemptMelee.cs @@ -1,12 +1,11 @@ -using CalamityMod.Projectiles.Hybrid; -using Microsoft.Xna.Framework; +using CalamityMod.Projectiles.Melee; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class StellarContemptMelee : ModItem + public class StellarContemptMelee : ModItem { public static int BaseDamage = 250; public static float Speed = 18f; @@ -33,21 +32,14 @@ namespace CalamityMod.Items.Weapons.Melee item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; - item.rare = 10; + item.rare = ItemRarityID.Red; item.Calamity().customRarity = CalamityRarity.Turquoise; - item.value = Item.buyPrice(1, 20, 0, 0); + item.value = Item.buyPrice(platinum: 1, gold: 20); item.shoot = ModContent.ProjectileType(); item.shootSpeed = Speed; } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceMelee = true; - return false; - } - public override void AddRecipes() { ModRecipe r = new ModRecipe(mod); diff --git a/Items/Weapons/Rogue/StellarContemptRogue.cs b/Items/Weapons/Rogue/StellarContemptRogue.cs deleted file mode 100644 index be5b13af4d..0000000000 --- a/Items/Weapons/Rogue/StellarContemptRogue.cs +++ /dev/null @@ -1,64 +0,0 @@ -using CalamityMod.Projectiles.Hybrid; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Rogue -{ - public class StellarContemptRogue : RogueWeapon - { - public static int BaseDamage = 250; - public static float Speed = 18f; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stellar Contempt"); - Tooltip.SetDefault("Lunar flares rain down on enemy hits"); - } - - public override void SafeSetDefaults() - { - item.width = 66; - item.height = 64; - item.damage = BaseDamage; - item.knockBack = 9f; - item.useTime = 13; - item.useAnimation = 13; - item.autoReuse = true; - item.noMelee = true; - item.noUseGraphic = true; - - item.useStyle = ItemUseStyleID.SwingThrow; - item.UseSound = SoundID.Item1; - - item.rare = 10; - item.Calamity().customRarity = CalamityRarity.Turquoise; - item.value = Item.buyPrice(1, 20, 0, 0); - - item.Calamity().rogue = true; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = Speed; - } - - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceRogue = true; - Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); - return false; - } - - public override void AddRecipes() - { - ModRecipe r = new ModRecipe(mod); - r.SetResult(this); - r.AddIngredient(ModContent.ItemType()); - r.AddIngredient(ItemID.LunarBar, 5); - r.AddIngredient(ItemID.FragmentSolar, 10); - r.AddIngredient(ItemID.FragmentNebula, 10); - r.AddTile(TileID.LunarCraftingStation); - r.AddRecipe(); - } - } -} diff --git a/Items/Weapons/Rogue/StellarContemptRogue.png b/Items/Weapons/Rogue/StellarContemptRogue.png deleted file mode 100644 index d77b953151999a3faf5f93443b67d31e3c6cb1d8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1785 zcmVPx*vq?ljRCt{2n_X;FMHI(>ce`yVRVW3@Qd&_yjO9Zzy>++%McIV_3dK+E-WWA#Xu0wRo@Ob?(W{9V}zz@+*D7vSQT zO#l?ty=ArU-}^lPVJFK0=ywMa_M2|+2#7Gsm`7-IP*0d%Uu2P>$~)a=zc-%I-q(>Z znmiOLb^vl`O4JEESpam$daQPLOH4q7QQC=65}bK60dVWC3kip864V=d%H@6J$W;KM z=JT`bmRRi%{!#|Op6FpK+O+p|08kj3;sA8SZjI`>10syl7B!M(jNxq?0BB$J8342Q zZ3LjFJOT_M;pQ~}b`Pw#`rVOr)OxQ3C^2sw&j#S+zYPFnJ7EW)&+WJFOXV2>5k_hE z2qi(k!yV@OqdT4fply?oP`LjD;CX_Qpajgxngc+nKnQ!Vv&0%_>biXS;kfirlswvu zi28sCqqKVj$Qq(#=3)T4=Hvn}`ARR~d4cK`=Scv*c7FmOG*t+QluFcTYrZb8ZFaul zk1Ex*%>eXN3Q4z*i)V~9Lk);9$`}!;v~ofP09OXC03Hc9UzF?9zL6P?{Usit(Zau4 z{qTm2dpaz`9+`R`@W|8qhRFJz10sCN1QE%UFe8jaB#NXWVM60e0Q4X1wmQ}J{-~m) zsZx;<5Mh+DdW4@4T_yIr11@+ZRIFNVwX6UBWWxS58eHA_Ef8PFSX3vT(Ap%Ks^%eE zqw@jJL-s@u15ieh18@OZ9S1}hWt@mgN&%>+*@`AhS1bddq(t(ChPp-o!p?N7AI(El znvb+?nr&TIuQ6ELV1B67fq;lXWsHc2i&p^99qVxcz6xyyytPE} zQkhZB9Q`CDoAK_sc67+U+ycatp!JKLyZ%V{e4p%k0Ps8`Ai^kP6{@J)2Y7kI;;P>O z2%XPKc%SZPX#2wb_L`*IL=9D5z2pfWYyD!O^sgSU^Mk8a`xoAqyhNi&xo`Y{2&1$U zksrzfJa6zaI*A?)+hk@d_R5TE2C33DhhFb^bG7xk)-n8*EY;c+BxpYI+7lO~!7(## z%HQmNqO=jA-Y_s}0suwbLWX8|)wM!E zy_pmZXagh7JljtR5vyYJ053DGSyO7YR}z#wC850EPM(#7s%d!+KJ3_Vs0z(> z04`?9Zn=`63WzXDn@1=Ky2FLoImoAZ;my^qpTG1s$FCuy**kCp^gK!i~o5y^J7 zb8@7Xs3iDzsoCY96JL*+5NK0yKvh+Bb_PT>uLRf2qR}!WRW%V#d(s+wf3~T02`iv8t~37RBl)a zc)Qnn`mO2InYg}T?EWX~UKJ2wG#E8Bhu_n4*oq1|^SXKrZMV-sDhYWL#S?n&jEyIx zTLBS9ae0KEXsxc5Jw&Z0M|M94K*g)_KU!aW^r>~9k}zI8!LNV_BWG>#Qvh6w$r&gA z8RzxqZvd&IgDN0moXgS7vbspB&^7H{R((OGHNa%iVZ4%{3WzWo{C=l87wNxeyc6J8 bK!nkMtl^9V%DiJH00000NkvXXu0mjf`=Ued diff --git a/Projectiles/Hybrid/StellarContemptHammer.cs b/Projectiles/Hybrid/StellarContemptHammer.cs deleted file mode 100644 index 9186fb7da8..0000000000 --- a/Projectiles/Hybrid/StellarContemptHammer.cs +++ /dev/null @@ -1,261 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Items.Weapons.Melee; -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 StellarContemptHammer : ModProjectile - { - public override string Texture => "CalamityMod/Items/Weapons/Melee/StellarContemptMelee"; - - private static float RotationIncrement = 0.22f; - private static int Lifetime = 240; - private static float ReboundTime = 26f; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stellar Contempt"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 8; - ProjectileID.Sets.TrailingMode[projectile.type] = 1; - } - - public override void SetDefaults() - { - projectile.width = 44; - projectile.height = 44; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.extraUpdates = 3; - projectile.timeLeft = Lifetime; - } - - public override void AI() - { - drawOffsetX = -11; - drawOriginOffsetY = -10; - drawOriginOffsetX = 0; - - Lighting.AddLight(projectile.Center, 0.7f, 0.3f, 0.6f); - - // The hammer makes sound while flying. - if (projectile.soundDelay == 0) - { - projectile.soundDelay = 8; - Main.PlaySound(SoundID.Item7, (int)projectile.position.X, (int)projectile.position.Y); - } - - // ai[0] stores whether the hammer is returning. If 0, it isn't. If 1, it is. - if (projectile.ai[0] == 0f) - { - projectile.ai[1] += 1f; - if (projectile.ai[1] >= ReboundTime) - { - projectile.ai[0] = 1f; - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - } - else - { - projectile.tileCollide = false; - float returnSpeed = StellarContemptMelee.Speed; - float acceleration = 3.2f; - Player owner = Main.player[projectile.owner]; - - // Delete the hammer if it's excessively far away. - Vector2 playerCenter = owner.Center; - float xDist = playerCenter.X - projectile.Center.X; - float yDist = playerCenter.Y - projectile.Center.Y; - float dist = (float)Math.Sqrt((double)(xDist * xDist + yDist * yDist)); - if (dist > 3000f) - projectile.Kill(); - - dist = returnSpeed / dist; - xDist *= dist; - yDist *= dist; - - // Home back in on the player. - if (projectile.velocity.X < xDist) - { - projectile.velocity.X = projectile.velocity.X + acceleration; - if (projectile.velocity.X < 0f && xDist > 0f) - projectile.velocity.X += acceleration; - } - else if (projectile.velocity.X > xDist) - { - projectile.velocity.X = projectile.velocity.X - acceleration; - if (projectile.velocity.X > 0f && xDist < 0f) - projectile.velocity.X -= acceleration; - } - if (projectile.velocity.Y < yDist) - { - projectile.velocity.Y = projectile.velocity.Y + acceleration; - if (projectile.velocity.Y < 0f && yDist > 0f) - projectile.velocity.Y += acceleration; - } - else if (projectile.velocity.Y > yDist) - { - projectile.velocity.Y = projectile.velocity.Y - acceleration; - if (projectile.velocity.Y > 0f && yDist < 0f) - projectile.velocity.Y -= acceleration; - } - - // Delete the projectile if it touches its owner. - if (Main.myPlayer == projectile.owner) - if (projectile.Hitbox.Intersects(owner.Hitbox)) - projectile.Kill(); - } - - // Rotate the hammer as it flies. - projectile.rotation += RotationIncrement; - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - // Some dust gets produced on impact. - int dustCount = Main.rand.Next(20, 24); - int dustRadius = 6; - Vector2 corner = new Vector2(target.Center.X - (float)dustRadius, target.Center.Y - (float)dustRadius); - for (int i = 0; i < dustCount; ++i) - { - int dustType = 229; - float scale = 0.8f + Main.rand.NextFloat(1.1f); - int idx = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, dustType); - Main.dust[idx].noGravity = true; - Main.dust[idx].velocity *= 3f; - Main.dust[idx].scale = scale; - } - - // Applies Nightwither on contact at night. - if (!Main.dayTime) - target.AddBuff(ModContent.BuffType(), 480); - - // Do not drop lunar flares on dummies. - if (target.type == NPCID.TargetDummy) - return; - - // Play the Lunar Flare sound centered on the user, not the target (consistent with Lunar Flare and Stellar Striker) - Player user = Main.player[projectile.owner]; - Main.PlaySound(SoundID.Item88, projectile.position); - projectile.netUpdate = true; - - int numFlares = 2; - int flareDamage = (int)(0.3f * projectile.damage); - float flareKB = 4f; - for (int i = 0; i < numFlares; ++i) - { - float flareSpeed = Main.rand.NextFloat(8f, 11f); - - // Flares never come from straight up, there is always at least an 80 pixel horizontal offset - float xDist = Main.rand.NextFloat(80f, 320f) * (Main.rand.NextBool() ? -1f : 1f); - float yDist = Main.rand.NextFloat(1200f, 1440f); - Vector2 startPoint = target.Center + new Vector2(xDist, -yDist); - - // The flare is somewhat inaccurate based on the size of the target. - float xVariance = target.width / 4f; - if (xVariance < 8f) - xVariance = 8f; - float yVariance = target.height / 4f; - if (yVariance < 8f) - yVariance = 8f; - float xOffset = Main.rand.NextFloat(-xVariance, xVariance); - float yOffset = Main.rand.NextFloat(-yVariance, yVariance); - Vector2 offsetTarget = target.Center + new Vector2(xOffset, yOffset); - - // Finalize the velocity vector and make sure it's going at the right speed. - Vector2 velocity = offsetTarget - startPoint; - velocity.Normalize(); - velocity *= flareSpeed; - - float AI1 = (float)Main.rand.Next(3); - if (projectile.owner == Main.myPlayer) - { - int proj = Projectile.NewProjectile(startPoint, velocity, ProjectileID.LunarFlare, flareDamage, flareKB, Main.myPlayer, 0f, AI1); - CalamityGlobalProjectile cgp = Main.projectile[proj].Calamity(); - if (projectile.melee) - cgp.forceMelee = true; - else - cgp.forceRogue = true; - } - } - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - // Some dust gets produced on impact. - int dustCount = Main.rand.Next(20, 24); - int dustRadius = 6; - Vector2 corner = new Vector2(target.Center.X - (float)dustRadius, target.Center.Y - (float)dustRadius); - for (int i = 0; i < dustCount; ++i) - { - int dustType = 229; - float scale = 0.8f + Main.rand.NextFloat(1.1f); - int idx = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, dustType); - Main.dust[idx].noGravity = true; - Main.dust[idx].velocity *= 3f; - Main.dust[idx].scale = scale; - } - - // Applies Nightwither on contact at night. - if (!Main.dayTime) - target.AddBuff(ModContent.BuffType(), 480); - - // Play the Lunar Flare sound centered on the user, not the target (consistent with Lunar Flare and Stellar Striker) - Player user = Main.player[projectile.owner]; - Main.PlaySound(SoundID.Item88, projectile.position); - projectile.netUpdate = true; - - int numFlares = 2; - int flareDamage = (int)(0.3f * projectile.damage); - float flareKB = 4f; - for (int i = 0; i < numFlares; ++i) - { - float flareSpeed = Main.rand.NextFloat(8f, 11f); - - // Flares never come from straight up, there is always at least an 80 pixel horizontal offset - float xDist = Main.rand.NextFloat(80f, 320f) * (Main.rand.NextBool() ? -1f : 1f); - float yDist = Main.rand.NextFloat(1200f, 1440f); - Vector2 startPoint = target.Center + new Vector2(xDist, -yDist); - - // The flare is somewhat inaccurate based on the size of the target. - float xVariance = target.width / 4f; - if (xVariance < 8f) - xVariance = 8f; - float yVariance = target.height / 4f; - if (yVariance < 8f) - yVariance = 8f; - float xOffset = Main.rand.NextFloat(-xVariance, xVariance); - float yOffset = Main.rand.NextFloat(-yVariance, yVariance); - Vector2 offsetTarget = target.Center + new Vector2(xOffset, yOffset); - - // Finalize the velocity vector and make sure it's going at the right speed. - Vector2 velocity = offsetTarget - startPoint; - velocity.Normalize(); - velocity *= flareSpeed; - - float AI1 = (float)Main.rand.Next(3); - if (projectile.owner == Main.myPlayer) - { - int proj = Projectile.NewProjectile(startPoint, velocity, ProjectileID.LunarFlare, flareDamage, flareKB, Main.myPlayer, 0f, AI1); - CalamityGlobalProjectile cgp = Main.projectile[proj].Calamity(); - if (projectile.melee) - cgp.forceMelee = true; - else - cgp.forceRogue = true; - } - } - } - } -} diff --git a/Projectiles/Melee/StellarContemptHammer.cs b/Projectiles/Melee/StellarContemptHammer.cs new file mode 100644 index 0000000000..32c987a62a --- /dev/null +++ b/Projectiles/Melee/StellarContemptHammer.cs @@ -0,0 +1,254 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Items.Weapons.Melee; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class StellarContemptHammer : ModProjectile + { + public override string Texture => "CalamityMod/Items/Weapons/Melee/StellarContemptMelee"; + + private static float RotationIncrement = 0.22f; + private static int Lifetime = 240; + private static float ReboundTime = 26f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stellar Contempt"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 8; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + } + + public override void SetDefaults() + { + projectile.width = 44; + projectile.height = 44; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.extraUpdates = 3; + projectile.timeLeft = Lifetime; + } + + public override void AI() + { + drawOffsetX = -11; + drawOriginOffsetY = -10; + drawOriginOffsetX = 0; + + Lighting.AddLight(projectile.Center, 0.7f, 0.3f, 0.6f); + + // The hammer makes sound while flying. + if (projectile.soundDelay == 0) + { + projectile.soundDelay = 8; + Main.PlaySound(SoundID.Item7, (int)projectile.position.X, (int)projectile.position.Y); + } + + // ai[0] stores whether the hammer is returning. If 0, it isn't. If 1, it is. + if (projectile.ai[0] == 0f) + { + projectile.ai[1] += 1f; + if (projectile.ai[1] >= ReboundTime) + { + projectile.ai[0] = 1f; + projectile.ai[1] = 0f; + projectile.netUpdate = true; + } + } + else + { + projectile.tileCollide = false; + float returnSpeed = StellarContemptMelee.Speed; + float acceleration = 3.2f; + Player owner = Main.player[projectile.owner]; + + // Delete the hammer if it's excessively far away. + Vector2 playerCenter = owner.Center; + float xDist = playerCenter.X - projectile.Center.X; + float yDist = playerCenter.Y - projectile.Center.Y; + float dist = (float)Math.Sqrt(xDist * xDist + yDist * yDist); + if (dist > 3000f) + projectile.Kill(); + + dist = returnSpeed / dist; + xDist *= dist; + yDist *= dist; + + // Home back in on the player. + if (projectile.velocity.X < xDist) + { + projectile.velocity.X = projectile.velocity.X + acceleration; + if (projectile.velocity.X < 0f && xDist > 0f) + projectile.velocity.X += acceleration; + } + else if (projectile.velocity.X > xDist) + { + projectile.velocity.X = projectile.velocity.X - acceleration; + if (projectile.velocity.X > 0f && xDist < 0f) + projectile.velocity.X -= acceleration; + } + if (projectile.velocity.Y < yDist) + { + projectile.velocity.Y = projectile.velocity.Y + acceleration; + if (projectile.velocity.Y < 0f && yDist > 0f) + projectile.velocity.Y += acceleration; + } + else if (projectile.velocity.Y > yDist) + { + projectile.velocity.Y = projectile.velocity.Y - acceleration; + if (projectile.velocity.Y > 0f && yDist < 0f) + projectile.velocity.Y -= acceleration; + } + + // Delete the projectile if it touches its owner. + if (Main.myPlayer == projectile.owner) + if (projectile.Hitbox.Intersects(owner.Hitbox)) + projectile.Kill(); + } + + // Rotate the hammer as it flies. + projectile.rotation += RotationIncrement; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + // Some dust gets produced on impact. + int dustCount = Main.rand.Next(20, 24); + int dustRadius = 6; + Vector2 corner = new Vector2(target.Center.X - dustRadius, target.Center.Y - dustRadius); + for (int i = 0; i < dustCount; ++i) + { + int dustType = 229; + float scale = 0.8f + Main.rand.NextFloat(1.1f); + int idx = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, dustType); + Main.dust[idx].noGravity = true; + Main.dust[idx].velocity *= 3f; + Main.dust[idx].scale = scale; + } + + // Applies Nightwither on contact at night. + if (!Main.dayTime) + target.AddBuff(ModContent.BuffType(), 480); + + // Do not drop lunar flares on dummies. + if (target.type == NPCID.TargetDummy) + return; + + // Play the Lunar Flare sound centered on the user, not the target (consistent with Lunar Flare and Stellar Striker) + Player user = Main.player[projectile.owner]; + Main.PlaySound(SoundID.Item88, projectile.position); + projectile.netUpdate = true; + + int numFlares = 2; + int flareDamage = (int)(0.3f * projectile.damage); + float flareKB = 4f; + for (int i = 0; i < numFlares; ++i) + { + float flareSpeed = Main.rand.NextFloat(8f, 11f); + + // Flares never come from straight up, there is always at least an 80 pixel horizontal offset + float xDist = Main.rand.NextFloat(80f, 320f) * (Main.rand.NextBool() ? -1f : 1f); + float yDist = Main.rand.NextFloat(1200f, 1440f); + Vector2 startPoint = target.Center + new Vector2(xDist, -yDist); + + // The flare is somewhat inaccurate based on the size of the target. + float xVariance = target.width / 4f; + if (xVariance < 8f) + xVariance = 8f; + float yVariance = target.height / 4f; + if (yVariance < 8f) + yVariance = 8f; + float xOffset = Main.rand.NextFloat(-xVariance, xVariance); + float yOffset = Main.rand.NextFloat(-yVariance, yVariance); + Vector2 offsetTarget = target.Center + new Vector2(xOffset, yOffset); + + // Finalize the velocity vector and make sure it's going at the right speed. + Vector2 velocity = offsetTarget - startPoint; + velocity.Normalize(); + velocity *= flareSpeed; + + float AI1 = Main.rand.Next(3); + if (projectile.owner == Main.myPlayer) + { + int proj = Projectile.NewProjectile(startPoint, velocity, ProjectileID.LunarFlare, flareDamage, flareKB, Main.myPlayer, 0f, AI1); + CalamityGlobalProjectile cgp = Main.projectile[proj].Calamity(); + cgp.forceMelee = true; + } + } + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + // Some dust gets produced on impact. + int dustCount = Main.rand.Next(20, 24); + int dustRadius = 6; + Vector2 corner = new Vector2(target.Center.X - dustRadius, target.Center.Y - dustRadius); + for (int i = 0; i < dustCount; ++i) + { + int dustType = 229; + float scale = 0.8f + Main.rand.NextFloat(1.1f); + int idx = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, dustType); + Main.dust[idx].noGravity = true; + Main.dust[idx].velocity *= 3f; + Main.dust[idx].scale = scale; + } + + // Applies Nightwither on contact at night. + if (!Main.dayTime) + target.AddBuff(ModContent.BuffType(), 480); + + Main.PlaySound(SoundID.Item88, projectile.position); + projectile.netUpdate = true; + + int numFlares = 2; + int flareDamage = (int)(0.3f * projectile.damage); + float flareKB = 4f; + for (int i = 0; i < numFlares; ++i) + { + float flareSpeed = Main.rand.NextFloat(8f, 11f); + + // Flares never come from straight up, there is always at least an 80 pixel horizontal offset + float xDist = Main.rand.NextFloat(80f, 320f) * (Main.rand.NextBool() ? -1f : 1f); + float yDist = Main.rand.NextFloat(1200f, 1440f); + Vector2 startPoint = target.Center + new Vector2(xDist, -yDist); + + // The flare is somewhat inaccurate based on the size of the target. + float xVariance = target.width / 4f; + if (xVariance < 8f) + xVariance = 8f; + float yVariance = target.height / 4f; + if (yVariance < 8f) + yVariance = 8f; + float xOffset = Main.rand.NextFloat(-xVariance, xVariance); + float yOffset = Main.rand.NextFloat(-yVariance, yVariance); + Vector2 offsetTarget = target.Center + new Vector2(xOffset, yOffset); + + // Finalize the velocity vector and make sure it's going at the right speed. + Vector2 velocity = offsetTarget - startPoint; + velocity.Normalize(); + velocity *= flareSpeed; + + float AI1 = Main.rand.Next(3); + if (projectile.owner == Main.myPlayer) + { + int proj = Projectile.NewProjectile(startPoint, velocity, ProjectileID.LunarFlare, flareDamage, flareKB, Main.myPlayer, 0f, AI1); + CalamityGlobalProjectile cgp = Main.projectile[proj].Calamity(); + cgp.forceMelee = true; + } + } + } + } +} From 11b599958457755e23499870529c64b6bce642a0 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 22 Nov 2020 15:28:49 -0500 Subject: [PATCH 19/26] removed rogue galaxy smasher --- Items/Weapons/Melee/GalaxySmasherMelee.cs | 8 +- Items/Weapons/Rogue/GalaxySmasherRogue.cs | 65 ----- Items/Weapons/Rogue/GalaxySmasherRogue.png | Bin 2326 -> 0 bytes Projectiles/Hybrid/GalaxySmasherHammer.cs | 259 ------------------ Projectiles/Melee/FallenPaladinsHammerProj.cs | 2 +- Projectiles/Melee/GalaxySmasherHammer.cs | 257 +++++++++++++++++ Projectiles/Melee/StellarContemptHammer.cs | 1 + 7 files changed, 263 insertions(+), 329 deletions(-) delete mode 100644 Items/Weapons/Rogue/GalaxySmasherRogue.cs delete mode 100644 Items/Weapons/Rogue/GalaxySmasherRogue.png delete mode 100644 Projectiles/Hybrid/GalaxySmasherHammer.cs create mode 100644 Projectiles/Melee/GalaxySmasherHammer.cs diff --git a/Items/Weapons/Melee/GalaxySmasherMelee.cs b/Items/Weapons/Melee/GalaxySmasherMelee.cs index 14085cc3b8..20bef3f193 100644 --- a/Items/Weapons/Melee/GalaxySmasherMelee.cs +++ b/Items/Weapons/Melee/GalaxySmasherMelee.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Hybrid; +using CalamityMod.Projectiles.Melee; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class GalaxySmasherMelee : ModItem + public class GalaxySmasherMelee : ModItem { public static int BaseDamage = 480; public static float Speed = 18f; @@ -35,9 +35,9 @@ namespace CalamityMod.Items.Weapons.Melee item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; - item.rare = 10; + item.rare = ItemRarityID.Red; item.Calamity().customRarity = CalamityRarity.DarkBlue; - item.value = Item.buyPrice(1, 80, 0, 0); + item.value = Item.buyPrice(platinum: 1, gold: 80); item.shoot = ModContent.ProjectileType(); item.shootSpeed = Speed; diff --git a/Items/Weapons/Rogue/GalaxySmasherRogue.cs b/Items/Weapons/Rogue/GalaxySmasherRogue.cs deleted file mode 100644 index 84e32b09f6..0000000000 --- a/Items/Weapons/Rogue/GalaxySmasherRogue.cs +++ /dev/null @@ -1,65 +0,0 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Hybrid; -using CalamityMod.Tiles.Furniture.CraftingStations; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Rogue -{ - public class GalaxySmasherRogue : RogueWeapon - { - public static int BaseDamage = 390; - public static float Speed = 18f; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Galaxy Smasher"); - Tooltip.SetDefault("Explodes and summons death lasers on enemy hits"); - } - - public override void SafeSetDefaults() - { - item.width = 86; - item.height = 72; - item.damage = BaseDamage; - item.knockBack = 9f; - item.useAnimation = 13; - item.useTime = 13; - item.autoReuse = true; - item.noMelee = true; - item.noUseGraphic = true; - - item.useStyle = ItemUseStyleID.SwingThrow; - item.UseSound = SoundID.Item1; - - item.rare = 10; - item.Calamity().customRarity = CalamityRarity.DarkBlue; - item.value = Item.buyPrice(1, 80, 0, 0); - - item.Calamity().rogue = true; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = Speed; - } - - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceRogue = true; - Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); - return false; - } - - public override void AddRecipes() - { - ModRecipe r = new ModRecipe(mod); - r.SetResult(this); - r.AddIngredient(ModContent.ItemType()); - r.AddIngredient(ModContent.ItemType(), 5); - r.AddIngredient(ModContent.ItemType()); - r.AddTile(ModContent.TileType()); - r.AddRecipe(); - } - } -} diff --git a/Items/Weapons/Rogue/GalaxySmasherRogue.png b/Items/Weapons/Rogue/GalaxySmasherRogue.png deleted file mode 100644 index 9b40695ec7c4a8bdfeccd47aba8e6fbcf684fba9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2326 zcmV+x3F-EUP)EOL000QxNkl&&{j#U+>!qedk`QAZqGMlu|uGJmA)SW64iQlu{e-3z5a^ZLiR&wYEI-uwO_JuQFS z??1Qqo^#JRZ~D2^9b3JBRZS^0PKQm$FOKxuS08Sq12`v}RyP?(txcI@Sb$v8- zzMyf`)>Hs6zj84E>9JF~Kd+efMlbbQ=hqc#-rBy-l;5%vfc-l= zGXVE}aT5S<{b9FNzp>?R00s{J)*?&@t}Sppnp7D_U-#bd@%w~FDrJ73kQ)>0NY06k zA~h)YNfnhWya|AYwKoE=e(lo$yuG~}fMfk{1JJzYbJl&DV6E~6OFV$mWH|umP7YY4 z$~ZK!LTYBEDffDNLv68EOspe0BUY0t|M_Hj6#(NG&H`}P@|&%C2O`?Ldt``|*_f7P~4h?y*31VBSu4FC^3b-UG0Z|{lF_J!b~o)nO^ z#iF$ze+-!ZguHX~2mt$cb^=hju-*e0I}`L{c`0u!TV&ne{7Sd{=|N1abIm!iqJa~} z7K)!L67ux*sPZK@8E-<9sr9ElyRCkk>sJ6-ub{fN!2>uwI+Ov}@Zt}E?32-%Hc!$c z`~M8UcwM;%kQ})H#Kbz&oDr*~{n98>_4P;Zy$6704>gAN`=33>fUGSQTQ0UeitOh) zo&~ag_4;j3Tje`OF5BZ*wl*f#k!CGcFh%+)u?W_0b4}=ve*M#&jcY=+qDa+53#lTp zt&eYbz(4;hFvZqlh#jvpGrO2rN18Pos}*H)H7TMfQlo6>!w-Ghswd^2{mT8;^`C8i z!8+Gof}DT!QPZBpFht+oTMs~cn;D1L+L%~JnhP7NWuBUnQUE5;9JdJm*5;pt-Xx@o zKPnQ!v^1%|d-?UydYV+xl@Ce)IQm-3YVR4})^_*Uwl*f#k>-rpo)iB7vQek6k{^d+?tGsjr`mFC8=S>oN`OzCkf)$kk}9@UyZ{}IlB1p>X=z(2_20dJi&gLT*SF@pfB7ejEnU-c zuT`$s+(e(MGvkSgb);Fhv0_ullg6gXYN?Pawk@!YKCuVh*abxUl|rO07ymYjRC!W# z%t1(%nU-F~t-I5Zsn_I0F|m&1oY)|Wl_)dED-*!R5!H(FLU12{QqiFAnwt@E4!ZS5*5kv5w??1);t1 zBLHMBk7poDioAU<9y0ajnG~pil&AjwFRL9PSBMRWEGad=Ve+yS$GyI+!UMQ8ao)O~ zFK6rbx2_NU9h%UO)tJ14!)cR)cJgA{svi^UNX~4mcmtKybpWI%>~(l~`|mqs$X#{R z5J{6c{NfIq+?W6NDgYUuRIfDY0c0+ZOOu9N-}^`;O*HD#go&0FOR8SO5<*+%R|D{7 zY6!^YYH7v9I+Am*Kr*K_F`_578#0H#ZETp>vadC@0PrsR07y=hcmNlw%qnT-tUXt+ zSl9r-`7VCCuEe^ z{_@%WtLksdgFm#+zqxyZbsiJzNLfGDCsZ<3Dyz)8depvt*?YR6#;jqTOC1m0aj0{t zrey(&{Aksw{(+)?fY`>`Uek{z_p7VFW7U7jx2+?kN$dWC`}1QanozBnSV!{Oo9_dr z6Dq5zde^kxog#ZrCGHuOu_D)VtezJ2)u1TJlh<5z3jhOW59fS0=>GCW@d{N;tRp2P zmnuDB=Tha{xu>)Kr2eSNQ4a?g-fakY&WFSj!6sb}9sY0lzvSz9I zwn}PvMh9H1W{Xg*m{>vftAZQeE3pt+^sp zD<;;F5}H)KuYc{)+%~m(sfiMu9yU>;*(OwUt&l2;iFG7TvI47@np~;V!~Iq~RiwRy z`DJDXb?&6G(J`sEVqzUBktNO8$kr9Nc>vFKJR3@`%=yQzGM+h8x>iXQ#l$*N5c!e( w0*Pm~uDA_=zW4uGR6NtQu60sHF|m&He|6T#CLjJ|F#rGn07*qoM6N<$g0WbI$N&HU diff --git a/Projectiles/Hybrid/GalaxySmasherHammer.cs b/Projectiles/Hybrid/GalaxySmasherHammer.cs deleted file mode 100644 index 8d7c2388ba..0000000000 --- a/Projectiles/Hybrid/GalaxySmasherHammer.cs +++ /dev/null @@ -1,259 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Items.Weapons.Melee; -using CalamityMod.Projectiles.Melee; -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 GalaxySmasherHammer : ModProjectile - { - public override string Texture => "CalamityMod/Items/Weapons/Melee/GalaxySmasherMelee"; - - private static float RotationIncrement = 0.22f; - private static int Lifetime = 240; - private static float ReboundTime = 26f; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Galaxy Smasher"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 8; - ProjectileID.Sets.TrailingMode[projectile.type] = 1; - } - - public override void SetDefaults() - { - projectile.width = 62; - projectile.height = 62; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.extraUpdates = 3; - projectile.timeLeft = Lifetime; - - // Slightly ignores iframes so it can easily hit twice. - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 8; - } - - public override void AI() - { - drawOffsetX = -12; - drawOriginOffsetY = -5; - drawOriginOffsetX = 0; - - // Produces violet dust constantly while in flight. This lights the hammer. - int numDust = 2; - for (int i = 0; i < numDust; ++i) - { - int dustType = Main.rand.NextBool(6) ? 112 : 173; - float scale = 0.8f + Main.rand.NextFloat(0.6f); - int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType); - Main.dust[idx].noGravity = true; - Main.dust[idx].velocity = Vector2.Zero; - Main.dust[idx].scale = scale; - } - - // The hammer makes sound while flying. - if (projectile.soundDelay == 0) - { - projectile.soundDelay = 8; - Main.PlaySound(SoundID.Item7, (int)projectile.position.X, (int)projectile.position.Y); - } - - // ai[0] stores whether the hammer is returning. If 0, it isn't. If 1, it is. - if (projectile.ai[0] == 0f) - { - projectile.ai[1] += 1f; - if (projectile.ai[1] >= ReboundTime) - { - projectile.ai[0] = 1f; - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - } - else - { - projectile.tileCollide = false; - float returnSpeed = GalaxySmasherMelee.Speed; - float acceleration = 3.2f; - Player owner = Main.player[projectile.owner]; - - // Delete the hammer if it's excessively far away. - Vector2 playerCenter = owner.Center; - float xDist = playerCenter.X - projectile.Center.X; - float yDist = playerCenter.Y - projectile.Center.Y; - float dist = (float)Math.Sqrt((double)(xDist * xDist + yDist * yDist)); - if (dist > 3000f) - projectile.Kill(); - - dist = returnSpeed / dist; - xDist *= dist; - yDist *= dist; - - // Home back in on the player. - if (projectile.velocity.X < xDist) - { - projectile.velocity.X = projectile.velocity.X + acceleration; - if (projectile.velocity.X < 0f && xDist > 0f) - projectile.velocity.X += acceleration; - } - else if (projectile.velocity.X > xDist) - { - projectile.velocity.X = projectile.velocity.X - acceleration; - if (projectile.velocity.X > 0f && xDist < 0f) - projectile.velocity.X -= acceleration; - } - if (projectile.velocity.Y < yDist) - { - projectile.velocity.Y = projectile.velocity.Y + acceleration; - if (projectile.velocity.Y < 0f && yDist > 0f) - projectile.velocity.Y += acceleration; - } - else if (projectile.velocity.Y > yDist) - { - projectile.velocity.Y = projectile.velocity.Y - acceleration; - if (projectile.velocity.Y > 0f && yDist < 0f) - projectile.velocity.Y -= acceleration; - } - - // Delete the projectile if it touches its owner. - if (Main.myPlayer == projectile.owner) - if (projectile.Hitbox.Intersects(owner.Hitbox)) - projectile.Kill(); - } - - // Rotate the hammer as it flies. - projectile.rotation += RotationIncrement; - return; - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - // Some dust gets produced on impact. - int dustSets = Main.rand.Next(5, 8); - int dustRadius = 6; - Vector2 corner = new Vector2(target.Center.X - (float)dustRadius, target.Center.Y - (float)dustRadius); - for (int i = 0; i < dustSets; ++i) - { - // Bigger, flying orb dust - float scaleOrb = 1.2f + Main.rand.NextFloat(1f); - int orb = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, 112); - Main.dust[orb].noGravity = true; - Main.dust[orb].velocity *= 4f; - Main.dust[orb].scale = scaleOrb; - - // Add six sparkles per flying orb - for (int j = 0; j < 6; ++j) - { - float scaleSparkle = 0.8f + Main.rand.NextFloat(1.1f); - int sparkle = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, 173); - Main.dust[sparkle].noGravity = true; - float dustSpeed = Main.rand.NextFloat(10f, 18f); - Main.dust[sparkle].velocity = Main.rand.NextVector2Unit() * dustSpeed; - Main.dust[sparkle].scale = scaleSparkle; - } - } - - // Makes an explosion sound. - Main.PlaySound(SoundID.Item14, projectile.position); - - // Applies God Slayer Inferno on contact. - target.AddBuff(ModContent.BuffType(), 480); - - // Three death lasers (aka "Nebula Shots") swarm the target. - int laserID = ModContent.ProjectileType(); - int laserDamage = (int)(0.2f * projectile.damage); - float laserKB = 2.5f; - int numLasers = 3; - for (int i = 0; i < numLasers; ++i) - { - float startDist = Main.rand.NextFloat(260f, 270f); - Vector2 startDir = Main.rand.NextVector2Unit(); - Vector2 startPoint = target.Center + (startDir * startDist); - - float laserSpeed = Main.rand.NextFloat(15f, 18f); - Vector2 velocity = startDir * (-laserSpeed); - - if (projectile.owner == Main.myPlayer) - { - int proj = Projectile.NewProjectile(startPoint, velocity, laserID, laserDamage, laserKB, projectile.owner); - if (projectile.melee) - Main.projectile[proj].Calamity().forceMelee = true; - else - Main.projectile[proj].Calamity().forceRogue = true; - Main.projectile[proj].tileCollide = false; - Main.projectile[proj].timeLeft = 30; - } - } - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - // Some dust gets produced on impact. - int dustSets = Main.rand.Next(5, 8); - int dustRadius = 6; - Vector2 corner = new Vector2(target.Center.X - (float)dustRadius, target.Center.Y - (float)dustRadius); - for (int i = 0; i < dustSets; ++i) - { - // Bigger, flying orb dust - float scaleOrb = 1.2f + Main.rand.NextFloat(1f); - int orb = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, 112); - Main.dust[orb].noGravity = true; - Main.dust[orb].velocity *= 4f; - Main.dust[orb].scale = scaleOrb; - - // Add six sparkles per flying orb - for (int j = 0; j < 6; ++j) - { - float scaleSparkle = 0.8f + Main.rand.NextFloat(1.1f); - int sparkle = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, 173); - Main.dust[sparkle].noGravity = true; - float dustSpeed = Main.rand.NextFloat(10f, 18f); - Main.dust[sparkle].velocity = Main.rand.NextVector2Unit() * dustSpeed; - Main.dust[sparkle].scale = scaleSparkle; - } - } - - // Makes an explosion sound. - Main.PlaySound(SoundID.Item14, projectile.position); - - // Applies God Slayer Inferno on contact. - target.AddBuff(ModContent.BuffType(), 480); - - // Three death lasers (aka "Nebula Shots") swarm the target. - int laserID = ModContent.ProjectileType(); - int laserDamage = (int)(0.2f * projectile.damage); - float laserKB = 2.5f; - int numLasers = 3; - for (int i = 0; i < numLasers; ++i) - { - float startDist = Main.rand.NextFloat(260f, 270f); - Vector2 startDir = Main.rand.NextVector2Unit(); - Vector2 startPoint = target.Center + (startDir * startDist); - - float laserSpeed = Main.rand.NextFloat(15f, 18f); - Vector2 velocity = startDir * (-laserSpeed); - - // NebulaShot projectile adjusts its own damage type based on ai[0] - if (projectile.owner == Main.myPlayer) - { - float damageType = projectile.melee ? 1f : 2f; - int proj = Projectile.NewProjectile(startPoint, velocity, laserID, laserDamage, laserKB, projectile.owner, damageType, 0f); - Main.projectile[proj].tileCollide = false; - Main.projectile[proj].timeLeft = 30; - } - } - } - } -} diff --git a/Projectiles/Melee/FallenPaladinsHammerProj.cs b/Projectiles/Melee/FallenPaladinsHammerProj.cs index 694fa0baa1..49dc78e2f6 100644 --- a/Projectiles/Melee/FallenPaladinsHammerProj.cs +++ b/Projectiles/Melee/FallenPaladinsHammerProj.cs @@ -25,10 +25,10 @@ namespace CalamityMod.Projectiles.Melee projectile.width = 62; projectile.height = 62; projectile.friendly = true; + projectile.melee = true; projectile.tileCollide = false; projectile.penetrate = -1; projectile.extraUpdates = 2; - projectile.melee = true; } public override void AI() diff --git a/Projectiles/Melee/GalaxySmasherHammer.cs b/Projectiles/Melee/GalaxySmasherHammer.cs new file mode 100644 index 0000000000..1af2910ce5 --- /dev/null +++ b/Projectiles/Melee/GalaxySmasherHammer.cs @@ -0,0 +1,257 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Items.Weapons.Melee; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class GalaxySmasherHammer : ModProjectile + { + public override string Texture => "CalamityMod/Items/Weapons/Melee/GalaxySmasherMelee"; + + private static float RotationIncrement = 0.22f; + private static int Lifetime = 240; + private static float ReboundTime = 26f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Galaxy Smasher"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 8; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + } + + public override void SetDefaults() + { + projectile.width = 62; + projectile.height = 62; + projectile.friendly = true; + projectile.melee = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.extraUpdates = 3; + projectile.timeLeft = Lifetime; + + // Slightly ignores iframes so it can easily hit twice. + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 8; + } + + public override void AI() + { + drawOffsetX = -12; + drawOriginOffsetY = -5; + drawOriginOffsetX = 0; + + // Produces violet dust constantly while in flight. This lights the hammer. + int numDust = 2; + for (int i = 0; i < numDust; ++i) + { + int dustType = Main.rand.NextBool(6) ? 112 : 173; + float scale = 0.8f + Main.rand.NextFloat(0.6f); + int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType); + Main.dust[idx].noGravity = true; + Main.dust[idx].velocity = Vector2.Zero; + Main.dust[idx].scale = scale; + } + + // The hammer makes sound while flying. + if (projectile.soundDelay == 0) + { + projectile.soundDelay = 8; + Main.PlaySound(SoundID.Item7, (int)projectile.position.X, (int)projectile.position.Y); + } + + // ai[0] stores whether the hammer is returning. If 0, it isn't. If 1, it is. + if (projectile.ai[0] == 0f) + { + projectile.ai[1] += 1f; + if (projectile.ai[1] >= ReboundTime) + { + projectile.ai[0] = 1f; + projectile.ai[1] = 0f; + projectile.netUpdate = true; + } + } + else + { + projectile.tileCollide = false; + float returnSpeed = GalaxySmasherMelee.Speed; + float acceleration = 3.2f; + Player owner = Main.player[projectile.owner]; + + // Delete the hammer if it's excessively far away. + Vector2 playerCenter = owner.Center; + float xDist = playerCenter.X - projectile.Center.X; + float yDist = playerCenter.Y - projectile.Center.Y; + float dist = (float)Math.Sqrt(xDist * xDist + yDist * yDist); + if (dist > 3000f) + projectile.Kill(); + + dist = returnSpeed / dist; + xDist *= dist; + yDist *= dist; + + // Home back in on the player. + if (projectile.velocity.X < xDist) + { + projectile.velocity.X = projectile.velocity.X + acceleration; + if (projectile.velocity.X < 0f && xDist > 0f) + projectile.velocity.X += acceleration; + } + else if (projectile.velocity.X > xDist) + { + projectile.velocity.X = projectile.velocity.X - acceleration; + if (projectile.velocity.X > 0f && xDist < 0f) + projectile.velocity.X -= acceleration; + } + if (projectile.velocity.Y < yDist) + { + projectile.velocity.Y = projectile.velocity.Y + acceleration; + if (projectile.velocity.Y < 0f && yDist > 0f) + projectile.velocity.Y += acceleration; + } + else if (projectile.velocity.Y > yDist) + { + projectile.velocity.Y = projectile.velocity.Y - acceleration; + if (projectile.velocity.Y > 0f && yDist < 0f) + projectile.velocity.Y -= acceleration; + } + + // Delete the projectile if it touches its owner. + if (Main.myPlayer == projectile.owner) + if (projectile.Hitbox.Intersects(owner.Hitbox)) + projectile.Kill(); + } + + // Rotate the hammer as it flies. + projectile.rotation += RotationIncrement; + return; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + // Some dust gets produced on impact. + int dustSets = Main.rand.Next(5, 8); + int dustRadius = 6; + Vector2 corner = new Vector2(target.Center.X - dustRadius, target.Center.Y - dustRadius); + for (int i = 0; i < dustSets; ++i) + { + // Bigger, flying orb dust + float scaleOrb = 1.2f + Main.rand.NextFloat(1f); + int orb = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, 112); + Main.dust[orb].noGravity = true; + Main.dust[orb].velocity *= 4f; + Main.dust[orb].scale = scaleOrb; + + // Add six sparkles per flying orb + for (int j = 0; j < 6; ++j) + { + float scaleSparkle = 0.8f + Main.rand.NextFloat(1.1f); + int sparkle = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, 173); + Main.dust[sparkle].noGravity = true; + float dustSpeed = Main.rand.NextFloat(10f, 18f); + Main.dust[sparkle].velocity = Main.rand.NextVector2Unit() * dustSpeed; + Main.dust[sparkle].scale = scaleSparkle; + } + } + + // Makes an explosion sound. + Main.PlaySound(SoundID.Item14, projectile.position); + + // Applies God Slayer Inferno on contact. + target.AddBuff(ModContent.BuffType(), 480); + + // Three death lasers (aka "Nebula Shots") swarm the target. + int laserID = ModContent.ProjectileType(); + int laserDamage = (int)(0.2f * projectile.damage); + float laserKB = 2.5f; + int numLasers = 3; + for (int i = 0; i < numLasers; ++i) + { + float startDist = Main.rand.NextFloat(260f, 270f); + Vector2 startDir = Main.rand.NextVector2Unit(); + Vector2 startPoint = target.Center + startDir * startDist; + + float laserSpeed = Main.rand.NextFloat(15f, 18f); + Vector2 velocity = startDir * -laserSpeed; + + if (projectile.owner == Main.myPlayer) + { + int proj = Projectile.NewProjectile(startPoint, velocity, laserID, laserDamage, laserKB, projectile.owner); + Main.projectile[proj].Calamity().forceMelee = true; + Main.projectile[proj].tileCollide = false; + Main.projectile[proj].timeLeft = 30; + } + } + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + // Some dust gets produced on impact. + int dustSets = Main.rand.Next(5, 8); + int dustRadius = 6; + Vector2 corner = new Vector2(target.Center.X - dustRadius, target.Center.Y - dustRadius); + for (int i = 0; i < dustSets; ++i) + { + // Bigger, flying orb dust + float scaleOrb = 1.2f + Main.rand.NextFloat(1f); + int orb = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, 112); + Main.dust[orb].noGravity = true; + Main.dust[orb].velocity *= 4f; + Main.dust[orb].scale = scaleOrb; + + // Add six sparkles per flying orb + for (int j = 0; j < 6; ++j) + { + float scaleSparkle = 0.8f + Main.rand.NextFloat(1.1f); + int sparkle = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, 173); + Main.dust[sparkle].noGravity = true; + float dustSpeed = Main.rand.NextFloat(10f, 18f); + Main.dust[sparkle].velocity = Main.rand.NextVector2Unit() * dustSpeed; + Main.dust[sparkle].scale = scaleSparkle; + } + } + + // Makes an explosion sound. + Main.PlaySound(SoundID.Item14, projectile.position); + + // Applies God Slayer Inferno on contact. + target.AddBuff(ModContent.BuffType(), 480); + + // Three death lasers (aka "Nebula Shots") swarm the target. + int laserID = ModContent.ProjectileType(); + int laserDamage = (int)(0.2f * projectile.damage); + float laserKB = 2.5f; + int numLasers = 3; + for (int i = 0; i < numLasers; ++i) + { + float startDist = Main.rand.NextFloat(260f, 270f); + Vector2 startDir = Main.rand.NextVector2Unit(); + Vector2 startPoint = target.Center + startDir * startDist; + + float laserSpeed = Main.rand.NextFloat(15f, 18f); + Vector2 velocity = startDir * -laserSpeed; + + // NebulaShot projectile adjusts its own damage type based on ai[0]. So set it to 1f + if (projectile.owner == Main.myPlayer) + { + float damageType = 1f; + int proj = Projectile.NewProjectile(startPoint, velocity, laserID, laserDamage, laserKB, projectile.owner, damageType, 0f); + Main.projectile[proj].tileCollide = false; + Main.projectile[proj].timeLeft = 30; + } + } + } + } +} diff --git a/Projectiles/Melee/StellarContemptHammer.cs b/Projectiles/Melee/StellarContemptHammer.cs index 32c987a62a..3e4702ace9 100644 --- a/Projectiles/Melee/StellarContemptHammer.cs +++ b/Projectiles/Melee/StellarContemptHammer.cs @@ -29,6 +29,7 @@ namespace CalamityMod.Projectiles.Melee projectile.width = 44; projectile.height = 44; projectile.friendly = true; + projectile.melee = true; projectile.ignoreWater = true; projectile.tileCollide = false; projectile.penetrate = -1; From a4b69c430a9e1020d318db1b3cf7eeae33309754 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 22 Nov 2020 15:32:03 -0500 Subject: [PATCH 20/26] removed rogue triactis hammer --- CalamityLists.cs | 7 +- ...tisTruePaladinianMageHammerofMightMelee.cs | 10 +- ...TriactisTruePaladinianMageHammerofMight.cs | 59 ------ ...riactisTruePaladinianMageHammerofMight.png | Bin 3555 -> 0 bytes Projectiles/Hybrid/TriactisOPHammer.cs | 177 ------------------ Projectiles/Melee/TriactisHammerProj.cs | 161 ++++++++++++++++ 6 files changed, 167 insertions(+), 247 deletions(-) delete mode 100644 Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs delete mode 100644 Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.png delete mode 100644 Projectiles/Hybrid/TriactisOPHammer.cs create mode 100644 Projectiles/Melee/TriactisHammerProj.cs diff --git a/CalamityLists.cs b/CalamityLists.cs index 7e08549f4b..a71279fbc2 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -1430,9 +1430,7 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), @@ -1441,12 +1439,9 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), @@ -1478,7 +1473,7 @@ namespace CalamityMod ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), - ModContent.ProjectileType(), + ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), diff --git a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs index ce64456628..8aedaecbe6 100644 --- a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs +++ b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Hybrid; +using CalamityMod.Projectiles.Melee; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class TriactisTruePaladinianMageHammerofMightMelee : ModItem + public class TriactisTruePaladinianMageHammerofMightMelee : ModItem { public override void SetStaticDefaults() { @@ -29,11 +29,11 @@ namespace CalamityMod.Items.Weapons.Melee item.UseSound = SoundID.Item1; item.melee = true; item.height = 160; - item.value = Item.buyPrice(5, 0, 0, 0); - item.rare = 10; - item.shoot = ModContent.ProjectileType(); item.shootSpeed = 25f; + item.value = Item.buyPrice(platinum: 5); + item.rare = ItemRarityID.Red; item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.shoot = ModContent.ProjectileType(); } public override void AddRecipes() diff --git a/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs b/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs deleted file mode 100644 index a7f0f096fc..0000000000 --- a/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs +++ /dev/null @@ -1,59 +0,0 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Hybrid; -using CalamityMod.Tiles.Furniture.CraftingStations; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Rogue -{ - public class TriactisTruePaladinianMageHammerofMight : RogueWeapon - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Triactis' True Paladinian Mage-Hammer of Might"); - Tooltip.SetDefault("Explodes on enemy hits"); - } - - public override void SafeSetDefaults() - { - item.width = 160; - item.damage = 10000; - item.noMelee = true; - item.noUseGraphic = true; - item.autoReuse = true; - item.useAnimation = 10; - item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 10; - item.knockBack = 50f; - item.UseSound = SoundID.Item1; - item.height = 160; - item.value = Item.buyPrice(5, 0, 0, 0); - item.rare = 10; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 25f; - item.Calamity().rogue = true; - 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) - { - int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceRogue = true; - Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); - return false; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ItemID.SoulofMight, 30); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddTile(ModContent.TileType()); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} diff --git a/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.png b/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.png deleted file mode 100644 index 3f86fa3c6daeaffb2078b6c66d1a729e31d76a56..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3555 zcmV<94IJ``P)$=W43#Rl*lE7u3UGvtU8}>f&z=EWLI+nTDoi8(%0@7fq2}qG>0)Te@ zbnU=9Zn$cDNbf5%2}lA`qy&a%6ObG+T1<5CrS}x>ykzm4;kvKPBp?Y$Vx&qWU=-r% zM9fGirmxH-MiP)Jc^(BM5@V`P#LTq+&x=BdTP}RLS2~k`Bp`{ADv>~5h{Z%3p88P8 zvGV;V!#5ZQb%S}3kK2U%zIW@EPTQHpNCHwN&tva_ow}IuR_> zEHa*zfnku3Ux7&f@BZHuiu&uWD+b-7_75E0u$Y|Z9_pKmVwdIiP(;0`PQHlU4G+Pp+1X=w(reE{>d}{ zQD|4&nMpv(ov{K^8Uu0e&H>3{qCGoa4Sfe=#4?lR{f8Y1|YCl%_Lv4oGL+c~3#-U>%0V17<=x094hhjF|}679(-{UcLK{ zkks@QyaG}_T^Eqj7^t(eHrA0WpO+;rOJ_oUOD9@&(MJnKt~meQg=<)_k$C#oei(jQ zvES=AWfpI=2aNicqdP-7;+U*{Oe&h7bBqK7q<}OU!=&Eb86ctKU?%8F7Nf*6lf^_! zKfJt9#M;Y>+a|$+jZEwBTM>S4dcA00;`T8Uy<_DkLYCK7FA3l9*@5Xkf5)XEeeIR^ zhi@@b>LXy}7my|sy4yKMvY5#-AR<4Wd|Y#WSgccZA~446FP;oVFZ{x%3e3dypdCnO zpB?T;c}6M;E+n3!1* zF}ZB!eTA$`u6u8|wwMj&PdegKK+2U_9%z2G2uQ;jtMfqen8}N=E(@U87X@ZpV4{sz zPiMETz94*UUinD)Uh~4Wg(45!voBmDj_H+U7lrHR9?b)uVjECVJ^?BBwZ%^JV_#{p z<0Bx&N~&S`*aB|F6Jd4+-6s}6mQDmQKsTBPp#9erCAB=W4^4e}Q^riYX2LggCNR;v z_MIEjk34op_+E5qb|TEw8%Dw?2}t!k*}Vf21B%58Ul!YozyO>d@kh)=JS#Jq=){iU zBYPy%h46vSblzM43rXv?W~)^0UH@$1dfdz;Aki=iNaYx-w?MMQb;b0efoF}d4-5I& z_r>KR8i4IY8$BjMK?Wo3{MI=ICi=ne7Z<9&?(CPs^`=!H8;i~)AkoMRNMfXN5=gwO zb|wM?8MC%y({F?p|LQBBE42LCwReT6_2EG2{dj!P0*5f#V^ab)yGAaBrbUV5s~4b8$$oD{e_Z5|AP# zFg%-p=@0`LExjSIuAup2>V zf==YcLxGtPJ%DzkMiGdS3;+s9Y2hdWk^`hzqMH{_gd6j?BFw_z&7WhUhn@~O;oWDQ z$YT^R6RP7#N^U><{9uoQuMYWBE#d-_fD|MkAjMKf$$ZxF>?jUSUXHcq>gFOJ=?`Wi z-fI%s!6aNRW^srS_qqw4h%MvGuRKw>HPu%qMsg%CAjLU-1tbGV-fpw{hDlI!mbe_69R0ZBj_%E0 zk&yZ75Q~X;*Ag_3cQ?VF0=(Bi>g>#lU*dF>>j6rPL?d9m(gdW;8En1cS_>pk3APBy z+WE}dgA#i=f{A#KNUn!hzVd7ib|NpblFP+vma{AI4UYc|F@kQH&s%+y*&vSw2PQnq@^dZh_S zqy+PE>Ud%;AjR&S&$B<)iC7ncj>7gGv1jD_Q%yjK}?9$sa_3~MRd zU?9#9b3o&DB=6)$0Vz8;P(X5YBJ8y0o#YsMx{$R1lAB@Kd8~c3d7q+#58oY%#1qRp z5;KamlGoCyP@kt0F~eA^Oe|(XIx`X*CL7C0*6eK5SDJt{c)3#Nfdt*iI!iW{iP$HG z2t&($!}}t!z%3?1K4v7$!n_kBSw|XGCjv8Bx(;S#-a5I~xky+y5|FZ^ORZNLhl8+k z-FqPMkq~&&Q<;c;WY%nqcc(>t))}-|eew0(zYSR}UlhMmy=6bVo(=%QY!L18y!fmW zfq6V;@^m6*=GN#)*3qHfG#>*ZAZ0_}TOjfIYj_ey1<<-ZOO5$rmVEYt7sEH}Cb$Vq zwDg<*3Q4Ik&O5rR=z+lPj{7wD>S1A-!s5 z@?x~PAFW{|G~9E-3P^*u0IXWMZY_{f0mQR1FcD^fZ~u6<;~4}D^TIRVzCNV?_|yLm z-+cNIuaSp9t70OQ$Bbk#5f5ltW=hqG1f*>nf(!(t!7tg=R~kxb{HqNO^>iX@g({ec zm3H{N~1Cp$6}AF6SYQ1 z5|AP~DPK=FTT8A(9OoW%lCB-E|YShgEs^@eu_EvofafmpLMixI}fNUSq~5s}X8)aquU z)-aNQH28_L04*RH3}xAgEISX1@m92Qbzn4)iD1uROL1MghezCO9+*_S8m}V>NW-Bd zAbF1({m-vBYc&X;Jqu>SidJ4JTb7Aw&~#V(-7VqLuHr zlvm`l)`?A8M;Z@Y>{>A8dbNpB3AQQrE&ak2C6Rk${vhL==!l16pH&!~tuuI#2Ab zAF)nPFcB6B^nG?_!A(HQH-TV7Bd!IcIHqbGkjgSqTz609;#lk0`^V+GifvC*@(D&P^q&6I$E)XZ^dU8^PrBr#Fz zurjp40#dieb7H+2JCMXg6C3MVD;AJy6>onE9~+RwMBN6JfYj~r9b4~e2a+t-V;jqf zRwN)zRQ%nkyfz?-iMj)ln4SnoF;Y?tA?w&jU5?C93!2& zile!rQOi;!ARwhkOLNFhN9gKnFpl1ralr*cgAPU3)c?p zAQdN@dc{y`H0uyaKu_F`7k$vH7=GTYAH}6j!dx}uc<=dO?3rM{g z>Uul6U>*~pzMPTfs($o;002ovPDHLkV1g8=j=lf@ diff --git a/Projectiles/Hybrid/TriactisOPHammer.cs b/Projectiles/Hybrid/TriactisOPHammer.cs deleted file mode 100644 index ed9bc3e251..0000000000 --- a/Projectiles/Hybrid/TriactisOPHammer.cs +++ /dev/null @@ -1,177 +0,0 @@ -using CalamityMod.Projectiles.Typeless; -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 TriactisOPHammer : ModProjectile - { - public override string Texture => "CalamityMod/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee"; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hammer"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } - - public override void SetDefaults() - { - projectile.width = 160; - projectile.height = 160; - projectile.friendly = true; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.extraUpdates = 3; - projectile.melee = true; - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, 0f, 0.5f, 0.75f); - if (projectile.soundDelay == 0) - { - projectile.soundDelay = 8; - Main.PlaySound(SoundID.Item7, projectile.position); - } - if (projectile.ai[0] == 0f) - { - projectile.ai[1] += 1f; - if (projectile.ai[1] >= 30f) - { - projectile.ai[0] = 1f; - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - } - else - { - projectile.tileCollide = false; - float num42 = 20f; - float num43 = 5f; - Vector2 vector2 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num44 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector2.X; - float num45 = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - vector2.Y; - float num46 = (float)Math.Sqrt((double)(num44 * num44 + num45 * num45)); - if (num46 > 3000f) - { - projectile.Kill(); - } - num46 = num42 / num46; - num44 *= num46; - num45 *= num46; - if (projectile.velocity.X < num44) - { - projectile.velocity.X = projectile.velocity.X + num43; - if (projectile.velocity.X < 0f && num44 > 0f) - { - projectile.velocity.X = projectile.velocity.X + num43; - } - } - else if (projectile.velocity.X > num44) - { - projectile.velocity.X = projectile.velocity.X - num43; - if (projectile.velocity.X > 0f && num44 < 0f) - { - projectile.velocity.X = projectile.velocity.X - num43; - } - } - if (projectile.velocity.Y < num45) - { - projectile.velocity.Y = projectile.velocity.Y + num43; - if (projectile.velocity.Y < 0f && num45 > 0f) - { - projectile.velocity.Y = projectile.velocity.Y + num43; - } - } - else if (projectile.velocity.Y > num45) - { - projectile.velocity.Y = projectile.velocity.Y - num43; - if (projectile.velocity.Y > 0f && num45 < 0f) - { - projectile.velocity.Y = projectile.velocity.Y - num43; - } - } - if (Main.myPlayer == projectile.owner) - { - Rectangle rectangle = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); - Rectangle value2 = new Rectangle((int)Main.player[projectile.owner].position.X, (int)Main.player[projectile.owner].position.Y, Main.player[projectile.owner].width, Main.player[projectile.owner].height); - if (rectangle.Intersects(value2)) - { - projectile.Kill(); - } - } - } - projectile.rotation += 0.5f; - } - - public override Color? GetAlpha(Color lightColor) - { - return new Color(250, 250, 250, 50); - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if (projectile.owner == Main.myPlayer) - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.25), projectile.knockBack, projectile.owner, 0f, 0f); - } - Main.PlaySound(SoundID.Item14, projectile.position); - for (int num621 = 0; num621 < 40; num621++) - { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 70; num623++) - { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); - Main.dust[num624].velocity *= 2f; - } - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - if (projectile.owner == Main.myPlayer) - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.25), projectile.knockBack, projectile.owner, 0f, 0f); - } - Main.PlaySound(SoundID.Item14, projectile.position); - for (int num621 = 0; num621 < 40; num621++) - { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 70; num623++) - { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); - Main.dust[num624].velocity *= 2f; - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - } -} diff --git a/Projectiles/Melee/TriactisHammerProj.cs b/Projectiles/Melee/TriactisHammerProj.cs new file mode 100644 index 0000000000..81438bb1ab --- /dev/null +++ b/Projectiles/Melee/TriactisHammerProj.cs @@ -0,0 +1,161 @@ +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class TriactisHammerProj : ModProjectile + { + public override string Texture => "CalamityMod/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Triactis' True Paladinian Mage-Hammer of Might"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 160; + projectile.height = 160; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.extraUpdates = 3; + projectile.melee = true; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, 0f, 0.5f, 0.75f); + if (projectile.soundDelay == 0) + { + projectile.soundDelay = 8; + Main.PlaySound(SoundID.Item7, projectile.position); + } + if (projectile.ai[0] == 0f) + { + projectile.ai[1] += 1f; + if (projectile.ai[1] >= 30f) + { + projectile.ai[0] = 1f; + projectile.ai[1] = 0f; + projectile.netUpdate = true; + } + } + else + { + projectile.tileCollide = false; + float num42 = 20f; + float num43 = 5f; + Vector2 vector2 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); + float num44 = Main.player[projectile.owner].position.X + Main.player[projectile.owner].width / 2 - vector2.X; + float num45 = Main.player[projectile.owner].position.Y + Main.player[projectile.owner].height / 2 - vector2.Y; + float num46 = (float)Math.Sqrt(num44 * num44 + num45 * num45); + if (num46 > 3000f) + projectile.Kill(); + num46 = num42 / num46; + num44 *= num46; + num45 *= num46; + if (projectile.velocity.X < num44) + { + projectile.velocity.X = projectile.velocity.X + num43; + if (projectile.velocity.X < 0f && num44 > 0f) + projectile.velocity.X = projectile.velocity.X + num43; + } + else if (projectile.velocity.X > num44) + { + projectile.velocity.X = projectile.velocity.X - num43; + if (projectile.velocity.X > 0f && num44 < 0f) + projectile.velocity.X = projectile.velocity.X - num43; + } + if (projectile.velocity.Y < num45) + { + projectile.velocity.Y = projectile.velocity.Y + num43; + if (projectile.velocity.Y < 0f && num45 > 0f) + projectile.velocity.Y = projectile.velocity.Y + num43; + } + else if (projectile.velocity.Y > num45) + { + projectile.velocity.Y = projectile.velocity.Y - num43; + if (projectile.velocity.Y > 0f && num45 < 0f) + projectile.velocity.Y = projectile.velocity.Y - num43; + } + if (Main.myPlayer == projectile.owner) + { + Rectangle rectangle = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); + Rectangle value2 = new Rectangle((int)Main.player[projectile.owner].position.X, (int)Main.player[projectile.owner].position.Y, Main.player[projectile.owner].width, Main.player[projectile.owner].height); + if (rectangle.Intersects(value2)) + projectile.Kill(); + } + } + projectile.rotation += 0.5f; + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(250, 250, 250, 50); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (projectile.owner == Main.myPlayer) + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(projectile.damage * 0.25), projectile.knockBack, projectile.owner, 0f, 0f); + Main.PlaySound(SoundID.Item14, projectile.position); + for (int num621 = 0; num621 < 40; num621++) + { + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.NextBool(2)) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 70; num623++) + { + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); + Main.dust[num624].velocity *= 2f; + } + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (projectile.owner == Main.myPlayer) + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(projectile.damage * 0.25), projectile.knockBack, projectile.owner, 0f, 0f); + Main.PlaySound(SoundID.Item14, projectile.position); + for (int num621 = 0; num621 < 40; num621++) + { + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.NextBool(2)) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 70; num623++) + { + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); + Main.dust[num624].velocity *= 2f; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + } +} From 77e39e9126befa150a8f6ca3fe80f956e555081b Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 22 Nov 2020 15:35:52 -0500 Subject: [PATCH 21/26] fixed more compile errors --- Items/CalamityGlobalItem.cs | 2 +- ModSupport/WeakReferenceSupport.cs | 2 +- NPCs/SupremeCalamitas/SupremeCalamitas.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 795da598f6..fb931aa6e1 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1167,7 +1167,7 @@ namespace CalamityMod.Items tt2.overrideColor = new Color(254, 253, 235); if (item.type == ModContent.ItemType()) tt2.overrideColor = new Color(207, 17, 117); - if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) + if (item.type == ModContent.ItemType()) tt2.overrideColor = new Color(227, 226, 180); if (item.type == ModContent.ItemType()) tt2.overrideColor = CalamityUtils.ColorSwap(new Color(154, 255, 151), new Color(228, 151, 255), 4f); diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 01b37a6d2e..c433feed02 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -542,7 +542,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("SupremeCalamitas", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}]"; string despawn = CalamityUtils.ColorMessage("Please don't waste my time.", new Color(0xFF, 0xA5, 0x00)); diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 117d8d8552..d0379e5bfa 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -2075,7 +2075,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas ModContent.ItemType(), ModContent.ItemType(), // Temporal Umbrella ModContent.ItemType(), // The Dance of Light - ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType() // Voidragon ); DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, CalamityWorld.revenge); From 1978f00124ff066519ac12d3961b4c9eece8e482 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 22 Nov 2020 15:57:31 -0500 Subject: [PATCH 22/26] change of plans: emp knives, illust knives, sotc are now melee --- CalamityLists.cs | 2 - Items/CalamityGlobalItem.cs | 2 +- .../EmpyreanKnives.cs} | 16 +- .../EmpyreanKnives.png} | Bin .../RoyalKnivesMelee.cs} | 15 +- .../RoyalKnivesMelee.png} | Bin .../ScourgeoftheCosmos.cs} | 25 +-- .../ScourgeoftheCosmos.png} | Bin ModSupport/WeakReferenceSupport.cs | 2 +- NPCs/SupremeCalamitas/SupremeCalamitas.cs | 8 +- Projectiles/{Rogue => Melee}/EmpyreanKnife.cs | 4 +- .../{Rogue => Melee}/EmpyreanKnife.png | Bin .../{Rogue => Melee}/IllustriousKnife.cs | 4 +- .../{Rogue => Melee}/IllustriousKnife.png | Bin Projectiles/Melee/ScourgeoftheCosmosMini.cs | 151 ++++++++++++++++ .../ScourgeoftheCosmosMini.png | Bin .../ScourgeoftheCosmosMiniGlow.png | Bin .../ScourgeoftheCosmosProj.cs | 5 +- .../ScourgeoftheCosmosProj.png | Bin Projectiles/Rogue/ScourgeoftheCosmosMini.cs | 170 ------------------ 20 files changed, 185 insertions(+), 219 deletions(-) rename Items/Weapons/{Rogue/EmpyreanKnivesThrown.cs => Melee/EmpyreanKnives.cs} (87%) rename Items/Weapons/{Rogue/EmpyreanKnivesThrown.png => Melee/EmpyreanKnives.png} (100%) rename Items/Weapons/{Rogue/RoyalKnives.cs => Melee/RoyalKnivesMelee.cs} (92%) rename Items/Weapons/{Rogue/RoyalKnives.png => Melee/RoyalKnivesMelee.png} (100%) rename Items/Weapons/{Rogue/ScourgeoftheCosmosThrown.cs => Melee/ScourgeoftheCosmos.cs} (62%) rename Items/Weapons/{Rogue/ScourgeoftheCosmosThrown.png => Melee/ScourgeoftheCosmos.png} (100%) rename Projectiles/{Rogue => Melee}/EmpyreanKnife.cs (97%) rename Projectiles/{Rogue => Melee}/EmpyreanKnife.png (100%) rename Projectiles/{Rogue => Melee}/IllustriousKnife.cs (97%) rename Projectiles/{Rogue => Melee}/IllustriousKnife.png (100%) create mode 100644 Projectiles/Melee/ScourgeoftheCosmosMini.cs rename Projectiles/{Rogue => Melee}/ScourgeoftheCosmosMini.png (100%) rename Projectiles/{Rogue => Melee}/ScourgeoftheCosmosMiniGlow.png (100%) rename Projectiles/{Rogue => Melee}/ScourgeoftheCosmosProj.cs (97%) rename Projectiles/{Rogue => Melee}/ScourgeoftheCosmosProj.png (100%) delete mode 100644 Projectiles/Rogue/ScourgeoftheCosmosMini.cs diff --git a/CalamityLists.cs b/CalamityLists.cs index a71279fbc2..0532142c1e 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -1502,7 +1502,6 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), @@ -1569,7 +1568,6 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index fb931aa6e1..f7adbff884 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1169,7 +1169,7 @@ namespace CalamityMod.Items tt2.overrideColor = new Color(207, 17, 117); if (item.type == ModContent.ItemType()) tt2.overrideColor = new Color(227, 226, 180); - if (item.type == ModContent.ItemType()) + if (item.type == ModContent.ItemType()) tt2.overrideColor = CalamityUtils.ColorSwap(new Color(154, 255, 151), new Color(228, 151, 255), 4f); if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 132, 22), new Color(221, 85, 7), 4f); diff --git a/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs b/Items/Weapons/Melee/EmpyreanKnives.cs similarity index 87% rename from Items/Weapons/Rogue/EmpyreanKnivesThrown.cs rename to Items/Weapons/Melee/EmpyreanKnives.cs index 6af2fbbe52..7be538ac4f 100644 --- a/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs +++ b/Items/Weapons/Melee/EmpyreanKnives.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Melee; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using System; @@ -7,9 +7,9 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Weapons.Rogue +namespace CalamityMod.Items.Weapons.Melee { - public class EmpyreanKnivesThrown : RogueWeapon + public class EmpyreanKnives : ModItem { public override void SetStaticDefaults() { @@ -17,10 +17,11 @@ namespace CalamityMod.Items.Weapons.Rogue Tooltip.SetDefault("Throws a flurry of bouncing knives that can heal the user"); } - public override void SafeSetDefaults() + public override void SetDefaults() { item.width = 18; - item.damage = 520; + item.damage = 600; + item.melee = true; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 15; @@ -34,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Rogue item.rare = ItemRarityID.Red; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 15f; - item.Calamity().rogue = true; item.Calamity().customRarity = CalamityRarity.Violet; } @@ -93,8 +93,7 @@ namespace CalamityMod.Items.Weapons.Rogue num149 *= num80; float x4 = vector2.X; float y4 = vector2.Y; - int knife = Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 1f); - Main.projectile[knife].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 0f); } return false; } @@ -105,7 +104,6 @@ namespace CalamityMod.Items.Weapons.Rogue recipe.AddIngredient(ItemID.VampireKnives); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType(), 999); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Rogue/EmpyreanKnivesThrown.png b/Items/Weapons/Melee/EmpyreanKnives.png similarity index 100% rename from Items/Weapons/Rogue/EmpyreanKnivesThrown.png rename to Items/Weapons/Melee/EmpyreanKnives.png diff --git a/Items/Weapons/Rogue/RoyalKnives.cs b/Items/Weapons/Melee/RoyalKnivesMelee.cs similarity index 92% rename from Items/Weapons/Rogue/RoyalKnives.cs rename to Items/Weapons/Melee/RoyalKnivesMelee.cs index a567802bf4..ea82d4962c 100644 --- a/Items/Weapons/Rogue/RoyalKnives.cs +++ b/Items/Weapons/Melee/RoyalKnivesMelee.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Hybrid; +using CalamityMod.Projectiles.Melee; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using System; @@ -7,9 +8,9 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Weapons.Rogue +namespace CalamityMod.Items.Weapons.Melee { - public class RoyalKnives : RogueWeapon + public class RoyalKnivesMelee : ModItem { public override void SetStaticDefaults() { @@ -17,10 +18,11 @@ namespace CalamityMod.Items.Weapons.Rogue Tooltip.SetDefault("Throws a flurry of homing knives that can heal the user"); } - public override void SafeSetDefaults() + public override void SetDefaults() { item.width = 18; item.damage = 2000; + item.melee = true; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 12; @@ -34,7 +36,6 @@ namespace CalamityMod.Items.Weapons.Rogue item.rare = ItemRarityID.Red; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 9f; - item.Calamity().rogue = true; item.Calamity().customRarity = CalamityRarity.ItemSpecific; } @@ -94,7 +95,7 @@ namespace CalamityMod.Items.Weapons.Rogue 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().stealthStrike = player.Calamity().StealthStrikeAvailable(); + Main.projectile[knife].Calamity().forceMelee = true; } return false; } @@ -104,7 +105,7 @@ namespace CalamityMod.Items.Weapons.Rogue ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 3); - recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Rogue/RoyalKnives.png b/Items/Weapons/Melee/RoyalKnivesMelee.png similarity index 100% rename from Items/Weapons/Rogue/RoyalKnives.png rename to Items/Weapons/Melee/RoyalKnivesMelee.png diff --git a/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs b/Items/Weapons/Melee/ScourgeoftheCosmos.cs similarity index 62% rename from Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs rename to Items/Weapons/Melee/ScourgeoftheCosmos.cs index c46740d878..6d5148f9ab 100644 --- a/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs +++ b/Items/Weapons/Melee/ScourgeoftheCosmos.cs @@ -1,14 +1,13 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Melee; using CalamityMod.Tiles.Furniture.CraftingStations; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Weapons.Rogue +namespace CalamityMod.Items.Weapons.Melee { - public class ScourgeoftheCosmosThrown : RogueWeapon + public class ScourgeoftheCosmos : ModItem { public override void SetStaticDefaults() { @@ -16,10 +15,11 @@ namespace CalamityMod.Items.Weapons.Rogue Tooltip.SetDefault("Throws a bouncing cosmic scourge that emits tiny homing cosmic scourges on death and tile hits"); } - public override void SafeSetDefaults() + public override void SetDefaults() { item.width = 18; - item.damage = 1100; + item.damage = 1300; + item.melee = true; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 20; @@ -29,28 +29,19 @@ namespace CalamityMod.Items.Weapons.Rogue item.UseSound = SoundID.Item109; item.autoReuse = true; item.height = 20; - item.value = Item.buyPrice(2, 50, 0, 0); - item.rare = 10; + item.value = Item.buyPrice(platinum: 2, gold: 50); + item.rare = ItemRarityID.Red; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 15f; - item.Calamity().rogue = true; item.Calamity().customRarity = CalamityRarity.Violet; } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int javelin = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 1f); - Main.projectile[javelin].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); - return false; - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.ScourgeoftheCorruptor); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType(), 200); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.png b/Items/Weapons/Melee/ScourgeoftheCosmos.png similarity index 100% rename from Items/Weapons/Rogue/ScourgeoftheCosmosThrown.png rename to Items/Weapons/Melee/ScourgeoftheCosmos.png diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index c433feed02..f39ffc715b 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -542,7 +542,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("SupremeCalamitas", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}]"; string despawn = CalamityUtils.ColorMessage("Please don't waste my time.", new Color(0xFF, 0xA5, 0x00)); diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index d0379e5bfa..fa7c54352b 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -1,10 +1,11 @@ using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; +using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; using CalamityMod.Items.Pets; +using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Potions; using CalamityMod.Items.Tools; using CalamityMod.Items.Weapons.Magic; @@ -21,10 +22,7 @@ using System; using System.IO; using Terraria; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; -using CalamityMod.Items.Placeables.Furniture.Trophies; -using CalamityMod.Events; namespace CalamityMod.NPCs.SupremeCalamitas { @@ -2066,7 +2064,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), // Flamsteed Ring - ModContent.ItemType(), // Illustrious Knives + ModContent.ItemType(), // Illustrious Knives ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), diff --git a/Projectiles/Rogue/EmpyreanKnife.cs b/Projectiles/Melee/EmpyreanKnife.cs similarity index 97% rename from Projectiles/Rogue/EmpyreanKnife.cs rename to Projectiles/Melee/EmpyreanKnife.cs index 4a780d1f66..8ffc84deb7 100644 --- a/Projectiles/Rogue/EmpyreanKnife.cs +++ b/Projectiles/Melee/EmpyreanKnife.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Rogue +namespace CalamityMod.Projectiles.Melee { public class EmpyreanKnife : ModProjectile { @@ -23,10 +23,10 @@ namespace CalamityMod.Projectiles.Rogue projectile.width = 12; projectile.height = 12; projectile.friendly = true; + projectile.melee = true; projectile.penetrate = 1; projectile.timeLeft = 300; projectile.extraUpdates = 1; - projectile.Calamity().rogue = true; } public override void AI() diff --git a/Projectiles/Rogue/EmpyreanKnife.png b/Projectiles/Melee/EmpyreanKnife.png similarity index 100% rename from Projectiles/Rogue/EmpyreanKnife.png rename to Projectiles/Melee/EmpyreanKnife.png diff --git a/Projectiles/Rogue/IllustriousKnife.cs b/Projectiles/Melee/IllustriousKnife.cs similarity index 97% rename from Projectiles/Rogue/IllustriousKnife.cs rename to Projectiles/Melee/IllustriousKnife.cs index 92706977f5..83eccd5aa1 100644 --- a/Projectiles/Rogue/IllustriousKnife.cs +++ b/Projectiles/Melee/IllustriousKnife.cs @@ -7,7 +7,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Rogue +namespace CalamityMod.Projectiles.Melee { public class IllustriousKnife : ModProjectile { @@ -23,9 +23,9 @@ namespace CalamityMod.Projectiles.Rogue projectile.width = 18; projectile.height = 18; projectile.friendly = true; + projectile.melee = true; projectile.penetrate = 1; projectile.timeLeft = 300; - projectile.Calamity().rogue = true; } public override void AI() diff --git a/Projectiles/Rogue/IllustriousKnife.png b/Projectiles/Melee/IllustriousKnife.png similarity index 100% rename from Projectiles/Rogue/IllustriousKnife.png rename to Projectiles/Melee/IllustriousKnife.png diff --git a/Projectiles/Melee/ScourgeoftheCosmosMini.cs b/Projectiles/Melee/ScourgeoftheCosmosMini.cs new file mode 100644 index 0000000000..68696b4586 --- /dev/null +++ b/Projectiles/Melee/ScourgeoftheCosmosMini.cs @@ -0,0 +1,151 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class ScourgeoftheCosmosMini : ModProjectile + { + private int bounce = 3; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Miniature Cosmic Scourge"); + Main.projFrames[projectile.type] = 2; + } + + public override void SetDefaults() + { + projectile.width = 16; + projectile.height = 16; + projectile.friendly = true; + projectile.melee = true; + projectile.alpha = 255; + projectile.penetrate = 1; + projectile.timeLeft = 300; + projectile.extraUpdates = 3; + } + + public override void AI() + { + if (projectile.alpha > 0) + projectile.alpha -= 50; + else + { + projectile.extraUpdates = 0; + } + if (projectile.alpha < 0) + projectile.alpha = 0; + projectile.frameCounter++; + if (projectile.frameCounter >= 6) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 1) + projectile.frame = 0; + for (int num369 = 0; num369 < 1; num369++) + { + int dustType = Main.rand.NextBool(3) ? 56 : 242; + float num370 = projectile.velocity.X / 3f * num369; + float num371 = projectile.velocity.Y / 3f * num369; + int num372 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f); + Dust dust = Main.dust[num372]; + dust.position.X = projectile.Center.X - num370; + dust.position.Y = projectile.Center.Y - num371; + dust.velocity *= 0f; + dust.scale = 0.5f; + } + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) - 1.57f; + float num373 = projectile.position.X; + float num374 = projectile.position.Y; + float num375 = 100000f; + bool flag10 = false; + projectile.ai[0] += 1f; + if (projectile.ai[0] > 30f) + { + projectile.ai[0] = 30f; + for (int num376 = 0; num376 < Main.maxNPCs; num376++) + { + if (Main.npc[num376].CanBeChasedBy(projectile, false) && (!Main.npc[num376].wet || projectile.type == 307)) + { + float num377 = Main.npc[num376].position.X + Main.npc[num376].width / 2; + float num378 = Main.npc[num376].position.Y + Main.npc[num376].height / 2; + float num379 = Math.Abs(projectile.position.X + projectile.width / 2 - num377) + Math.Abs(projectile.position.Y + projectile.height / 2 - num378); + if (num379 < 800f && num379 < num375 && Collision.CanHit(projectile.position, projectile.width, projectile.height, Main.npc[num376].position, Main.npc[num376].width, Main.npc[num376].height)) + { + num375 = num379; + num373 = num377; + num374 = num378; + flag10 = true; + } + } + } + } + if (!flag10) + { + num373 = projectile.position.X + projectile.width / 2 + projectile.velocity.X * 100f; + num374 = projectile.position.Y + projectile.height / 2 + projectile.velocity.Y * 100f; + } + float num380 = 10f; + float num381 = 0.16f; + Vector2 vector30 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); + float num382 = num373 - vector30.X; + float num383 = num374 - vector30.Y; + float num384 = (float)Math.Sqrt(num382 * num382 + num383 * num383); + num384 = num380 / num384; + num382 *= num384; + num383 *= num384; + if (projectile.velocity.X < num382) + { + projectile.velocity.X = projectile.velocity.X + num381; + if (projectile.velocity.X < 0f && num382 > 0f) + projectile.velocity.X = projectile.velocity.X + num381 * 2f; + } + else if (projectile.velocity.X > num382) + { + projectile.velocity.X = projectile.velocity.X - num381; + if (projectile.velocity.X > 0f && num382 < 0f) + projectile.velocity.X = projectile.velocity.X - num381 * 2f; + } + if (projectile.velocity.Y < num383) + { + projectile.velocity.Y = projectile.velocity.Y + num381; + if (projectile.velocity.Y < 0f && num383 > 0f) + projectile.velocity.Y = projectile.velocity.Y + num381 * 2f; + } + else if (projectile.velocity.Y > num383) + { + projectile.velocity.Y = projectile.velocity.Y - num381; + if (projectile.velocity.Y > 0f && num383 < 0f) + projectile.velocity.Y = projectile.velocity.Y - num381 * 2f; + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + bounce--; + if (bounce <= 0) + projectile.Kill(); + 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 PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture2D13 = Main.projectileTexture[projectile.type]; + int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + int y6 = num214 * projectile.frame; + Vector2 origin = new Vector2(9f, 10f); + spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Melee/ScourgeoftheCosmosMiniGlow"), projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Color.White, projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); + } + } +} diff --git a/Projectiles/Rogue/ScourgeoftheCosmosMini.png b/Projectiles/Melee/ScourgeoftheCosmosMini.png similarity index 100% rename from Projectiles/Rogue/ScourgeoftheCosmosMini.png rename to Projectiles/Melee/ScourgeoftheCosmosMini.png diff --git a/Projectiles/Rogue/ScourgeoftheCosmosMiniGlow.png b/Projectiles/Melee/ScourgeoftheCosmosMiniGlow.png similarity index 100% rename from Projectiles/Rogue/ScourgeoftheCosmosMiniGlow.png rename to Projectiles/Melee/ScourgeoftheCosmosMiniGlow.png diff --git a/Projectiles/Rogue/ScourgeoftheCosmosProj.cs b/Projectiles/Melee/ScourgeoftheCosmosProj.cs similarity index 97% rename from Projectiles/Rogue/ScourgeoftheCosmosProj.cs rename to Projectiles/Melee/ScourgeoftheCosmosProj.cs index 988a954b0d..b2962cd7e1 100644 --- a/Projectiles/Rogue/ScourgeoftheCosmosProj.cs +++ b/Projectiles/Melee/ScourgeoftheCosmosProj.cs @@ -1,4 +1,3 @@ -using CalamityMod.Projectiles.Hybrid; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -6,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Rogue +namespace CalamityMod.Projectiles.Melee { public class ScourgeoftheCosmosProj : ModProjectile { @@ -25,10 +24,10 @@ namespace CalamityMod.Projectiles.Rogue projectile.height = 14; projectile.alpha = 255; projectile.friendly = true; + projectile.melee = true; projectile.ignoreWater = true; projectile.penetrate = 1; projectile.extraUpdates = 1; - projectile.Calamity().rogue = true; } public override void AI() diff --git a/Projectiles/Rogue/ScourgeoftheCosmosProj.png b/Projectiles/Melee/ScourgeoftheCosmosProj.png similarity index 100% rename from Projectiles/Rogue/ScourgeoftheCosmosProj.png rename to Projectiles/Melee/ScourgeoftheCosmosProj.png diff --git a/Projectiles/Rogue/ScourgeoftheCosmosMini.cs b/Projectiles/Rogue/ScourgeoftheCosmosMini.cs deleted file mode 100644 index aeab483e36..0000000000 --- a/Projectiles/Rogue/ScourgeoftheCosmosMini.cs +++ /dev/null @@ -1,170 +0,0 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Hybrid -{ - public class ScourgeoftheCosmosMini : ModProjectile - { - private int bounce = 3; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cosmic Scourge Mini"); - Main.projFrames[projectile.type] = 2; - } - - public override void SetDefaults() - { - projectile.width = 16; - projectile.height = 16; - projectile.friendly = true; - projectile.alpha = 255; - projectile.penetrate = 1; - projectile.timeLeft = 300; - projectile.extraUpdates = 3; - projectile.Calamity().rogue = true; - } - - public override void AI() - { - if (projectile.alpha > 0) - { - projectile.alpha -= 50; - } - else - { - projectile.extraUpdates = 0; - } - if (projectile.alpha < 0) - { - projectile.alpha = 0; - } - projectile.frameCounter++; - if (projectile.frameCounter >= 6) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 1) - { - projectile.frame = 0; - } - for (int num369 = 0; num369 < 1; num369++) - { - int dustType = Main.rand.NextBool(3) ? 56 : 242; - float num370 = projectile.velocity.X / 3f * (float)num369; - float num371 = projectile.velocity.Y / 3f * (float)num369; - int num372 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f); - Dust dust = Main.dust[num372]; - dust.position.X = projectile.Center.X - num370; - dust.position.Y = projectile.Center.Y - num371; - dust.velocity *= 0f; - dust.scale = 0.5f; - } - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) - 1.57f; - float num373 = projectile.position.X; - float num374 = projectile.position.Y; - float num375 = 100000f; - bool flag10 = false; - projectile.ai[0] += 1f; - if (projectile.ai[0] > 30f) - { - projectile.ai[0] = 30f; - for (int num376 = 0; num376 < Main.maxNPCs; num376++) - { - if (Main.npc[num376].CanBeChasedBy(projectile, false) && (!Main.npc[num376].wet || projectile.type == 307)) - { - float num377 = Main.npc[num376].position.X + (float)(Main.npc[num376].width / 2); - float num378 = Main.npc[num376].position.Y + (float)(Main.npc[num376].height / 2); - float num379 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num377) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num378); - if (num379 < 800f && num379 < num375 && Collision.CanHit(projectile.position, projectile.width, projectile.height, Main.npc[num376].position, Main.npc[num376].width, Main.npc[num376].height)) - { - num375 = num379; - num373 = num377; - num374 = num378; - flag10 = true; - } - } - } - } - if (!flag10) - { - num373 = projectile.position.X + (float)(projectile.width / 2) + projectile.velocity.X * 100f; - num374 = projectile.position.Y + (float)(projectile.height / 2) + projectile.velocity.Y * 100f; - } - float num380 = 10f; - float num381 = 0.16f; - Vector2 vector30 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num382 = num373 - vector30.X; - float num383 = num374 - vector30.Y; - float num384 = (float)Math.Sqrt((double)(num382 * num382 + num383 * num383)); - num384 = num380 / num384; - num382 *= num384; - num383 *= num384; - if (projectile.velocity.X < num382) - { - projectile.velocity.X = projectile.velocity.X + num381; - if (projectile.velocity.X < 0f && num382 > 0f) - { - projectile.velocity.X = projectile.velocity.X + num381 * 2f; - } - } - else if (projectile.velocity.X > num382) - { - projectile.velocity.X = projectile.velocity.X - num381; - if (projectile.velocity.X > 0f && num382 < 0f) - { - projectile.velocity.X = projectile.velocity.X - num381 * 2f; - } - } - if (projectile.velocity.Y < num383) - { - projectile.velocity.Y = projectile.velocity.Y + num381; - if (projectile.velocity.Y < 0f && num383 > 0f) - { - projectile.velocity.Y = projectile.velocity.Y + num381 * 2f; - } - } - else if (projectile.velocity.Y > num383) - { - projectile.velocity.Y = projectile.velocity.Y - num381; - if (projectile.velocity.Y > 0f && num383 < 0f) - { - projectile.velocity.Y = projectile.velocity.Y - num381 * 2f; - } - } - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - bounce--; - if (bounce <= 0) - { - projectile.Kill(); - } - 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 PostDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D texture2D13 = Main.projectileTexture[projectile.type]; - int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; - int y6 = num214 * projectile.frame; - Vector2 origin = new Vector2(9f, 10f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Rogue/ScourgeoftheCosmosMiniGlow"), projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Color.White, projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); - } - } -} From 9a877b7d4c658d9c2575788b84d3ef124ed50f47 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 22 Nov 2020 16:52:12 -0500 Subject: [PATCH 23/26] fixed kelvin catalyst rarity --- Items/Weapons/Rogue/KelvinCatalyst.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/KelvinCatalyst.cs b/Items/Weapons/Rogue/KelvinCatalyst.cs index 29b36f3240..7689e77c85 100644 --- a/Items/Weapons/Rogue/KelvinCatalyst.cs +++ b/Items/Weapons/Rogue/KelvinCatalyst.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.UseSound = SoundID.Item1; item.height = 20; item.value = Item.buyPrice(gold: 48); - item.rare = ItemRarityID.Purple; + item.rare = ItemRarityID.LightPurple; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 8f; item.Calamity().rogue = true; From 46de0d348bbf583a4cc65ea5765c3ba42d9b4ec4 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 22 Nov 2020 19:38:10 -0500 Subject: [PATCH 24/26] Fix issues Ben noticed --- Items/Weapons/Melee/EmpyreanKnives.cs | 1 + Items/Weapons/Melee/RoyalKnivesMelee.cs | 4 +--- Items/Weapons/Melee/ScourgeoftheCosmos.cs | 1 + ModSupport/WeakReferenceSupport.cs | 2 +- Projectiles/Rogue/CorpusAvertorClone.cs | 8 +------- Projectiles/Rogue/CorpusAvertorProj.cs | 10 ++-------- Projectiles/Rogue/NanoblackMain.cs | 5 +---- 7 files changed, 8 insertions(+), 23 deletions(-) diff --git a/Items/Weapons/Melee/EmpyreanKnives.cs b/Items/Weapons/Melee/EmpyreanKnives.cs index 7be538ac4f..c1f16c4e58 100644 --- a/Items/Weapons/Melee/EmpyreanKnives.cs +++ b/Items/Weapons/Melee/EmpyreanKnives.cs @@ -102,6 +102,7 @@ namespace CalamityMod.Items.Weapons.Melee { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.VampireKnives); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddTile(ModContent.TileType()); diff --git a/Items/Weapons/Melee/RoyalKnivesMelee.cs b/Items/Weapons/Melee/RoyalKnivesMelee.cs index ea82d4962c..17c1eac823 100644 --- a/Items/Weapons/Melee/RoyalKnivesMelee.cs +++ b/Items/Weapons/Melee/RoyalKnivesMelee.cs @@ -1,5 +1,4 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Hybrid; using CalamityMod.Projectiles.Melee; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; @@ -94,8 +93,7 @@ namespace CalamityMod.Items.Weapons.Melee 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; + Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 0f); } return false; } diff --git a/Items/Weapons/Melee/ScourgeoftheCosmos.cs b/Items/Weapons/Melee/ScourgeoftheCosmos.cs index 6d5148f9ab..40ab27aa3a 100644 --- a/Items/Weapons/Melee/ScourgeoftheCosmos.cs +++ b/Items/Weapons/Melee/ScourgeoftheCosmos.cs @@ -40,6 +40,7 @@ namespace CalamityMod.Items.Weapons.Melee { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.ScourgeoftheCorruptor); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddTile(ModContent.TileType()); diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index f39ffc715b..ff17885d08 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -386,7 +386,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("Ravager", out float order); List segments = new List() { NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType() }; int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.GreaterHealingPotion }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.GreaterHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}]"; string despawn = CalamityUtils.ColorMessage("The automaton of misshapen victims went looking for the true perpetrator.", new Color(0xB2, 0x22, 0x22)); diff --git a/Projectiles/Rogue/CorpusAvertorClone.cs b/Projectiles/Rogue/CorpusAvertorClone.cs index 02fe2e20d2..fc22245bb3 100644 --- a/Projectiles/Rogue/CorpusAvertorClone.cs +++ b/Projectiles/Rogue/CorpusAvertorClone.cs @@ -25,18 +25,12 @@ namespace CalamityMod.Projectiles.Rogue projectile.friendly = true; projectile.penetrate = 1; projectile.timeLeft = 180; - projectile.melee = true; projectile.tileCollide = false; + projectile.Calamity().rogue = true; } public override void AI() { - if (projectile.ai[1] == 1f) - { - projectile.melee = false; - projectile.Calamity().rogue = true; - } - projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.04f; projectile.velocity.X *= 1.005f; diff --git a/Projectiles/Rogue/CorpusAvertorProj.cs b/Projectiles/Rogue/CorpusAvertorProj.cs index ee280c481a..a9c1d19485 100644 --- a/Projectiles/Rogue/CorpusAvertorProj.cs +++ b/Projectiles/Rogue/CorpusAvertorProj.cs @@ -25,17 +25,11 @@ namespace CalamityMod.Projectiles.Rogue projectile.friendly = true; projectile.penetrate = 1; projectile.timeLeft = 300; - projectile.melee = true; + projectile.Calamity().rogue = true; } public override void AI() { - if (projectile.ai[1] == 1f) - { - projectile.melee = false; - projectile.Calamity().rogue = true; - } - projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.02f; if (projectile.ai[0] < 120f) @@ -50,7 +44,7 @@ namespace CalamityMod.Projectiles.Rogue velocity *= mult; Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), - (int)(projectile.damage * mult), projectile.knockBack * mult, projectile.owner, projectile.ai[0], projectile.melee ? 0f : 1f); + (int)(projectile.damage * mult), projectile.knockBack * mult, projectile.owner, projectile.ai[0]); } } else diff --git a/Projectiles/Rogue/NanoblackMain.cs b/Projectiles/Rogue/NanoblackMain.cs index 9c8d5227cd..7ec930a674 100644 --- a/Projectiles/Rogue/NanoblackMain.cs +++ b/Projectiles/Rogue/NanoblackMain.cs @@ -156,10 +156,7 @@ namespace CalamityMod.Projectiles.Rogue Vector2 velocityOffset = Main.rand.NextFloat(-velocityMult, velocityMult) * projectile.velocity; Vector2 pos = projectile.Center + directOffset + velocityOffset; if (projectile.owner == Main.myPlayer) - { - int proj = Projectile.NewProjectile(pos, Vector2.Zero, bladeID, bladeDamage, bladeKB, projectile.owner, 0f, spin); - CalamityGlobalProjectile cgp = Main.projectile[proj].Calamity(); - } + Projectile.NewProjectile(pos, Vector2.Zero, bladeID, bladeDamage, bladeKB, projectile.owner, 0f, spin); } } } From ba3b180ef3b5adc4fe637b0d5470c0fbc80308c1 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 22 Nov 2020 15:30:07 -0600 Subject: [PATCH 25/26] Fixed a map null error when viewing chests --- Tiles/Abyss/RustyChestTile.cs | 24 +------------ Tiles/Astral/AstralChestLocked.cs | 28 +++++---------- .../AgedSecurityChestTile.cs | 18 +--------- Tiles/DraedonStructures/SecurityChestTile.cs | 18 +--------- Tiles/FurnitureAbyss/AbyssChest.cs | 24 +------------ Tiles/FurnitureAshen/AshenChest.cs | 24 +------------ Tiles/FurnitureAstral/MonolithChest.cs | 24 +------------ Tiles/FurnitureBotanic/BotanicChest.cs | 24 +------------ Tiles/FurnitureCosmilite/CosmiliteChest.cs | 24 +------------ Tiles/FurnitureEutrophic/EutrophicChest.cs | 24 +------------ Tiles/FurnitureOccult/OccultChest.cs | 24 +------------ .../PlaguedPlateChest.cs | 24 +------------ Tiles/FurnitureProfaned/ProfanedChest.cs | 24 +------------ Tiles/FurnitureSilva/SilvaChest.cs | 24 +------------ Tiles/FurnitureStatigel/StatigelChest.cs | 24 +------------ Tiles/FurnitureStratus/StratusChest.cs | 24 +------------ Tiles/FurnitureVoid/VoidChest.cs | 24 +------------ Utilities/CalamityUtils.cs | 34 +++++++++++++++++++ 18 files changed, 58 insertions(+), 376 deletions(-) diff --git a/Tiles/Abyss/RustyChestTile.cs b/Tiles/Abyss/RustyChestTile.cs index 4111461e82..1459eb9784 100644 --- a/Tiles/Abyss/RustyChestTile.cs +++ b/Tiles/Abyss/RustyChestTile.cs @@ -28,29 +28,7 @@ namespace CalamityMod.Tiles.Abyss public override bool HasSmartInteract() => true; - public string MapChestName(string name, int i, int j) - { - // Bounds check - if (i < 0 || i >= Main.maxTilesX || j < 0 || j >= Main.maxTilesY) - return name; - - // Tile null check - Tile tile = Main.tile[i, j]; - if (tile is null) - return name; - - int left = i; - int top = j; - if (tile.frameX % 36 != 0) - left--; - if (tile.frameY != 0) - top--; - - int chest = Chest.FindChest(left, top); - if (chest == -1) - return name; - return name + (Main.chest[chest].name != "" ? ": " + Main.chest[chest].name : ""); - } + public string MapChestName(string name, int i, int j) => CalamityUtils.GetMapChestName(name, i, j); public override void NumDust(int i, int j, bool fail, ref int num) { diff --git a/Tiles/Astral/AstralChestLocked.cs b/Tiles/Astral/AstralChestLocked.cs index af401183b3..dd49aa368d 100644 --- a/Tiles/Astral/AstralChestLocked.cs +++ b/Tiles/Astral/AstralChestLocked.cs @@ -13,9 +13,15 @@ namespace CalamityMod.Tiles.Astral public override void SetDefaults() { this.SetUpChest(); + ModTranslation name = CreateMapEntryName("chestAstral"); name.SetDefault("Astral Chest"); AddMapEntry(new Color(174, 129, 92), name, MapChestName); + + name = CreateMapEntryName("chestAstral_Locked"); + name.SetDefault("Locked Astral Chest"); + AddMapEntry(new Color(174, 129, 92), name, MapChestName); + dustType = ModContent.DustType(); disableSmartCursor = true; adjTiles = new int[] { TileID.Containers }; @@ -37,27 +43,9 @@ namespace CalamityMod.Tiles.Astral return true; } - public string MapChestName(string name, int i, int j) - { - // Bounds check - if (i < 0 || i >= Main.maxTilesX || j < 0 || j >= Main.maxTilesY) - return name; + public override ushort GetMapOption(int i, int j) => (ushort)(Main.tile[i, j].frameX / 36); - // Tile null check - Tile tile = Main.tile[i, j]; - if (tile is null) - return name; - - int left = i; - int top = j; - if (tile.frameX % 36 != 0) - left--; - if (tile.frameY != 0) - top--; - - int chest = Chest.FindChest(left, top); - return name + (Main.chest[chest].name != "" ? ": " + Main.chest[chest].name : ""); - } + public string MapChestName(string name, int i, int j) => CalamityUtils.GetMapChestName(name, i, j); public override void NumDust(int i, int j, bool fail, ref int num) { diff --git a/Tiles/DraedonStructures/AgedSecurityChestTile.cs b/Tiles/DraedonStructures/AgedSecurityChestTile.cs index eb5b5cfbde..9f1a3423f7 100644 --- a/Tiles/DraedonStructures/AgedSecurityChestTile.cs +++ b/Tiles/DraedonStructures/AgedSecurityChestTile.cs @@ -30,23 +30,7 @@ namespace CalamityMod.Tiles.DraedonStructures public override bool HasSmartInteract() => true; - public string MapChestName(string name, int i, int j) - { - int left = i; - int top = j; - Tile tile = Main.tile[i, j]; - - if (tile.frameX % 36 != 0) - left--; - if (tile.frameY != 0) - top--; - - int chest = Chest.FindChest(left, top); - if (Main.chest[chest].name == "") - return name; - else - return name + ": " + Main.chest[chest].name; - } + public string MapChestName(string name, int i, int j) => CalamityUtils.GetMapChestName(name, i, j); public override void NumDust(int i, int j, bool fail, ref int num) { diff --git a/Tiles/DraedonStructures/SecurityChestTile.cs b/Tiles/DraedonStructures/SecurityChestTile.cs index b6fb5769ca..5d79866916 100644 --- a/Tiles/DraedonStructures/SecurityChestTile.cs +++ b/Tiles/DraedonStructures/SecurityChestTile.cs @@ -30,23 +30,7 @@ namespace CalamityMod.Tiles.DraedonStructures public override bool HasSmartInteract() => true; - public string MapChestName(string name, int i, int j) - { - int left = i; - int top = j; - Tile tile = Main.tile[i, j]; - - if (tile.frameX % 36 != 0) - left--; - if (tile.frameY != 0) - top--; - - int chest = Chest.FindChest(left, top); - if (Main.chest[chest].name == "") - return name; - else - return name + ": " + Main.chest[chest].name; - } + public string MapChestName(string name, int i, int j) => CalamityUtils.GetMapChestName(name, i, j); public override void NumDust(int i, int j, bool fail, ref int num) { diff --git a/Tiles/FurnitureAbyss/AbyssChest.cs b/Tiles/FurnitureAbyss/AbyssChest.cs index 41b136759f..26d2d4a0fa 100644 --- a/Tiles/FurnitureAbyss/AbyssChest.cs +++ b/Tiles/FurnitureAbyss/AbyssChest.cs @@ -35,29 +35,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss return true; } - public string MapChestName(string name, int i, int j) - { - int left = i; - int top = j; - Tile tile = Main.tile[i, j]; - if (tile.frameX % 36 != 0) - { - left--; - } - if (tile.frameY != 0) - { - top--; - } - int chest = Chest.FindChest(left, top); - if (Main.chest[chest].name == "") - { - return name; - } - else - { - return name + ": " + Main.chest[chest].name; - } - } + public string MapChestName(string name, int i, int j) => CalamityUtils.GetMapChestName(name, i, j); public override void KillMultiTile(int i, int j, int frameX, int frameY) { diff --git a/Tiles/FurnitureAshen/AshenChest.cs b/Tiles/FurnitureAshen/AshenChest.cs index 40ba948270..baa98396ef 100644 --- a/Tiles/FurnitureAshen/AshenChest.cs +++ b/Tiles/FurnitureAshen/AshenChest.cs @@ -41,29 +41,7 @@ namespace CalamityMod.Tiles.FurnitureAshen return true; } - public string MapChestName(string name, int i, int j) - { - int left = i; - int top = j; - Tile tile = Main.tile[i, j]; - if (tile.frameX % 36 != 0) - { - left--; - } - if (tile.frameY != 0) - { - top--; - } - int chest = Chest.FindChest(left, top); - if (Main.chest[chest].name == "") - { - return name; - } - else - { - return name + ": " + Main.chest[chest].name; - } - } + public string MapChestName(string name, int i, int j) => CalamityUtils.GetMapChestName(name, i, j); public override void NumDust(int i, int j, bool fail, ref int num) { diff --git a/Tiles/FurnitureAstral/MonolithChest.cs b/Tiles/FurnitureAstral/MonolithChest.cs index f0270e566e..6223834471 100644 --- a/Tiles/FurnitureAstral/MonolithChest.cs +++ b/Tiles/FurnitureAstral/MonolithChest.cs @@ -61,29 +61,7 @@ namespace CalamityMod.Tiles.FurnitureAstral return true; } - public string MapChestName(string name, int i, int j) - { - int left = i; - int top = j; - Tile tile = Main.tile[i, j]; - if (tile.frameX % 36 != 0) - { - left--; - } - if (tile.frameY != 0) - { - top--; - } - int chest = Chest.FindChest(left, top); - if (Main.chest[chest].name == "") - { - return name; - } - else - { - return name + ": " + Main.chest[chest].name; - } - } + public string MapChestName(string name, int i, int j) => CalamityUtils.GetMapChestName(name, i, j); public override void KillMultiTile(int i, int j, int frameX, int frameY) { diff --git a/Tiles/FurnitureBotanic/BotanicChest.cs b/Tiles/FurnitureBotanic/BotanicChest.cs index a8bc8f0ea5..35520d7182 100644 --- a/Tiles/FurnitureBotanic/BotanicChest.cs +++ b/Tiles/FurnitureBotanic/BotanicChest.cs @@ -37,29 +37,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic return true; } - public string MapChestName(string name, int i, int j) - { - int left = i; - int top = j; - Tile tile = Main.tile[i, j]; - if (tile.frameX % 36 != 0) - { - left--; - } - if (tile.frameY != 0) - { - top--; - } - int chest = Chest.FindChest(left, top); - if (Main.chest[chest].name == "") - { - return name; - } - else - { - return name + ": " + Main.chest[chest].name; - } - } + public string MapChestName(string name, int i, int j) => CalamityUtils.GetMapChestName(name, i, j); public override void KillMultiTile(int i, int j, int frameX, int frameY) { diff --git a/Tiles/FurnitureCosmilite/CosmiliteChest.cs b/Tiles/FurnitureCosmilite/CosmiliteChest.cs index e7238b0804..99661e3e9c 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteChest.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteChest.cs @@ -31,29 +31,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite return true; } - public string MapChestName(string name, int i, int j) - { - int left = i; - int top = j; - Tile tile = Main.tile[i, j]; - if (tile.frameX % 36 != 0) - { - left--; - } - if (tile.frameY != 0) - { - top--; - } - int chest = Chest.FindChest(left, top); - if (Main.chest[chest].name == "") - { - return name; - } - else - { - return name + ": " + Main.chest[chest].name; - } - } + public string MapChestName(string name, int i, int j) => CalamityUtils.GetMapChestName(name, i, j); public override void NumDust(int i, int j, bool fail, ref int num) { diff --git a/Tiles/FurnitureEutrophic/EutrophicChest.cs b/Tiles/FurnitureEutrophic/EutrophicChest.cs index 4f878bfe51..9158f7e566 100644 --- a/Tiles/FurnitureEutrophic/EutrophicChest.cs +++ b/Tiles/FurnitureEutrophic/EutrophicChest.cs @@ -35,29 +35,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic return true; } - public string MapChestName(string name, int i, int j) - { - int left = i; - int top = j; - Tile tile = Main.tile[i, j]; - if (tile.frameX % 36 != 0) - { - left--; - } - if (tile.frameY != 0) - { - top--; - } - int chest = Chest.FindChest(left, top); - if (Main.chest[chest].name == "") - { - return name; - } - else - { - return name + ": " + Main.chest[chest].name; - } - } + public string MapChestName(string name, int i, int j) => CalamityUtils.GetMapChestName(name, i, j); public override void KillMultiTile(int i, int j, int frameX, int frameY) { diff --git a/Tiles/FurnitureOccult/OccultChest.cs b/Tiles/FurnitureOccult/OccultChest.cs index 139ff362f4..a4bfbc56ee 100644 --- a/Tiles/FurnitureOccult/OccultChest.cs +++ b/Tiles/FurnitureOccult/OccultChest.cs @@ -37,29 +37,7 @@ namespace CalamityMod.Tiles.FurnitureOccult return true; } - public string MapChestName(string name, int i, int j) - { - int left = i; - int top = j; - Tile tile = Main.tile[i, j]; - if (tile.frameX % 36 != 0) - { - left--; - } - if (tile.frameY != 0) - { - top--; - } - int chest = Chest.FindChest(left, top); - if (Main.chest[chest].name == "") - { - return name; - } - else - { - return name + ": " + Main.chest[chest].name; - } - } + public string MapChestName(string name, int i, int j) => CalamityUtils.GetMapChestName(name, i, j); public override void KillMultiTile(int i, int j, int frameX, int frameY) { diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateChest.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateChest.cs index 887398dbfa..424e8a0ac2 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateChest.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateChest.cs @@ -35,29 +35,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate return true; } - public string MapChestName(string name, int i, int j) - { - int left = i; - int top = j; - Tile tile = Main.tile[i, j]; - if (tile.frameX % 36 != 0) - { - left--; - } - if (tile.frameY != 0) - { - top--; - } - int chest = Chest.FindChest(left, top); - if (Main.chest[chest].name == "") - { - return name; - } - else - { - return name + ": " + Main.chest[chest].name; - } - } + public string MapChestName(string name, int i, int j) => CalamityUtils.GetMapChestName(name, i, j); public override void KillMultiTile(int i, int j, int frameX, int frameY) { diff --git a/Tiles/FurnitureProfaned/ProfanedChest.cs b/Tiles/FurnitureProfaned/ProfanedChest.cs index 79dce48340..bb4a9b1c38 100644 --- a/Tiles/FurnitureProfaned/ProfanedChest.cs +++ b/Tiles/FurnitureProfaned/ProfanedChest.cs @@ -37,29 +37,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned return true; } - public string MapChestName(string name, int i, int j) - { - int left = i; - int top = j; - Tile tile = Main.tile[i, j]; - if (tile.frameX % 36 != 0) - { - left--; - } - if (tile.frameY != 0) - { - top--; - } - int chest = Chest.FindChest(left, top); - if (Main.chest[chest].name == "") - { - return name; - } - else - { - return name + ": " + Main.chest[chest].name; - } - } + public string MapChestName(string name, int i, int j) => CalamityUtils.GetMapChestName(name, i, j); public override void KillMultiTile(int i, int j, int frameX, int frameY) { diff --git a/Tiles/FurnitureSilva/SilvaChest.cs b/Tiles/FurnitureSilva/SilvaChest.cs index 90e8e435de..17fe2b23be 100644 --- a/Tiles/FurnitureSilva/SilvaChest.cs +++ b/Tiles/FurnitureSilva/SilvaChest.cs @@ -37,29 +37,7 @@ namespace CalamityMod.Tiles.FurnitureSilva return true; } - public string MapChestName(string name, int i, int j) - { - int left = i; - int top = j; - Tile tile = Main.tile[i, j]; - if (tile.frameX % 36 != 0) - { - left--; - } - if (tile.frameY != 0) - { - top--; - } - int chest = Chest.FindChest(left, top); - if (Main.chest[chest].name == "") - { - return name; - } - else - { - return name + ": " + Main.chest[chest].name; - } - } + public string MapChestName(string name, int i, int j) => CalamityUtils.GetMapChestName(name, i, j); public override void KillMultiTile(int i, int j, int frameX, int frameY) { diff --git a/Tiles/FurnitureStatigel/StatigelChest.cs b/Tiles/FurnitureStatigel/StatigelChest.cs index 581d57cc64..dfb4a48336 100644 --- a/Tiles/FurnitureStatigel/StatigelChest.cs +++ b/Tiles/FurnitureStatigel/StatigelChest.cs @@ -30,29 +30,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel return true; } - public string MapChestName(string name, int i, int j) - { - int left = i; - int top = j; - Tile tile = Main.tile[i, j]; - if (tile.frameX % 36 != 0) - { - left--; - } - if (tile.frameY != 0) - { - top--; - } - int chest = Chest.FindChest(left, top); - if (Main.chest[chest].name == "") - { - return name; - } - else - { - return name + ": " + Main.chest[chest].name; - } - } + public string MapChestName(string name, int i, int j) => CalamityUtils.GetMapChestName(name, i, j); public override void NumDust(int i, int j, bool fail, ref int num) { diff --git a/Tiles/FurnitureStratus/StratusChest.cs b/Tiles/FurnitureStratus/StratusChest.cs index 1a78b18ac9..7321369bfb 100644 --- a/Tiles/FurnitureStratus/StratusChest.cs +++ b/Tiles/FurnitureStratus/StratusChest.cs @@ -31,29 +31,7 @@ namespace CalamityMod.Tiles.FurnitureStratus return true; } - public string MapChestName(string name, int i, int j) - { - int left = i; - int top = j; - Tile tile = Main.tile[i, j]; - if (tile.frameX % 36 != 0) - { - left--; - } - if (tile.frameY != 0) - { - top--; - } - int chest = Chest.FindChest(left, top); - if (Main.chest[chest].name == "") - { - return name; - } - else - { - return name + ": " + Main.chest[chest].name; - } - } + public string MapChestName(string name, int i, int j) => CalamityUtils.GetMapChestName(name, i, j); public override void NumDust(int i, int j, bool fail, ref int num) { diff --git a/Tiles/FurnitureVoid/VoidChest.cs b/Tiles/FurnitureVoid/VoidChest.cs index 464bbf0d0d..b05d86daf7 100644 --- a/Tiles/FurnitureVoid/VoidChest.cs +++ b/Tiles/FurnitureVoid/VoidChest.cs @@ -30,29 +30,7 @@ namespace CalamityMod.Tiles.FurnitureVoid return true; } - public string MapChestName(string name, int i, int j) - { - int left = i; - int top = j; - Tile tile = Main.tile[i, j]; - if (tile.frameX % 36 != 0) - { - left--; - } - if (tile.frameY != 0) - { - top--; - } - int chest = Chest.FindChest(left, top); - if (Main.chest[chest].name == "") - { - return name; - } - else - { - return name + ": " + Main.chest[chest].name; - } - } + public string MapChestName(string name, int i, int j) => CalamityUtils.GetMapChestName(name, i, j); public override void NumDust(int i, int j, bool fail, ref int num) { diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 670174e6ff..776cc263ed 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -1948,6 +1948,40 @@ namespace CalamityMod #endregion #region Tile Utilities + + public static string GetMapChestName(string baseName, int x, int y) + { + // Bounds check. + if (!WorldGen.InWorld(x, y, 2)) + return baseName; + + // Tile null check. + Tile tile = Main.tile[x, y]; + if (tile is null) + return baseName; + + int left = x; + int top = y; + if (tile.frameX % 36 != 0) + left--; + if (tile.frameY != 0) + top--; + + int chest = Chest.FindChest(left, top); + + // Valid chest index check. + if (chest < 0) + return baseName; + + string name = baseName; + + // Concatenate the chest's custom name if it has one. + if (!string.IsNullOrEmpty(Main.chest[chest].name)) + name += $": {Main.chest[chest].name}"; + + return name; + } + public static void SafeSquareTileFrame(int x, int y, bool resetFrame = true) { if (Main.tile[x, y] is null) From 65b7ea0a53637ce7a71388cee4666a20c9e8202d Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 22 Nov 2020 17:36:52 -0500 Subject: [PATCH 26/26] fixed Contagion and Frosty Flare Stealth strike rotation issues --- Projectiles/Ranged/ContagionBow.cs | 5 +++-- Projectiles/Rogue/FrostyFlareStealth.cs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Projectiles/Ranged/ContagionBow.cs b/Projectiles/Ranged/ContagionBow.cs index 59d5aa08e8..35f91c840b 100644 --- a/Projectiles/Ranged/ContagionBow.cs +++ b/Projectiles/Ranged/ContagionBow.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { Player player = Main.player[projectile.owner]; - float num = 0f; Vector2 vector = player.RotatedRelativePoint(player.MountedCenter, true); if (projectile.type == ModContent.ProjectileType()) { @@ -128,7 +127,9 @@ namespace CalamityMod.Projectiles.Ranged } } projectile.position = player.RotatedRelativePoint(player.MountedCenter, true) - projectile.Size / 2f; - projectile.rotation = projectile.velocity.ToRotation() + num; + projectile.rotation = projectile.velocity.ToRotation(); + if (projectile.spriteDirection == -1) + projectile.rotation += MathHelper.Pi; projectile.spriteDirection = projectile.direction; projectile.timeLeft = 2; player.ChangeDir(projectile.direction); diff --git a/Projectiles/Rogue/FrostyFlareStealth.cs b/Projectiles/Rogue/FrostyFlareStealth.cs index 6f6c20b3ca..967bfc816e 100644 --- a/Projectiles/Rogue/FrostyFlareStealth.cs +++ b/Projectiles/Rogue/FrostyFlareStealth.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Rogue { projectile.velocity.X *= 0.99f; projectile.velocity.Y += 0.25f; - projectile.rotation = projectile.velocity.ToRotation(); + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; if (shoot) {