From e4c9dd65261bf0a67d0b2ff37bd539607598f200 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 3 Nov 2019 20:37:32 -0500 Subject: [PATCH 1/3] stuff --- Items/CalamityGlobalItem.cs | 2 ++ Items/Fishing/NavyFishingRod.png | Bin 0 -> 1233 bytes Projectiles/Typeless/NavyBobber.png | Bin 0 -> 515 bytes 3 files changed, 2 insertions(+) create mode 100644 Items/Fishing/NavyFishingRod.png create mode 100644 Projectiles/Typeless/NavyBobber.png diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index e24f02bd13..09ba7b0642 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -492,6 +492,8 @@ namespace CalamityMod.Items tt2.overrideColor = new Color(255, Main.DiscoG, 155); if (item.type == ModContent.ItemType()) tt2.overrideColor = new Color(255, Main.DiscoG, 0); + /*if (item.type == ModContent.ItemType()) + tt2.overrideColor = new Color(60, Main.DiscoG, 190);*/ break; case 18: //Fabstaff tt2.overrideColor = new Color(Main.DiscoR, 100, 255); diff --git a/Items/Fishing/NavyFishingRod.png b/Items/Fishing/NavyFishingRod.png new file mode 100644 index 0000000000000000000000000000000000000000..361bef81125f52ddb4250c050bc6dd1cec237d56 GIT binary patch literal 1233 zcmV;?1TOoDP)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00bXNL_t(&-tC&-YnxRV$3Le@nlz!Q zO&e|2q}vQ-V_m1+)GF2=IKA;o#)hE&1JkSB2zsG{Afgwt3lXmb!3#yb5S$l+=sH2C zqLf*bbYJ8dCv1ZCyE9u+S)HK zEvNT=QNIGPawPzY`Jz>AzECuz0CMRZ04ej`YuKltNpStDWMkefaRpGEngpON76f2EmA3#|9@QkbDjxvd@gB$d zFHKGZFq_U8{n_y=z$PH*t=Ggt&buWJlu1Pn9|0iy!FvYL`BWZ&?T;ma)x?C9*jOcr zjf$EC*Q?^xqy=SiBD*)NWMjX4@}toX#`_dN$?^jbi1!=6gzV49jPXr^wMuNy(;fk! zbS(?Oo}GIDIQh;?01P}n1i-fKn%u9We*k5YLN2`b9_?*C?Ev^%!WMw9{75+oEC7FR zzXDjecpBIQ1ULK~w4Zw&!%qX?*}DUP|)9R|we{JRILl3Ob=yIfE3rZyPb`lQirSttMy$j&%s z*7gX+9_4!mH95)iTJKIOfVSuk3qZxXbRHM$25z0)@_KLAH`yrFLeP;|ymJ<)oMF%P z+%VcgF0d`30Q`3iI@+9^W9yac3D)dI0KU6K`CI;GnZV-7uc$Z`DfFJ1>=_wb_b7}gp7*tFcLAbYrsqCP8fHU$9pbec!eP(@3mLV{!<zPa0!TtmLfz{P7$@A>7=zWje3&6i;r;YvQ)r4W=`oI>w)pj_|#`lD}*cBABag35m0Rl3~~ zTN7fUV3)oV&u4N~y{+5|b@u6u{qlL8>DS8!MeZkJ3=F?O+Fmd)lo~KFyh>nTu$sZZAYL$MSD+10f-TA0 z-G$*l2rk&Wd@|6aKu;IP5R21WFWY*{I*J_oct6EA#3W)xLPvq9?*~-{F|Jukz01UO zMYDsKnTOgrcvWB2Pt0LSUO06^LRUvzfQTvMVx>gG?2Xlm)jM6gzGkMKn^WBO-^N%t zB}>b<;ZlaZM*e%%tQ97=OwB7vEXmBzV=!!qcmtAU@O1TaS?83{1ONx( B&_@6O literal 0 HcmV?d00001 From 456ee439d02f0036686706f6675a2a7c03e51886 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 4 Nov 2019 16:41:52 -0500 Subject: [PATCH 2/3] set up projectiles for sea's searing (no weapon yet) --- Projectiles/Ranged/SeasSearingBubble.cs | 125 +++++++++++++++++++ Projectiles/Ranged/SeasSearingBubble.png | Bin 0 -> 328 bytes Projectiles/Ranged/SeasSearingSecondary.cs | 69 +++++++++++ Projectiles/Ranged/SeasSearingSecondary.png | Bin 0 -> 152 bytes Projectiles/Ranged/SeasSearingSpout.cs | 128 ++++++++++++++++++++ Projectiles/Ranged/SeasSearingSpout.png | Bin 0 -> 5121 bytes Projectiles/Ranged/TyphoonBubble.cs | 12 +- 7 files changed, 332 insertions(+), 2 deletions(-) create mode 100644 Projectiles/Ranged/SeasSearingBubble.cs create mode 100644 Projectiles/Ranged/SeasSearingBubble.png create mode 100644 Projectiles/Ranged/SeasSearingSecondary.cs create mode 100644 Projectiles/Ranged/SeasSearingSecondary.png create mode 100644 Projectiles/Ranged/SeasSearingSpout.cs create mode 100644 Projectiles/Ranged/SeasSearingSpout.png diff --git a/Projectiles/Ranged/SeasSearingBubble.cs b/Projectiles/Ranged/SeasSearingBubble.cs new file mode 100644 index 0000000000..39fed924ee --- /dev/null +++ b/Projectiles/Ranged/SeasSearingBubble.cs @@ -0,0 +1,125 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using System; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Buffs.DamageOverTime; + +namespace CalamityMod.Projectiles.Ranged +{ + public class SeasSearingBubble : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Searing Bubble"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 18; + projectile.height = 18; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.alpha = 255; + projectile.penetrate = 2; + projectile.timeLeft = 480; + projectile.ranged = true; + projectile.extraUpdates = 2; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + } + + public override void AI() + { + if (projectile.alpha > 0) + { + projectile.alpha -= 25; + if (projectile.alpha < 0) + projectile.alpha = 0; + } + for (int num105 = 0; num105 < 2; num105++) + { + float num99 = projectile.velocity.X / 3f * (float)num105; + float num100 = projectile.velocity.Y / 3f * (float)num105; + int num101 = 4; + int num102 = Dust.NewDust(new Vector2(projectile.position.X + (float)num101, projectile.position.Y + (float)num101), projectile.width - num101 * 2, projectile.height - num101 * 2, 202, 0f, 0f, 100, default, 1.2f); + Main.dust[num102].noGravity = true; + Main.dust[num102].velocity *= 0.1f; + Main.dust[num102].velocity += projectile.velocity * 0.1f; + Dust expr_47FA_cp_0 = Main.dust[num102]; + expr_47FA_cp_0.position.X -= num99; + Dust expr_4815_cp_0 = Main.dust[num102]; + expr_4815_cp_0.position.Y -= num100; + } + if (Main.rand.NextBool(10)) + { + int num103 = 4; + int num104 = Dust.NewDust(new Vector2(projectile.position.X + (float)num103, projectile.position.Y + (float)num103), projectile.width - num103 * 2, projectile.height - num103 * 2, 202, 0f, 0f, 100, default, 0.6f); + Main.dust[num104].velocity *= 0.25f; + Main.dust[num104].velocity += projectile.velocity * 0.5f; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 96); + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 202, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 96); + target.AddBuff(BuffID.Wet, 240); + target.AddBuff(ModContent.BuffType(), 240); + + int type = ModContent.ProjectileType(); + if (projectile.ai[0] == 1f) + { + int numWaterBlasts = 2; + int waterDamage = 150; //SeasSearing.BaseDamage / 2; + float waterKB = 1f; + Player owner = Main.player[projectile.owner]; + for (int i = 0; i < numWaterBlasts; ++i) + { + float startOffsetX = Main.rand.NextFloat(1000f, 1400f) * (Main.rand.NextBool() ? -1f : 1f); + float startOffsetY = Main.rand.NextFloat(80f, 900f) * (Main.rand.NextBool() ? -1f : 1f); + Vector2 startPos = new Vector2(target.Center.X + startOffsetX, target.Center.Y + startOffsetY); + float dx = target.Center.X - startPos.X; + float dy = target.Center.Y - startPos.Y; + + // Add some randomness / inaccuracy + dx += Main.rand.NextFloat(-5f, 5f); + dy += Main.rand.NextFloat(-5f, 5f); + float speed = Main.rand.NextFloat(20f, 25f); + float dist = (float)Math.Sqrt((double)(dx * dx + dy * dy)); + dist = speed / dist; + dx *= dist; + dy *= dist; + Vector2 waterVel = new Vector2(dx, dy); + float angle = Main.rand.NextFloat(MathHelper.TwoPi); + if (projectile.owner == Main.myPlayer) + { + int idx = Projectile.NewProjectile(startPos, waterVel, type, waterDamage, waterKB, projectile.owner, 0f, 0f); + Main.projectile[idx].rotation = angle; + Main.projectile[idx].tileCollide = false; + Main.projectile[idx].usesLocalNPCImmunity = true; + Main.projectile[idx].localNPCHitCooldown = -1; + } + } + } + } + } +} diff --git a/Projectiles/Ranged/SeasSearingBubble.png b/Projectiles/Ranged/SeasSearingBubble.png new file mode 100644 index 0000000000000000000000000000000000000000..f12e5e04b51a596854c6f445c53f4a317a92c4de GIT binary patch literal 328 zcmV-O0k{5%P)Px$0!c(cR5*>bl(9+!K@f(&J%Y`_RUru?92O@b=>qo#L9p- 4f) + { + for (int num468 = 0; num468 < 3; num468++) + { + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 217, 0f, 0f, 100, default, projectile.scale); + Main.dust[num469].noGravity = true; + Main.dust[num469].velocity *= 0f; + int num470 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 202, 0f, 0f, 100, default, projectile.scale); + Main.dust[num470].noGravity = true; + Main.dust[num470].velocity *= 0f; + } + } + } + + public override void Kill(int timeLeft) + { + if (projectile.owner == Main.myPlayer) + { + int endoftime = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + Main.projectile[endoftime].localAI[1] = 1f; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 360); + target.AddBuff(ModContent.BuffType(), 360); + } + } +} diff --git a/Projectiles/Ranged/SeasSearingSecondary.png b/Projectiles/Ranged/SeasSearingSecondary.png new file mode 100644 index 0000000000000000000000000000000000000000..4a5f92eb8fd3c2403f05b1ede7d8f1d387706cee GIT binary patch literal 152 zcmeAS@N?(olHy`uVBq!ia0vp^0zj<5!3HFyJAa%3Qfx`y?k)`fL2$v|<&%LToCO|{ z#S9F5M?jcysy3fAP>{XE)7O>#0hf$8o0P@ARcnDls-7;6As)w*|NQ@N&#c<16w-}%X22WQ%mvv4FO#lZ0DPI5p literal 0 HcmV?d00001 diff --git a/Projectiles/Ranged/SeasSearingSpout.cs b/Projectiles/Ranged/SeasSearingSpout.cs new file mode 100644 index 0000000000..10db19cacb --- /dev/null +++ b/Projectiles/Ranged/SeasSearingSpout.cs @@ -0,0 +1,128 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ModLoader; +using CalamityMod.Buffs.DamageOverTime; +namespace CalamityMod.Projectiles.Ranged +{ + public class SeasSearingSpout : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spout"); + Main.projFrames[projectile.type] = 6; + } + + public override void SetDefaults() + { + projectile.width = 150; + projectile.height = 42; + projectile.scale = 0.6f; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.ranged = true; + projectile.penetrate = -1; + projectile.alpha = 255; + projectile.timeLeft = 60; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 30; + } + + public override void AI() + { + int num613 = 10; + int num614 = 15; + float num615 = 1f; + int num616 = 150; + int num617 = 42; + if (projectile.velocity.X != 0f) + { + projectile.direction = projectile.spriteDirection = -Math.Sign(projectile.velocity.X); + } + projectile.frameCounter++; + if (projectile.frameCounter > 2) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= 6) + { + projectile.frame = 0; + } + if (projectile.localAI[0] == 0f) + { + projectile.localAI[0] = 1f; + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.scale = ((float)(num613 + num614) - projectile.ai[1]) * num615 / (float)(num614 + num613); + projectile.width = (int)((float)num616 * projectile.scale); + projectile.height = (int)((float)num617 * projectile.scale); + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.netUpdate = true; + } + if (projectile.ai[1] != -1f) + { + projectile.scale = ((float)(num613 + num614) - projectile.ai[1]) * num615 / (float)(num614 + num613); + projectile.width = (int)((float)num616 * projectile.scale); + projectile.height = (int)((float)num617 * projectile.scale); + } + if (!Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + { + projectile.alpha -= 30; + if (projectile.alpha < 60) + { + projectile.alpha = 60; + } + } + else + { + projectile.alpha += 30; + if (projectile.alpha > 150) + { + projectile.alpha = 150; + } + } + if (projectile.ai[0] > 0f) + { + projectile.ai[0] -= 1f; + } + if (projectile.ai[0] == 1f && projectile.ai[1] > 0f && projectile.owner == Main.myPlayer) + { + projectile.netUpdate = true; + Vector2 center = projectile.Center; + center.Y -= (float)num617 * projectile.scale / 2f; + float num618 = ((float)(num613 + num614) - projectile.ai[1] + 1f) * num615 / (float)(num614 + num613); + center.Y -= (float)num617 * num618 / 2f; + center.Y += 2f; + Projectile.NewProjectile(center.X, center.Y, projectile.velocity.X, projectile.velocity.Y, projectile.type, projectile.damage, projectile.knockBack, projectile.owner, 10f, projectile.ai[1] - 1f); + } + if (projectile.ai[0] <= 0f) + { + float num622 = 0.104719758f; + float num623 = (float)projectile.width / 5f; + float num624 = (float)(Math.Cos((double)(num622 * -(double)projectile.ai[0])) - 0.5) * num623; + projectile.position.X = projectile.position.X - num624 * (float)-(float)projectile.direction; + projectile.ai[0] -= 1f; + num624 = (float)(Math.Cos((double)(num622 * -(double)projectile.ai[0])) - 0.5) * num623; + projectile.position.X = projectile.position.X + num624 * (float)-(float)projectile.direction; + } + } + + public override bool PreDraw(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; + Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 360); + } + } +} diff --git a/Projectiles/Ranged/SeasSearingSpout.png b/Projectiles/Ranged/SeasSearingSpout.png new file mode 100644 index 0000000000000000000000000000000000000000..1cca5e1bae865338d1e61a23234c771945a46bab GIT binary patch literal 5121 zcmXAtdpwix|HoO49Gj4whYBf@;}DafQdx4t8s`z~bbd3$K9#NjfzY^)bvsv{|_Z?rf!+9B%HCE%$eF zTrGo=w+`0ZXFlj=@zB-|f7{O(39YUk?hJfd8VxyIJw6lnm{rx>P&{lYe-?yNehS6C zO$99A1MSj1!Uco(zO}LRL76JXqmWv>CS3%mcztty2|#@}qxy6FZfi;f`bx0#dSk8Z zpdtIM*&|tNaE&dq4G(P@QxasdD%CO___hpysjAXGBizh zH%Job554j|fZWr)86-^Z>Nhx3rT|nV{3*n9_GoA&>Mzl03awn85C!I#^i0_dL4V%g zJ}tk~nf<4WB(}=H9qY_v5>iYIJ$FkWxr0bytjv%hrWx|J>?}-_-l84h^ccuoCvsJZ zf(b}TZ0U#82k%cbrivoch`m9Efn(=EwJppL6TsRVfmZDT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1D7I23hm2Kdj$tHjt5 z%V5Mj?9~?SHuI>W4NGdQ7b^3~C&%-2j(8&yej=QV3{i|F5S8$^(^!86QN5mnCR+&h z7&!!AAyh%p|8_e&Qu`ahIOkJqo4C~BIl%9pFD+4;?XgP#H&S$~1o4IlAK9OF{w-4p z_^^1?F2r+bZe?J{=F=X8rKa!}ku<{;#jdVAp$_%N#?%6Wb%qgBTU0sPBO2Tz-1xf+ zZLM%%COkIW$fsX9^rNO63(HDy0<*7ptS;1XQ+Jha5}8S>i!oYkUq6fbuhRv8hZ*9U zSLs`;!l5~REP=Zwp>XUW8ZVkYVEVvGbf=7i_qsWtyU cDnH{{H?^j6p8orUbG65H%^VJ^yyEuYe?f@crvLx| literal 0 HcmV?d00001 diff --git a/Projectiles/Ranged/TyphoonBubble.cs b/Projectiles/Ranged/TyphoonBubble.cs index 367b1dfd50..af3079d3b6 100644 --- a/Projectiles/Ranged/TyphoonBubble.cs +++ b/Projectiles/Ranged/TyphoonBubble.cs @@ -109,8 +109,16 @@ namespace CalamityMod.Projectiles.Ranged { if (projectile.ai[1] < 1f) { - int num230 = Projectile.NewProjectile(projectile.Center.X - (float)(projectile.direction * 30), projectile.Center.Y - 4f, (float)-(float)projectile.direction * 0.01f, 0f, ModContent.ProjectileType(), projectile.damage, 3f, projectile.owner, 16f, 8f); - Main.projectile[num230].netUpdate = true; + if (projectile.localAI[1] == 1f) + { + int num230 = Projectile.NewProjectile(projectile.Center.X - (float)(projectile.direction * 30), projectile.Center.Y - 4f, (float)-(float)projectile.direction * 0.01f, 0f, ModContent.ProjectileType(), projectile.damage, 3f, projectile.owner, 16f, 8f); + Main.projectile[num230].netUpdate = true; + } + else + { + int num230 = Projectile.NewProjectile(projectile.Center.X - (float)(projectile.direction * 30), projectile.Center.Y - 4f, (float)-(float)projectile.direction * 0.01f, 0f, ModContent.ProjectileType(), projectile.damage, 3f, projectile.owner, 16f, 8f); + Main.projectile[num230].netUpdate = true; + } } } } From 90fc83308019e7d2b5062a8f6542c8905e87f756 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 4 Nov 2019 19:00:51 -0500 Subject: [PATCH 3/3] added navy fishing rod; fixed eater of shoals --- CalPlayer/CalamityPlayer.cs | 43 ++++++ Items/Fishing/EaterofShoals.cs | 2 +- Items/Fishing/NavyFishingRod.cs | 47 ++++++ Projectiles/CalamityGlobalProjectile.cs | 2 + Projectiles/Typeless/EaterofShoalsBobber.cs | 2 +- Projectiles/Typeless/NavyBobber.cs | 153 ++++++++++++++++++++ 6 files changed, 247 insertions(+), 2 deletions(-) create mode 100644 Items/Fishing/NavyFishingRod.cs create mode 100644 Projectiles/Typeless/NavyBobber.cs diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index ecb8706036..c516373c1f 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -4637,6 +4637,49 @@ namespace CalamityMod.CalPlayer { } } + if (player.inventory[player.selectedItem].type == ModContent.ItemType() && player.ownedProjectileCounts[ModContent.ProjectileType()] != 0) + { + int auraCounter = 0; + float num2 = 200f; + bool flag = auraCounter % 60 == 0; + int num3 = 10; + int random = Main.rand.Next(15); + if (player.whoAmI == Main.myPlayer) + { + if (random == 0) + { + for (int l = 0; l < 200; l++) + { + NPC nPC = Main.npc[l]; + if (nPC.active && !nPC.friendly && nPC.damage > 0 && !nPC.dontTakeDamage && Vector2.Distance(player.Center, nPC.Center) <= num2) + { + if (flag) + { + nPC.StrikeNPC(num3, 0f, 0, false, false, false); + if (Main.netMode != NetmodeID.SinglePlayer) + { + NetMessage.SendData(28, -1, -1, null, l, (float)num3, 0f, 0f, 0, 0, 0); + } + Vector2 value15 = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); + while (value15.X == 0f && value15.Y == 0f) + { + value15 = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); + } + value15.Normalize(); + value15 *= (float)Main.rand.Next(30, 61) * 0.1f; + int num17 = Projectile.NewProjectile(nPC.Center.X, nPC.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), 5, 0f, player.whoAmI, 0f, 0f); + Main.projectile[num17].melee = false; + Main.projectile[num17].localNPCHitCooldown = -1; + } + } + } + } + } + auraCounter++; + if (auraCounter >= 180) + { + } + } if (brimstoneElementalLore && player.inferno) { int num = ModContent.BuffType(); diff --git a/Items/Fishing/EaterofShoals.cs b/Items/Fishing/EaterofShoals.cs index de3333b7e9..ca06eb692d 100644 --- a/Items/Fishing/EaterofShoals.cs +++ b/Items/Fishing/EaterofShoals.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Fishing int linecolor = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, 0, 0f, player.whoAmI, 0.0f, 0.0f); if (Main.rand.NextBool(2)) //randomizing line color { - Main.projectile[linecolor].localAI[1] = 1; + Main.projectile[linecolor].Calamity().lineColor = true; } } return false; diff --git a/Items/Fishing/NavyFishingRod.cs b/Items/Fishing/NavyFishingRod.cs new file mode 100644 index 0000000000..5413d607b4 --- /dev/null +++ b/Items/Fishing/NavyFishingRod.cs @@ -0,0 +1,47 @@ +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using CalamityMod.Items.Placeables; +namespace CalamityMod.Items.Fishing +{ + public class NavyFishingRod : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Navy Fishing Rod"); + Tooltip.SetDefault("While held, slowly electrifies nearby enemies.\n" + + "The sea is a city.\n" + //Life of Pi ref Ch.59 + "Just below are highways, boulevards, streets and roundabouts bustling with submarine traffic."); + } + + public override void SetDefaults() + { + //item.CloneDefaults(2289); //Wooden Fishing Pole + item.width = 24; + item.height = 28; + item.useAnimation = 8; + item.useTime = 8; + item.useStyle = 1; + item.UseSound = SoundID.Item1; + item.fishingPole = 25; + item.shootSpeed = 13f; + item.shoot = ModContent.ProjectileType(); + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 2; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 97ef6881ba..13e9efc0a4 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -55,6 +55,8 @@ namespace CalamityMod.Projectiles // Counters and Timers private int counter = 0; private int counter2 = 0; + + public bool lineColor = false; //holy mother of god, Eater of Shoals was a pain in the ass #region SetDefaults public override void SetDefaults(Projectile projectile) diff --git a/Projectiles/Typeless/EaterofShoalsBobber.cs b/Projectiles/Typeless/EaterofShoalsBobber.cs index 36de6993c7..1c427f80ce 100644 --- a/Projectiles/Typeless/EaterofShoalsBobber.cs +++ b/Projectiles/Typeless/EaterofShoalsBobber.cs @@ -153,7 +153,7 @@ namespace CalamityMod.Projectiles.Typeless } rotation2 = (float)Math.Atan2((double)projPosY, (double)projPosX) - 1.57f; - if (projectile.localAI[1] == 1) //pink line + if (projectile.Calamity().lineColor == true) //pink line { red = 252; green = 109; diff --git a/Projectiles/Typeless/NavyBobber.cs b/Projectiles/Typeless/NavyBobber.cs new file mode 100644 index 0000000000..0015f06ecc --- /dev/null +++ b/Projectiles/Typeless/NavyBobber.cs @@ -0,0 +1,153 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items.Fishing; +namespace CalamityMod.Projectiles.Typeless +{ + public class NavyBobber : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Navy Bobber"); + } + + public override void SetDefaults() + { + //projectile.CloneDefaults(360); //Wooden Bobber + projectile.width = 14; + projectile.height = 14; + projectile.aiStyle = 61; + projectile.bobber = true; + projectile.penetrate = -1; + } + + public override bool PreDrawExtras(SpriteBatch spriteBatch) + { + Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.25f / 255f, (255 - projectile.alpha) * 0.25f / 255f); + + Player player = Main.player[projectile.owner]; + if (projectile.bobber && Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].holdStyle > 0) + { + float pPosX = player.MountedCenter.X; + float pPosY = player.MountedCenter.Y; + pPosY += Main.player[projectile.owner].gfxOffY; + int type = Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type; + float gravDir = Main.player[projectile.owner].gravDir; + + if (type == ModContent.ItemType()) + { + pPosX += (float)(50 * Main.player[projectile.owner].direction); + if (Main.player[projectile.owner].direction < 0) + { + pPosX -= 13f; + } + pPosY -= 33f * gravDir; + } + + if (gravDir == -1f) + { + pPosY -= 12f; + } + Vector2 value = new Vector2(pPosX, pPosY); + value = Main.player[projectile.owner].RotatedRelativePoint(value + new Vector2(8f), true) - new Vector2(8f); + float projPosX = projectile.position.X + (float)projectile.width * 0.5f - value.X; + float projPosY = projectile.position.Y + (float)projectile.height * 0.5f - value.Y; + Math.Sqrt((double)(projPosX * projPosX + projPosY * projPosY)); + float rotation2 = (float)Math.Atan2((double)projPosY, (double)projPosX) - 1.57f; + bool flag2 = true; + if (projPosX == 0f && projPosY == 0f) + { + flag2 = false; + } + else + { + float projPosXY = (float)Math.Sqrt((double)(projPosX * projPosX + projPosY * projPosY)); + projPosXY = 12f / projPosXY; + projPosX *= projPosXY; + projPosY *= projPosXY; + value.X -= projPosX; + value.Y -= projPosY; + projPosX = projectile.position.X + (float)projectile.width * 0.5f - value.X; + projPosY = projectile.position.Y + (float)projectile.height * 0.5f - value.Y; + } + while (flag2) + { + float num = 12f; + float num2 = (float)Math.Sqrt((double)(projPosX * projPosX + projPosY * projPosY)); + float num3 = num2; + if (float.IsNaN(num2) || float.IsNaN(num3)) + { + flag2 = false; + } + else + { + if (num2 < 20f) + { + num = num2 - 8f; + flag2 = false; + } + num2 = 12f / num2; + projPosX *= num2; + projPosY *= num2; + value.X += projPosX; + value.Y += projPosY; + projPosX = projectile.position.X + (float)projectile.width * 0.5f - value.X; + projPosY = projectile.position.Y + (float)projectile.height * 0.1f - value.Y; + if (num3 > 12f) + { + float num4 = 0.3f; + float num5 = Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y); + if (num5 > 16f) + { + num5 = 16f; + } + num5 = 1f - num5 / 16f; + num4 *= num5; + num5 = num3 / 80f; + if (num5 > 1f) + { + num5 = 1f; + } + num4 *= num5; + if (num4 < 0f) + { + num4 = 0f; + } + num5 = 1f - projectile.localAI[0] / 100f; + num4 *= num5; + if (projPosY > 0f) + { + projPosY *= 1f + num4; + projPosX *= 1f - num4; + } + else + { + num5 = Math.Abs(projectile.velocity.X) / 3f; + if (num5 > 1f) + { + num5 = 1f; + } + num5 -= 0.5f; + num4 *= num5; + if (num4 > 0f) + { + num4 *= 2f; + } + projPosY *= 1f + num4; + projPosX *= 1f - num4; + } + } + rotation2 = (float)Math.Atan2((double)projPosY, (double)projPosX) - 1.57f; + Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)value.X / 16, (int)(value.Y / 16f), new Microsoft.Xna.Framework.Color(36, 61, 111, 100)); //dark blue + + Main.spriteBatch.Draw(Main.fishingLineTexture, new Vector2(value.X - Main.screenPosition.X + (float)Main.fishingLineTexture.Width * 0.5f, value.Y - Main.screenPosition.Y + (float)Main.fishingLineTexture.Height * 0.5f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.fishingLineTexture.Width, (int)num)), color2, rotation2, new Vector2((float)Main.fishingLineTexture.Width * 0.5f, 0f), 1f, SpriteEffects.None, 0f); + } + } + } + return false; + } + } +}