From 6855fd3ed8f048a565aba11bc61c588b4f00c98d Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Wed, 24 Apr 2024 15:05:03 -0400 Subject: [PATCH] Start of Elemental Saw --- CalPlayer/CalamityPlayer.cs | 2 +- Cooldowns/ElementalSawBoost.cs | 18 ++ Cooldowns/ElementalSawBoost.png | Bin 0 -> 443 bytes Cooldowns/ElementalSawBoostOutline.png | Bin 0 -> 213 bytes Cooldowns/ElementalSawBoostOverlay.png | Bin 0 -> 175 bytes Items/Weapons/Ranged/Buzzkill.cs | 3 +- Items/Weapons/Ranged/ElementalBlaster.cs | 53 ----- Items/Weapons/Ranged/ElementalBlaster.png | Bin 2006 -> 0 bytes Items/Weapons/Ranged/ElementalSaw.cs | 114 ++++++++++ Items/Weapons/Ranged/ElementalSaw.png | Bin 0 -> 2595 bytes ...ods.CalamityMod.Items.Weapons.Ranged.hjson | 14 +- .../Mods.CalamityMod.Projectiles.Ranged.hjson | 2 +- Localization/en-US/Mods.CalamityMod.UI.hjson | 1 + Projectiles/Ranged/BuzzkillHoldout.cs | 6 +- Projectiles/Ranged/ElementalSawHoldout.cs | 198 ++++++++++++++++++ Projectiles/Ranged/ElementalSawHoldout.png | Bin 0 -> 4177 bytes Projectiles/Ranged/ElementalSawLargeSlash.png | Bin 0 -> 1882 bytes Projectiles/Ranged/ElementalSawProj.cs | 159 ++++++++++++++ Projectiles/Ranged/ElementalSawProj.png | Bin 0 -> 1452 bytes Projectiles/Ranged/ElementalSawSmallSlash.png | Bin 0 -> 1050 bytes Projectiles/Ranged/RainbowBlast.cs | 64 ------ Projectiles/Ranged/RainbowBlast.png | Bin 174 -> 0 bytes 22 files changed, 506 insertions(+), 128 deletions(-) create mode 100644 Cooldowns/ElementalSawBoost.cs create mode 100644 Cooldowns/ElementalSawBoost.png create mode 100644 Cooldowns/ElementalSawBoostOutline.png create mode 100644 Cooldowns/ElementalSawBoostOverlay.png delete mode 100644 Items/Weapons/Ranged/ElementalBlaster.cs delete mode 100644 Items/Weapons/Ranged/ElementalBlaster.png create mode 100644 Items/Weapons/Ranged/ElementalSaw.cs create mode 100644 Items/Weapons/Ranged/ElementalSaw.png create mode 100644 Projectiles/Ranged/ElementalSawHoldout.cs create mode 100644 Projectiles/Ranged/ElementalSawHoldout.png create mode 100644 Projectiles/Ranged/ElementalSawLargeSlash.png create mode 100644 Projectiles/Ranged/ElementalSawProj.cs create mode 100644 Projectiles/Ranged/ElementalSawProj.png create mode 100644 Projectiles/Ranged/ElementalSawSmallSlash.png delete mode 100644 Projectiles/Ranged/RainbowBlast.cs delete mode 100644 Projectiles/Ranged/RainbowBlast.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index a9e5f4b528..c7e62c3dbf 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -3044,7 +3044,7 @@ namespace CalamityMod.CalPlayer //Right click dash on Speed Blaster if (sBlasterDashActivated == true) { - if ((Player.controlUp || Player.controlDown || Player.controlLeft || Player.controlRight) && !Player.pulley && Player.grappling[0] == -1 && !Player.tongued && !Player.mount.Active && Player.HasCooldown(Cooldowns.SpeedBlasterBoost.ID) && Player.dashDelay == 0) + if ((Player.controlUp || Player.controlDown || Player.controlLeft || Player.controlRight) && !Player.pulley && Player.grappling[0] == -1 && !Player.tongued && !Player.mount.Active && (Player.HasCooldown(SpeedBlasterBoost.ID) || Player.HasCooldown(ElementalSawBoost.ID)) && Player.dashDelay == 0) { SpeedBlasterDashStarted = true; } diff --git a/Cooldowns/ElementalSawBoost.cs b/Cooldowns/ElementalSawBoost.cs new file mode 100644 index 0000000000..98e9231279 --- /dev/null +++ b/Cooldowns/ElementalSawBoost.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.Localization; + +namespace CalamityMod.Cooldowns +{ + public class ElementalSawBoost : CooldownHandler + { + public static new string ID => "ElementalSawBoost"; + public override bool ShouldDisplay => true; + public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}"); + public override string Texture => "CalamityMod/Cooldowns/ElementalSawBoost"; + public override Color OutlineColor => new Color(207, 207, 207); + public override Color CooldownStartColor => new Color(122, 240, 58); + public override Color CooldownEndColor => new Color(32, 186, 171); + } +} diff --git a/Cooldowns/ElementalSawBoost.png b/Cooldowns/ElementalSawBoost.png new file mode 100644 index 0000000000000000000000000000000000000000..1cacbc5c4a1163c8b0dfce47ece899c8cd4ee219 GIT binary patch literal 443 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%Grio-U3d7XHasjJ(nr7=0HnPx$rA^5y>oHmL;jzb7~rEsdya{`tMXJ0bKq z%hHu>5}{Z39OMa;libj2YHZf<)4<^ET8W7@q;hF{Y&Jr@mwiG{H_m=%2(+h=1 zGR8BGJq?m5_`HQ3Xhvdheveo#@0TZ4BNz$?x^mt;$ z@>#fL;)OYuJvP>B%#>JhGn+YeA=Aov`~hOjy~&c#oFoE-1KTzQFzV>!um04Sd29Ct zD=mpL74^(PRW{m!44-{tZ4R1P{V=FiozZsmlYgYxhSN9X|1*Bh6lx1lWA5TkOg#LS ze`BzMv5e2*1Ht`I6K47P^Sn6}KRvGT=a*td9)Z_E3JY9yj13qV*!;5e*8ej|1qL%; fYJ_K+uP=iZkj(+aAaE&oGKlhY^>bP0l+XkK0rRE0 literal 0 HcmV?d00001 diff --git a/Cooldowns/ElementalSawBoostOutline.png b/Cooldowns/ElementalSawBoostOutline.png new file mode 100644 index 0000000000000000000000000000000000000000..245f680cb533cfc362f84fe449a111c000e6dc01 GIT binary patch literal 213 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjjKx9jP7LeL$-D$|N)O;`^^B#TGfW`|B=`7cQUFBWvcqxb~}r^>x0$HP?T< zTCW$)ZaT65;2MX6i~>aw47W6I1ppnumm1-j=IhI#1!QvoF$i1=o(!TqUHx3vIVCg! E03;eu2><{9 literal 0 HcmV?d00001 diff --git a/Cooldowns/ElementalSawBoostOverlay.png b/Cooldowns/ElementalSawBoostOverlay.png new file mode 100644 index 0000000000000000000000000000000000000000..da21d02b349ab032cd0b504d6ad21c0e08c882ab GIT binary patch literal 175 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~e@_?35R2aA z6bI)2K+vyu>;Mp)IB~+G$4V`yX$r%RwL5ZDL<8=(UMZ5)>0w{botR)UP1B$wY@^K& z-X#{(E_yFK`2OiZ@wS5IjH!H#b+c6jH?Fv-1vHv3HNrE^*Ovjr<^W<4xD-4YM0vXU KxvX "Items.Weapons.Ranged"; - - public override void SetStaticDefaults() - { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; - } - public override void SetDefaults() - { - Item.width = 104; - Item.height = 42; - Item.damage = 67; - Item.DamageType = DamageClass.Ranged; - Item.useTime = 2; - Item.useAnimation = 6; - Item.useStyle = ItemUseStyleID.Shoot; - Item.noMelee = true; - Item.knockBack = 1.75f; - Item.value = CalamityGlobalItem.RarityPurpleBuyPrice; - Item.rare = ItemRarityID.Purple; - Item.UseSound = CommonCalamitySounds.PlasmaBoltSound; - Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 18f; - } - - public override Vector2? HoldoutOffset() - { - return new Vector2(-15, 0); - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(). - AddIngredient(ItemID.LunarBar, 5). - AddIngredient(5). - AddIngredient(5). - AddTile(TileID.LunarCraftingStation). - Register(); - } - } -} diff --git a/Items/Weapons/Ranged/ElementalBlaster.png b/Items/Weapons/Ranged/ElementalBlaster.png deleted file mode 100644 index 3ce7de1a2cecd27c3e26f6a62712788ad4cf65e7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2006 zcmV;{2Pyc8P)=B2TNZCpe~vKp#RpeZJ1cbzN@`1ny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items/Weapons/Ranged/ElementalSaw.cs new file mode 100644 index 0000000000..c8149831ae --- /dev/null +++ b/Items/Weapons/Ranged/ElementalSaw.cs @@ -0,0 +1,114 @@ +using CalamityMod.Cooldowns; +using CalamityMod.Items.Materials; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Ranged; +using CalamityMod.Sounds; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Ranged +{ + [LegacyName("ElementalBlaster")] + public class ElementalSaw : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Weapons.Ranged"; + + public const float ShootSpeed = 18f; + + public const int DashCooldown = 360; + + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DashCooldown / 60); + + public override void SetStaticDefaults() + { + ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; + } + public override void SetDefaults() + { + Item.width = 104; + Item.height = 42; + Item.damage = 67; + Item.DamageType = DamageClass.Ranged; + Item.useTime = 30; + Item.useAnimation = 30; + Item.useStyle = ItemUseStyleID.Shoot; + Item.noMelee = true; + Item.noUseGraphic = true; + Item.channel = true; + Item.knockBack = 1.75f; + Item.value = CalamityGlobalItem.RarityPurpleBuyPrice; + Item.rare = ItemRarityID.Purple; + //Item.UseSound = CommonCalamitySounds.PlasmaBoltSound; + Item.autoReuse = true; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = ShootSpeed; + Item.Calamity().canFirePointBlankShots = true; + } + + // Terraria seems to really dislike high crit values in SetDefaults + public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 21; + public override bool AltFunctionUse(Player player) => true; + public override bool CanUseItem(Player player) + { + if (player.altFunctionUse == 2 && player.HasCooldown(Cooldowns.ElementalSawBoost.ID)) + return false; + else + return player.ownedProjectileCounts[Item.shoot] <= 0; + } + + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + // Right click dash + if (player.altFunctionUse == 2) + { + if (!player.HasCooldown(ElementalSawBoost.ID)) + { + player.AddCooldown(ElementalSawBoost.ID, DashCooldown); + player.Calamity().sBlasterDashActivated = true; + + // TODO - Lingering saw on right click, and empowering saws + + // If moving, make particle effects when the dash activates + if (player.velocity != Vector2.Zero) + { + int particleAmt = 7; + for (int c = 0; c < particleAmt; c++) + { + Color sparkColor = Color.Lerp(new Color(122, 240, 58), new Color(32, 186, 171), c / (particleAmt - 1)); + Particle spark = new CritSpark(player.Center, player.velocity.RotatedByRandom(MathHelper.ToRadians(13f)) * Main.rand.NextFloat(-2.1f, -4.5f), Color.White, sparkColor, 2f, 45, 2.25f, 2f); + GeneralParticleHandler.SpawnParticle(spark); + } + for (int e = 0; e < particleAmt; e++) + { + Color sparkColor2 = Color.Lerp(new Color(122, 240, 58), new Color(32, 186, 171), e / (particleAmt - 1)); + Particle spark2 = new NanoParticle(player.Center, player.velocity.RotatedByRandom(MathHelper.ToRadians(-MathHelper.PiOver4)) * Main.rand.NextFloat(0.25f, 0.5f), sparkColor2, 1.5f, 45, Main.rand.NextBool(3)); + GeneralParticleHandler.SpawnParticle(spark2); + } + } + } + } + else + { + // The holdout deals 2x base damage. + Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), (int)(damage * 2), knockback, player.whoAmI, 0f, 0f); + } + return false; + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(). + AddIngredient(). + AddIngredient(ItemID.LunarBar, 5). + AddIngredient(5). + AddIngredient(5). + AddTile(TileID.LunarCraftingStation). + Register(); + } + } +} diff --git a/Items/Weapons/Ranged/ElementalSaw.png b/Items/Weapons/Ranged/ElementalSaw.png new file mode 100644 index 0000000000000000000000000000000000000000..d95c1d0751e6ee65f91e3bc96241e5fd80ef4546 GIT binary patch literal 2595 zcmV+;3f%RHP)Px;-AP12RCt{2n{99v)fvZs8EN^! z5!>l>YO9Qlo#I%5@}*To9hosYQmlYNbsS#g)nI`Phzte^Au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nKjZ5w`1`w~psq_mz<* zBhdDCX{XIrZlJ{YL7PA`^mcVa1Q6USI5_YfRU6oIOQzD4HGA*!#@o z(^d)b`)zyW-P8P>J$4ToQzp-0rO|)JWUHQ#t+CswiBn|6TzElaiu0rK>BY_;5^NTCAV(u%O0q7kkvA^GxB3t>gG|4HH&k&+o z->nBAxlpo*PSS_Wn+ibvLvo&j@7vm&Va=!O+|GxlO)GjewW4F4Cc{eYywdY(<;#B8WaVNLzItak%#p1Iy zyEyd)d9EXQl6zThxsdWksaN2a*nKSj=dy3b@|)7d-KqOokW*>^Jd2wTzpe@yX%>wb z2|#C?OmjO&cGdge1i<6DQR-e2HxVB%okiD^=n5^s=28}4xDSA~ebSRM|9aSV{nLNA z1%Slw%XN3i5=M&ObByq2+R5%oN}lFGH1|)`U`&>6ezo0|^du+QItRMH?gQB(s}CN=PP&d9=U|OQ zBap5+luk3%xa(RguVkt9902wV^@WY)8!VL8d1ZBg`f8`T z^4iVIyL}ENyv!p+PnU&XjA>X3K=zxG8`7Rwar6M-5`Nuv%?ZC&%3m+8AoZ}{gy0;d zx&{5>LSw9x_@3k>S*1klNO@AGxTYh%TD>12^4EDT;W5^Cmhea}D7#2vXnm#K73tS> zPFE30>T(u+C|ex|WR=`z0PK#FwTPXKGMCyidudedx`fAA-&w*{P8Z} to charge up a powerful buzzsaw that deals close-range damage - Fired buzzsaws slice through foes, making them bleed, and can bounce off tiles + Fired buzzsaws slice through foes, lacerating them, and can bounce off tiles The longer it is charged, the more damage and pierce the buzzsaw has Does not consume ammo 'Not to be confused with the Sawed-On Shotgun' @@ -441,11 +441,17 @@ Drataliornus: { ''' } -ElementalBlaster: { - DisplayName: Elemental Blaster +ElementalSaw: { + DisplayName: Elemental Saw Tooltip: ''' - Fires a storm of rainbow blasts + Hold to charge up a powerful elemental buzzsaw that deals close-range damage + Fired buzzsaws lacerate foes and inflict Elemental Mix, and can bounce off tiles + The longer it is charged, the more damage and pierce the buzzsaw has + Buzzsaws return to the player after exhausting their pierce, releasing homing bolts + Press to propel a short distance and fire a lingering buzzsaw towards the cursor + This dash has a {0} second cooldown + While on cooldown, buzzsaws slightly home to the cursor and release homing bolts faster while returning Does not consume ammo ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index 2d79b08a0a..b38a343f6e 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -68,6 +68,7 @@ DrizzlefishFireSplit.DisplayName: Drizzlefish Flames DWArrow.DisplayName: Death's Arrow ElementalFire.DisplayName: Elemental Fire ElementalFlare.DisplayName: Elemental Flare +ElementalSawProj.DisplayName: Elemental Buzzsaw ElysianArrowProj.DisplayName: Elysian Arrow ElysianArrowRain.DisplayName: Elysian Light EmesisGore.DisplayName: Rotten Gore @@ -165,7 +166,6 @@ PristineFire.DisplayName: Pristine Fire PristineSecondary.DisplayName: Pristine Lingering Fire PumplerGrenade.DisplayName: Squash Shell P90Round.DisplayName: Armor-piercing Round -RainbowBlast.DisplayName: Blast RainbowFront.DisplayName: Rainbow RainbowTrail.DisplayName: Rainbow RealmRavagerBullet.DisplayName: Explosive Bullet diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index ede020f320..81152743fe 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -88,6 +88,7 @@ Cooldowns: { DivingPlatesBreaking: Abyssal Diving Suit Plates Durability DivingPlatesBroken: Abyssal Diving Suit Broken Plates ParryCooldown: Parry Ability Cooldown + ElementalSawBoost: Elemental Saw Boost EvasionScarf: Scarf Cooldown FleshTotem: Contact Damage Halving Cooldown GaelsRage: Gael's Greatsword Rage Cooldown diff --git a/Projectiles/Ranged/BuzzkillHoldout.cs b/Projectiles/Ranged/BuzzkillHoldout.cs index cd65b320fd..0676791e9d 100644 --- a/Projectiles/Ranged/BuzzkillHoldout.cs +++ b/Projectiles/Ranged/BuzzkillHoldout.cs @@ -1,11 +1,11 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Utilities; +using System; using Terraria; using Terraria.Audio; using Terraria.DataStructures; @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 30; SoundEngine.PlaySound(SoundID.DD2_BallistaTowerShot, GunTipPosition); - float sawDamageMult = MathHelper.Clamp(MathHelper.Lerp(1f, 5f, Time / ChargeupTime), 1f, 4f) / 1.6f; // The damage must be divided by 1.6 to offset the holdout having 1.6x base damage. + float sawDamageMult = MathHelper.Clamp(MathHelper.Lerp(1f, 5f, Time / ChargeupTime), 1f, 5f) / 1.6f; // The damage must be divided by 1.6 to offset the holdout having 1.6x base damage. int sawPierce = (int)MathHelper.Clamp(MathHelper.Lerp(2f, 6f, Time / ChargeupTime), 2f, 6f); bool useSmallSlash = (Time / ChargeupTime) >= 0.25f; diff --git a/Projectiles/Ranged/ElementalSawHoldout.cs b/Projectiles/Ranged/ElementalSawHoldout.cs new file mode 100644 index 0000000000..7e88b7f86f --- /dev/null +++ b/Projectiles/Ranged/ElementalSawHoldout.cs @@ -0,0 +1,198 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Cooldowns; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; +using System; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class ElementalSawHoldout : BaseGunHoldoutProjectile + { + public override int AssociatedItemID => ModContent.ItemType(); + public override float RecoilResolveSpeed => 0.05f; + public override float MaxOffsetLengthFromArm => 36f; + public override float BaseOffsetY => -5f; + public override float OffsetYUpwards => -5f; + public override float OffsetYDownwards => 5f; + public override Vector2 GunTipPosition => Projectile.Center + Vector2.UnitX.RotatedBy(Projectile.rotation) * Projectile.width * 0.25f; + + public ref float Time => ref Projectile.ai[0]; + public const float ChargeupTime = 120f; + public SlotId ChargeIdle; + + // Controls the saw visually disappearing from the holdout when it fires. + public bool NoSawOnHoldout = false; + + public override void SetStaticDefaults() + { + Main.projFrames[Projectile.type] = 5; + } + + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.penetrate = -1; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 10; + } + + public override void KillHoldoutLogic() + { + if (HeldItem.type != Owner.ActiveItem().type) + { + Projectile.Kill(); + Projectile.netUpdate = true; + } + } + + public override void HoldoutAI() + { + Time++; + if (Main.myPlayer == Projectile.owner) + Owner.Calamity().rightClickListener = true; + + if (Owner.CantUseHoldout()) + { + if (Projectile.ai[1] < 1f) + { + Projectile.ai[1] = 1f; + KeepRefreshingLifetime = false; + Projectile.timeLeft = 30; + + SoundEngine.PlaySound(SoundID.DD2_BallistaTowerShot, GunTipPosition); // Placeholder? + float sawDamageMult = MathHelper.Clamp(MathHelper.Lerp(1f, 5f, Time / ChargeupTime), 1f, 5f) / 2f; // The damage must be divided by 2 to offset the holdout having 2x base damage. + int sawPierce = (int)MathHelper.Clamp(MathHelper.Lerp(2f, 6f, Time / ChargeupTime), 2f, 6f); + + bool useSmallSlash = (Time / ChargeupTime) >= 0.25f; + bool useLargeSlash = (Time / ChargeupTime) >= 1f; + float ai0 = 0; + if (useSmallSlash) + ai0++; + if (useLargeSlash) + ai0++; + + // ai[0] determines which slashes are drawn. ai[1] is the saw's timer variable. ai[2] stores the saw's pierce. + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitY) * ElementalSaw.ShootSpeed, ModContent.ProjectileType(), (int)(Projectile.damage * sawDamageMult), Projectile.knockBack, Main.myPlayer, ai0, 0f, sawPierce); + + NoSawOnHoldout = true; + OffsetLengthFromArm -= 4f + 12f * Math.Clamp(Time / ChargeupTime, 0f, 1f); + } + } + + // Handle the right-click dash + if (Owner.Calamity().mouseRight && !Owner.HasCooldown(ElementalSawBoost.ID)) + { + Owner.AddCooldown(ElementalSawBoost.ID, ElementalSaw.DashCooldown); + Owner.Calamity().sBlasterDashActivated = true; + + // TODO - Lingering saw on right click, and empowering saws + + // If moving, make particle effects when the dash activates + if (Owner.velocity != Vector2.Zero) + { + int particleAmt = 7; + for (int c = 0; c < particleAmt; c++) + { + Color sparkColor = Color.Lerp(new Color(122, 240, 58), new Color(32, 186, 171), c / (particleAmt - 1)); + Particle spark = new CritSpark(Owner.Center, Owner.velocity.RotatedByRandom(MathHelper.ToRadians(13f)) * Main.rand.NextFloat(-2.1f, -4.5f), Color.White, sparkColor, 2f, 45, 2.25f, 2f); + GeneralParticleHandler.SpawnParticle(spark); + } + for (int e = 0; e < particleAmt; e++) + { + Color sparkColor2 = Color.Lerp(new Color(122, 240, 58), new Color(32, 186, 171), e / (particleAmt - 1)); + Particle spark2 = new NanoParticle(Owner.Center, Owner.velocity.RotatedByRandom(MathHelper.ToRadians(-MathHelper.PiOver4)) * Main.rand.NextFloat(2.5f, 4.5f), sparkColor2, 1f, 45, Main.rand.NextBool(3)); + GeneralParticleHandler.SpawnParticle(spark2); + } + } + } + + if (NoSawOnHoldout) + Projectile.frame = 4; + else + { + Projectile.frameCounter++; + if (Projectile.frameCounter >= 3) + { + Projectile.frameCounter = 0; + Projectile.frame++; + if (Projectile.frame > 3) + Projectile.frame = 0; + } + } + } + + public override void OnSpawn(IEntitySource source) + { + base.OnSpawn(source); + ExtraBackArmRotation = MathHelper.ToRadians(15f); + } + + // The holdout can deal damage; you're literally spinning up a buzzsaw at the end, after all. + public override bool? CanDamage() => !NoSawOnHoldout; + + public override void ModifyDamageHitbox(ref Rectangle hitbox) + { + hitbox = new Rectangle((int)GunTipPosition.X - 23, (int)GunTipPosition.Y - 23, 46, 46); + + if (Time / ChargeupTime >= 1f) + hitbox.Inflate(70, 70); + else if (Time / ChargeupTime >= 0.25f) + hitbox.Inflate(32, 32); + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 150); + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/SwiftSlice") { Volume = 0.7f }, GunTipPosition); + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Ranged/ElementalSawHoldout").Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Rectangle frame = texture.Frame(verticalFrames: Main.projFrames[Type], frameY: Projectile.frame); + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = frame.Size() * 0.5f; + SpriteEffects flipSprite = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + if (!NoSawOnHoldout) + { + float shake = Utils.Remap(Time, 0f, ChargeupTime, 0f, 3f); + drawPosition += Main.rand.NextVector2Circular(shake, shake); + } + + Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), drawRotation, rotationPoint, Projectile.scale, flipSprite); + + if (Time > 30f && !NoSawOnHoldout) + { + if (Time / ChargeupTime >= 1f) + { + Texture2D largeSlashTexture = ModContent.Request("CalamityMod/Projectiles/Ranged/ElementalSawLargeSlash").Value; + Color drawColorLarge = new Color(200, 200, 200, 100); + Main.EntitySpriteDraw(largeSlashTexture, GunTipPosition - Main.screenPosition + new Vector2(Main.rand.NextFloat(-8f, 8f), Main.rand.NextFloat(-8f, 8f)), null, drawColorLarge, -(Time * 7f), largeSlashTexture.Size() / 2, 1f, SpriteEffects.None); + } + + if (Time / ChargeupTime >= 0.25f) + { + Texture2D smallSlashTexture = ModContent.Request("CalamityMod/Projectiles/Ranged/ElementalSawSmallSlash").Value; + Color drawColorSmall = new Color(200, 200, 200, 100); + Main.EntitySpriteDraw(smallSlashTexture, GunTipPosition - Main.screenPosition + new Vector2(Main.rand.NextFloat(-5f, 5f), Main.rand.NextFloat(-5f, 5f)), null, drawColorSmall, Time * 7f, smallSlashTexture.Size() / 2, 1f, SpriteEffects.None); + } + } + return false; + } + } +} diff --git a/Projectiles/Ranged/ElementalSawHoldout.png b/Projectiles/Ranged/ElementalSawHoldout.png new file mode 100644 index 0000000000000000000000000000000000000000..e5445246aae833a02417cc0d8a3513d6eaf6c84f GIT binary patch literal 4177 zcmYM22{e>lAHWf>CG@J1on9(~7>s=^X^bt)Fi5tP-Lx=c$=F_nGFhS+WE(WLkToMF zZ<1wfVJu}S#=eh+l=vR+_nq^d^W5j2d!BplbMJG1|KI*|aazfoo4cz6c_j|{*f#ZvqpydcbLVGP1xK4F zI;e`$?;1Mts1CVN8*$jM6EY~sxL#V~AqOcVuuJi+NfG^3R0xe}VW2T)En^ z?|SJUhC}zLZ(q1lb`G$$-20T+NX+zV*c*7iTz?v^)k-7sM|2j(FNtvUB-!%QmeJB% z)m@=CpCs;$M~S*dzrOGGWUOsWQ-90z)$ZcEgJ9f@597@zCPknfY}I`PLkL}6p%~X3 zWk`VTRVff1Lzy#6du^+8PVKx*3->4P(^B3oR%62&HAEB5=eDsmzoqicx4%AnS0bEV zrcBytY7J^7-?)G4kkC3~0pT=_Dm z+OT+M49QNh2o~Wk;whI0Kalkw2Pb_AuL)~Fz`<5MFW@R~<}QFP{v*KF{v6-Q>>Wq~Qoci*3R$_SZ<}IHS%TA4X zCxs$jF3T(=HjqIk`c02#o9(ZmZb#rQbXZs-lpdxQpuRlv(Pv zs$P(2EHSZmK94Ly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&Xw!pyaxhP-{4Jql3DKq7n85zwDc@yyzyE{ zX-u5l*i5XYNQOHdB{;R_^*iqBavDu|9wf5| zQh4ueoqa1LT{zCWpz-F+kJ#K#7B5WZ{cwvv_1#AT y1BhM)=nZ>Itx&7!8xN_K9E|ZE "Projectiles.Ranged"; + public static readonly SoundStyle TileCollideGFB = new("CalamityMod/Sounds/Custom/MetalPipeFalling") { Volume = 2f }; + + // Controls if the saw is returning to the player. + public bool Returning = false; + public int ReturnTimer = 0; + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 46; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.timeLeft = 480; + Projectile.penetrate = -1; // Saws only pierce a certain number of times before returning, and don't deal direct damage while returning + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 10; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; + } + + public override void AI() + { + // dies from cringe (Deadshot Brooch moment) + if (Projectile.MaxUpdates > 1) + Projectile.MaxUpdates = 1; + + Projectile.ai[1]++; + Projectile.rotation = Projectile.ai[1] * Projectile.spriteDirection * (MathHelper.Pi / 6); + + // Saws automatically return 2 seconds after hitting an enemy. + if (ReturnTimer > 0) + { + ReturnTimer++; + if (ReturnTimer > 120) + Returning = true; + } + + if (Returning) + { + // Still need to do this. For now, lemme make sure it enters the return state properly + Main.NewText("Returning"); + Projectile.Kill(); + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + for (int s = 0; s < 7; s++) + { + Vector2 sparkVelocity = new Vector2(); + if (Projectile.velocity.X != oldVelocity.X && oldVelocity.X < 0) + sparkVelocity = new Vector2(6.5f, 0f); + else if (Projectile.velocity.X != oldVelocity.X && oldVelocity.X >= 0) + sparkVelocity = new Vector2(-6.5f, 0f); + else if (Projectile.velocity.Y != oldVelocity.Y && oldVelocity.Y < 0) + sparkVelocity = new Vector2(0f, 6.5f); + else if (Projectile.velocity.Y != oldVelocity.Y && oldVelocity.Y >= 0) + sparkVelocity = new Vector2(0f, -6.5f); + + Vector2 sparkLocation = sparkVelocity.X > 0f ? new Vector2(Projectile.Center.X - Projectile.width / 2, Projectile.Center.Y) : (sparkVelocity.X < 0f ? new Vector2(Projectile.Center.X + Projectile.width / 2, Projectile.Center.Y) : (sparkVelocity.Y > 0f ? new Vector2(Projectile.Center.X, Projectile.Center.Y - Projectile.height / 2) : new Vector2(Projectile.Center.X, Projectile.Center.Y + Projectile.height / 2))); + sparkVelocity = sparkVelocity.RotatedBy(Main.rand.NextFloat(-MathHelper.PiOver2, MathHelper.PiOver2)); + + Particle collisionSparks = new AltLineParticle(sparkLocation, sparkVelocity, false, 30, 0.6f, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB)); + GeneralParticleHandler.SpawnParticle(collisionSparks); + } + + Projectile.ai[2]--; + if (Projectile.ai[2] <= 0) + { + Returning = true; + } + else + { + SoundEngine.PlaySound(Main.zenithWorld ? TileCollideGFB : SoundID.Item178, Projectile.Center); // Placeholder sound + + if (Projectile.velocity.X != oldVelocity.X) + Projectile.velocity.X = -oldVelocity.X; + if (Projectile.velocity.Y != oldVelocity.Y) + Projectile.velocity.Y = -oldVelocity.Y; + } + + return false; + } + + public override bool? CanDamage() => !(Returning && Projectile.ai[2] == 0); + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 90); + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/SwiftSlice"), Projectile.Center); + + if (Projectile.numHits < 1) + ReturnTimer = 1; + + Projectile.ai[2]--; + if (Projectile.ai[2] <= 0) + Returning = true; + } + + public override void OnKill(int timeLeft) + { + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/CeramicImpact", 2), Projectile.Center); + } + + public override void ModifyDamageHitbox(ref Rectangle hitbox) + { + if (Projectile.ai[0] == 2f) + hitbox.Inflate(70, 70); + else if (Projectile.ai[0] == 1f) + hitbox.Inflate(32, 32); + } + + public override bool PreDraw(ref Color lightColor) + { + if (Projectile.ai[0] >= 2f) + { + Texture2D largeSlashTexture = ModContent.Request("CalamityMod/Projectiles/Ranged/ElementalSawLargeSlash").Value; + Color drawColor = new Color(200, 200, 200, 100); + Main.EntitySpriteDraw(largeSlashTexture, Projectile.Center - Main.screenPosition + new Vector2(Main.rand.NextFloat(-8f, 8f), Main.rand.NextFloat(-8f, 8f)), null, drawColor, -(Projectile.ai[1] * 7f), largeSlashTexture.Size() / 2, 1f, SpriteEffects.None); + + if (Projectile.ai[1] % 4 == 0) + { + Vector2 randomParticleOffset = new Vector2(Main.rand.NextFloat(-Projectile.width * 1.75f, Projectile.width * 1.75f), Main.rand.NextFloat(-Projectile.width * 1.75f, Projectile.width * 1.75f)); + float randomParticleScale = Main.rand.NextFloat(0.65f, 0.95f); + Particle bloomCircle = new BloomParticle(Projectile.Center + randomParticleOffset, Projectile.velocity, Main.rand.NextBool() ? Color.White : new Color(44, 168, 48), randomParticleScale, randomParticleScale, 4, false); + GeneralParticleHandler.SpawnParticle(bloomCircle); + } + } + if (Projectile.ai[0] >= 1f) + { + Texture2D smallSlashTexture = ModContent.Request("CalamityMod/Projectiles/Ranged/ElementalSawSmallSlash").Value; + Color drawColor = new Color(200, 200, 200, 100); + Main.EntitySpriteDraw(smallSlashTexture, Projectile.Center - Main.screenPosition + new Vector2(Main.rand.NextFloat(-5f, 5f), Main.rand.NextFloat(-5f, 5f)), null, drawColor, Projectile.ai[1] * 7f, smallSlashTexture.Size() / 2, 1f, SpriteEffects.None); + + if (Projectile.ai[1] % 4 == 0) + { + Vector2 randomParticleOffset = new Vector2(Main.rand.NextFloat(-Projectile.width, Projectile.width), Main.rand.NextFloat(-Projectile.width, Projectile.width)); + float randomParticleScale = Main.rand.NextFloat(0.35f, 0.65f); + Particle bloomCircle = new BloomParticle(Projectile.Center + randomParticleOffset, Projectile.velocity, Main.rand.NextBool() ? Color.White : new Color(44, 168, 48), randomParticleScale, randomParticleScale, 4, false); + GeneralParticleHandler.SpawnParticle(bloomCircle); + } + } + return true; + } + } +} diff --git a/Projectiles/Ranged/ElementalSawProj.png b/Projectiles/Ranged/ElementalSawProj.png new file mode 100644 index 0000000000000000000000000000000000000000..319c5357b2b875047085d0831f755b666eeca068 GIT binary patch literal 1452 zcmV;d1ylNoP)Px)W=TXrRA_QsEH{ggNh^yi9iG% zNYH==30`8P#PBA*U?LbV5iqpz#h{fIr$KB8+LYE(QVN|mgwmmeK!tXW59_Q>_F<-- zN6)O6cCWK<^X-4Fz0W=t30mf{r2tfpzaizUu>h>fECyhp`;?tXKjU*(SpcWP7Xb+O z-3Op%U`ovT;g`?E^rs{??f;*RiT6MWr{>)TpnU8+0BSn00S@02VjYE#01znbO=!Rq z;UzY}((Vudn+9aXHWkdU01kIvwE_0bEVBR}`$fhHth{OT<5}XC{_`;5#Q^-#(P9IP zT`YtyOuHPjqwv6f0BZ036!ZCt2`|YwC&Ehr@HMpp@T^}}uAx2$fV`;_Er6#N zTr=8vm$;ICKKD5Qe(pX!B4H(z)!AsiPGFB313pryH2f;N!(I{;OU zqOBvLd2yPW*+5r7wXbC*Uzqbakhr$vnaF=gbHXn4! z8OKdN^1ufquI&erTBEExtHxeas0{Ej@gFWY68zlLn1Ty04-9Ch07b+U_hiN|}OgjMTq((2cGdmYm4m;V9aV6D`z zTrm!ShEnOb=Z?9eZN0Z#BTKnu%J%@wyRlB(89hd=!S^3u%4F^i7he z-?>@Jy7TVbyuf%~cST}B3F}#=t>|?C=3M$({D{9S-F&-OOCI97!?nBev}*0G{2hir z;L6Vp4q0ER*{_?lduL8_&7=8F764@=8}V0W`7MavFa{s-X=b#?V3byQQz%Rs+ty$^jBBjH0o_c zcEDls2>A_|XCb%g3JuvAGQUg90r)Lz8sK5#)}jx$0+8ol2tY%A*arA(#_pI6MkBp( z=9flUP5nxKwY|q^@3!6L^5sLdy(vA-0;p^B_)XUE{djiWJ^+S710!Y^eM5?;X|;Id z-OqIe+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vi literal 0 HcmV?d00001 diff --git a/Projectiles/Ranged/RainbowBlast.cs b/Projectiles/Ranged/RainbowBlast.cs deleted file mode 100644 index 4fe0111b80..0000000000 --- a/Projectiles/Ranged/RainbowBlast.cs +++ /dev/null @@ -1,64 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Ranged -{ - public class RainbowBlast : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Ranged"; - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - } - - public override void SetDefaults() - { - Projectile.width = 10; - Projectile.height = 10; - Projectile.friendly = true; - Projectile.penetrate = 1; - Projectile.extraUpdates = 1; - Projectile.DamageType = DamageClass.Ranged; - Projectile.timeLeft = 300; - } - - public override void AI() - { - //Rotation - Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); - Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); - - Lighting.AddLight(Projectile.Center, new Vector3(Main.DiscoR, Main.DiscoG, Main.DiscoB) * (1.5f / 255)); - - Projectile.localAI[0]++; - if (Projectile.localAI[0] > 5f) - { - Vector2 dspeed = -Projectile.velocity * 0.5f; - int rainbowDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.RainbowTorch, dspeed.X, dspeed.Y, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.1f); - Main.dust[rainbowDust].noGravity = true; - Main.dust[rainbowDust].velocity = dspeed; - } - - CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); - } - - public override Color? GetAlpha(Color lightColor) - { - Color color = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - return color; - } - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); - return false; - } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 60); - } - } -} diff --git a/Projectiles/Ranged/RainbowBlast.png b/Projectiles/Ranged/RainbowBlast.png deleted file mode 100644 index 80909384b51ec1b681389abccfe8d5a70281416e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 174 zcmeAS@N?(olHy`uVBq!ia0vp^d_c^_!3HE-Zss2cQl*|Qjv*Qo_fAygJD?!IvfOum z!vTeYnx-Yw>~`Ext6}PQ{Jj|1-IHpYB!X868t;2s$+(d#$j;TG57? z?NKQlia891#}0O@h<~bH6vV~w{LX{w_peJ2I@I~+tYw@~%yuA3d-Y?bw;vpjzx-}L Zuar$|+8eo}ML-8Ic)I$ztaD0e0s!F*LdO6A