diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 7e2f8d3669..b4c295f03a 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -302,6 +302,10 @@ namespace CalamityMod.CalPlayer public bool despoilerNerf = false; /// Variable used to trigger Molten Amputator's stealth effect on right-click. public int amputatorBuff = 0; + /// Variable used to track the fuel of Pristine Fury right click + public int furyFuelMax = 1800; + public int furyFuel = 1800; + public float furyRefuelTimer = 0; public int rOfResilienceCooldown = 0; public int rOfResilienceEffect = 0; public int rOfResilienceOrbitOffset = 0; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index c22aaf6ae3..28b8f37573 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -203,6 +203,16 @@ namespace CalamityMod.CalPlayer rage = 0f; } + if (furyFuel < furyFuelMax && furyRefuelTimer >= 0) + { + furyFuel += (int)furyRefuelTimer; + furyRefuelTimer = MathHelper.Lerp(furyRefuelTimer, 25, 0.01f); + if (furyFuel > furyFuelMax) + furyFuel = furyFuelMax; + } + else if (furyRefuelTimer < 0) + furyRefuelTimer++; + // De-equipping Draedon's Heart deletes all Adrenaline. if (!draedonsHeart && hadNanomachinesLastFrame) { diff --git a/Cooldowns/FuryFuel.cs b/Cooldowns/FuryFuel.cs new file mode 100644 index 0000000000..0df9315cc6 --- /dev/null +++ b/Cooldowns/FuryFuel.cs @@ -0,0 +1,45 @@ +using System; +using CalamityMod.Items.Accessories; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Ranged; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.Localization; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Cooldowns +{ + public class FuryFuel : CooldownHandler + { + public float CompletionPercentage => MathF.Round(instance.Completion * 100); + private bool IsEmpty => CompletionPercentage == 100; + private float TextXOffset => -5.4f; + private Vector2 TextPosition => new(TextXOffset, 15); + private Color TextColor => Color.White; + private Color TextBorderColor = Color.Violet; + + public static new string ID => "FuryFuel"; + public override bool CanTickDown => false; + public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}"); + public override bool ShouldDisplay => instance.player.HeldItem.type == ItemType(); + public override string Texture => "CalamityMod/Cooldowns/" + ID; + + public override Color CooldownStartColor => IsEmpty ? Color.DimGray : Color.Lerp(Color.Purple, Color.SlateGray, instance.Completion); + public override Color CooldownEndColor => IsEmpty ? Color.DimGray : Color.Lerp(Color.Orchid, Color.SlateGray, instance.Completion); + + public override void DrawExpanded(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) + { + base.DrawExpanded(spriteBatch, position, opacity, scale); + } + + public override void DrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) + { + base.DrawCompact(spriteBatch, position, opacity, scale); + } + } +} diff --git a/Cooldowns/FuryFuel.png b/Cooldowns/FuryFuel.png new file mode 100644 index 0000000000..6820cf90a0 Binary files /dev/null and b/Cooldowns/FuryFuel.png differ diff --git a/Cooldowns/FuryFuelOutline.png b/Cooldowns/FuryFuelOutline.png new file mode 100644 index 0000000000..9f65a9db98 Binary files /dev/null and b/Cooldowns/FuryFuelOutline.png differ diff --git a/Cooldowns/FuryFuelOverlay.png b/Cooldowns/FuryFuelOverlay.png new file mode 100644 index 0000000000..834115ddfb Binary files /dev/null and b/Cooldowns/FuryFuelOverlay.png differ diff --git a/Items/Weapons/Ranged/PristineFury.cs b/Items/Weapons/Ranged/PristineFury.cs index 8ac9e7131e..73019a111a 100644 --- a/Items/Weapons/Ranged/PristineFury.cs +++ b/Items/Weapons/Ranged/PristineFury.cs @@ -1,4 +1,5 @@ -using CalamityMod.Dusts; +using CalamityMod.Cooldowns; +using CalamityMod.Dusts; using CalamityMod.Particles; using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; @@ -8,6 +9,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.CalPlayer; namespace CalamityMod.Items.Weapons.Ranged { @@ -19,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged public bool Trail = true; public int shotCount = 0; - public static int boomTime = 60; + public static int boomTime = 6; public override Color? TooltipExtensionColor => new Color(255, 140, 0); @@ -56,20 +58,40 @@ namespace CalamityMod.Items.Weapons.Ranged // Right click consumes ammo at the same rate but faster at spewing public override float UseTimeMultiplier(Player player) => player.altFunctionUse == 2 ? 0.5f : 1f; - + public override void HoldItem(Player player) + { + int max = player.Calamity().furyFuelMax; + if (player.Calamity().cooldowns.TryGetValue(FuryFuel.ID, out var cooldown)) + { + cooldown.timeLeft = max - player.Calamity().furyFuel; + } + else + { + player.AddCooldown(FuryFuel.ID, max); + } + } + public override bool CanConsumeAmmo(Item ammo, Player player) + { + return (player.altFunctionUse != 2); // Right click doesn't use ammo, it's crystal powder not gel + } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.altFunctionUse == 2) { - Vector2 newVel = velocity.RotatedByRandom(MathHelper.ToRadians(5f)); - Projectile.NewProjectile(source, position, newVel, ModContent.ProjectileType(), (int) (damage * 0.7f), knockback, player.whoAmI); //.7x base damage + player.Calamity().furyRefuelTimer = -50; + if (player.Calamity().furyFuel > 0) + { + Vector2 newVel = velocity.RotatedByRandom(MathHelper.ToRadians(5f)); + Projectile.NewProjectile(source, position, newVel, ModContent.ProjectileType(), (int)(damage * 0.25f), knockback, player.whoAmI); //.25x base damage - Dust dust = Dust.NewDustPerfect(position + velocity * 3f + new Vector2(0, -3), ModContent.DustType(), velocity.RotatedBy(0.25f * player.direction).RotatedByRandom(0.35f) * Main.rand.NextFloat(0.5f, 2.5f), 0, default, Main.rand.NextFloat(0.4f, 0.8f)); - dust.noGravity = true; - dust.color = Color.Orchid; + Dust dust = Dust.NewDustPerfect(position + velocity * 3f + new Vector2(0, -3), ModContent.DustType(), velocity.RotatedBy(0.25f * player.direction).RotatedByRandom(0.35f) * Main.rand.NextFloat(0.5f, 2.5f), 0, default, Main.rand.NextFloat(0.4f, 0.8f)); + dust.noGravity = true; + dust.color = Color.Orchid; - CritSpark spark = new CritSpark(position + velocity * 3f + new Vector2(0, -3), velocity.RotatedBy(0.25f * player.direction).RotatedByRandom(0.25f) * Main.rand.NextFloat(0.2f, 1.8f), Color.White, Color.Orchid, 0.9f, 18, 2f, 2.2f); - GeneralParticleHandler.SpawnParticle(spark); + CritSpark spark = new CritSpark(position + velocity * 3f + new Vector2(0, -3), velocity.RotatedBy(0.25f * player.direction).RotatedByRandom(0.25f) * Main.rand.NextFloat(0.2f, 1.8f), Color.White, Color.Orchid, 0.9f, 18, 2f, 2.2f); + GeneralParticleHandler.SpawnParticle(spark); + player.Calamity().furyFuel -= 15; + } } else { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index f428170653..d4036cd346 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -989,7 +989,7 @@ PristineFury: { Tooltip: ''' Fires an intense helix of flames that burst into a column of smoke - to disperse flammable crystalline powder + to disperse a limited supply of flammable crystalline powder that restores over time Powder can be ignited, causuing it to explode for extra damage Both helix flames and other nearby explosions can ignite the powder Uses gel for ammo diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index 44c41c544a..e782d7db5c 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -92,6 +92,7 @@ Cooldowns: { DSOCritCooldown: Extra Critical Strike Chance ParryCooldown: Parry Ability Cooldown FleshTotem: Contact Damage Halving Cooldown + FuryFuel: Crystal Powder GaelsRage: Gael's Greatsword Rage Cooldown GlobalDodge: Dodge Cooldown GodSlayerDash: God Slayer Dash Cooldown diff --git a/Projectiles/Ranged/PristineSecondary.cs b/Projectiles/Ranged/PristineSecondary.cs index 355ee730d8..f8b4aeb2c1 100644 --- a/Projectiles/Ranged/PristineSecondary.cs +++ b/Projectiles/Ranged/PristineSecondary.cs @@ -50,7 +50,8 @@ namespace CalamityMod.Projectiles.Ranged { // Xyk: "This is probably too much lol" // Yeah I'd say 7x base damage is a bit much - Projectile.damage *= (int) 5.5; + // Xyk: Follow up, the inital damage is nerfed AND it has a "cooldown" 7x should now be fine... + Projectile.damage *= (int)7; FogColor = Color.Lerp(Color.OrangeRed, Color.Goldenrod, Main.rand.NextFloat()); SoundStyle ignite = new("CalamityMod/Sounds/Custom/Providence/ProvidenceHolyBlastImpact");