From 8a5dd9dba20d130c255d38748c2519ea793cc47b Mon Sep 17 00:00:00 2001 From: Xyk Date: Sun, 12 Apr 2026 17:01:57 -0700 Subject: [PATCH] Updates to mammoth --- CalPlayer/CalamityPlayer.cs | 6 +- Items/Accessories/FrozenCube.cs | 21 +- .../Mods.CalamityMod.Items.Accessories.hjson | 4 + Projectiles/Typeless/Elumphant.cs | 750 ++++++++++-------- Projectiles/Typeless/ElumphantMist.cs | 28 +- .../Typeless}/SmokePuff1.png | Bin .../Typeless}/SmokePuff2.png | Bin .../Typeless}/SmokePuff3.png | Bin Sounds/Item/ElumphantBop.ogg | Bin 0 -> 14432 bytes 9 files changed, 478 insertions(+), 331 deletions(-) rename {Particles => Projectiles/Typeless}/SmokePuff1.png (100%) rename {Particles => Projectiles/Typeless}/SmokePuff2.png (100%) rename {Particles => Projectiles/Typeless}/SmokePuff3.png (100%) create mode 100644 Sounds/Item/ElumphantBop.ogg diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 04c7a9e714..6de7ccdd80 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1129,7 +1129,9 @@ namespace CalamityMod.CalPlayer public bool scionsCurioVisuals = false; public float scionsCurioDebuffDamage = 0; public bool frozenCube = false; - public float frozenCubePower = 0; + public bool frozenCubeVisuals = false; + public float frozenCubeDebuffBoost = 0; + public float frozenCubeElumphantBoost = 0; public bool miniOldDuke = false; public bool miniOldDukeVanity = false; public bool starbusterCore = false; @@ -2511,7 +2513,7 @@ namespace CalamityMod.CalPlayer camper = false; corrosiveSpine = false; scionsCurio = false; - frozenCube = false; + frozenCube = false; frozenCubeDebuffBoost = 0; frozenCubeElumphantBoost = 0; rottenDogTooth = false; angelicAlliance = false; ChaosStone = false; diff --git a/Items/Accessories/FrozenCube.cs b/Items/Accessories/FrozenCube.cs index 650f1f50d1..486aaabec2 100644 --- a/Items/Accessories/FrozenCube.cs +++ b/Items/Accessories/FrozenCube.cs @@ -4,6 +4,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; @@ -12,11 +13,17 @@ namespace CalamityMod.Items.Accessories { public class FrozenCube : ModItem, ILocalizedModType { - public static int mistBaseDamage = 3; - public static int slamBaseDamage = 24; + public static int mistBaseDamage = 2; + public static int slamBaseDamage = 38; public static int baseAttackSpeed = 90; public static int baseAttackCooldown = 180; - public static int debuff = BuffID.Frostburn; // Wind chilled + public static int debuff = ModContent.BuffType(); + + public static readonly SoundStyle noise = new("CalamityMod/Sounds/Item/ElumphantSound") { Volume = 0.6f }; + public static readonly SoundStyle cry = new("CalamityMod/Sounds/Item/ElumphantCry") { Volume = 0.6f }; + public static readonly SoundStyle hit = new("CalamityMod/Sounds/Item/ElumphantBop") { Volume = 0.6f }; + public static readonly SoundStyle jokeBonk = new("CalamityMod/Sounds/Item/Bonk") { Volume = 0.6f }; + public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { @@ -26,11 +33,11 @@ namespace CalamityMod.Items.Accessories Item.rare = ItemRarityID.Orange; Item.accessory = true; } - public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.frozenCube = true; + modPlayer.frozenCubeVisuals = !hideVisual; int projectile = ProjectileType(); if (player.ownedProjectileCounts[projectile] < 1 && !player.dead) @@ -41,9 +48,11 @@ namespace CalamityMod.Items.Accessories } public override void ModifyTooltips(List list) { - Player player = Main.LocalPlayer; if (Main.LocalPlayer != null) - list.FindAndReplace("[DAMAGE]", ((int)(player.Calamity().frozenCubePower)).ToString() + "x"); + list.FindAndReplace("[DAMAGELINE]", Main.LocalPlayer.Calamity().frozenCube ? + this.GetLocalization("EquippedDebuff").Format((Main.LocalPlayer.Calamity().frozenCubeDebuffBoost.ToPercent("N0")).ToString()) + "\n" + + this.GetLocalization("EquippedElumphant").Format((Main.LocalPlayer.Calamity().frozenCubeElumphantBoost.ToPercent("N1")).ToString()) + : this.GetLocalizedValue("Unequipped")); } } } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index f13c657338..ec854ac6f6 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -2252,6 +2252,10 @@ FrozenCube: { The Elumphant will cycle between shooting cold air that inflicts [cbuff:CalamityMod/WindChilled], and headbutting enemies Elumphant's headbutts only target enemies inflicted with [cbuff:CalamityMod/WindChilled] Reduces your defense by 33%, but uses that defense to boost the Elumphant's power and your cold debuff damage + [DAMAGELINE] [c/7497ED:What I wanna know is, where's the mammoth?'] ''' + EquippedDebuff: Current Cold Debuff boost: +{0}% + EquippedElumphant: Current Elumphant Power: +{0}% + Unequipped: Equip this accessory to view its statistics } diff --git a/Projectiles/Typeless/Elumphant.cs b/Projectiles/Typeless/Elumphant.cs index f193374ebd..06f3ea2de2 100644 --- a/Projectiles/Typeless/Elumphant.cs +++ b/Projectiles/Typeless/Elumphant.cs @@ -1,25 +1,24 @@ using System; using System.Collections.Generic; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; +using System.Linq; using CalamityMod.Dusts; +using CalamityMod.Enums; +using CalamityMod.Graphics.Primitives; using CalamityMod.Items.Accessories; -using CalamityMod.NPCs.SunkenSea; using CalamityMod.Particles; -using CalamityMod.Projectiles.Ranged; -using Microsoft.CodeAnalysis; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; +using ReLogic.Utilities; using Terraria; using Terraria.Audio; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; -using static System.Net.Mime.MediaTypeNames; namespace CalamityMod.Projectiles.Typeless { - public class Elumphant : ModProjectile, ILocalizedModType + public class Elumphant : ModProjectile, ILocalizedModType, IPixelatedPrimitiveRenderer { public new string LocalizationCategory => "Projectiles.Typeless"; public Player Owner => Main.player[Projectile.owner]; @@ -27,49 +26,57 @@ namespace CalamityMod.Projectiles.Typeless public static Color color2 = new Color(103, 188, 214); public Color usedColor = Color.White; public ref float time => ref Projectile.ai[0]; - public float squashTimerX = 0; - public float squashTimerY = 0; - public float fallTimer = 0; + public float squashTimerX = 0; public float squashTimerY = 0; // Adjusts the X and Y centric squash effects + public float fallTimer = 0; // How long the Elumphant has been falling public int maxFallTimer = 120; public int lastHighestFallTimer = 0; - public ref float attackTimer => ref Projectile.ai[1]; + public ref float attackTimer => ref Projectile.ai[1]; // Timer for cycling between attack and cooldown phases + public ref float mistShootTimer => ref Projectile.ai[2]; // Timer for the frames that it fires mist public float fxFade = 0; // The glow visuals multiplier - public float followSpeed = 7; // The speed it follows you, lower is faster - public float lerpDir = 0; - public float actionSpeed = 1; - public float verticalSquash = 0; - public float horizontalSquash = 0; + public float verticalSquash = 0; public float horizontalSquash = 0; // The Elumphant's current X and Y squash - public float trunkRotation = 0; - public bool dashing = false; - public NPC targeted; - public bool hitHead = true; - public int blinkTime = 1; - public int cryTime = 1; - public bool mammothFlip = false; - public bool mammothOops = false; - public float hopSize = 0; - public int hopTimer = 0; + public float trunkRotation = 0; // Rotation for the trunk, and also the direction that it's mist will be fired in + public bool dashing = false; // If the Elumphant is performing its jumping bonk attack + public NPC targeted; // The currently targeted NPC for either of it's attacks + public bool hitHead = true; // If the Elumphant has landed on its back when falling back to the player's head + public int blinkTime = 1; public int cryTime = 1; // Timers for doing its idle animations + public bool mammothFlip = false; // If the Elumphant is spinning as it falls back to the player + public bool mammothOops = false; // If the Elumphant is doing its mistake animation after bonking the player's head + public int hopTimer = 0; // Timer for the little hop after bonking its head public bool attackedThisFrame = false; public int attackDirection = 1; - public float mistShootTimer = 0; public int attacksDone = 0; - public bool recoiling = false; - public float maxTargetingDistance => 500 * GetPower(0.25f); + public bool recoiling = false; // If the Elumphant has finished bonking enemies and is returning to the player + public float maxTargetingDistance = 0; public float maxTrunkRot => -MathHelper.PiOver2 * 1.1f; public int attackTime => (int)(FrozenCube.baseAttackSpeed); - public int attackTimeAdjusted => (int)(FrozenCube.baseAttackSpeed / (GetPower(0.5f) + 0.23f * Projectile.numHits)); - public int cooldownTime => (int)(FrozenCube.baseAttackCooldown / GetPower(0.5f)); + public int attackTimeAdjusted = 0; // Attack speed adjusted for the slam attack + public float damageScaling = 0; // The damage scaling on the mist and slam attacks + public int cooldownTime = 0; // The cooldown between attacks public List hitNPCs = new List(); public Vector2 lastHitNPCPos; public Vector2 lastProjPos; public bool spawnJumpDusts = true; + public int usedDefenseDivide = 3; + public float frozenCubePower = 0; // The base power boost gained fromd defense before scaling adjustments + public bool vis => Owner.Calamity().frozenCubeVisuals; Vector2 goalPosition; + public SlotId soundSlot; + public static Asset TrunkTexture { get; private set; } + public override void Load() + { + if (Main.dedServ) + return; + + TrunkTexture = ModContent.Request("CalamityMod/Projectiles/Typeless/ElumphantTrunk"); + } public override void SetStaticDefaults() { + ProjectileID.Sets.TrailCacheLength[Type] = 25; + ProjectileID.Sets.TrailingMode[Type] = 2; Main.projFrames[Type] = 3; } public override void SetDefaults() @@ -85,16 +92,62 @@ namespace CalamityMod.Projectiles.Typeless Projectile.localNPCHitCooldown = -1; Projectile.DamageType = DamageClass.Generic; } + public float WidthFunction(float completion, Vector2 _) + { + float width; + float sine = MathF.Sin(Main.GlobalTimeWrappedHourly * 9 - completion * 6); + float newSine = 0.7f - sine * 0.1f; + float cutPoint = 0.1f; + float baseFade = (MathF.Pow((1 - completion), 2)); + float compFade = completion > cutPoint ? baseFade : baseFade * (1 - MathF.Pow((Utils.GetLerpValue(cutPoint, 0, completion)), 3)); + width = (completion == 0 ? 0 : 45 * newSine * compFade); + + return width; + } + public Color ColorFunction(float completion, Vector2 _) + { + float sine = MathF.Sin(Main.GlobalTimeWrappedHourly * 9 - completion * 6); + Color clr = Color.Lerp(usedColor, Color.DodgerBlue, 0.6f + 0.2f * sine); + Color tipColor = Color.Lerp(clr, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + return Color.Lerp(clr, tipColor, completion) * fxFade; + } + public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, GeneralDrawLayer layer) + { + if (vis) + { + // Render the main trail + string shader = "CalamityMod:TrailStreak"; + Vector2[] length = Projectile.oldPos.Take((int)(Math.Max(10 - Projectile.numHits, 5))).ToArray(); + GameShaders.Misc[shader].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/DoubleTrail")); + PrimitiveRenderer.RenderTrail(length, new(WidthFunction, ColorFunction, (_, _) => Projectile.Size * 0.5f, true, true, GameShaders.Misc[shader]), length.Length * 6); + } + } + public void SetStats() + { + maxTargetingDistance = (float)(500 * GetPower(0.25f)); + attackTimeAdjusted = (int)(FrozenCube.baseAttackSpeed / (GetPower(0.5f))); + damageScaling = (float)GetPower(0.014f, 21 * (1 + frozenCubePower)); + cooldownTime = (int)(FrozenCube.baseAttackCooldown / GetPower(0.5f)); + } public void SetElumphantPower() { - int usedDefense = (Owner.statDefense / 3); - if (time == 0) + int usedDefense = (Owner.statDefense / usedDefenseDivide); + if (time == 0) // Show the player how much defense is being used CombatText.NewText(Projectile.Hitbox, color2, -usedDefense,false, true); Owner.statDefense -= usedDefense; - Owner.Calamity().frozenCubePower = usedDefense * 0.05f; - Owner.Calamity().ColdDebuffMultiplier += Owner.Calamity().frozenCubePower; + frozenCubePower = usedDefense * 0.05f; // 1 point of defense = 5% effectiveness + + float power = (float)(GetPower(0.02f, 14f * (1 + frozenCubePower)) - 1); + Owner.Calamity().frozenCubeDebuffBoost = power; + Owner.Calamity().frozenCubeElumphantBoost = damageScaling - 1; + Owner.Calamity().ColdDebuffMultiplier += power; // Boost cold debuff damage } - public float GetPower(float efficiency) => 1 + Owner.Calamity().frozenCubePower * efficiency; + public double GetPower(float efficiency, float intenseScaling = 1) + { + double defensePower = frozenCubePower; + return Math.Pow(1 + defensePower * efficiency, intenseScaling); + } + public void GetColor() { float rate = Main.GlobalTimeWrappedHourly * 5; @@ -128,26 +181,21 @@ namespace CalamityMod.Projectiles.Typeless } Projectile.spriteDirection = newDirection; } - public void GetTarget(bool excludeHitNPCs) // Target closest NPC to mouse, unless they're too far, then do closest to Elumphant + public void GetTarget(bool excludeHitNPCs, float distanceMult = 1) // Target closest NPC to mouse, unless they're too far, then do closest to Elumphant { if (excludeHitNPCs) { - float distance = maxTargetingDistance * 5; NPC chosenTarget = null; - for (int index = 0; index < Main.npc.Length; index++) // look for a target that isnt one it has already hit in the last two hits. + float distance = 0; + for (int index = 0; index < Main.npc.Length; index++) // look for a target that isnt one it has already hit { NPC searchedTarget = Main.npc[index]; - if (searchedTarget.CanBeChasedBy(null, false)) + if (searchedTarget.CanBeChasedBy(null, false) && searchedTarget.HasBuff(FrozenCube.debuff) && !hitNPCs.Contains(searchedTarget) && searchedTarget.active && searchedTarget.life > 0) { - float extraDistance = (searchedTarget.width / 2) + (searchedTarget.height / 2); - - bool canHit = true; - if (extraDistance < distance) - canHit = Collision.CanHit(Projectile.Center, 1, 1, Main.npc[index].Center, 1, 1); // blocked by walls - - if (searchedTarget.HasBuff(ModContent.BuffType()) && Vector2.Distance(Projectile.Center, searchedTarget.Center) < distance && !hitNPCs.Contains(searchedTarget) && searchedTarget.active && searchedTarget.life > 0 && canHit) + float targetDistance = Projectile.Center.Distance(new Vector2(searchedTarget.Center.X, Projectile.Center.Y)); + if (targetDistance > distance) { - distance = Vector2.Distance(Projectile.Center, searchedTarget.Center); + distance = targetDistance; chosenTarget = searchedTarget; } } @@ -156,27 +204,261 @@ namespace CalamityMod.Projectiles.Typeless } else { - targeted = (Owner.ClampedMouseWorld()).ClosestNPCAt(maxTargetingDistance, true); - if (!ValidDistance()) - targeted = (Projectile.Center).ClosestNPCAt(maxTargetingDistance, true); + bool targetFar = (distanceMult != -1); + + NPC chosenTarget = null; + float distance = (targetFar ? 0 : maxTargetingDistance); + for (int index = 0; index < Main.npc.Length; index++) + { + NPC searchedTarget = Main.npc[index]; + if (searchedTarget.CanBeChasedBy(null, false) && searchedTarget.active && searchedTarget.life > 0) + { + bool canHit = Collision.CanHit(Owner.Center, 1, 1, searchedTarget.Center, 1, 1); + + float targetDistance = Owner.Center.Distance(new Vector2(searchedTarget.Center.X, Owner.Center.Y)); + // Checks most distant target first, then closest if that fails + bool inRange = (targetFar ? (targetDistance > distance) : (targetDistance < distance)); + if (inRange && canHit && targetDistance < maxTargetingDistance) + { + distance = targetDistance; + chosenTarget = searchedTarget; + } + } + } + if (chosenTarget != null) + targeted = chosenTarget; + if (!ValidDistance()) targeted = null; } } - public bool ValidDistance() => (targeted != null && targeted.Distance(Projectile.Center) < maxTargetingDistance); + public void ScaleOpacity(float endAt) + { + Projectile.Opacity = MathHelper.Lerp(Projectile.Opacity, endAt, 0.12f); + } + public bool ValidDistance(float distanceCheckMult = 1) => (targeted != null && targeted.Distance(Owner.Center) < (maxTargetingDistance * distanceCheckMult)); + public void HopAttack(Vector2 originalPosition) + { + if (!vis) + ScaleOpacity(0.4f); + if (attackTimer == 0 && Projectile.numHits == 0) + { + GetTarget(true); + } + if (attacksDone != 0) + Projectile.frame = 2; + if (recoiling) + { + attackTimeAdjusted = (int)(FrozenCube.baseAttackSpeed / GetPower(0.5f)); + if (Projectile.numHits > 1) + attackTimer = attackTimeAdjusted; + Projectile.numHits = 1; + } + + float attackLerp = Utils.GetLerpValue((int)(Math.Max(attackTimeAdjusted, 2) / 2), Math.Max(attackTimeAdjusted, 2), attackTimer, true); + int direction = Owner.ItemAnimationActive ? (Math.Sign(Projectile.Center.DirectionTo(Owner.ClampedMouseWorld()).X)) : (Owner.direction); + if (!recoiling) + fxFade = (attackLerp <= 0.2f ? 0 : Math.Max(attackLerp, MathHelper.Lerp(fxFade, 1, 0.15f))); + else + fxFade = MathHelper.Lerp(0f, 1, MathF.Pow(attackLerp, 4)); + if (targeted == null || (targeted != null && (targeted.life <= 0 || !targeted.active))) + { + if (attackLerp > 0 && !recoiling) + { + lastHitNPCPos = Projectile.Center; + attackTimer = attackTimeAdjusted; + } + recoiling = true; + targeted = null; + } + + Vector2 basePosition = recoiling ? originalPosition : Projectile.numHits == 0 ? originalPosition : (lastHitNPCPos); + Vector2 targetPos = recoiling ? lastHitNPCPos : targeted.Center - (Vector2.UnitY * targeted.height / 2); + + float jumpHeight = 250;// Math.Max(250 - Projectile.numHits * 10, recoiling ? 250 : 60); + float jumpLerp = attackLerp > 0.5f ? 1 - (MathF.Pow(Utils.GetLerpValue(0.5f, 1f, attackLerp), 4)) : 1 - (MathF.Pow(Utils.GetLerpValue(0.5f, 0f, attackLerp), 2)); + float jumpOffsetY = MathHelper.Lerp(basePosition.Y, targetPos.Y, attackLerp) - jumpHeight * jumpLerp; + float jumpOffsetX = MathHelper.Lerp(basePosition.X, targetPos.X, attackLerp); + goalPosition = new Vector2(jumpOffsetX, jumpOffsetY); + + Projectile.Center = goalPosition; + + if (attackLerp > 0f && spawnJumpDusts && vis) + { + bool clrChoose = Main.rand.NextBool(); + int halfDusts = 14; + for (int i = -halfDusts; i <= halfDusts; i++) + { + Vector2 dustVel = -Vector2.UnitY.RotatedByRandom(0.9f) * Main.rand.NextFloat(0.6f, 1.8f); + Vector2 dustPos = Owner.Center + Vector2.UnitY * -(Owner.height / 2 + Projectile.height / 2.5f * Projectile.scale) + dustVel * 1.5f; + Dust dust2 = Dust.NewDustPerfect(dustPos, ModContent.DustType(), + dustVel.RotatedByRandom(0.55f) * (Math.Abs(i) * 0.2f) * (Main.rand.NextBool(5) ? 3 : 1), 0, default, Main.rand.NextFloat(0.2f, 0.45f) * 2.5f); + dust2.noGravity = true; + dust2.color = Main.rand.NextBool() ? color1 : color2; + dust2.customData = new Vector2(0.6f, 1.5f); + dust2.fadeIn = -0.7f; + + if (i == -1) + i = 1; + } + spawnJumpDusts = false; + } + + float goalAngle = (attackLerp > 0.5f ? basePosition.DirectionTo(Projectile.Center) : Projectile.Center.DirectionTo(targetPos)).ToRotation() + (attackLerp > 0.5f ? MathHelper.PiOver2 : -MathHelper.PiOver2); + if (!recoiling) + Projectile.rotation = MathHelper.WrapAngle(Utils.Remap(attackLerp, 0, 1, -MathHelper.PiOver2 * Projectile.spriteDirection, MathHelper.PiOver2 * Projectile.spriteDirection)) * (1 - MathF.Pow(1 - attackLerp, 3)); + else + Projectile.rotation = MathHelper.WrapAngle(Utils.Remap(attackLerp, 0, 1, MathHelper.TwoPi * 2 * Projectile.spriteDirection, 0)); + trunkRotation = Utils.AngleLerp(trunkRotation, 0, 0.11f); + + int attemptDir = Math.Sign((recoiling ? basePosition.X : targetPos.X) - Projectile.Center.X); + SetDirection(attemptDir); + + if (attackTimer <= (int)(Math.Max(attackTimeAdjusted, 2) / 2) && recoiling) + { + Projectile.frame = 0; + hitNPCs.Clear(); + Projectile.velocity = Vector2.Zero; + recoiling = false; + dashing = false; + Projectile.numHits = 0; + attackTimer = (int)(cooldownTime / 2); + attacksDone = 0; + spawnJumpDusts = true; + for (int i = 0; i < Main.maxNPCs; i++) + Projectile.localNPCImmunity[i] = 0; + GetTarget(true); + } + } + public void MistAttack(float fallLerp) + { + Projectile.frame = 1; + float angleSweep = MathF.Sin(attackTimer * 0.085f) * attackDirection; + float goalAngle = Projectile.Center.DirectionTo(targeted.Center).ToRotation() - MathHelper.PiOver2; + if (attackTimer == cooldownTime + 1) // Make start attack sound + { + if (vis) + SoundEngine.PlaySound(FrozenCube.noise with { Pitch = Main.rand.NextFloat(-0.2f, 0.2f) }, Projectile.Center); + + Projectile.soundDelay = 0; + Projectile.frameCounter = 1; + } + SetDirection(Math.Sign(Projectile.Center.DirectionTo(targeted.Center).X)); + horizontalSquash = 0.5f; + Projectile.rotation = Projectile.rotation.AngleLerp((goalAngle + MathHelper.PiOver2 * Projectile.spriteDirection), 0.07f) * MathF.Pow(fallLerp, 0.2f); + float angleMax = MathHelper.PiOver4 * 0.75f * Utils.GetLerpValue(maxTargetingDistance, 30, Projectile.Center.Distance(targeted.Center), true); + if (hopTimer <= 0) + trunkRotation = trunkRotation.AngleLerp(goalAngle - Projectile.rotation - angleMax * angleSweep, 0.23f); + + if (attackTimer > (cooldownTime * 1.1f)) + { + if (!vis) + ScaleOpacity(0.4f); + if (mistShootTimer == 0 && Main.myPlayer == Projectile.owner) + { + Vector2 shootVel = (trunkRotation + Projectile.rotation + MathHelper.PiOver2).ToRotationVector2(); + int damage = (int)Owner.GetTotalDamage().ApplyTo((float)(FrozenCube.mistBaseDamage * damageScaling)); + int projectile = ModContent.ProjectileType(); + Vector2 shootPosition = Projectile.Center + shootVel * 5 * Projectile.scale; + Projectile mist = Projectile.NewProjectileDirect(Owner.GetSource_FromThis(), shootPosition, (shootVel * shootPosition.Distance(targeted.Center) / 25) * Main.rand.NextFloat(0.9f, 1.1f), projectile, damage, 0, Owner.whoAmI, 0, Owner.ownedProjectileCounts[projectile] % 3, (float)GetPower(1)); + } + mistShootTimer += (float)(0.35f * GetPower(0.25f)); + if (mistShootTimer >= 2f) + mistShootTimer = 0; + } + mammothFlip = false; + + attackedThisFrame = true; + if (!ValidDistance()) + { + GetTarget(false, -1); + if (!ValidDistance()) + { + attackTimer = cooldownTime + attackTime; + targeted = null; + } + } + if (attackTimer == cooldownTime + attackTime) + { + attackDirection *= -1; + Projectile.frame = 0; + attacksDone++; + if (attacksDone >= 2) // Every 2 attacks, do a dash slam + { + dashing = true; + attackTimer = -1; + } + } + } + public void Idle() + { + if (!vis) + ScaleOpacity(0); + targeted = null; + if (Owner.StandingStill()) // If standing still, let the player mess with the mammoth squash for fun + { + if (Owner.controlDown) + horizontalSquash = 0.5f; + if (Owner.controlUp) + verticalSquash = 0.5f; + } + if (Math.Abs(Owner.velocity.X) > 4 && fallTimer == 0) + verticalSquash = 0.25f * Utils.GetLerpValue(4, 10, Math.Abs(Owner.velocity.X)); + if (targeted == null && attackTimer > cooldownTime) // If can attack but there is no target, wait to decrease the timer until a target is found + attackTimer--; + int cryStart = (int)(cryTime - 65); + if (Projectile.soundDelay >= cryStart) + { + if (Projectile.soundDelay == cryStart) // Sound + { + verticalSquash = 0.3f; + if (vis) + soundSlot = SoundEngine.PlaySound(FrozenCube.cry with { Pitch = Main.rand.NextFloat(-0.2f, 0.2f) }, Projectile.Center); + } + trunkRotation = Utils.AngleLerp(trunkRotation, maxTrunkRot * Projectile.spriteDirection, 0.025f); + } + else if (hopTimer <= 0) + trunkRotation = Utils.AngleLerp(trunkRotation, 0, 0.11f); + if (Projectile.soundDelay >= cryTime) + { + SetRandCry(); + } + + if (Projectile.frameCounter >= blinkTime) + { + Projectile.frame = 1; + Projectile.frameCounter = -6; + } + if (Projectile.frameCounter == 0) + { + Projectile.frame = 0; + SetRandBlink(); + } + if (vis) + { + Projectile.frameCounter++; + Projectile.soundDelay += 2; // Naturally decreases by 1, so to make it count up, increases it by 2 + } + } public override void AI() { if (time == 0) { - lastHitNPCPos = lastProjPos = Owner.MountedCenter; + lastHitNPCPos = lastProjPos = Owner.Center; + Projectile.Opacity = 0; } + if (vis && Projectile.Opacity < 1) + ScaleOpacity(1); Projectile.timeLeft++; + SetStats(); GetColor(); SetElumphantPower(); ManageSquash(); + if (SoundEngine.TryGetActiveSound(soundSlot, out var sound) && sound.IsPlaying) + sound.Position = Projectile.Center; if (targeted != null && (targeted.life <= 0 || !targeted.active || !targeted.CanBeChasedBy(Projectile))) - targeted = null; + GetTarget(false); float sine = MathF.Sin(time * 0.04f); float sine2 = MathF.Sin(time * 0.08f); @@ -194,205 +476,31 @@ namespace CalamityMod.Projectiles.Typeless Vector2 offsetY = -Vector2.UnitY * (Owner.height / 2 + Projectile.height / 2.5f * Projectile.scale) * (1 + 0.4f * sine2 * fallLerp + 5 * CalamityUtils.EaseInOutExp(fallLerp, 2f, 2f)) * hop; Vector2 offsetX = Vector2.UnitX * ((3 * Projectile.spriteDirection) + 17 * sine3 * fallLerp) * Projectile.scale; - goalPosition = Owner.MountedCenter + offsetX + offsetY; - if (dashing) + goalPosition = Owner.Center + offsetX + offsetY; + + if (dashing) // Hop Attack { - if (attackTimer == 0) - { - GetTarget(true); - } - if (attacksDone != 0) - Projectile.frame = 2; - - float attackLerp = Utils.GetLerpValue((int)(attackTimeAdjusted / 2), attackTimeAdjusted, attackTimer, true); - int direction = Owner.ItemAnimationActive ? (Math.Sign(Projectile.Center.DirectionTo(Owner.ClampedMouseWorld()).X)) : (Owner.direction); - fxFade = attackLerp; - if (targeted == null || (targeted != null && (targeted.life <= 0 || !targeted.active))) - { - if (attackLerp > 0 && !recoiling) - { - lastHitNPCPos = Projectile.Center; - attackTimer = attackTimeAdjusted; - } - recoiling = true; - targeted = null; - } - - Vector2 ownerPos = (Owner.MountedCenter + new Vector2((3 * Projectile.spriteDirection), -(Owner.height / 2 + Projectile.height / 2.5f * Projectile.scale))); - Vector2 basePosition = recoiling ? ownerPos : Projectile.numHits == 0 ? ownerPos : (lastHitNPCPos); - Vector2 targetPos = recoiling ? lastHitNPCPos : targeted.Center - (Vector2.UnitY * targeted.height / 2); - - float jumpHeight = Math.Max(250 - Projectile.numHits * 40, recoiling ? 250 : 60); - float jumpLerp = attackLerp > 0.5f ? 1 - (MathF.Pow(Utils.GetLerpValue(0.5f, 1f, attackLerp), 4)) : 1 - (MathF.Pow(Utils.GetLerpValue(0.5f, 0f, attackLerp), 2)); - float jumpOffsetY = MathHelper.Lerp(basePosition.Y, targetPos.Y, attackLerp) - (jumpHeight + Math.Max(targeted != null ? (Owner.Center.Y - targeted.Center.Y) : 0, 0)) * jumpLerp; - float jumpOffsetX = MathHelper.Lerp(basePosition.X, targetPos.X, attackLerp); - goalPosition = new Vector2(jumpOffsetX, jumpOffsetY); - - Projectile.Center = goalPosition; - - if (attackLerp > 0f && spawnJumpDusts) - { - bool clrChoose = Main.rand.NextBool(); - int halfDusts = 14; - for (int i = -halfDusts; i <= halfDusts; i++) - { - Vector2 dustVel = -Vector2.UnitY.RotatedByRandom(0.9f) * Main.rand.NextFloat(0.6f, 1.8f); - Vector2 dustPos = Owner.MountedCenter + Vector2.UnitY * -(Owner.height / 2 + Projectile.height / 2.5f * Projectile.scale) + dustVel * 1.5f; - Dust dust2 = Dust.NewDustPerfect(dustPos, ModContent.DustType(), - dustVel.RotatedByRandom(0.55f) * (Math.Abs(i) * 0.2f) * (Main.rand.NextBool(5) ? 3 : 1), 0, default, Main.rand.NextFloat(0.2f, 0.45f) * 2.5f); - dust2.noGravity = true; - dust2.color = Main.rand.NextBool() ? color1 : color2; - dust2.customData = new Vector2(0.6f, 1.5f); - dust2.fadeIn = -0.7f; - - if (i == -1) - i = 1; - } - spawnJumpDusts = false; - } - - if (attackLerp > 0.6f && !recoiling) - { - Vector2 vel = lastProjPos.DirectionTo(Projectile.Center); - bool clrChoose = Main.rand.NextBool(); - float opacity = 0.3f * attackLerp; - Particle smoke = new CustomColorChangeSpark(Projectile.Center - vel * 18, vel * Main.rand.NextFloat(0.3f, 0.45f), "CalamityMod/Particles/BloomCircle", false, Main.rand.Next(12, 17), (Main.rand.NextFloat(0.35f, 0.45f) + 0.35f * attackLerp) * Projectile.scale, (clrChoose ? color1 : color2) with { A = 0 } * opacity, (clrChoose ? color2 : color1) with { A = 0 } * opacity, new Vector2(0.65f, 1f), false, shrinkSpeed: 0.1f); - GeneralParticleHandler.SpawnParticle(smoke, true, Enums.GeneralDrawLayer.BeforeProjectiles); - } - - float goalAngle = (attackLerp > 0.5f ? basePosition.DirectionTo(Projectile.Center) : Projectile.Center.DirectionTo(targetPos)).ToRotation() + (attackLerp > 0.5f ? MathHelper.PiOver2 : -MathHelper.PiOver2); - if (!recoiling) - Projectile.rotation = MathHelper.WrapAngle(Utils.Remap(attackLerp, 0, 1, -MathHelper.PiOver2 * Projectile.spriteDirection, MathHelper.PiOver2 * Projectile.spriteDirection)) * (1 - MathF.Pow(1 - attackLerp, 3)); - else - Projectile.rotation = MathHelper.WrapAngle(Utils.Remap(attackLerp, 0, 1, MathHelper.TwoPi * 2 * Projectile.spriteDirection, 0)); - trunkRotation = trunkRotation.AngleLerp(Projectile.rotation, recoiling ? 1 : 0.15f); - - int attemptDir = Math.Sign((recoiling ? basePosition.X : targetPos.X) - Projectile.Center.X); - SetDirection(attemptDir); - - if (attackTimer <= (int)(attackTimeAdjusted / 2) && recoiling) - { - Projectile.frame = 0; - hitNPCs.Clear(); - Projectile.velocity = Vector2.Zero; - recoiling = false; - dashing = false; - Projectile.numHits = 0; - attackTimer = (int)(cooldownTime / 2); - attacksDone = 0; - spawnJumpDusts = true; - for (int i = 0; i < Main.maxNPCs; i++) - Projectile.localNPCImmunity[i] = 0; - GetTarget(true); - } + HopAttack(goalPosition); } else { - int direction = Owner.ItemAnimationActive ? (Math.Sign(Projectile.Center.DirectionTo(Owner.ClampedMouseWorld()).X)) : Math.Sign(Owner.velocity.X); - if (fallTimer == 0) - SetDirection(direction); Projectile.Center = goalPosition; if (targeted == null) GetTarget(false); - if (attackTimer == cooldownTime && !ValidDistance()) - attackTimer--; - if (attackTimer > cooldownTime && ValidDistance()) // Attack!!! + + if (attackTimer > cooldownTime && targeted != null) // Mist Attack { - Projectile.frame = 1; - float angleSweep = MathF.Sin(attackTimer * 0.085f) * attackDirection; - float goalAngle = Projectile.Center.DirectionTo(targeted.Center).ToRotation() - MathHelper.PiOver2; - if (attackTimer == cooldownTime + 1) // Make start attack sound - { - SoundStyle attack = new("CalamityMod/Sounds/Item/ElumphantSound"); - SoundEngine.PlaySound(attack with { Pitch = Main.rand.NextFloat(-0.2f, 0.2f) }, Projectile.Center); - - Projectile.soundDelay = 0; - Projectile.frameCounter = 1; - } - SetDirection(Math.Sign(Projectile.Center.DirectionTo(targeted.Center).X)); - horizontalSquash = 0.5f; - Projectile.rotation = Projectile.rotation.AngleLerp((goalAngle + MathHelper.PiOver2 * Projectile.spriteDirection), 0.07f) * MathF.Pow(fallLerp, 0.2f); - float angleMax = MathHelper.PiOver4 * 0.75f * Utils.GetLerpValue(maxTargetingDistance, 30, Projectile.Center.Distance(targeted.Center), true); - if (hopTimer == 0) - trunkRotation = trunkRotation.AngleLerp(goalAngle - Projectile.rotation - angleMax * angleSweep, 0.23f); - - if (attackTimer > (cooldownTime * 1.1f)) - { - if (mistShootTimer == 0 && Main.myPlayer == Projectile.owner) - { - Vector2 shootVel = (trunkRotation + Projectile.rotation + MathHelper.PiOver2).ToRotationVector2(); - int damage = (int)Owner.GetTotalDamage().ApplyTo(FrozenCube.mistBaseDamage * GetPower(4)); - int projectile = ModContent.ProjectileType(); - Vector2 shootPosition = Projectile.Center + shootVel * 5 * Projectile.scale; - Projectile mist = Projectile.NewProjectileDirect(Owner.GetSource_FromThis(), shootPosition, (shootVel * shootPosition.Distance(targeted.Center) / 25) * Main.rand.NextFloat(0.9f, 1.1f), projectile, damage, 0, Owner.whoAmI, 0, Owner.ownedProjectileCounts[projectile] % 3, GetPower(1)); - } - mistShootTimer += 0.35f * GetPower(0.25f); - if (mistShootTimer >= 2f) - mistShootTimer = 0; - } - mammothFlip = false; - - attackedThisFrame = true; - if (attackTimer == cooldownTime + attackTime) - { - attackDirection *= -1; - Projectile.frame = 0; - attacksDone++; - if (attacksDone >= 2) // Every 2 attacks, do a dash slam - { - dashing = true; - attackTimer = -1; - } - } + MistAttack(fallLerp); } else // Idle { - targeted = null; - if (Owner.StandingStill()) // If standing still, let the player mess with the mammoth squash for fun - { - if (Owner.controlDown) - horizontalSquash = 0.5f; - if (Owner.controlUp) - verticalSquash = 0.5f; - } - if (Math.Abs(Owner.velocity.X) > 4 && fallTimer == 0) - verticalSquash = 0.25f * Utils.GetLerpValue(4, 10, Math.Abs(Owner.velocity.X)); - if (targeted == null && attackTimer > cooldownTime) // If can attack but there is no target, wait to decrease the timer until a target is found - attackTimer--; - int cryStart = (int)(cryTime - 65); - if (Projectile.soundDelay >= cryStart) - { - if (Projectile.soundDelay == cryStart) // Sound - { - verticalSquash = 0.3f; - SoundStyle cry = new("CalamityMod/Sounds/Item/ElumphantCry"); - SoundEngine.PlaySound(cry with { Pitch = Main.rand.NextFloat(-0.2f, 0.2f) }, Projectile.Center); - } - trunkRotation = Utils.AngleLerp(trunkRotation, maxTrunkRot * Projectile.spriteDirection, 0.025f); - } - else - trunkRotation = Utils.AngleLerp(trunkRotation, 0, 0.11f); - if (Projectile.soundDelay >= cryTime) - { - SetRandCry(); - } - - if (Projectile.frameCounter >= blinkTime) - { - Projectile.frame = 1; - Projectile.frameCounter = -6; - } - if (Projectile.frameCounter == 0) - { - Projectile.frame = 0; - SetRandBlink(); - } - - Projectile.frameCounter++; - Projectile.soundDelay += 2; // Naturally decreases by 1, so to make it count up, increases it by 2 + int direction = Owner.ItemAnimationActive ? (Math.Sign(Projectile.Center.DirectionTo(Owner.ClampedMouseWorld()).X)) : Owner.direction; + if (fallTimer == 0) + SetDirection(direction); + Idle(); } - if (hopTimer == 0 && !attackedThisFrame) + if (hopTimer <= 0 && !attackedThisFrame) { if (mammothFlip) { @@ -403,11 +511,10 @@ namespace CalamityMod.Projectiles.Typeless } } - - if (Owner.velocity.Y > 8) + if (Owner.velocity.Y > 8 && !dashing && vis) // If the player is falling at close to max normal downward velocity { if (fallTimer == 0) - mammothFlip = true;//Main.rand.NextBool(3); + mammothFlip = Main.rand.NextBool(3); hitHead = false; SetRandCry(); SetRandBlink(); @@ -415,7 +522,7 @@ namespace CalamityMod.Projectiles.Typeless fallTimer++; } else if (fallTimer > 0) - fallTimer -= 7 - Owner.velocity.Y; if (fallTimer < 0) fallTimer = 0; + fallTimer -= 7 - Math.Min(Owner.velocity.Y, 0); if (fallTimer < 0) fallTimer = 0; if (fallTimer <= 0 && !hitHead) { float landPower = (Utils.GetLerpValue(0, maxFallTimer, lastHighestFallTimer, true)); @@ -425,32 +532,31 @@ namespace CalamityMod.Projectiles.Typeless float rotation = MathHelper.WrapAngle(Projectile.rotation + MathHelper.Pi); if (mammothFlip && rotation < MathHelper.PiOver2 && rotation > -MathHelper.PiOver2 && landPower > 0.2f) { - SoundStyle bonk = new("CalamityMod/Sounds/Item/Bonk"); - SoundEngine.PlaySound(bonk with { Pitch = Main.rand.NextFloat(0.1f, 0.2f) }, Projectile.Center); - int halfDusts = 7; - Owner.SetScreenshake(3); Projectile.frame = 1; SetRandBlink(); - for (int i = -halfDusts; i <= halfDusts; i++) + if (vis) { - Vector2 dustVel = Vector2.UnitX.RotatedByRandom(0.2f) * Main.rand.NextFloat(0.6f, 1.8f); - Vector2 dustPos = Owner.MountedCenter - (Vector2.UnitY * Owner.height / 2) + dustVel * 1.5f; - Dust dust2 = Dust.NewDustPerfect(dustPos, ModContent.DustType(), - dustVel * (i * 0.4f), 0, default, Main.rand.NextFloat(0.2f, 0.45f) * 3); - dust2.noGravity = true; - dust2.color = Main.rand.NextBool() ? color1 : color2; - dust2.customData = new Vector2(0.6f, 1.5f); - dust2.fadeIn = -0.4f; - if (i == -1) - i = 1; + Owner.SetScreenshake(2); + SoundEngine.PlaySound(FrozenCube.jokeBonk with { Pitch = Main.rand.NextFloat(0.1f, 0.2f) }, Projectile.Center); + for (int i = -halfDusts; i <= halfDusts; i++) + { + Vector2 dustVel = Vector2.UnitX.RotatedByRandom(0.2f) * Main.rand.NextFloat(0.6f, 1.8f); + Vector2 dustPos = Owner.Center - (Vector2.UnitY * Owner.height / 2) + dustVel * 1.5f; + Dust dust2 = Dust.NewDustPerfect(dustPos, ModContent.DustType(), + dustVel * (i * 0.4f), 0, default, Main.rand.NextFloat(0.2f, 0.45f) * 3); + dust2.noGravity = true; + dust2.color = Main.rand.NextBool() ? color1 : color2; + dust2.customData = new Vector2(0.6f, 1.5f); + dust2.fadeIn = -0.4f; + if (i == -1) + i = 1; + } + SoundEngine.PlaySound(FrozenCube.noise with { Pitch = Main.rand.NextFloat(0.4f, 0.6f), volume = 0.6f }, Projectile.Center); + CombatText.NewText(Projectile.Hitbox, usedColor, "!"); } trunkRotation = maxTrunkRot * Projectile.spriteDirection; - SoundStyle ahh = new("CalamityMod/Sounds/Item/ElumphantSound"); - SoundEngine.PlaySound(ahh with { Pitch = Main.rand.NextFloat(0.4f, 0.6f), volume = 0.6f }, Projectile.Center); - CombatText.NewText(Projectile.Hitbox, usedColor, "!"); - verticalSquash = 1.5f * landPower; mammothOops = true; } @@ -461,7 +567,7 @@ namespace CalamityMod.Projectiles.Typeless mammothFlip = false; } - if (fxFade > 0) + if (fxFade > 0 && vis) Lighting.AddLight(Projectile.Center, usedColor.ToVector3() * 0.6f * fxFade); if (fallTimer > lastHighestFallTimer) @@ -470,7 +576,7 @@ namespace CalamityMod.Projectiles.Typeless if (attackTimer >= attackTime + cooldownTime) attackTimer = 0; - attackTimer += recoiling ? -0.75f : 1; + attackTimer += recoiling ? -0.75f : 1 + 0.4f * Projectile.numHits; time++; if (mammothOops) hopTimer++; @@ -485,7 +591,12 @@ namespace CalamityMod.Projectiles.Typeless lastProjPos = Projectile.Center; if (!Owner.Calamity().frozenCube) + { + if (sound.IsPlaying) + sound?.Stop(); Projectile.Kill(); + return; + } } public void SetRandBlink() { @@ -495,15 +606,16 @@ namespace CalamityMod.Projectiles.Typeless public void SetRandCry() { Projectile.soundDelay = 0; - cryTime = Main.rand.Next(420, 600 + 1); + cryTime = Main.rand.Next(800, 1200 + 1); } public override bool PreDraw(ref Color lightColor) { + if (time == 0) + return false; Asset tex = ModContent.Request(Texture); - Texture2D trunk = ModContent.Request("CalamityMod/Projectiles/Typeless/ElumphantTrunk").Value; - Texture2D bTexture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + Texture2D trunk = TrunkTexture.Value; - Color bodyColor = lightColor; + Color bodyColor = lightColor * Projectile.Opacity; Rectangle frame = tex.Value.Frame(1, Main.projFrames[Type], 0, Projectile.frame); float squashSineV = MathF.Sin(squashTimerY * 0.55f) * verticalSquash; @@ -518,11 +630,14 @@ namespace CalamityMod.Projectiles.Typeless float trunkPosX = (trunkDistX - trunkDistX * (1 - squashX)) * Projectile.spriteDirection; Vector2 trunkPos = new Vector2(trunkPosX * Projectile.scale, 0); - for (int i = 0; i < 18; i++) // Backglow + if (vis) { - Vector2 drawOffset = (MathHelper.TwoPi * i / 18f).ToRotationVector2() * 6 * fxFade; - Main.EntitySpriteDraw(tex.Value, elumphantLocation - Main.screenPosition + drawOffset, frame, usedColor with { A = 0 } * 0.2f * fxFade, Projectile.rotation, frame.Size() * 0.5f, elumphantSquash * Projectile.scale, Projectile.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally); - Main.EntitySpriteDraw(trunk, elumphantLocation - Main.screenPosition + trunkPos.RotatedBy(Projectile.rotation), null, usedColor with { A = 0 } * 0.2f * fxFade, Projectile.rotation + trunkRotation, new Vector2(trunk.Width / 2, 0), elumphantSquash * Projectile.scale, Projectile.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally); + for (int i = 0; i < 18; i++) // Backglow + { + Vector2 drawOffset = (MathHelper.TwoPi * i / 18f).ToRotationVector2() * 4 * fxFade; + Main.EntitySpriteDraw(tex.Value, elumphantLocation - Main.screenPosition + drawOffset, frame, usedColor with { A = 0 } * 0.2f * fxFade, Projectile.rotation, frame.Size() * 0.5f, elumphantSquash * Projectile.scale, Projectile.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally); + Main.EntitySpriteDraw(trunk, elumphantLocation - Main.screenPosition + trunkPos.RotatedBy(Projectile.rotation), null, usedColor with { A = 0 } * 0.2f * fxFade * Projectile.Opacity, Projectile.rotation + trunkRotation, new Vector2(trunk.Width / 2, 0), elumphantSquash * Projectile.scale, Projectile.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally); + } } // Main body @@ -536,11 +651,8 @@ namespace CalamityMod.Projectiles.Typeless { if (dashing) { - float attackMult = 0.7f * GetPower(0.5f); - SoundStyle attack = new("CalamityMod/Sounds/Item/Bonk"); - SoundEngine.PlaySound(attack with { Pitch = -0.2f + 0.05f * Projectile.numHits, volume = 0.75f, MaxInstances = -1 }, Projectile.Center); - - target.MoveNPC(Projectile.Center.DirectionTo(target.Center), 8, false, Owner); + float attackMult = (float)(0.7f * GetPower(0.5f)); + target.MoveNPC(Vector2.UnitY, 8, false, Owner); hitNPCs.Add(target); GetTarget(true); @@ -549,62 +661,65 @@ namespace CalamityMod.Projectiles.Typeless bool lastHit = false; if (targeted == null) { - Projectile.extraUpdates = 0; attackMult *= 1.25f; - Owner.SetScreenshake(3 * attackMult); + if (vis) + Owner.SetScreenshake(3 * attackMult); lastHit = true; recoiling = true; - modifiers.SourceDamage *= 2f * GetPower(5); + modifiers.SourceDamage *= (float)(1.5f * damageScaling); } else { - attackTimer = (int)(attackTimeAdjusted / 2) - 4; - float minMult = 0.1f; - int hitsToMinMult = 3; + attackTimer = (int)(attackTimeAdjusted / 2); + float minMult = 0.25f; + int hitsToMinMult = 4; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= damageMult * GetPower(4); + modifiers.SourceDamage *= (float)(damageMult * damageScaling); } - if (lastHit) + if (lastHit && vis) { - SoundStyle finalHit = new("CalamityMod/Sounds/Item/ElumphantSound"); - SoundEngine.PlaySound(finalHit with { Pitch = -0.5f, volume = 0.8f }, Projectile.Center); + SoundEngine.PlaySound(FrozenCube.noise with { Pitch = -0.5f, volume = 0.8f }, Projectile.Center); } verticalSquash = lastHit ? 0.85f : 0.5f; - int halfDusts = (int)((lastHit ? 12 : 8) * attackMult); - for (int i = -halfDusts; i <= halfDusts; i++) + if (vis) { - Vector2 dustVel = Vector2.UnitX * Main.rand.NextFloat(0.6f, 1.8f) * attackMult; - Vector2 dustPos = Projectile.Center + dustVel * 1.5f; - Dust dust2 = Dust.NewDustPerfect(dustPos, ModContent.DustType(), - dustVel.RotatedByRandom(0.35f) * (i * 0.4f), 0, default, Main.rand.NextFloat(0.2f, 0.45f) * (lastHit ? 5 : 3.5f) * attackMult); - dust2.noGravity = true; - dust2.color = Main.rand.NextBool() ? color1 : color2; - dust2.customData = new Vector2(0.6f, 1.5f); - dust2.fadeIn = -0.4f / attackMult; - - float opacity = 0.7f; - if (i % 2 == 0) + SoundEngine.PlaySound(FrozenCube.hit with { Pitch = -0.2f + 0.05f * Projectile.numHits, volume = 1f, MaxInstances = -1 }, Projectile.Center); + int halfDusts = (int)((lastHit ? 12 : 8) * attackMult); + for (int i = -halfDusts; i <= halfDusts; i++) { - bool clrChoose = Main.rand.NextBool(); - Particle smoke = new CustomColorChangeSpark(dustPos, dustVel.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.3f, 0.45f) * i * (lastHit ? 2 : 1), Main.rand.NextBool(3) ? "CalamityMod/Particles/WaterFoam" : "CalamityMod/Particles/BloomCircle", false, Main.rand.Next(22, 27), Main.rand.NextFloat(0.45f, 0.65f) * Projectile.scale * (lastHit ? 2 : 1) * attackMult, (clrChoose ? color1 : color2) * opacity, (clrChoose ? color2 : color1) * opacity, new Vector2(0.25f, 1.2f)); - GeneralParticleHandler.SpawnParticle(smoke, true); - } + Vector2 dustVel = Vector2.UnitX * Main.rand.NextFloat(0.6f, 1.8f) * attackMult; + Vector2 dustPos = Projectile.Center + dustVel * 1.5f; + Dust dust2 = Dust.NewDustPerfect(dustPos, ModContent.DustType(), + dustVel.RotatedByRandom(0.35f) * (i * 0.4f), 0, default, Main.rand.NextFloat(0.2f, 0.45f) * (lastHit ? 5 : 3.5f) * attackMult); + dust2.noGravity = true; + dust2.color = Main.rand.NextBool() ? color1 : color2; + dust2.customData = new Vector2(0.6f, 1.5f); + dust2.fadeIn = -0.4f / attackMult; - if (lastHit) - { - bool clrChoose = Main.rand.NextBool(); - float velMult = Main.rand.NextFloat(1.2f, 1.35f) * i; - Vector2 velocity = dustVel.RotatedByRandom(0.3f) * velMult; - Particle mist = new CustomPulsingSpark(dustPos, velocity, "CalamityMod/Particles/ThinSparkle", "CalamityMod/Particles/BloomCircle", false, 55, Main.rand.NextFloat(1.05f, 1.45f) * Projectile.scale * attackMult, (clrChoose ? color1 : color2) * opacity, (clrChoose ? color2 : color1) * opacity, - new Vector2(0.6f, 1.2f), true, true, Main.rand.Next(4, 7 + 1), colorFadeSpeed: 0.85f, noShrink: true, extraRotation: 0, shrinkSpeed: 0.1f, turnRate: (Main.rand.NextBool() ? -1 : 1) * Main.rand.NextFloat(0.0028f, 0.0035f) * velMult, - sineRate: Main.rand.NextFloat(0.09f, 0.12f), sineIntensity: (int)(4 + Main.rand.Next(15, 20 + 1)) * Projectile.scale, sineRotation: MathHelper.PiOver2 + velocity.ToRotation()); - GeneralParticleHandler.SpawnParticle(mist, true, Main.rand.NextBool() ? Enums.GeneralDrawLayer.AfterNPCs : Enums.GeneralDrawLayer.BeforeNPCs); - } + float opacity = 0.7f; + if (i % 2 == 0) + { + bool clrChoose = Main.rand.NextBool(); + Particle smoke = new CustomColorChangeSpark(dustPos, dustVel.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.3f, 0.45f) * i * (lastHit ? 2 : 1), Main.rand.NextBool(3) ? "CalamityMod/Particles/WaterFoam" : "CalamityMod/Particles/BloomCircle", false, Main.rand.Next(22, 27), Main.rand.NextFloat(0.45f, 0.65f) * Projectile.scale * (lastHit ? 2 : 1) * attackMult, (clrChoose ? color1 : color2) * opacity, (clrChoose ? color2 : color1) * opacity, new Vector2(0.25f, 1.2f)); + GeneralParticleHandler.SpawnParticle(smoke, true); + } - if (i == -1) - i = 1; + if (lastHit) + { + bool clrChoose = Main.rand.NextBool(); + float velMult = Main.rand.NextFloat(1.2f, 1.35f) * i; + Vector2 velocity = dustVel.RotatedByRandom(0.3f) * velMult; + Particle mist = new CustomPulsingSpark(dustPos, velocity, "CalamityMod/Particles/ThinSparkle", "CalamityMod/Particles/BloomCircle", false, 55, Main.rand.NextFloat(1.05f, 1.45f) * Projectile.scale * attackMult, (clrChoose ? color1 : color2) * opacity, (clrChoose ? color2 : color1) * opacity, + new Vector2(0.6f, 1.2f), true, true, Main.rand.Next(4, 7 + 1), colorFadeSpeed: 0.85f, noShrink: true, extraRotation: 0, shrinkSpeed: 0.1f, turnRate: (Main.rand.NextBool() ? -1 : 1) * Main.rand.NextFloat(0.0028f, 0.0035f) * velMult, + sineRate: Main.rand.NextFloat(0.09f, 0.12f), sineIntensity: (int)(4 + Main.rand.Next(15, 20 + 1)) * Projectile.scale, sineRotation: MathHelper.PiOver2 + velocity.ToRotation()); + GeneralParticleHandler.SpawnParticle(mist, true, Main.rand.NextBool() ? Enums.GeneralDrawLayer.AfterNPCs : Enums.GeneralDrawLayer.BeforeNPCs); + } + + if (i == -1) + i = 1; + } } } } @@ -616,6 +731,7 @@ namespace CalamityMod.Projectiles.Typeless { if (targeted == null) return false; + // These extra frames before the hit allow for a bit of "hitstop" on the jump attack return (dashing && attackTimer >= attackTimeAdjusted + 3 && target == targeted) ? null : false; } } diff --git a/Projectiles/Typeless/ElumphantMist.cs b/Projectiles/Typeless/ElumphantMist.cs index b84d3d6ff2..9cf18c4ac7 100644 --- a/Projectiles/Typeless/ElumphantMist.cs +++ b/Projectiles/Typeless/ElumphantMist.cs @@ -28,6 +28,19 @@ namespace CalamityMod.Projectiles.Typeless public int lifetime = 90; public float originalScale = 0; public Color mistColor = Color.White; + public bool vis => Owner.Calamity().frozenCubeVisuals; + public static Asset SmokeTexture1 { get; private set; } + public static Asset SmokeTexture2 { get; private set; } + public static Asset SmokeTexture3 { get; private set; } + public override void Load() + { + if (Main.dedServ) + return; + + SmokeTexture1 = ModContent.Request("CalamityMod/Projectiles/Typeless/SmokePuff1"); + SmokeTexture2 = ModContent.Request("CalamityMod/Projectiles/Typeless/SmokePuff2"); + SmokeTexture3 = ModContent.Request("CalamityMod/Projectiles/Typeless/SmokePuff3"); + } public override void SetDefaults() { Projectile.width = 32; @@ -57,12 +70,12 @@ namespace CalamityMod.Projectiles.Typeless float inverseFade = Utils.GetLerpValue(lifetime, 0, Projectile.timeLeft, true); float opacity = 0.4f * fade * (1.2f - inverseFade); - if (Main.rand.NextBool(3)) // Effects + if (Main.rand.NextBool(3) && vis) // Effects { Particle trail = new CustomColorChangeSpark(Projectile.Center + Main.rand.NextVector2Circular(40, 40) * Projectile.scale * (1 - fade) - Projectile.velocity.SafeNormalize(Vector2.UnitX) * (-35 + 65 * inverseFade) * Projectile.scale, Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.3f) * Main.rand.NextFloat(3, 4), Main.rand.NextBool(3) ? "CalamityMod/Particles/WaterFoam" : "CalamityMod/Particles/BloomCircle", false, Main.rand.Next(9, 12), Main.rand.NextFloat(0.75f, 1f) * Projectile.scale, (mistColor == Elumphant.color1 ? mistColor : Elumphant.color2) * opacity, (mistColor == Elumphant.color2 ? mistColor : Elumphant.color1) * opacity, new Vector2(0.15f + 0.85f * inverseFade, 1.4f - 0.4f * inverseFade)); GeneralParticleHandler.SpawnParticle(trail, true); } - if (Main.rand.NextBool(12)) + if (Main.rand.NextBool(12) && vis) { float rotation = 0; Vector2 velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.1f) * Main.rand.NextFloat(7f, 14f); @@ -78,7 +91,11 @@ namespace CalamityMod.Projectiles.Typeless } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - target.AddBuff(ModContent.BuffType(), (int)(300 * Projectile.ai[2])); + target.AddBuff(FrozenCube.debuff, (int)(300 * Projectile.ai[2])); + float minMult = 0.25f; + int hitsToMinMult = 3; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + modifiers.SourceDamage *= damageMult; } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { @@ -88,13 +105,12 @@ namespace CalamityMod.Projectiles.Typeless { if (time == 0) return false; - Asset tex = ModContent.Request(Texture); - Texture2D bTexture = (textureChoice == 0 ? ModContent.Request("CalamityMod/Particles/SmokePuff1").Value : textureChoice == 1 ? ModContent.Request("CalamityMod/Particles/SmokePuff2").Value : ModContent.Request("CalamityMod/Particles/SmokePuff3").Value); + Texture2D bTexture = (textureChoice == 0 ? SmokeTexture1.Value : textureChoice == 1 ? SmokeTexture2.Value : SmokeTexture3.Value); float inverseFade = Utils.GetLerpValue(lifetime, 0, Projectile.timeLeft, true); PixelationManager.AddPixelatedDrawer((_) => { - Main.EntitySpriteDraw(bTexture, Projectile.Center - Main.screenPosition, null, mistColor with { A = 0 } * fade, Projectile.rotation, new Vector2(bTexture.Width / 2, bTexture.Height * (MathHelper.Lerp(0.7f, 0.4f, inverseFade))), new Vector2(0.3f + 0.7f * inverseFade, 1.4f - 0.4f * inverseFade) * Projectile.scale, SpriteEffects.None); + Main.EntitySpriteDraw(bTexture, Projectile.Center - Main.screenPosition, null, mistColor with { A = 0 } * fade * (vis ? 1 : 0.5f), Projectile.rotation, new Vector2(bTexture.Width / 2, bTexture.Height * (MathHelper.Lerp(0.7f, 0.4f, inverseFade))), new Vector2(0.3f + 0.7f * inverseFade, 1.4f - 0.4f * inverseFade) * Projectile.scale, SpriteEffects.None); }, Enums.GeneralDrawLayer.AfterProjectiles, default); return false; } diff --git a/Particles/SmokePuff1.png b/Projectiles/Typeless/SmokePuff1.png similarity index 100% rename from Particles/SmokePuff1.png rename to Projectiles/Typeless/SmokePuff1.png diff --git a/Particles/SmokePuff2.png b/Projectiles/Typeless/SmokePuff2.png similarity index 100% rename from Particles/SmokePuff2.png rename to Projectiles/Typeless/SmokePuff2.png diff --git a/Particles/SmokePuff3.png b/Projectiles/Typeless/SmokePuff3.png similarity index 100% rename from Particles/SmokePuff3.png rename to Projectiles/Typeless/SmokePuff3.png diff --git a/Sounds/Item/ElumphantBop.ogg b/Sounds/Item/ElumphantBop.ogg new file mode 100644 index 0000000000000000000000000000000000000000..5f5cc8687202ed61dbfcf57803ebd0ed6074a4db GIT binary patch literal 14432 zcmch-dsv!R+Aq97FomZ4qaDvtY%*#jO?sG(h>D2T z0~%vBqbQ05GiqaMY&u)wA?H>jnjTY4+Qyhpo2KndJGmHk#N!S5* z%YP+zOBh5grTq|x<3Ih+MD=*qQ!G?LRZ>E)8V^v(WBA`*+qVlrP~#*%3A z!U9cx$I`{pCjg*V&;E)kzxx703d*t=GD~yl}P=5!eQdhri$K#5=s0J zX^T;|n&5T$$MF24gXafJkG@Y2L-}MNq4@)jkX(b8yI*+*axD>h)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