diff --git a/Cooldowns/HellbornShots.cs b/Cooldowns/HellbornShots.cs new file mode 100644 index 0000000000..b421fc8b98 --- /dev/null +++ b/Cooldowns/HellbornShots.cs @@ -0,0 +1,49 @@ +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 HellbornShots : 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.Gold; + private Color TextBorderColor = Color.DarkRed; + + public static new string ID => "HellbornShots"; + 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.Red, Color.SlateGray, instance.Completion); + public override Color CooldownEndColor => IsEmpty ? Color.DimGray : Color.Lerp(Color.Gold, Color.SlateGray, instance.Completion); + + public override void DrawExpanded(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) + { + base.DrawExpanded(spriteBatch, position, opacity, scale); + + CalamityUtils.DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, instance.player.Calamity().hellbornShots.ToString(), position + TextPosition, TextColor, TextBorderColor); + } + + public override void DrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) + { + base.DrawCompact(spriteBatch, position, opacity, scale); + + CalamityUtils.DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, instance.player.Calamity().hellbornShots.ToString(), position + TextPosition, TextColor, TextBorderColor); + } + } +} diff --git a/Cooldowns/HellbornShots.png b/Cooldowns/HellbornShots.png new file mode 100644 index 0000000000..e60077601e Binary files /dev/null and b/Cooldowns/HellbornShots.png differ diff --git a/Cooldowns/HellbornShotsOutline.png b/Cooldowns/HellbornShotsOutline.png new file mode 100644 index 0000000000..94bf4c490a Binary files /dev/null and b/Cooldowns/HellbornShotsOutline.png differ diff --git a/Cooldowns/HellbornShotsOverlay.png b/Cooldowns/HellbornShotsOverlay.png new file mode 100644 index 0000000000..4ff8f97677 Binary files /dev/null and b/Cooldowns/HellbornShotsOverlay.png differ diff --git a/Items/Weapons/Melee/Earth.cs b/Items/Weapons/Melee/Earth.cs index 208828a7c0..0e55e55fc9 100644 --- a/Items/Weapons/Melee/Earth.cs +++ b/Items/Weapons/Melee/Earth.cs @@ -21,10 +21,10 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 164; Item.height = 164; - Item.damage = 1980; + Item.damage = 4004; Item.DamageType = TrueMeleeDamageClass.Instance; - Item.useAnimation = 38; - Item.useTime = 38; + Item.useAnimation = 42; + Item.useTime = 42; Item.useTurn = true; Item.knockBack = 15f; Item.autoReuse = true; diff --git a/Items/Weapons/Ranged/Hellborn.cs b/Items/Weapons/Ranged/Hellborn.cs index ff8069195f..0a7735e92a 100644 --- a/Items/Weapons/Ranged/Hellborn.cs +++ b/Items/Weapons/Ranged/Hellborn.cs @@ -1,4 +1,6 @@ using System.Linq; +using CalamityMod.Cooldowns; +using CalamityMod.Items.Accessories; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; @@ -45,6 +47,16 @@ namespace CalamityMod.Items.Weapons.Ranged { if (Main.myPlayer == player.whoAmI) player.Calamity().rightClickListener = true; + + + if (player.Calamity().cooldowns.TryGetValue(HellbornShots.ID, out var cooldown)) + { + cooldown.timeLeft = 8 - player.Calamity().hellbornShots; + } + else + { + player.AddCooldown(HellbornShots.ID, 8); + } } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index e3bfc66005..e9c1f6e4ee 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -423,7 +423,7 @@ Earth: { A beautiful prismatic blade with unrivaled close combat proficiency Heals you greatly on hit Every other swing will summon three Gaia meteors to fall upon nearby enemies - 'All its spawn shall know the beauty and wrath of their creator' + 'All Its spawn shall know the beauty and wrath of their creator' ''' } @@ -711,7 +711,7 @@ Hellkite: { ''' An ancient blade created during the Draconic Era by Azafure's finest forgemaster Swings a slow and heavy blade with powerful knockback - Holding while swinging will begin charging a strengthened swing + Holding will begin charging a strengthened swing Releasing while fully charged will unleash a devastating slash [c/0C507F:'My beloved <3' -Xyk] ''' diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index 63fa289aa0..60eb8763f4 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -94,6 +94,7 @@ Cooldowns: { GaelsRage: Gael's Greatsword Rage Cooldown GlobalDodge: Dodge Cooldown GodSlayerDash: God Slayer Dash Cooldown + HellbornShots: Hellborn Shots InkBomb: Ink Bomb Cooldown LifeSteal: Life Steal Cooldown LionHeartShield: Energy Shell Cooldown diff --git a/Projectiles/Melee/EarthHoldout.cs b/Projectiles/Melee/EarthHoldout.cs index 736c25be17..3cb51314b4 100644 --- a/Projectiles/Melee/EarthHoldout.cs +++ b/Projectiles/Melee/EarthHoldout.cs @@ -36,6 +36,7 @@ namespace CalamityMod.Projectiles.Melee public bool spawnBoom = true; public Color mainColor = Color.OrangeRed; public bool finalFlip = false; + public int pause = 0; public override void SetDefaults() { base.SetDefaults(); @@ -47,7 +48,7 @@ namespace CalamityMod.Projectiles.Melee { Projectile.knockBack = 0; Projectile.scale = 1; - Projectile.ai[1] = -1; + Projectile.ai[1] = 1; base.OnSpawn(source); mousePos = Owner.Calamity().mouseWorld; aimVel = (Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitX) * 65; @@ -61,6 +62,13 @@ namespace CalamityMod.Projectiles.Melee public override void UseStyle() { + if (pause > 0) + { + pause--; + Animation--; + return; + } + AnimationProgress = Animation % useAnim; DrawUnconditionally = false; @@ -223,9 +231,26 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.ai[1] == -1 && spawnBoom) { Vector2 spawnSpot = target.Center + new Vector2(Main.rand.NextFloat(-450, 450), Main.rand.NextFloat(-450, -650)); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage * 2, Projectile.knockBack, Projectile.owner, 0, 0, 2); + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 0, 2); spawnBoom = false; } + if (Projectile.numHits == 0) + { + pause = 6; + for (int i = 0; i < 5; i++) + { + Particle spark = new GlowSparkParticle(target.Center, (Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitY) * (-25), false, 12, 0.12f - i * 0.025f, mainColor, new Vector2(3.75f, 0.9f), true, false, 1.15f); + GeneralParticleHandler.SpawnParticle(spark); + } + for (int i = 0; i < 15; i++) + { + float power = Main.rand.NextFloat(0, 0.6f); + Particle sparker = new CustomSpark(target.Center, (Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitY).RotatedByRandom(power) * (-Main.rand.NextFloat(18.5f, 50) * (1 - power)), "CalamityMod/Particles/Sparkle", false, 38, Main.rand.NextFloat(2.2f, 4.8f), mainColor, new Vector2(0.4f, Main.rand.NextFloat(0.9f, 1.4f)), true, true); + GeneralParticleHandler.SpawnParticle(sparker); + } + SoundStyle hit2 = new("CalamityMod/Sounds/Item/FinalDawnSlash"); + SoundEngine.PlaySound(hit2 with { Volume = 0.85f, Pitch = Main.rand.NextFloat(0.2f, 0.3f) }, Projectile.Center); + } SoundStyle fire = new("CalamityMod/Sounds/NPCHit/ThanatosHitOpen1"); SoundEngine.PlaySound(fire with { Volume = 0.75f, Pitch = 0.2f }, Projectile.Center); @@ -265,10 +290,8 @@ namespace CalamityMod.Projectiles.Melee for (int i = 0; i < MathHelper.Clamp(10 - Projectile.numHits * 2, 2, 10); i++) { - Particle mini = new CustomPulse(target.Center, ((Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitY) * -35).RotatedByRandom(0.7) * Main.rand.NextFloat(0.1f, 1f), mainColor, "CalamityMod/Particles/HealingPlus", Vector2.One, Main.rand.NextFloat(-10, 10), Main.rand.NextFloat(0.8f, 1.4f) * scaleFactor, 0.2f * scaleFactor, 35, true); - GeneralParticleHandler.SpawnParticle(mini); - - Dust dust2 = Dust.NewDustPerfect(target.Center, 278, new Vector2(12, 12).RotatedByRandom(100) * Main.rand.NextFloat(0.05f, 0.7f)); + float power = Main.rand.NextFloat(0.2f, 0.8f); + Dust dust2 = Dust.NewDustPerfect(target.Center, 278, (Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld)).RotatedByRandom(power) * (Main.rand.NextFloat(10f, 35f) * ( 1 - power))); dust2.scale = Main.rand.NextFloat(0.55f, 0.85f) * scaleFactor; dust2.noGravity = true; dust2.color = Color.Lerp(Color.White, mainColor, 0.5f); diff --git a/Projectiles/Melee/EarthMeteor.cs b/Projectiles/Melee/EarthMeteor.cs index 10b1f1fd2c..bec6576d11 100644 --- a/Projectiles/Melee/EarthMeteor.cs +++ b/Projectiles/Melee/EarthMeteor.cs @@ -10,6 +10,7 @@ using CalamityMod.Projectiles.Ranged; using CalamityMod.Items.Weapons.Ranged; using Microsoft.Xna.Framework.Graphics; using CalamityMod.Particles; +using Terraria.Graphics.Renderers; namespace CalamityMod.Projectiles.Melee { @@ -154,8 +155,8 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.numHits <= 0) { Player Owner = Main.player[Projectile.owner]; - Owner.Calamity().GeneralScreenShakePower = 4f; - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), Projectile.knockBack, Projectile.owner); + Owner.Calamity().GeneralScreenShakePower = 4.5f; + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75f), Projectile.knockBack, Projectile.owner); for (int i = 0; i < 20; i++) { randomColor = Main.rand.Next(3) switch @@ -168,14 +169,20 @@ namespace CalamityMod.Projectiles.Melee dust2.scale = Main.rand.NextFloat(0.85f, 1.15f); dust2.noGravity = false; dust2.color = Color.Lerp(Color.White, randomColor, 0.5f); + + Particle sparker = new CustomSpark(target.Center, Vector2.One.RotatedByRandom(100) * Main.rand.NextFloat(5.5f, 20), "CalamityMod/Particles/Sparkle", false, 38, Main.rand.NextFloat(2.2f, 4.8f), randomColor, new Vector2(0.4f, Main.rand.NextFloat(0.9f, 1.4f)), true, true); + GeneralParticleHandler.SpawnParticle(sparker); } - Particle bolt2 = new CustomPulse(target.Center, Vector2.Zero, Color.OrangeRed, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.5f, 19); - GeneralParticleHandler.SpawnParticle(bolt2); - Particle bolt3 = new CustomPulse(target.Center, Vector2.Zero, Color.MediumTurquoise, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.35f, 17); - GeneralParticleHandler.SpawnParticle(bolt3); - Particle bolt4 = new CustomPulse(target.Center, Vector2.Zero, Color.LawnGreen, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.2f, 15); - GeneralParticleHandler.SpawnParticle(bolt4); + for (int i = 0; i < 3; i++) + { + Particle bolt2 = new CustomPulse(target.Center, Vector2.Zero, Color.OrangeRed, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.5f - i * 0.05f, 19 - i * 4); + GeneralParticleHandler.SpawnParticle(bolt2); + Particle bolt3 = new CustomPulse(target.Center, Vector2.Zero, Color.MediumTurquoise, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.35f - i * 0.05f, 17 - i * 4); + GeneralParticleHandler.SpawnParticle(bolt3); + Particle bolt4 = new CustomPulse(target.Center, Vector2.Zero, Color.LawnGreen, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.2f - i * 0.05f, 15 - i * 4); + GeneralParticleHandler.SpawnParticle(bolt4); + } SoundStyle fire2 = new("CalamityMod/Sounds/Item/EarthMeteor"); SoundEngine.PlaySound(fire2 with { Volume = 0.9f }, target.Center);