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 a3192f9461..2b703b8d20 100644 Binary files a/Projectiles/Melee/Brimlash2.png and b/Projectiles/Melee/Brimlash2.png differ 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 04c5646fde..2b703b8d20 100644 Binary files a/Projectiles/Melee/BrimlashProj.png and b/Projectiles/Melee/BrimlashProj.png differ 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 15e8775737..8fa56cb0df 100644 Binary files a/Projectiles/Melee/EssenceBeam.png and b/Projectiles/Melee/EssenceBeam.png differ 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 6ea4de3903..d2f546e3da 100644 Binary files a/Projectiles/Melee/GreenBall.png and b/Projectiles/Melee/GreenBall.png differ diff --git a/Projectiles/Melee/GreenWater.cs b/Projectiles/Melee/GreenWater.cs index f25e32cfad..aa89cb719b 100644 --- a/Projectiles/Melee/GreenWater.cs +++ b/Projectiles/Melee/GreenWater.cs @@ -1,4 +1,6 @@ -using Microsoft.Xna.Framework; +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -9,13 +11,15 @@ namespace CalamityMod.Projectiles.Melee { public override void SetStaticDefaults() { - DisplayName.SetDefault("Water"); - } + DisplayName.SetDefault("Tooth"); + 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.friendly = true; projectile.ignoreWater = true; projectile.tileCollide = false; @@ -24,48 +28,48 @@ namespace CalamityMod.Projectiles.Melee projectile.melee = true; } - public override void AI() - { - Lighting.AddLight(projectile.Center, 0f, 0.25f, 0.5f); - if (projectile.localAI[0] == 0f) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 21); - projectile.localAI[0] += 1f; - } - int randomDust = Main.rand.Next(2); - if (randomDust == 0) - { - randomDust = 33; - } - else - { - randomDust = 89; - } - for (int num457 = 0; num457 < 5; num457++) - { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDust, 0f, 0f, 100, default, 1.2f); - Main.dust[num458].noGravity = true; - Main.dust[num458].velocity *= 0.5f; - Main.dust[num458].velocity += projectile.velocity * 0.1f; - } - } + public override void AI() + { + Lighting.AddLight(projectile.Center, 0f, 0.25f, 0.5f); + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f; + if (projectile.localAI[0] == 0f) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 21); + projectile.localAI[0] += 1f; + } + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 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 bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (projectile.timeLeft > 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 04c5646fde..09f523255f 100644 Binary files a/Projectiles/Melee/GreenWater.png and b/Projectiles/Melee/GreenWater.png differ 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 e6c2d4b44a..615ff62268 100644 Binary files a/Projectiles/Melee/JudgementBlah.png and b/Projectiles/Melee/JudgementBlah.png differ 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 0056fc1e24..5e9263f98a 100644 Binary files a/Projectiles/Melee/OceanBeam.png and b/Projectiles/Melee/OceanBeam.png differ diff --git a/Projectiles/Melee/RedBall.cs b/Projectiles/Melee/RedBall.cs index 2c21d3f2df..230af335f0 100644 --- a/Projectiles/Melee/RedBall.cs +++ b/Projectiles/Melee/RedBall.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - DisplayName.SetDefault("Ball"); + DisplayName.SetDefault("Red Bag"); } public override void SetDefaults() @@ -20,7 +20,8 @@ namespace CalamityMod.Projectiles.Melee projectile.height = 20; projectile.friendly = true; projectile.melee = true; - projectile.penetrate = 2; + projectile.alpha = 255; + projectile.penetrate = 2; projectile.aiStyle = 14; projectile.timeLeft = 300; } @@ -28,17 +29,14 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.45f / 255f, (255 - projectile.alpha) * 0.05f / 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, 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 6ea4de3903..88df2e1c31 100644 Binary files a/Projectiles/Melee/RedBall.png and b/Projectiles/Melee/RedBall.png differ