diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index b142dd257b..c7a70f66e4 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3669,7 +3669,7 @@ namespace CalamityMod.CalPlayer velocity.Y *= travelDist; velocity.X += Main.rand.Next(-50, 51) * 0.02f; velocity.Y += Main.rand.Next(-50, 51) * 0.02f; - int laser = Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), dmg, 4f, player.whoAmI, 0f, Main.rand.Next(10)); + int laser = Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), dmg, 4f, player.whoAmI, 0f, 0f); Main.projectile[laser].localNPCHitCooldown = 5; } Main.PlaySound(SoundID.Item12, player.position); diff --git a/Items/Weapons/Magic/DeathhailStaff.cs b/Items/Weapons/Magic/DeathhailStaff.cs index f65ded93fc..f0fca04e3a 100644 --- a/Items/Weapons/Magic/DeathhailStaff.cs +++ b/Items/Weapons/Magic/DeathhailStaff.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Magic { DisplayName.SetDefault("Deathhail Staff"); Tooltip.SetDefault("Rain death upon your foes!\n" + - "Casts a storm of nebula shots from the sky"); + "Casts a storm of nebula lasers from the sky"); Item.staff[item.type] = true; } @@ -101,7 +101,7 @@ namespace CalamityMod.Items.Weapons.Magic num79 *= num80; float speedX4 = num78 + (float)Main.rand.Next(-50, 51) * 0.02f; float speedY5 = num79 + (float)Main.rand.Next(-50, 51) * 0.02f; - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, num73, num74, i, 0f, (float)Main.rand.Next(10)); + Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, num73, num74, i, 0f, 0f); } return false; } diff --git a/Items/Weapons/Typeless/YanmeisKnife.cs b/Items/Weapons/Typeless/YanmeisKnife.cs index fabdacfe67..162fd7a9ad 100644 --- a/Items/Weapons/Typeless/YanmeisKnife.cs +++ b/Items/Weapons/Typeless/YanmeisKnife.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Typeless DisplayName.SetDefault("Yanmei's Knife"); Tooltip.SetDefault("When hitting a boss or its minions, you gain various boosts and cripple the enemy hit\n" + "A knife from an unknown world\n" + - "An owner who's heart is pure and free of taint\n" + + "An owner whose heart is pure and free of taint\n" + "A heart of iron and valor"); } diff --git a/Projectiles/Magic/MagicNebulaShot.cs b/Projectiles/Magic/MagicNebulaShot.cs index 43293cf1d2..1c8431dcac 100644 --- a/Projectiles/Magic/MagicNebulaShot.cs +++ b/Projectiles/Magic/MagicNebulaShot.cs @@ -1,64 +1,62 @@ +using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class MagicNebulaShot : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shot"); - } + public class MagicNebulaShot : BaseLaserbeamProjectile + { + private Color startingColor = new Color(119, 210, 255); + private Color secondColor = new Color(247, 119, 255); + public override float MaxScale => 0.7f; + public override float MaxLaserLength => 1599.999999f; + public override float Lifetime => 20f; + public override Color LaserOverlayColor => CalamityUtils.ColorSwap(startingColor, secondColor, 0.9f); + public override Color LightCastColor => LaserOverlayColor; + public override Texture2D LaserBeginTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UltimaRayStart"); + public override Texture2D LaserMiddleTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UltimaRayMid"); + public override Texture2D LaserEndTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UltimaRayEnd"); - public override void SetDefaults() - { - projectile.width = 4; - projectile.height = 4; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.magic = true; - projectile.tileCollide = false; - projectile.alpha = 255; - projectile.penetrate = -1; - projectile.extraUpdates = 5; - projectile.timeLeft = 200; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 2; - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nebula Shot"); + } - public override void AI() - { - if (projectile.ai[1] == 0f) - { - projectile.ai[1] = 1f; - Main.PlaySound(SoundID.Item12, projectile.position); - } - if (projectile.alpha > 0) - { - projectile.alpha -= 15; - } - if (projectile.alpha < 0) - { - projectile.alpha = 0; - } - Lighting.AddLight(projectile.Center, 0.4f, 0.2f, 0.4f); - for (int num121 = 0; num121 < 5; num121++) - { - Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, Main.rand.NextBool(3) ? 56 : 242, projectile.velocity.X, projectile.velocity.Y, 100, default, 1f)]; - dust4.velocity = Vector2.Zero; - dust4.position -= projectile.velocity / 5f * (float)num121; - dust4.noGravity = true; - dust4.scale = 0.8f; - dust4.noLight = true; - } - } + public override void SetDefaults() + { + projectile.width = projectile.height = 22; + projectile.friendly = true; + projectile.magic = true; + projectile.penetrate = -1; + projectile.alpha = 255; + projectile.localNPCHitCooldown = 2; + projectile.usesLocalNPCImmunity = true; + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.OnFire, 600); - target.AddBuff(BuffID.Frostburn, 600); - } - } + public override bool PreAI() + { + // Initialization. Using the AI hook would override the base laser's code, and we don't want that. + if (projectile.localAI[0] == 0f) + { + if (Main.rand.NextBool()) + { + secondColor = new Color(119, 210, 255); + startingColor = new Color(247, 119, 255); + } + } + return true; + } + + public override bool ShouldUpdatePosition() => false; + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.OnFire, 600); + target.AddBuff(BuffID.Frostburn, 600); + } + } } diff --git a/Projectiles/Summon/PlantThornBall.cs b/Projectiles/Summon/PlantThornBall.cs index be0abf75a2..07f4c8293b 100644 --- a/Projectiles/Summon/PlantThornBall.cs +++ b/Projectiles/Summon/PlantThornBall.cs @@ -17,7 +17,6 @@ namespace CalamityMod.Projectiles.Summon { projectile.width = 30; projectile.height = 30; - projectile.scale = 0.75f; projectile.friendly = true; projectile.penetrate = 3; projectile.timeLeft = 300; diff --git a/Projectiles/Summon/PlantThornBall.png b/Projectiles/Summon/PlantThornBall.png index 2b5de4b6ae..b2ea5197ee 100644 Binary files a/Projectiles/Summon/PlantThornBall.png and b/Projectiles/Summon/PlantThornBall.png differ