From 3737484dc63e04d28757ce61d38fb4cc706bf295 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Tue, 12 Nov 2019 17:17:53 -0600 Subject: [PATCH] New melee projectiles and some other comments. --- Items/Weapons/Melee/AquaticDissolution.cs | 2 +- Items/Weapons/Melee/GreatswordofBlah.cs | 4 +- Items/Weapons/Melee/Greentide.cs | 2 +- Items/Weapons/Melee/HolidayHalberd.cs | 2 +- NPCs/AquaticScourge/AquaticScourgeHead.cs | 8 +- NPCs/CalamityAI.cs | 20 +++-- NPCs/CalamityGlobalNPC.cs | 8 +- Projectiles/Boss/BrimstoneHellblast.cs | 1 + Projectiles/Melee/Brimlash2.cs | 68 ++++++++++---- Projectiles/Melee/Brimlash2.png | Bin 136 -> 811 bytes Projectiles/Melee/BrimlashProj.cs | 85 ++++++++++++------ Projectiles/Melee/BrimlashProj.png | Bin 139 -> 811 bytes Projectiles/Melee/ElementalExcaliburBeam.cs | 2 +- Projectiles/Melee/EssenceBeam.cs | 76 +++++++++++----- Projectiles/Melee/EssenceBeam.png | Bin 135 -> 1816 bytes Projectiles/Melee/GreenBall.cs | 33 ++++--- Projectiles/Melee/GreenBall.png | Bin 148 -> 429 bytes Projectiles/Melee/GreenWater.cs | 94 ++++++++++---------- Projectiles/Melee/GreenWater.png | Bin 139 -> 724 bytes Projectiles/Melee/JudgementBlah.cs | 90 +++++++++++++++---- Projectiles/Melee/JudgementBlah.png | Bin 180 -> 861 bytes Projectiles/Melee/OceanBeam.cs | 73 +++++++-------- Projectiles/Melee/OceanBeam.png | Bin 136 -> 547 bytes Projectiles/Melee/RedBall.cs | 37 +++++--- Projectiles/Melee/RedBall.png | Bin 148 -> 403 bytes 25 files changed, 385 insertions(+), 220 deletions(-) diff --git a/Items/Weapons/Melee/AquaticDissolution.cs b/Items/Weapons/Melee/AquaticDissolution.cs index 667968585a..2c9c3276d1 100644 --- a/Items/Weapons/Melee/AquaticDissolution.cs +++ b/Items/Weapons/Melee/AquaticDissolution.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Aquatic Dissolution"); - Tooltip.SetDefault("Fires aquatic jets from the sky that bounce off tiles"); + Tooltip.SetDefault("Fires whaling spears from the sky that bounce off tiles"); } public override void SetDefaults() diff --git a/Items/Weapons/Melee/GreatswordofBlah.cs b/Items/Weapons/Melee/GreatswordofBlah.cs index da2faed9bf..ddf1ab965d 100644 --- a/Items/Weapons/Melee/GreatswordofBlah.cs +++ b/Items/Weapons/Melee/GreatswordofBlah.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee { DisplayName.SetDefault("Greatsword of Blah"); Tooltip.SetDefault("A pale white sword from a forgotten land\n" + - "Fires a rainbow orb that emits rainbow rain on death for a time\n" + + "Fires a rainbow beam that emits rainbow rain on death for a time\n" + "You can hear faint yet comforting whispers emanating from the blade\n" + "'No matter where you may be you are never alone\n" + "I shall always be at your side, my lord'"); @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Melee item.value = Item.buyPrice(1, 80, 0, 0); item.rare = 10; item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 12f; + item.shootSpeed = 6f; item.Calamity().postMoonLordRarity = 14; } diff --git a/Items/Weapons/Melee/Greentide.cs b/Items/Weapons/Melee/Greentide.cs index 90b7471572..6397b485d5 100644 --- a/Items/Weapons/Melee/Greentide.cs +++ b/Items/Weapons/Melee/Greentide.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Greentide"); - Tooltip.SetDefault("Summons green blasts of water from the sky on hit"); + Tooltip.SetDefault("Summons teeth from the sky on hit"); } public override void SetDefaults() diff --git a/Items/Weapons/Melee/HolidayHalberd.cs b/Items/Weapons/Melee/HolidayHalberd.cs index d8639ed67d..46b695c8df 100644 --- a/Items/Weapons/Melee/HolidayHalberd.cs +++ b/Items/Weapons/Melee/HolidayHalberd.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee DisplayName.SetDefault("Holiday Halberd"); Tooltip.SetDefault("idk I'm miserable with names\n" + "- The General\n" + - "Fires red and green bouncing balls that emit clouds as they travel"); + "Fires red and green bouncing gift bags that emit clouds as they travel"); } public override void SetDefaults() diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index 2979f43a1a..3680dc70d1 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -24,13 +24,10 @@ namespace CalamityMod.NPCs.AquaticScourge public class AquaticScourgeHead : ModNPC { private bool detectsPlayer = false; - private const int minLength = 30; - private const int maxLength = 31; private float speed = 5f; //10 private float turnSpeed = 0.08f; //0.15 private bool TailSpawned = false; private bool despawning = false; - private bool charging = false; public override void SetStaticDefaults() { @@ -74,7 +71,6 @@ namespace CalamityMod.NPCs.AquaticScourge writer.Write(despawning); writer.Write(detectsPlayer); writer.Write(npc.chaseable); - writer.Write(charging); } public override void ReceiveExtraAI(BinaryReader reader) @@ -82,7 +78,6 @@ namespace CalamityMod.NPCs.AquaticScourge despawning = reader.ReadBoolean(); detectsPlayer = reader.ReadBoolean(); npc.chaseable = reader.ReadBoolean(); - charging = reader.ReadBoolean(); } public override void AI() @@ -116,11 +111,12 @@ namespace CalamityMod.NPCs.AquaticScourge { if (!TailSpawned && npc.ai[0] == 0f) { + int maxLength = 31; int Previous = npc.whoAmI; for (int num36 = 0; num36 < maxLength; num36++) { int lol; - if (num36 >= 0 && num36 < minLength) + if (num36 >= 0 && num36 < maxLength - 1) { if (num36 % 2 == 0) { diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 48d431853b..0dae6dbf49 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -91,7 +91,7 @@ namespace CalamityMod.NPCs float yDistance = player.Center.Y - vectorCenter.Y; float totalDistance = (float)Math.Sqrt((double)(xDistance * xDistance + yDistance * yDistance)); - // Phase 1 movement, static movement towards target + // Static movement towards target if (npc.ai[0] <= 2f) { npc.rotation = npc.velocity.X * 0.04f; @@ -103,7 +103,7 @@ namespace CalamityMod.NPCs npc.velocity.Y = (npc.velocity.Y * 50f + yDistance) / 51f; } - // Phase 1 teleport, pick a location to teleport to + // Pick a location to teleport to if (npc.ai[0] == 0f) { npc.chaseable = true; @@ -181,7 +181,7 @@ namespace CalamityMod.NPCs } } - // Either teleport again or go to phase 2 + // Either teleport again or go to next AI state else if (npc.ai[0] == 2f) { npc.alpha -= 50; @@ -205,7 +205,7 @@ namespace CalamityMod.NPCs } } - // Phase 2, float above target and fire projectiles + // Float above target and fire projectiles else if (npc.ai[0] == 3f) { npc.chaseable = true; @@ -333,7 +333,7 @@ namespace CalamityMod.NPCs } } - // Phase 3, cocoon bullet hell + // Cocoon bullet hell else if (npc.ai[0] == 4f) { npc.defense = 99999; @@ -549,11 +549,14 @@ namespace CalamityMod.NPCs npc.chaseable = !brotherAlive; } + // Get a target if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(true); + // Target variable Player player = Main.player[npc.target]; + // Rotation float num801 = npc.position.X + (float)(npc.width / 2) - player.position.X - (float)(player.width / 2); float num802 = npc.position.Y + (float)npc.height - 59f - player.position.Y - (float)(player.height / 2); float num803 = (float)Math.Atan2((double)num802, (double)num801) + 1.57f; @@ -587,6 +590,7 @@ namespace CalamityMod.NPCs if (npc.rotation > num803 - num804 && npc.rotation < num803 + num804) npc.rotation = num803; + // Despawn if (!player.active || player.dead || (dayTime && !Main.eclipse)) { npc.TargetClosest(false); @@ -603,6 +607,7 @@ namespace CalamityMod.NPCs else if (npc.timeLeft < 1800) npc.timeLeft = 1800; + // Float above target and fire lasers or fireballs if (npc.ai[1] == 0f) { float num823 = expertMode ? 9.5f : 8f; @@ -673,9 +678,9 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient) { + npc.localAI[1] += 1f; if (phase2) { - npc.localAI[1] += 1f; if (!brotherAlive) { npc.localAI[1] += 1f * (1f - lifeRatio); @@ -705,7 +710,6 @@ namespace CalamityMod.NPCs } else { - npc.localAI[1] += 1f; if (revenge) npc.localAI[1] += 0.5f; @@ -726,6 +730,8 @@ namespace CalamityMod.NPCs } } } + + // Float to the side of the target and fire lasers else { int num831 = 1; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index bf2c3a5ec1..e49d74dea2 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -3282,11 +3282,11 @@ namespace CalamityMod.NPCs } if (Main.rand.NextBool(4) && Main.LocalPlayer.ZoneDesert) { - chat = "I hate sand. It's coarse, and rough… and gets in my paint."; + chat = "I hate sand. It's coarse, and rough and gets in my paint."; } if (Main.rand.NextBool(4) && Main.LocalPlayer.ZoneHoly) { - chat = "Do you think unicorn blood could be used as a good pigment or resin? … No I'm not going to find out myself."; + chat = "Do you think unicorn blood could be used as a good pigment or resin? No I'm not going to find out myself."; } if (Main.rand.NextBool(4) && Main.LocalPlayer.ZoneSkyHeight) { @@ -3315,7 +3315,7 @@ namespace CalamityMod.NPCs } if (Main.rand.NextBool(4) && Main.LocalPlayer.Calamity().ZoneSulphur) { - chat = "Fun fact! Sulphur was used as pigment once upon a time! … Or was it Cinnabar?"; + chat = "Fun fact! Sulphur was used as pigment once upon a time! Or was it Cinnabar?"; } if (Main.rand.NextBool(4) && Main.LocalPlayer.Calamity().ZoneAbyss) { @@ -3486,7 +3486,7 @@ namespace CalamityMod.NPCs if (Main.rand.NextBool(5) && Main.LocalPlayer.Center.ToTileCoordinates().X < 380 && !Main.LocalPlayer.Calamity().ZoneSulphur) { - chat = "Now this is a scene that I can admire any time! … I feel like something is watching me though."; + chat = "Now this is a scene that I can admire any time! I feel like something is watching me though."; } if (Main.rand.NextBool(5) && Main.LocalPlayer.Calamity().ZoneSulphur) diff --git a/Projectiles/Boss/BrimstoneHellblast.cs b/Projectiles/Boss/BrimstoneHellblast.cs index 196dc58424..24686f3b88 100644 --- a/Projectiles/Boss/BrimstoneHellblast.cs +++ b/Projectiles/Boss/BrimstoneHellblast.cs @@ -5,6 +5,7 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Boss { public class BrimstoneHellblast : ModProjectile diff --git a/Projectiles/Melee/Brimlash2.cs b/Projectiles/Melee/Brimlash2.cs index 3a4c07b2f6..7acd005674 100644 --- a/Projectiles/Melee/Brimlash2.cs +++ b/Projectiles/Melee/Brimlash2.cs @@ -1,8 +1,11 @@ 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.Melee { public class Brimlash2 : ModProjectile @@ -10,13 +13,17 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Brimlash"); - } + ProjectileID.Sets.TrailCacheLength[projectile.type] = 2; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } public override void SetDefaults() { - projectile.width = 6; - projectile.height = 6; - projectile.friendly = true; + projectile.width = 20; + projectile.height = 20; + projectile.aiStyle = 27; + aiType = 156; + projectile.friendly = true; projectile.ignoreWater = true; projectile.penetrate = 1; projectile.melee = true; @@ -59,21 +66,46 @@ namespace CalamityMod.Projectiles.Melee projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; } - if (projectile.localAI[0] == 0f) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); - projectile.localAI[0] += 1f; - } - for (int num457 = 0; num457 < 2; num457++) - { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1.5f); - Main.dust[num458].noGravity = true; - Main.dust[num458].velocity *= 0.5f; - Main.dust[num458].velocity += projectile.velocity * 0.1f; - } - } + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1f); + Main.dust[num458].noGravity = true; + Main.dust[num458].velocity *= 0.5f; + Main.dust[num458].velocity += projectile.velocity * 0.1f; + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + public override Color? GetAlpha(Color lightColor) + { + return new Color(200, 200, 200, projectile.alpha); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (projectile.timeLeft > 115) + return false; + + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item10, projectile.position); + int num3; + for (int num795 = 4; num795 < 31; num795 = num3 + 1) + { + float num796 = projectile.oldVelocity.X * (30f / (float)num795); + float num797 = projectile.oldVelocity.Y * (30f / (float)num795); + int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 235, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.8f); + Main.dust[num798].noGravity = true; + Dust dust = Main.dust[num798]; + dust.velocity *= 0.5f; + num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 235, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.4f); + dust = Main.dust[num798]; + dust.velocity *= 0.05f; + num3 = num795; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 300); } diff --git a/Projectiles/Melee/Brimlash2.png b/Projectiles/Melee/Brimlash2.png index a3192f94614dc2f6790aa57e1c0aa31cc0d6ee18..2b703b8d203a707d5f0824e3c6500f13f71026f2 100644 GIT binary patch literal 811 zcmV+`1JwM9P)Px%aGVI0OkM+CN2>C0}M+|47*O6=%S-6 zn&`wIKumOVaUl{|Of<-XXkuct35lW=6~qX&w4B3xPs_bfkfP0&3|~|k?(nft|7OZyaVu+2H$vi35wi_!zlnp zUu9i@c+pg6HntCdRN|)t@MA9Tn=f*bP0se7$jN(B_y~43oBd%&OALU~my<4(t5Z^D zW(qMEV8H5k^-n(laO=)60IhrW`o`Duo)mb3j)+N3_2xLWXp&+0a=UN*+zr2%loZe2 zF92}-Kmu6V_w2sdJ3e1p1FZC(6nKJBtPE8rznC;zMfJ68-(%lIJ7dqDH&tKqoJUj{ zTdhJt5P*RrTY$1R^BC*{W(4xm^+Cv6*6Z3k(lIN#2v>sVkSdfN}z) zJDPptHaTggSn~Lq)mlm6BPdU)Z>i&_tv+`D`K0gMCTDxPS_Plrv7HeIpm%)UAQ+!m zbAr5RCqt{1B!5c5C-^%11%U02;{a@n8e1;qzPkWD%_d1oUh)X1=05`EM6t=~e*HpY zv(+`i;1i4&{r{CL70glO?CLD{Ni(iQQGZm`+vGOd|D@m()CYTCCvuHmmVWaRL0(fI z6fwP9XooyDyZSrEMiqF1PCD7<0vz2M0andana+ikSuNT3Z4nJ z@ErkR#;MwT(m+A>5>H=O_6KY%{Dx*XIN1&Zg+x7F978y+C;$2X-=5j*z>x;#3(iao Y`*N8%pC){&2P$CjboFyt=akR{0HAOs6#xJL diff --git a/Projectiles/Melee/BrimlashProj.cs b/Projectiles/Melee/BrimlashProj.cs index 1d80ae9dac..32ee8f37fc 100644 --- a/Projectiles/Melee/BrimlashProj.cs +++ b/Projectiles/Melee/BrimlashProj.cs @@ -1,8 +1,11 @@ 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.Melee { public class BrimlashProj : ModProjectile @@ -10,44 +13,70 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Brimlash"); - } + ProjectileID.Sets.TrailCacheLength[projectile.type] = 2; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } public override void SetDefaults() { - projectile.width = 12; - projectile.height = 12; - projectile.friendly = true; + projectile.width = 20; + projectile.height = 20; + projectile.aiStyle = 27; + aiType = 156; + projectile.friendly = true; projectile.ignoreWater = true; projectile.penetrate = -1; + projectile.timeLeft = 300; projectile.melee = true; } - public override void AI() - { - projectile.velocity.X *= 0.985f; - projectile.velocity.Y *= 0.985f; - if (Math.Abs(projectile.velocity.X) <= 1f || Math.Abs(projectile.velocity.Y) <= 1f) - { - projectile.Kill(); - } - Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0.05f / 255f, (255 - projectile.alpha) * 0.05f / 255f); - if (projectile.localAI[0] == 0f) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); - projectile.localAI[0] += 1f; - } - for (int num457 = 0; num457 < 3; num457++) - { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1.5f); - Main.dust[num458].noGravity = true; - Main.dust[num458].velocity *= 0.5f; - Main.dust[num458].velocity += projectile.velocity * 0.1f; - } - } + public override void AI() + { + projectile.velocity *= 0.99f; + if (projectile.velocity.Length() < 3f) + { + projectile.Kill(); + } + Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0.05f / 255f, (255 - projectile.alpha) * 0.05f / 255f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1f); + Main.dust[num458].noGravity = true; + Main.dust[num458].velocity *= 0.5f; + Main.dust[num458].velocity += projectile.velocity * 0.1f; + } - public override void Kill(int timeLeft) + public override Color? GetAlpha(Color lightColor) + { + return new Color(200, 200, 200, projectile.alpha); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (projectile.timeLeft > 295) + return false; + + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void Kill(int timeLeft) { - float spread = 90f * 0.0174f; + Main.PlaySound(SoundID.Item10, projectile.position); + int num3; + for (int num795 = 4; num795 < 31; num795 = num3 + 1) + { + float num796 = projectile.oldVelocity.X * (30f / (float)num795); + float num797 = projectile.oldVelocity.Y * (30f / (float)num795); + int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 235, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.8f); + Main.dust[num798].noGravity = true; + Dust dust = Main.dust[num798]; + dust.velocity *= 0.5f; + num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 235, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.4f); + dust = Main.dust[num798]; + dust.velocity *= 0.05f; + num3 = num795; + } + + float spread = 90f * 0.0174f; double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; double offsetAngle; diff --git a/Projectiles/Melee/BrimlashProj.png b/Projectiles/Melee/BrimlashProj.png index 04c5646fded8c39b9fa4fb2cb4826b55a2aacdbb..2b703b8d203a707d5f0824e3c6500f13f71026f2 100644 GIT binary patch literal 811 zcmV+`1JwM9P)Px%aGVI0OkM+CN2>C0}M+|47*O6=%S-6 zn&`wIKumOVaUl{|Of<-XXkuct35lW=6~qX&w4B3xPs_bfkfP0&3|~|k?(nft|7OZyaVu+2H$vi35wi_!zlnp zUu9i@c+pg6HntCdRN|)t@MA9Tn=f*bP0se7$jN(B_y~43oBd%&OALU~my<4(t5Z^D zW(qMEV8H5k^-n(laO=)60IhrW`o`Duo)mb3j)+N3_2xLWXp&+0a=UN*+zr2%loZe2 zF92}-Kmu6V_w2sdJ3e1p1FZC(6nKJBtPE8rznC;zMfJ68-(%lIJ7dqDH&tKqoJUj{ zTdhJt5P*RrTY$1R^BC*{W(4xm^+Cv6*6Z3k(lIN#2v>sVkSdfN}z) zJDPptHaTggSn~Lq)mlm6BPdU)Z>i&_tv+`D`K0gMCTDxPS_Plrv7HeIpm%)UAQ+!m zbAr5RCqt{1B!5c5C-^%11%U02;{a@n8e1;qzPkWD%_d1oUh)X1=05`EM6t=~e*HpY zv(+`i;1i4&{r{CL70glO?CLD{Ni(iQQGZm`+vGOd|D@m()CYTCCvuHmmVWaRL0(fI z6fwP9XooyDyZSrEMiqF1PCD7<0vz2M0andana+ikSuNT3Z<>&pIsosmIag3oHse4vnor;B5V#`)ww|Nq-FYc_N?x)`iV cT#~`S@HK*2wD-*0YM>ehPgg&ebxsLQ0I1_7Bme*a diff --git a/Projectiles/Melee/ElementalExcaliburBeam.cs b/Projectiles/Melee/ElementalExcaliburBeam.cs index fc445ec8fe..c7c5f5845f 100644 --- a/Projectiles/Melee/ElementalExcaliburBeam.cs +++ b/Projectiles/Melee/ElementalExcaliburBeam.cs @@ -371,7 +371,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(SoundID.Item10, projectile.position); + Main.PlaySound(SoundID.Item10, projectile.Center); projectile.position = projectile.Center; projectile.width = projectile.height = 64; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Melee/EssenceBeam.cs b/Projectiles/Melee/EssenceBeam.cs index 5655a9f0c2..2e96fa1cf8 100644 --- a/Projectiles/Melee/EssenceBeam.cs +++ b/Projectiles/Melee/EssenceBeam.cs @@ -1,49 +1,77 @@ using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Melee { public class EssenceBeam : ModProjectile { public override void SetStaticDefaults() { - DisplayName.SetDefault("Beam"); - } + DisplayName.SetDefault("Essence Beam"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } public override void SetDefaults() { - projectile.width = 4; - projectile.height = 4; - projectile.friendly = true; + projectile.width = 26; + projectile.height = 26; + projectile.aiStyle = 27; + aiType = 156; + projectile.ignoreWater = true; + projectile.friendly = true; projectile.melee = true; projectile.penetrate = 10; - projectile.extraUpdates = 100; - projectile.timeLeft = 120; + projectile.extraUpdates = 1; + projectile.timeLeft = 600; } public override void AI() { - projectile.localAI[0] += 1f; - if (projectile.localAI[0] > 3f) - { - for (int num447 = 0; num447 < 4; num447++) - { - Vector2 vector33 = projectile.position; - vector33 -= projectile.velocity * ((float)num447 * 0.25f); - projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 173, 0f, 0f, 0, default, 1f); - Main.dust[num448].position = vector33; - Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; - Main.dust[num448].velocity *= 0.2f; - } - } - } + Lighting.AddLight(projectile.Center, 0.6f, 0f, 0.2f); + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + public override Color? GetAlpha(Color lightColor) + { + return new Color(200, 200, 200, projectile.alpha); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (projectile.timeLeft > 595) + return false; + + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 300); target.immune[projectile.owner] = 2; } - } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item10, projectile.position); + int num3; + for (int num795 = 4; num795 < 31; num795 = num3 + 1) + { + float num796 = projectile.oldVelocity.X * (30f / (float)num795); + float num797 = projectile.oldVelocity.Y * (30f / (float)num795); + int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 173, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.8f); + Main.dust[num798].noGravity = true; + Dust dust = Main.dust[num798]; + dust.velocity *= 0.5f; + num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 173, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.4f); + dust = Main.dust[num798]; + dust.velocity *= 0.05f; + num3 = num795; + } + } + } } diff --git a/Projectiles/Melee/EssenceBeam.png b/Projectiles/Melee/EssenceBeam.png index 15e877573779272f931ab67d818cf9f2b8911a17..8fa56cb0dfed5c1d58eb7ab19b899e526e950fb8 100644 GIT binary patch literal 1816 zcmX9x3w>{J!(+k8|G7`JD54p7(v9=bV#fV`U~HbV>*S01+nJdF6o%{)0Pv5RW3Jdokk(2p19Kft#+8m){a*cG%@<(-8$P*f zCn%|>BP!YC-cM^qDl6AzA`f|E5)gH%%BJ4}a1HLB3PkCNzfE~^Xwzou{U(#&wS-a3 zyLT5u7TAni?6Rv-1|%Q7uRCE_25OOvU&pKH$LwDK7Kch-yktC`D~?OXpQ-0C1E(VpLzq3e3hrx=dtSt7*Fh-0IGbbJ2Z}b zET?QMQ9r~zd`SU#b{jH%i3Dp;kBD_5L_S>jrUXn?IPpjiz_o|! zd|JS4DaeY%R?m z9DSiBZD-CWM&A;R%jFx&B;@k-3EP^DNh{J(D?KMJO?oDJW35iT2?X2~Lyt6So20W1 zE3%K8?+L`U%x2}VkfVC5YKKkuDNyb%hUkpV6plB@k5>Pu3tVhnGH`Nf=LzHE_coy~ zbK@!OAJLtQ|dRYJkfAac%@psaz*$Nc2Zws`@ssJ;jrv;uz|;a>@bqqx0-R& zivqsyGGDMGoUcDOh#8=f)Hl}O*;#e0$Sj=b7q&GWgDcX>JUJ^{S>Vlz9yL5_y~xKrAzEI^AsXN1xhJcZ`wKtndD7pVad{~a>Ktq~zLCRfEbn?FBW28i zy_Q?^NLEGnAR1M&=3U>~tjRhaFbyn&&3v)7#%WBI6zAppJ_a!O4?|}pI=75X;O~a! zS?nvZ&gG0(Z{zsLI#tjtqD<3!dG2-C_JZ1E*;lJ1Hc))?3{5K7P{C3}G*fn@=1`O_ zdh3Z^#Z2x6o2=m=J>AvmB%?1lK57e5h#VwFf$)+jJ^854vMbKkor9p?%NT@)_0QEk zzolUj+H)URk0Hw?T|usnXI$!&H#>4tojPzypZLum`nUgtMpeYC_1y{JZ76Z-mTz;J zN~xM`-cbP$pAz07%Mw1a>m=?AgEyNf!bAKRJ?%7WX}lsHcR0~(rIdbSkVbzQRq7Dp zI!Frpf0?3)wt|-MzO|hj>RrLOCZX&_q*thNXgm|PMjT1EdgBT9tR6A?EZ^aGT;%JO zV>v$EvIuL%=W2dypeDFr^uR0E9ZK6gOU>`^Xs-{P%ROR@i7LYB&M>eIb)5(i`!Z^6 zvE+3X&9Dc>3V8c%8QJ%GpmDX~yyx941ska;b&m%O(YUI1doEtHYIaWYy`guMiO!ni zOBjjep`9dajXO(n7C?Hdx_G5xpvkpxia+Q?8gWsy^OjFr*wqB4#J}V{CjM7e4L#** z-D_9aGjQ88OXEMe8Ie)9l6&o|sc@0@aLVT&7v9T&+^4UdfT7suJ7S)H>g3}j>mt#< z9b;{^_b}?*oVyTB#ZPN(`16YqRp=9+t}~#e#I^T7L2K?CXTV@GY#hV7P9<;`U z72z9&TY;t#c3?Y4?xN|Lc{f2PdL|dbOSoC4iy%=38K7g#bO-4;Igp^`PHItO7g+4e z+o?qx5!@GVlu*eTfl{y2f1bb?CL>Yvq}-xL18z_9(Jn=>AI3qbauj!|HAo+h2LZv5 z1O`%3*>O;9eH2;>EG_$BjuUCES_Jp!avt$yuHN0tyF6eCeszHPZ&nzJiF?BT0C|#U AXaE2J literal 135 zcmeAS@N?(olHy`uVBq!ia0vp^EFjFm1|(O0oL2{=*pj^6T^Rm@;DWu&Cj&(|3p^r= z85sBugD~Uq{1qucLG}_)Usv`AZ0utE^0#a@0p%D(JY5_^IIbuE`TyUZ*(f2&fw_g1 Y;aDFttLt^E7eILiPgg&ebxsLQ0Jwf72LJ#7 diff --git a/Projectiles/Melee/GreenBall.cs b/Projectiles/Melee/GreenBall.cs index 57c261d14b..778c0175ee 100644 --- a/Projectiles/Melee/GreenBall.cs +++ b/Projectiles/Melee/GreenBall.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - DisplayName.SetDefault("Ball"); + DisplayName.SetDefault("Green Bag"); } public override void SetDefaults() @@ -21,6 +21,7 @@ namespace CalamityMod.Projectiles.Melee projectile.friendly = true; projectile.melee = true; projectile.penetrate = 2; + projectile.alpha = 255; projectile.aiStyle = 14; projectile.timeLeft = 300; } @@ -28,16 +29,13 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.05f / 255f, (255 - projectile.alpha) * 0.45f / 255f, (255 - projectile.alpha) * 0.05f / 255f); - projectile.localAI[0] += 1f; - if (projectile.localAI[0] > 4f) - { - for (int num468 = 0; num468 < 5; num468++) - { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, default, 1.5f); - Main.dust[num469].noGravity = true; - Main.dust[num469].velocity *= 0f; - } - } + if (projectile.alpha > 0) + { + projectile.alpha -= 25; + if (projectile.alpha > 0) + projectile.alpha = 0; + } + projectile.rotation = projectile.velocity.X * 0.04f; projTime--; if (projTime == 0) { @@ -49,7 +47,18 @@ namespace CalamityMod.Projectiles.Melee } } - public override bool OnTileCollide(Vector2 oldVelocity) + public override Color? GetAlpha(Color lightColor) + { + if (projectile.timeLeft < 85) + { + byte b2 = (byte)(projectile.timeLeft * 3); + byte a2 = (byte)(100f * ((float)b2 / 255f)); + return new Color((int)b2, (int)b2, (int)b2, (int)a2); + } + return new Color(255, 255, 255, 100); + } + + public override bool OnTileCollide(Vector2 oldVelocity) { projectile.penetrate--; if (projectile.penetrate <= 0) diff --git a/Projectiles/Melee/GreenBall.png b/Projectiles/Melee/GreenBall.png index 6ea4de390303173be2d92b5b3fb1ba302aa351bf..d2f546e3da6e067c03ab26ff669c99e8f9f67b46 100644 GIT binary patch delta 416 zcmV;R0bl-<0j&d&7k?HA1^@s6z(KqQ00001b5ch_0Itp)=>Px$XGugsR5*>bls!ws zP!xur8%rA~7SSTu(yAy3(ZRL&1G))LqJxWTSAT%BtE+>HQYaK$`~|wWxU^8Pv^rE2 z6k8Efsa}WVHp%sCFnOnYl9PL%yyx5_(3CC|)l&MOk6Pn;s(cGv?=SmmDFH@|fdKE%LMI&h;PVcEnK9?A_S1*-ldddG0C3iL0HAqv8`vv+4;5K5 zZvyagV@sC|fWx@$WL8=Ll;#}|Czlh!jZ$%Hu(>%L34> zTsZHo3;^=gj(>(wqzgp}u(i7cc-7OZsigW)_fSH#t(J^o4I6J~R!0H~Hb624YXsakgW@VWj7c=J)u55Es*w>JPtxYMQYP8TJe zz&8&8k2sk(qnS3td8kO04Dk*?x7L;XqF5>}00zA`=NY?@0r>=|v}kGyv^2H=0000< KMNUMnLSTab2D!HY delta 132 zcmZ3>JcV(Bc&!Kr8v_GFZ>KCTkYY>nc6VX;4}uH!E}sk(;VkfoEM{QfI}E~%$MaXD z00r4gJbhi+AFy)?Sc*NY7CQ?RQuK6j46!(!{OA9FduCHcVdkj^S2QkW>yxs`da$C= b`KSX!CO5Nc(+Z&kpkfA3S3j3^P6 145) + return false; + + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void Kill(int timeLeft) { - int randomDust = Main.rand.Next(2); - if (randomDust == 0) - { - randomDust = 33; - } - else - { - randomDust = 89; - } - for (int lol = 0; lol < 5; lol++) - { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDust, 0f, 0f, 100, default, 1.2f); - } - } + Main.PlaySound(SoundID.Item10, projectile.Center); + int num3; + for (int num795 = 4; num795 < 31; num795 = num3 + 1) + { + float num796 = projectile.oldVelocity.X * (30f / (float)num795); + float num797 = projectile.oldVelocity.Y * (30f / (float)num795); + int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 5, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.8f); + Main.dust[num798].noGravity = true; + Dust dust = Main.dust[num798]; + dust.velocity *= 0.5f; + num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 5, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.4f); + dust = Main.dust[num798]; + dust.velocity *= 0.05f; + num3 = num795; + } + } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { diff --git a/Projectiles/Melee/GreenWater.png b/Projectiles/Melee/GreenWater.png index 04c5646fded8c39b9fa4fb2cb4826b55a2aacdbb..09f523255face0e6262f1de314e6e48c1989c7b8 100644 GIT binary patch literal 724 zcmV;_0xSKAP)Px%j!8s8R9J=O*Gp>?Q5eSY|0xN@^g;t|FiE|%i6-E!3WY4)sJKy3)P*km04{Wq zMa8u)vMmUL;6fKF3a&)$2PjnWj!kXVs!gB?Rt%<;6vsvSnx2`CO_Q|F*k?6!<{akm z<9!b^ihq>ziGA9=ud@q)Vm@aq9&cK^E!7saRxhenY{#(^0KC0_7jS`~XSH7-a_!-6 z0Deq;H2{kF98eM4+rJHf=Ogd6_3KwqFu0-5j_KKu0j70KR84fC~g0R)eRydH@LYM1bYx%-x!um;s>hZ5Dv*WAA|VASiON z#BKmy4m~vhl6O+tygmDS0l1NRq>T@yt^p8;^(uhr^at&^;{|K(VzXR&_*GSMa{i@G zCIPG5?c7Ig{r@Let(;xtyz_Mg6u`u@G+>pJI9{;oF0NNj&OJHrTK(no&Q4C^enC&L z1%OgC1X$%n=4|p1VC`1Pa_6009548%i$%(uPQwd8UX=`hs~0Y5&+WeJBrEM&a~vS$S0g;P`w%o8--WTDU3;zIpHjfSpGV0JV3mIj$50;M|s&b}th0&meg*JOV&p zqF)=AuJvyUDu9_U*_t-!KEdtYRs}FPnKqyzdHD1}ZJx+UN};WQ^-EdgR$6-!=L^dD z7xlFPFjg!WQ0ZE8Z9Tm8Si28K{6MAV?s=vGI1=wu0N&9|T^n?~po&K}0x-THCp9N> zQfq^gX>Fmo%jJ3aSF-|`YMKLJKKrw-4LV=Y6Kv7sBxW&*)TY#)%!~Tk6u@|~0Msuh zagU%m;pPqHTAG`cA+5WmTUSd?;tIiP=W5c8?pC`vUhp^gBM292$0zFm0000<>&pIsosmIag3oHse4vnor;B5V#`)ww|Nq-FYc_N?x)`iV cT#~`S@HK*2wD-*0YM>ehPgg&ebxsLQ0I1_7Bme*a diff --git a/Projectiles/Melee/JudgementBlah.cs b/Projectiles/Melee/JudgementBlah.cs index 604dd157d7..7c98624ea6 100644 --- a/Projectiles/Melee/JudgementBlah.cs +++ b/Projectiles/Melee/JudgementBlah.cs @@ -1,7 +1,10 @@ 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 JudgementBlah : ModProjectile @@ -10,24 +13,52 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - DisplayName.SetDefault("Judgement"); - } + DisplayName.SetDefault("Blah Beam"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } public override void SetDefaults() { - projectile.width = 12; - projectile.height = 12; + projectile.width = 20; + projectile.height = 20; projectile.extraUpdates = 3; projectile.friendly = true; projectile.ignoreWater = true; - projectile.penetrate = -1; - projectile.timeLeft = 60; + projectile.penetrate = 1; + projectile.timeLeft = 120; projectile.melee = true; } public override void AI() { - Lighting.AddLight((int)projectile.Center.X / 16, (int)projectile.Center.Y / 16, (float)Main.DiscoR / 200f, (float)Main.DiscoG / 200f, (float)Main.DiscoB / 200f); + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f; + if (projectile.ai[1] == 0f) + { + projectile.ai[1] = 1f; + Main.PlaySound(SoundID.Item60, projectile.position); + } + if (projectile.localAI[0] == 0f) + { + projectile.scale -= 0.02f; + projectile.alpha += 30; + if (projectile.alpha >= 250) + { + projectile.alpha = 255; + projectile.localAI[0] = 1f; + } + } + else if (projectile.localAI[0] == 1f) + { + projectile.scale += 0.02f; + projectile.alpha -= 30; + if (projectile.alpha <= 0) + { + projectile.alpha = 0; + projectile.localAI[0] = 0f; + } + } + Lighting.AddLight((int)projectile.Center.X / 16, (int)projectile.Center.Y / 16, (float)Main.DiscoR / 200f, (float)Main.DiscoG / 200f, (float)Main.DiscoB / 200f); whiteLightTimer--; if (whiteLightTimer == 0) { @@ -51,13 +82,10 @@ namespace CalamityMod.Projectiles.Melee } whiteLightTimer = 5; } - for (int num457 = 0; num457 < 2; num457++) - { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f); - Main.dust[num458].noGravity = true; - Main.dust[num458].velocity *= 0.5f; - Main.dust[num458].velocity += projectile.velocity * 0.1f; - } + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 0.6f); + Main.dust[num458].noGravity = true; + Main.dust[num458].velocity *= 0.5f; + Main.dust[num458].velocity += projectile.velocity * 0.1f; float num472 = projectile.Center.X; float num473 = projectile.Center.Y; float num474 = 400f; @@ -93,10 +121,38 @@ namespace CalamityMod.Projectiles.Melee } } - public override void Kill(int timeLeft) + public override Color? GetAlpha(Color lightColor) + { + return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, projectile.alpha); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (projectile.timeLeft > 115) + return false; + + 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, 122); - if (projectile.owner == Main.myPlayer) + Main.PlaySound(SoundID.Item122, projectile.Center); + for (int num193 = 0; num193 < 2; num193++) + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.5f); + Main.dust[dust].noGravity = true; + } + for (int num194 = 0; num194 < 20; num194++) + { + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 2.5f); + Main.dust[num195].noGravity = true; + Main.dust[num195].velocity *= 3f; + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.5f); + Main.dust[num195].velocity *= 2f; + Main.dust[num195].noGravity = true; + } + if (projectile.owner == Main.myPlayer) { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y - 100, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Melee/JudgementBlah.png b/Projectiles/Melee/JudgementBlah.png index e6c2d4b44a07eb42a6dbffb67e7305e89c18f367..615ff62268b03420f0897bd4df7e22217589ea52 100644 GIT binary patch literal 861 zcmV-j1ETziP)Px&7fD1xRA_bC#UsVP?+E(ecMQK0XFuYikRDmzS66 zqV>7;Zz)~4q&M(WWOjFV7l4O{hbcg_*$l0#*XsauyImlIhVw~p;JZYbJwHDO;O_1Y z2+UqxT>&r}jR0>rz5LXyC3A*TpQXQQ_U!BofKI0aK($&0;PUbkfKsXCz#C2v%ghSJ zY?Rq@x$FRj!y(`eCr_i%0O0882!P>m_^DZ;Y`o0u_4PI24JU`p?(gpd(C_!B0IgQ* z)Ah>EVwqXt4aZGfW`#E#7jc^v-tf9vX4ZB+t1>IR;dLRi<#HJaPEc`~72fcwi86b7 zdKy}{ZnMH0UKMFGE4*QgOj$NIHUKCVi=pS^@fd*3%}rq5?EU>c04FCW!1w#v-;z1Q zv$=GX$x5XHz+f;4-OA;1Iej}q&-eEB9Kg-ZO{&b!_Px?i`vZJ-^AIvN7z}{mMAUA# z0Vos-p>>)$b-Ue#W_63FTfVr=3U64*kPN6^3K^Agv9q%S1ZEYZNt+eku#i!i(n-ip zB(}G=L+fq!)%!A^lv$BI!>YeJG3lfvWJ>0gZDm~MgsrpU`S}@ugM$MH@bvTq#AjAy z&#-fuA#bP28)9e}+GHL1cdO%QrZCzH(>Zf8> z|2?B@o;2RDP`y-4+iWb87Z(?yzx54KwiY^Ry}!RZfXQU?%dP(mZ&+q6ib-MXvCP`o zwr6dEZp>%tIB<5-kN2YsWPjjnL$x zR;xLHx3{+`1SW59Z-F3di>SIS(|S)-DisI8B*hzEGc&_>!eL`}GMP9CVp>GqBnZXs zhwPt7?2618p4DN+oSjZ8rXL?4LoZshdOxa;r-jTJo{M2SZM3n6nOj@b=i14M#m8_= n%+=vVYrpfsNf}&5<_!M>%&+dtU{?i=00000NkvXXu0mjfiGH0b literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&kwj^(N7l!{JxM1({$v_d#0*}aI z1_r((Aj~*bn@<`j$X?><>&pIslS|Z6VY=1-dq5%C%#er@=ltB<)VvZPmw~~#C^fMp zHASI3vm`^o-P1Q9MK6^dC@$gY;uxZFKKal8|Mtw94V{fH2CEX6WH2y%jbIk-J@d92 Oq}kKe&t;ucLK6UDATj9x diff --git a/Projectiles/Melee/OceanBeam.cs b/Projectiles/Melee/OceanBeam.cs index 74fa8946e2..8b159385ef 100644 --- a/Projectiles/Melee/OceanBeam.cs +++ b/Projectiles/Melee/OceanBeam.cs @@ -1,67 +1,63 @@ -using Microsoft.Xna.Framework; +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Melee { public class OceanBeam : ModProjectile { public override void SetStaticDefaults() { - DisplayName.SetDefault("Beam"); - } + DisplayName.SetDefault("Spear"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } public override void SetDefaults() { - projectile.width = 8; - projectile.height = 8; + projectile.width = 14; + projectile.height = 14; projectile.friendly = true; - projectile.alpha = 255; projectile.extraUpdates = 2; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 8; projectile.penetrate = 3; - projectile.timeLeft /= 2; + projectile.timeLeft = 600; projectile.melee = true; projectile.tileCollide = false; } public override void AI() { - for (int num92 = 0; num92 < 2; num92++) - { - float num93 = projectile.velocity.X / 3f * (float)num92; - float num94 = projectile.velocity.Y / 3f * (float)num92; - int num95 = 4; - int num96 = Dust.NewDust(new Vector2(projectile.position.X + (float)num95, projectile.position.Y + (float)num95), projectile.width - num95 * 2, projectile.height - num95 * 2, 56, 0f, 0f, 100, default, 1.2f); - Main.dust[num96].noGravity = true; - Main.dust[num96].velocity *= 0.25f; - Main.dust[num96].velocity += projectile.velocity * 0.1f; - Dust expr_47FA_cp_0 = Main.dust[num96]; - expr_47FA_cp_0.position.X -= num93; - Dust expr_4815_cp_0 = Main.dust[num96]; - expr_4815_cp_0.position.Y -= num94; - } - 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, 245, 0f, 0f, 100, default, 1.2f); - Main.dust[num102].noGravity = true; - Main.dust[num102].velocity *= 0.1f; - Main.dust[num102].velocity += projectile.velocity * 0.25f; - 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; - } + projectile.frameCounter++; + if (projectile.frameCounter > 24) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } - projectile.ai[1] += 1f; + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); + + projectile.ai[1] += 1f; if (projectile.ai[1] >= 60f) projectile.tileCollide = true; } - public override bool OnTileCollide(Vector2 oldVelocity) + 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) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -70,7 +66,6 @@ namespace CalamityMod.Projectiles.Melee } else { - projectile.ai[0] += 0.1f; if (projectile.velocity.X != oldVelocity.X) { projectile.velocity.X = -oldVelocity.X; @@ -86,7 +81,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); for (int k = 0; k < 3; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 56, projectile.oldVelocity.X * 0.25f, projectile.oldVelocity.Y * 0.25f); diff --git a/Projectiles/Melee/OceanBeam.png b/Projectiles/Melee/OceanBeam.png index 0056fc1e2479e11bd6391fc4ccd1fe54fa0d671f..5e9263f98af03bc46bd29a671bb754227621c9c6 100644 GIT binary patch literal 547 zcmV+;0^I$HP)Px#Ay7omNhx6f001h$rt$y)01I?d zPE!E?|NsC0|NsC0|9y6S)c^ninMp)JR9J=Wn8B8VAPhwnP}~3i;W15PLP(JkoSB7h zrB?1iBlm<(lbQLI@|u137=ZkFJ_2W94_%9U#sk7Ta6=H`^OX2%jLV)F>D&(pVLgJ= zOz+@?=XqVX?eW;M#8&`30+3HyJ_aHnfKNx()p!Hl0IQg?p!gW@BIVGN&&dJ6A^MZW z;W)T5bP%8n7W(<@8axPa`rC~%ZH(E;Fz%cC<|vPt@yOu09$7~yg_Mh zfSuck|07>@h)#gjUeeNPf_4Ey7A-eyF7)yiN^=8bn}^bnt)5gGwU{ioqEGAuXr1Y1 zPbv)`gnvKYfCE59$z_JeT)fjZZva4lLUMD_pfoq2mfMMcnd(0EB0%2m;lf!K{Q~J1 z!-<^$dl}O)C`4|33#GXMdh451aKd`)`@xBw02!Ki`A0z0-nk2)3&_o$taFpn9Dw|0 lZ1&3G6{WcW_1sRpJU>!X8aaa2BE0|r002ovPDHLkV1l#M_r?GK literal 136 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqY)RhkE)4%caKYZ?lYt_f1s;*b z3=DjSL74G){)!Z!AbW|YuPgflb|yv^-kZzH%z;9po-U3d5|@+z{QqyyY 4f) - { - for (int num468 = 0; num468 < 5; num468++) - { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 90, 0f, 0f, 100, default, 1.5f); - Main.dust[num469].noGravity = true; - Main.dust[num469].velocity *= 0f; - } - } - projTime--; + if (projectile.alpha > 0) + { + projectile.alpha -= 25; + if (projectile.alpha > 0) + projectile.alpha = 0; + } + projectile.rotation = projectile.velocity.X * 0.04f; + projTime--; if (projTime == 0) { if (projectile.owner == Main.myPlayer) @@ -49,7 +47,18 @@ namespace CalamityMod.Projectiles.Melee } } - public override bool OnTileCollide(Vector2 oldVelocity) + public override Color? GetAlpha(Color lightColor) + { + if (projectile.timeLeft < 85) + { + byte b2 = (byte)(projectile.timeLeft * 3); + byte a2 = (byte)(100f * ((float)b2 / 255f)); + return new Color((int)b2, (int)b2, (int)b2, (int)a2); + } + return new Color(255, 255, 255, 100); + } + + public override bool OnTileCollide(Vector2 oldVelocity) { projectile.penetrate--; if (projectile.penetrate <= 0) diff --git a/Projectiles/Melee/RedBall.png b/Projectiles/Melee/RedBall.png index 6ea4de390303173be2d92b5b3fb1ba302aa351bf..88df2e1c31a1509ede21585cbb5b27805a53d7b7 100644 GIT binary patch delta 389 zcmV;00eb$F0h0re7k?HA1^@s6z(KqQ00001b5ch_0Itp)=>Px$O-V#SR5*>bls!uW zK@>&LMk9h^RxK=q$To@y8nh6!)+U{{R{9&Zu(1%k{02MQlvcq~3qjc?MQox0%VM77!%<<} zsPF21IVu2eOq0r&IVT+Yknj$G$-E}(HhL;aINK(BFwRhV~vjAMzng($fm7a$RAUs?J z;`Hn^ZDR3IBz|7HpA>sW7s3MoI#;*flJ4xU7`3hRXZfjgVUUUJ`X{+3oSUEW04n9G zg0Ja`D&;BwQF{Qy`_b-q{~w;_w*Z))(2M8wO&POn6D0N_5EBP}CZ$P{gOCpOnSazA jD1MP_nO0x7IVb!8B5h=G2OKt_00000NkvXXu0mjf8g;IR delta 132 zcmbQtJcV(Bc&!Kr8v_GFZ>KCTkYY>nc6VX;4}uH!E}sk(;VkfoEM{QfI}E~%$MaXD z00r4gJbhi+AFy)?Sc*NY7CQ?RQuK6j46!(!{OA9FduCHcVdkj^S2QkW>yxs`da$C= b`KSX!CO5Nc(+Z&kpkfA3S3j3^P6