From a794d30ab800201893954db0959e4313d8ebee33 Mon Sep 17 00:00:00 2001 From: AlterraKira Date: Tue, 17 Dec 2019 12:54:34 +0000 Subject: [PATCH] Night's Gaze & Sludge Splotch (and small nychthemeron fix) --- Buffs/CalamityGlobalBuff.cs | 9 ++ Items/Weapons/Rogue/NightsGaze.cs | 67 +++++++++ Items/Weapons/Rogue/NightsGaze.png | Bin 0 -> 1737 bytes Items/Weapons/Rogue/SludgeSplotch.cs | 62 ++++++++ Items/Weapons/Rogue/SludgeSplotch.png | Bin 0 -> 559 bytes NPCs/CalamityGlobalNPC.cs | 23 ++- Projectiles/Rogue/NightsGazeProjectile.cs | 123 +++++++++++++++ Projectiles/Rogue/NightsGazeProjectile.png | Bin 0 -> 1684 bytes .../Rogue/NightsGazeProjectileGlow.png | Bin 0 -> 1419 bytes Projectiles/Rogue/NightsGazeSpark.cs | 106 +++++++++++++ Projectiles/Rogue/NightsGazeSpark.png | Bin 0 -> 158 bytes Projectiles/Rogue/NightsGazeStar.cs | 141 ++++++++++++++++++ Projectiles/Rogue/NightsGazeStar.png | Bin 0 -> 414 bytes Projectiles/Rogue/NychthemeronOrb.cs | 2 +- Projectiles/Rogue/SludgeSplotchProj1.cs | 128 ++++++++++++++++ Projectiles/Rogue/SludgeSplotchProj1.png | Bin 0 -> 364 bytes Projectiles/Rogue/SludgeSplotchProj2.cs | 81 ++++++++++ Projectiles/Rogue/SludgeSplotchProj2.png | Bin 0 -> 297 bytes 18 files changed, 740 insertions(+), 2 deletions(-) create mode 100644 Items/Weapons/Rogue/NightsGaze.cs create mode 100644 Items/Weapons/Rogue/NightsGaze.png create mode 100644 Items/Weapons/Rogue/SludgeSplotch.cs create mode 100644 Items/Weapons/Rogue/SludgeSplotch.png create mode 100644 Projectiles/Rogue/NightsGazeProjectile.cs create mode 100644 Projectiles/Rogue/NightsGazeProjectile.png create mode 100644 Projectiles/Rogue/NightsGazeProjectileGlow.png create mode 100644 Projectiles/Rogue/NightsGazeSpark.cs create mode 100644 Projectiles/Rogue/NightsGazeSpark.png create mode 100644 Projectiles/Rogue/NightsGazeStar.cs create mode 100644 Projectiles/Rogue/NightsGazeStar.png create mode 100644 Projectiles/Rogue/SludgeSplotchProj1.cs create mode 100644 Projectiles/Rogue/SludgeSplotchProj1.png create mode 100644 Projectiles/Rogue/SludgeSplotchProj2.cs create mode 100644 Projectiles/Rogue/SludgeSplotchProj2.png diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index 87c8f2f8d0..0d504b4f9f 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -56,6 +56,15 @@ namespace CalamityMod.Buffs npc.DelBuff(buffIndex); buffIndex--; } + else if (type == BuffID.Slow) + { + if (npc.Calamity().slowed < npc.buffTime[buffIndex]) + { + npc.Calamity().slowed = npc.buffTime[buffIndex]; + } + npc.DelBuff(buffIndex); + buffIndex--; + } } public override void ModifyBuffTip(int type, ref string tip, ref int rare) diff --git a/Items/Weapons/Rogue/NightsGaze.cs b/Items/Weapons/Rogue/NightsGaze.cs new file mode 100644 index 0000000000..e7761c9a8d --- /dev/null +++ b/Items/Weapons/Rogue/NightsGaze.cs @@ -0,0 +1,67 @@ +using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Ores; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class NightsGaze : RogueWeapon + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Night's Gaze"); + Tooltip.SetDefault("Throws a spear that shatters when it hits an enemy\n" + + "Stealth strikes cause the spear to summon homing stars as it flies\n" + + "Strike your foes with this spear of the night"); + } + + public override void SafeSetDefaults() + { + item.width = 80; + item.damage = 800; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 20; + item.useStyle = 1; + item.useTime = 20; + item.knockBack = 1f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 80; + item.maxStack = 1; + item.value = Item.buyPrice(1, 40, 0, 0); + item.rare = 10; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 30f; + item.Calamity().postMoonLordRarity = 13; + item.Calamity().rogue = true; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.Calamity().StealthStrikeAvailable()) + { + int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[p].Calamity().stealthStrike = true; + return false; + } + return true; + } + + /* + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddIngredient(ModContent.ItemType(), 12); + recipe.AddIngredient(ItemID.DayBreak); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this, 1); + recipe.AddRecipe(); + } + */ + } +} diff --git a/Items/Weapons/Rogue/NightsGaze.png b/Items/Weapons/Rogue/NightsGaze.png new file mode 100644 index 0000000000000000000000000000000000000000..70193b68e59a50a7a5bf1f900f89a9831924bd7e GIT binary patch literal 1737 zcmV;)1~&PLP)_AOGu|>tJcfp5EgCwC^7PVD`qa+vvPVvu||0<23sQT8%LCwtw_q z;JgQ?zW}U(#>AR^1Fb^u!H)rm_H_U-d-Yntyl>v`2jJB=e-2z{4K!ra#z2X6bE#ec zvIlkpaPMxx1$gqr%Rs$(^A~EvXH?7o>1R#=10}y?9KhRM`j=cuJw!wbDk9lI=-`}1G zU~6B815mko4S-v@bL#qL|H12>jT{4AfcQ)SfQjB60AxJlj(_k1;Kw>aH!qoKa{wNX z&H#|}%oD7EhP1qaJ$?NPzMpmng9nl-)=?M-{7&Mn7k2`1?$cj^`YijB_x{7n>UHYg z4FKlGRd&wZ`n=)yTLTSgIRh6nPG`Ea2tem_o64@9d6HelsFPlH9U2UNzGU4qSIR(5 zy_e~B0Jh|F3x2;f(2$lfP|WM&TA*e!UllHPDcj=|pN`p9`>i;3)uhKYJi>-s68q0l0Sgf;!OA?*Ke;=ncT1reyZ1 ziE>!ICrIr3@|`mPbQP7+(TB=hYv3x=v>2#o+ek#+%KW@CA~&K;%l&jda9*LHvSOw? z>j2C=Qs7ziw$ zb@2?GpD!!ZJQGXvV=llrm(_Vg-cLRO;H+oZ#IF6`ab;k&<4C4eCE|53%f%XK$eP!I zdiIUS+W;t)iZ1vuFbv7Uf*vy^R?3v7vTdgW(7kUv;Ma+gb>)AsSiKj9HPDbXGf>Qn z#guX7a&bw$t{66%etp67664Oe83I#uzIdQh^ctZ7ImF{G{E>gaW1er&`AI5>E$;rE$h4K$<~28LyR7yKzq z1hu**>$5Ux78B20*%`Q4Vyc)eCd%=xJNj4+tbvBCnSqZ+?=(Cv^`XS9LP718N~5x` zOqOM0Ec^D(zVaaeiPX)&=Si%SY%WHx7S=#RT4ov}F-sVC)Kn$yCC!v~{K4rPf%oyo zcY3T71BKha|FJ6fZ4ES}>1!g)2A-osCrR479ELwl9lCW zS69*jn3`JNuOKA`ifxy-x#h z>*ilTy?MGZdJMh!XRxj-m5TD~ny&L$0}U}YaIqbwnVu{F`A2Flcj&O{Wv~7g-18D< zUKmo>#bPSgk^UPT(tbvBCn1S)Ob^uDn*@h-cOq`r}46J|i1Z$un|2qqdd3v3v zn^*H%vUJNl8L$#q0}WZWfnnz9**4zRuAU(B&D)Sz0}WZSfz@Z(5^8-c%sjo$V}r#! z9c!Q=p?2s~mi7*{({pxa+J*Xg-bU*%mWnmdkfp>x7hrZ~8mKp~E0Nli<_Xq7L#i>b z?&-;>_w;0?+_1xF@91>EH*>R@Cs+dwam2iVBS!%kzH~9rIfU&Pz_WL=nkQHT4RQ2| z^1D9{0siwCgV`ehM55jvlgjGsFPtf|$42jnlCP8shZy^)I+T zZ{WyL2VnTpMZg-UV+}N(); + item.shootSpeed = 7.5f; + item.Calamity().rogue = true; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Main.PlaySound(4, (int)player.position.X, (int)player.position.Y, 9, 2, 0); + + if (player.Calamity().StealthStrikeAvailable()) + { + int p = Projectile.NewProjectile(position.X, position.Y, speedX * 1.2f, speedY * 1.2f, type, damage, knockBack * 3, player.whoAmI, 0f, 1f); + Main.projectile[p].Calamity().stealthStrike = true; + return false; + } + return true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType()); + recipe.SetResult(this, 20); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Rogue/SludgeSplotch.png b/Items/Weapons/Rogue/SludgeSplotch.png new file mode 100644 index 0000000000000000000000000000000000000000..9b73c0656480131f9d521ae9af56f74633957133 GIT binary patch literal 559 zcmV+~0?_@5P)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00DhTL_t(Y$Hmq?OT$1M$MNrJoAhB2 zq!g4sh@j}?CRS8XM_qgaPQDf2i*LYHK}B4hDvDxTQ7A=l=tDYKhvculYtt&ow5s4U!VFTHNG<<`j!~&1pB8*sxP+@i)0psNz7f@O}GjMXRAo0?1{|vW6mzA7U1g5|&dm?lF$cTr$d+lrdTZw&<9Ec>9PAY&_vn@^X_oMzIh)nbanER$n x%CItR0000IbVXQnMOaBjI!|(GWo~p~bZKvH05ODE?C$^o002ovPDHLkV1n;|>yiKf literal 0 HcmV?d00001 diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 3a75681139..2ca8d42ed8 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -97,6 +97,7 @@ namespace CalamityMod.NPCs public int eFreeze = 0; public int silvaStun = 0; public int webbed = 0; + public int slowed = 0; public int yellowCandle = 0; public int pearlAura = 0; public int wCleave = 0; @@ -609,6 +610,7 @@ namespace CalamityMod.NPCs npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[BuffID.Webbed] = true; + npc.buffImmune[BuffID.Slow] = true; } if (DestroyerIDs.Contains(npc.type) || npc.type == NPCID.DD2EterniaCrystal || npc.townNPC) @@ -2117,7 +2119,9 @@ namespace CalamityMod.NPCs silvaStun--; if (webbed > 0) webbed--; - if (yellowCandle > 0) + if (slowed > 0) + slowed--; + if (yellowCandle > 0) yellowCandle--; if (pearlAura > 0) pearlAura--; @@ -2182,6 +2186,8 @@ namespace CalamityMod.NPCs npc.velocity = Vector2.Zero; else if (timeSlow > 0 || webbed > 0) npc.velocity *= 0.85f; + else if (slowed > 0) + npc.velocity *= 0.9f; } } #endregion @@ -3163,6 +3169,21 @@ namespace CalamityMod.NPCs } } } + if (slowed > 0) + { + if (Main.rand.Next(5) < 4) + { + int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, 191, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 225, default, 3f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 1.1f; + Main.dust[dust].velocity.Y += 0.25f; + if (Main.rand.NextBool(2)) + { + Main.dust[dust].noGravity = false; + Main.dust[dust].scale *= 0.5f; + } + } + } if (gState > 0 || eFreeze > 0) { diff --git a/Projectiles/Rogue/NightsGazeProjectile.cs b/Projectiles/Rogue/NightsGazeProjectile.cs new file mode 100644 index 0000000000..2ea0a66fcc --- /dev/null +++ b/Projectiles/Rogue/NightsGazeProjectile.cs @@ -0,0 +1,123 @@ + +using CalamityMod.Buffs.DamageOverTime; +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 NightsGazeProjectile : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Night's Gaze"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 8; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + } + + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 300; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + if (projectile.ai[0] == 0f) + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; + } + + if (projectile.Calamity().stealthStrike) + { + if (Main.rand.Next(10) == 0) + { + int projectileDamage = (int)(projectile.damage * 0.25f); + int projectileType = ModContent.ProjectileType(); + Vector2 velocity = projectile.velocity; + + int p = Projectile.NewProjectile(projectile.Center, velocity, projectileType, projectileDamage, 5f, projectile.owner, 1f, 0f); + Main.projectile[p].penetrate = 1; + } + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), projectile.timeLeft); + + int starCount = 6; + int starFrequency = 3; + float spread = 20f; + for (int i = 0; i < starCount; i++) + { + int projectileDamage = (int)(projectile.damage * 0.75f); + int projectileType = ModContent.ProjectileType(); + if (Main.rand.Next(starCount) < starFrequency) + { + projectileType = ModContent.ProjectileType(); + } + Vector2 velocity = projectile.oldVelocity.RotateRandom(MathHelper.ToRadians(spread)); + float speed = Main.rand.NextFloat(1.5f, 2f); + float moveDuration = Main.rand.Next(5, 15); + + Projectile.NewProjectile(projectile.Center, velocity * speed, projectileType, projectileDamage, 5f, projectile.owner, 0f, moveDuration); + } + + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62, 0.6f); + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 68, 0.2f); + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 122, 0.4f); + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); + Main.PlaySound(0, projectile.position); + projectile.Kill(); + return false; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 3); + return false; + } + + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 origin = new Vector2(projectile.width / 2, projectile.height / 2); + spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Rogue/NightsGazeProjectileGlow"), projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, origin, 1f, SpriteEffects.None, 0f); + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 5; i++) + { + int dustToUse = Main.rand.Next(0, 3); + int dustType = 0; + switch (dustToUse) + { + case 0: + dustType = 109; + break; + case 1: + dustType = 111; + break; + case 2: + dustType = 132; + break; + } + + int dust = Dust.NewDust(projectile.Center, 1, 1, dustType, projectile.velocity.X / 3f, projectile.velocity.Y / 3f, 0, default, 1.5f); + Main.dust[dust].noGravity = true; + } + } + } +} diff --git a/Projectiles/Rogue/NightsGazeProjectile.png b/Projectiles/Rogue/NightsGazeProjectile.png new file mode 100644 index 0000000000000000000000000000000000000000..80fbd96afe69b45ff91899cd36555f87db40555f GIT binary patch literal 1684 zcmV;F25b3=P)^dcA&6oq1=Bu%$J>`%MJcDLi<+jnQ?>&$l3 zZ`*CV-*egS&g|@T_v!oh&DI&}Kjjia+reQ6;Ms$503Od=#j=`MqfcPFlaL?we)>UR z!{miaE_fymJvaqe6LqYChExok8k+#%`)}U@;0(%0F)=VU{`JiXx`Xp4K&0V>Q~v7fxYTB zJ?Vm%mB0Sz1pqGpQUu`3vzGzr{`Y~}KlPjgKxQs*;ASz>8fb_kKZuF((GdWiPA|Fu zFTeLT;F);l^9jJq+ABA%1rAu+vtPy3To!fUZ<40Qt;P zsELBa#;X^90wD8H_0E+TslApp&=SCj+OTh^Qs=n5Cqh2eY4ZKd)8LN7Nv(poeevhhR4KySXwLv-zsq>^$p=_8Q3-=sS_fNm3 z4te$B1mKxld48Ef$C5H~v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wZHL&0uIs?NRrRRy+nrIC)BLmbHpDY96O|%9Ya%c=pN7#y`t>Xm%*4N^`&x4G#1{zW_1`5e_ z>}s{|Yx1w(L!EC8%n>DLpde-)Ia&q4)a0Kj&ueT+>;~ITy&KFLXfdO{vD0X`t2NM& zl8u4Fu01`G#GalRwI^rHedL0-m;2LKPWk?3)<8oJeK#f@K|3G>{lC-cSOYB$B;Wq#P002ovPDHLkV1l>vsnh@f literal 0 HcmV?d00001 diff --git a/Projectiles/Rogue/NightsGazeSpark.cs b/Projectiles/Rogue/NightsGazeSpark.cs new file mode 100644 index 0000000000..9d9d449286 --- /dev/null +++ b/Projectiles/Rogue/NightsGazeSpark.cs @@ -0,0 +1,106 @@ + +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class NightsGazeSpark : ModProjectile + { + public static int lifetime = 150; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Night's Gaze Spark"); + } + + public override void SetDefaults() + { + projectile.width = 6; + projectile.height = 6; + projectile.friendly = true; + projectile.penetrate = 5; + projectile.timeLeft = lifetime; + projectile.Calamity().rogue = true; + projectile.localAI[0] = 10f; + } + + public override void AI() + { + projectile.rotation += projectile.direction * projectile.ai[0]; + + if (projectile.timeLeft < (lifetime - projectile.ai[1]) && projectile.localAI[0] >= 0) + { + projectile.velocity.Normalize(); + projectile.velocity *= projectile.localAI[0]; + projectile.localAI[0]--; + } + + if (projectile.localAI[0] == 0) + { + projectile.Kill(); + } + + for (int i = 0; i < 3; i++) + { + float dustVelocity = Main.rand.NextFloat(0f, 0.5f); + int dustToUse = Main.rand.Next(0, 3); + int dustType = 0; + switch (dustToUse) + { + case 0: + dustType = 109; + break; + case 1: + dustType = 111; + break; + case 2: + dustType = 132; + break; + } + + int dust = Dust.NewDust(projectile.Center, 1, 1, dustType, projectile.velocity.X, projectile.velocity.Y, 0, default, 1.5f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= dustVelocity; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); + projectile.Kill(); + return false; + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 5; i++) + { + int dustToUse = Main.rand.Next(0, 3); + int dustType = 0; + switch (dustToUse) + { + case 0: + dustType = 109; + break; + case 1: + dustType = 111; + break; + case 2: + dustType = 132; + break; + } + + int dust = Dust.NewDust(projectile.Center, 1, 1, dustType, projectile.velocity.X, projectile.velocity.Y, 0, default, 1.5f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 0.75f; + } + } + } +} diff --git a/Projectiles/Rogue/NightsGazeSpark.png b/Projectiles/Rogue/NightsGazeSpark.png new file mode 100644 index 0000000000000000000000000000000000000000..4a2fe20cc931d1b25dd390fe82d6d13dc853e094 GIT binary patch literal 158 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4F%}28J29*~C-V}>iSTrB43U_c zoYKIgIljQf+xO0GVnoF^er6yzY{cL8f62^_yhHz- z{eg-kB*a9t9DG_%P0mx|IpE{O?lSuXM{= 0) + { + projectile.velocity.Normalize(); + projectile.velocity *= projectile.localAI[0]; + projectile.localAI[0]--; + } + else if (projectile.timeLeft >= (lifetime - projectile.ai[1])) + { + for (int i = 0; i < 3; i++) + { + float dustVelocity = Main.rand.NextFloat(0f, 0.5f); + int dustToUse = Main.rand.Next(0, 3); + int dustType = 0; + switch (dustToUse) + { + case 0: + dustType = 109; + break; + case 1: + dustType = 111; + break; + case 2: + dustType = 132; + break; + } + + int dust = Dust.NewDust(projectile.Center, 1, 1, dustType, projectile.velocity.X, projectile.velocity.Y, 0, default, 1.5f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= dustVelocity; + } + } + } + else if (projectile.ai[0] == 1f) + { + float minDist = 999f; + int index = 0; + for (int i = 0; i < Main.npc.Length; i++) + { + NPC npc = Main.npc[i]; + if (!npc.friendly && !npc.townNPC && npc.active && !npc.dontTakeDamage && npc.chaseable) + { + float dist = (projectile.Center - npc.Center).Length(); + if (dist < minDist) + { + minDist = dist; + index = i; + } + } + } + + if (minDist < 999f) + { + Vector2 velocityNew = Main.npc[index].Center - projectile.Center; + float speed = 10f; + velocityNew.Normalize(); + projectile.velocity = velocityNew * speed; + } + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); + projectile.Kill(); + return false; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, Color.White, ProjectileID.Sets.TrailingMode[projectile.type], 3); + return false; + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 5; i++) + { + int dustToUse = Main.rand.Next(0, 3); + int dustType = 0; + switch (dustToUse) + { + case 0: + dustType = 109; + break; + case 1: + dustType = 111; + break; + case 2: + dustType = 132; + break; + } + + int dust = Dust.NewDust(projectile.Center, 1, 1, dustType, projectile.velocity.X, projectile.velocity.Y, 0, default, 1.5f); + Main.dust[dust].noGravity = true; + } + } + } +} diff --git a/Projectiles/Rogue/NightsGazeStar.png b/Projectiles/Rogue/NightsGazeStar.png new file mode 100644 index 0000000000000000000000000000000000000000..2edc75ddf533f9d17cd1f8420c0bcb2a770467f2 GIT binary patch literal 414 zcmV;P0b%}$P)X+;6KPhut+1RB`Ov+!WLpJjK$1VX2P1a81YuSZ{EV0JNL~(O|?6@ZFh28w|}8- z<8RfN*U;P^Sb*-?9smYM{czpO{wJ~2-)VT_dir}}dAr#=4C-~gPDi}f>{@{Lm91c5 zabq2TgZ)-em)FJas;`9Eew#ifCf0+z6k#!X`SC;b^-mr7)!hdG!;{p+Po;6EdX5D! ztT2ijjN2&u;)ICxa|0@k|D*@_QM1DVd8~U^dU`Q=vRBSEM5*Ri5#aIGnnj zCinP@Sd(`gk-mW?qta>epSeV=-F@#v`?*IS*07*qo IM6N<$f^w(1v;Y7A literal 0 HcmV?d00001 diff --git a/Projectiles/Rogue/NychthemeronOrb.cs b/Projectiles/Rogue/NychthemeronOrb.cs index 8f426053fa..64de33a875 100644 --- a/Projectiles/Rogue/NychthemeronOrb.cs +++ b/Projectiles/Rogue/NychthemeronOrb.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { bool isActive = false; - for (int i = 0; i < 200; i++) + for (int i = 0; i < Main.projectile.Length; i++) { Projectile p = Main.projectile[i]; if (p.identity == projectile.ai[1] && p.active) diff --git a/Projectiles/Rogue/SludgeSplotchProj1.cs b/Projectiles/Rogue/SludgeSplotchProj1.cs new file mode 100644 index 0000000000..ae9a2e64be --- /dev/null +++ b/Projectiles/Rogue/SludgeSplotchProj1.cs @@ -0,0 +1,128 @@ +using CalamityMod.Buffs.StatDebuffs; +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 SludgeSplotchProj1 : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sludge Splotch"); + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 300; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + projectile.velocity.Y += 0.1f; + if (projectile.velocity.Y >= 16f) + { + projectile.velocity.Y = 16f; + } + + projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); + + int numDust = 2; + for (int i = 0; i < numDust; i++) + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 191, 0f, 0f, 225, new Color(255, 255, 255), 3); + Main.dust[dust].noGravity = true; + Main.dust[dust].noLight = true; + Main.dust[dust].velocity = Main.dust[dust].velocity * 0.25f; + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + if (projectile.Calamity().stealthStrike) + { + projectile.ai[0] = 0; + projectile.ai[1] = 0; + + if (projectile.velocity.X != oldVelocity.X) + { + if (oldVelocity.X < 0) + { + projectile.ai[0] = 1; + } + if (oldVelocity.X > 0) + { + projectile.ai[0] = -1; + } + } + if (projectile.velocity.Y != oldVelocity.Y) + { + if (oldVelocity.Y < 0) + { + projectile.ai[1] = 1; + } + if (oldVelocity.Y > 0) + { + projectile.ai[1] = -1; + } + } + } + + Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); + Main.PlaySound(0, projectile.position); + Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 9, 2, 0); + projectile.Kill(); + return false; + } + + 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.AddBuff(BuffID.Slow, 240); + Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 9, 2, 0); + } + + public override void Kill(int timeLeft) + { + if (projectile.Calamity().stealthStrike) + { + int sparkCount = Main.rand.Next(3, 6); + for (int i = 0; i < sparkCount; i++) + { + int sparkScatter = 1; + Vector2 sparkVelocity = new Vector2(Main.rand.NextFloat(-sparkScatter, sparkScatter), Main.rand.NextFloat(-sparkScatter - 2, sparkScatter + 2)); + + sparkVelocity.Normalize(); + sparkVelocity *= 7; + + Projectile.NewProjectile(projectile.Center, sparkVelocity, ModContent.ProjectileType(), 7, 0, projectile.owner, 0, 0); + } + } + + int numDust = 20; + int dustType = 191; + float spread = 3f; + for (int i = 0; i < numDust; i++) + { + Vector2 velocity = projectile.velocity + new Vector2(Main.rand.NextFloat(-spread, spread), Main.rand.NextFloat(-spread, spread)); + + int dust = Dust.NewDust(projectile.Center, 1, 1, dustType, velocity.X, velocity.Y, 175, default, 3f); + Main.dust[dust].noGravity = true; + } + } + } +} diff --git a/Projectiles/Rogue/SludgeSplotchProj1.png b/Projectiles/Rogue/SludgeSplotchProj1.png new file mode 100644 index 0000000000000000000000000000000000000000..7d4731aed9456e2b0ddc5740ed8cdaa7aa587445 GIT binary patch literal 364 zcmeAS@N?(olHy`uVBq!ia0vp^LO{&N!3HFiZux8nQY`6?zK#qG8~eHcB(ehejKx9j zP7LeL$-D$|6p}rHd>I(3)EF2VS{N990fib~Fff!FFfhDIU|_JC!N4G1FlSew4N!tD z$=lt9;Xep2*t>i(P-K^sl+6)&+ng|_{@L5qjC%L0qF{cDepHOT+nnuoS`y|;exScN>J^BOjQP* zFyqw2DZ9dseZS4xpyD?>erD)IrHhS!pX@cK-$Q zw&k{rdHI{q0evA<;u--&o^DqDMVYC2C5a`O`FRY6EfH_t17#UJUHx3vIVCg!0GV-v AX#fBK literal 0 HcmV?d00001 diff --git a/Projectiles/Rogue/SludgeSplotchProj2.cs b/Projectiles/Rogue/SludgeSplotchProj2.cs new file mode 100644 index 0000000000..d7685afeb0 --- /dev/null +++ b/Projectiles/Rogue/SludgeSplotchProj2.cs @@ -0,0 +1,81 @@ +using CalamityMod.Buffs.StatDebuffs; +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 SludgeSplotchProj2 : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sludge Splotch"); + } + + public override void SetDefaults() + { + projectile.width = 6; + projectile.height = 6; + projectile.friendly = true; + projectile.penetrate = 2; + projectile.timeLeft = 150; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = -1; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + projectile.velocity.Y += 0.1f; + if (projectile.velocity.Y >= 16f) + { + projectile.velocity.Y = 16f; + } + + projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); + + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 191, 0f, 0f, 225, new Color(255, 255, 255), 2); + Main.dust[dust].noGravity = true; + Main.dust[dust].noLight = true; + Main.dust[dust].velocity = Main.dust[dust].velocity * 0.25f; + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); + Main.PlaySound(0, projectile.position); + Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 28, 0.3f, 0); + projectile.Kill(); + return false; + } + + 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.AddBuff(BuffID.Slow, 120); + } + + public override void Kill(int timeLeft) + { + int numDust = 10; + int dustType = 191; + float spread = 2f; + for (int i = 0; i < numDust; i++) + { + Vector2 velocity = projectile.velocity + new Vector2(Main.rand.NextFloat(-spread, spread), Main.rand.NextFloat(-spread, spread)); + + int dust = Dust.NewDust(projectile.Center, 1, 1, dustType, velocity.X, velocity.Y, 175, default, 2f); + Main.dust[dust].noGravity = true; + } + } + } +} diff --git a/Projectiles/Rogue/SludgeSplotchProj2.png b/Projectiles/Rogue/SludgeSplotchProj2.png new file mode 100644 index 0000000000000000000000000000000000000000..1d5c771e9d3e610f06c2e3137c40985ca365d4ee GIT binary patch literal 297 zcmeAS@N?(olHy`uVBq!ia0vp^d_c^>!3HEx3Z6Ryq*&4&eH|GXHuiJ>Nn{1`8HI-n|4P;1O3$l$n}Wl30?NpT}U>67l9eP?o{d)z4*}Q$iB}9yw=~ literal 0 HcmV?d00001