From 3f6cc6a1fe66abebd4fedf86dbb254bdf8f1660a Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 4 Jul 2020 18:00:41 -0400 Subject: [PATCH 1/2] plantation thorn ball sprite --- Projectiles/Summon/PlantThornBall.cs | 1 - Projectiles/Summon/PlantThornBall.png | Bin 387 -> 561 bytes 2 files changed, 1 deletion(-) 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 2b5de4b6aebd7b1abe27499dda00506422c6ed9c..b2ea5197ee108705392402d7e7a9b8e4e4b01e7b 100644 GIT binary patch literal 561 zcmV-10?z%3P)Px$>q$gGR7i=<)<0`gQ5eVZ&n+UMU?{QJR*0BEsE95W5xclMI5;?Ea?uyy;45$_ zz5&6>Q96ikz$H?|E``vdgMkhjiKRr4;NW$*KKa+AO+?83F3COTo^#Ld{GR7LCov_r zFWm*r&X*LH3M&b`{q%aOdFH15@c-ge{JDSi(L@8zEoQ$ue-p?+o!{f^G8L-v(IN)*Q zX()^69j7$ti)!>djx&Gud3?Eiq@Jd5Z6WhKqBV$o4Wd8)c|6?ES5MK4@+U7c1;fgN zP#RUOTH78uUyv)0Q%48; literal 387 zcmV-}0et?6P)J0=pM~8OjoMjgvU#r zx8V*9K%4ni7NyRMUWj`zPQ(GYg!|=Dq?MH8q%OoS7zff4#)4^n zUpI++Fb=qw^dgi3HvC{uM>7#@tJJ>_#()fP8m~kEgnj9EA`N)31K1rHZ(bw>!2NK2 z69CzdOPhSKx&_nPn@a%z4a@@MxF)DOFa|+jv^TdoZ+Z<#YXXjoc^}7!Td>qpBB2F@ z1r*z3#lb94PQV}*P_}c-4Vd*wg3SP0>56?TtASb99t)t_eXKfIyYsjI%3NUW?IQQ< h(Eq-VwKrH}JOLIs<(t@4<6i&(002ovPDHLkV1kJ)q7DE6 From 5d0ac7c7e96e2b4eb68e796f95ab082a729bcfc7 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 4 Jul 2020 18:10:54 -0400 Subject: [PATCH 2/2] deathhail lasers and knife typo fix --- CalPlayer/CalamityPlayerMiscEffects.cs | 2 +- Items/Weapons/Magic/DeathhailStaff.cs | 4 +- Items/Weapons/Typeless/YanmeisKnife.cs | 2 +- Projectiles/Magic/MagicNebulaShot.cs | 104 ++++++++++++------------- 4 files changed, 55 insertions(+), 57 deletions(-) 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); + } + } }