From 66aa39c1f5b404a335c8a2f0793ed22103822794 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Wed, 2 Apr 2025 20:43:03 -0700 Subject: [PATCH] clam --- BiomeManagers/ClamDen.cs | 31 ++ CalPlayer/CalamityPlayer.cs | 3 +- Enums/SunkenSeaBiomeFlags.cs | 1 + .../en-US/Mods.CalamityMod.Biomes.hjson | 5 + NPCs/SunkenSea/Clam.cs | 384 ++++++++++++++---- NPCs/SunkenSea/Clam.png | Bin 830 -> 333 bytes NPCs/SunkenSea/ClamAlgae.png | Bin 0 -> 333 bytes NPCs/SunkenSea/ClamBack.png | Bin 0 -> 180 bytes NPCs/SunkenSea/ClamBottom.png | Bin 0 -> 316 bytes NPCs/SunkenSea/ClamBottomAlgae.png | Bin 0 -> 316 bytes NPCs/SunkenSea/ClamBottomCoral.png | Bin 0 -> 319 bytes NPCs/SunkenSea/ClamCoral.png | Bin 0 -> 358 bytes NPCs/SunkenSea/HauntedChum.cs | 3 + NPCs/SunkenSea/Jellyghoul.cs | 4 + NPCs/SunkenSea/KelpieSeadragon.cs | 3 + NPCs/SunkenSea/Leerslug.cs | 26 ++ NPCs/SunkenSea/Polyperil.cs | 3 + NPCs/SunkenSea/PolyperilTentacle.cs | 3 + NPCs/SunkenSea/Sharkoon.cs | 4 + .../SunkenSeaBiomeCorrespondentDict.cs | 1 + 20 files changed, 383 insertions(+), 88 deletions(-) create mode 100644 BiomeManagers/ClamDen.cs create mode 100644 NPCs/SunkenSea/ClamAlgae.png create mode 100644 NPCs/SunkenSea/ClamBack.png create mode 100644 NPCs/SunkenSea/ClamBottom.png create mode 100644 NPCs/SunkenSea/ClamBottomAlgae.png create mode 100644 NPCs/SunkenSea/ClamBottomCoral.png create mode 100644 NPCs/SunkenSea/ClamCoral.png diff --git a/BiomeManagers/ClamDen.cs b/BiomeManagers/ClamDen.cs new file mode 100644 index 0000000000..f4d06835a9 --- /dev/null +++ b/BiomeManagers/ClamDen.cs @@ -0,0 +1,31 @@ +using CalamityMod.Items.Placeables.Furniture; +using CalamityMod.Systems; +using CalamityMod.Waters; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.BiomeManagers +{ + public class ClamDenBiome : ModBiome + { + public override ModWaterStyle WaterStyle => SunkenSeaBurrowsWater.Instance; + public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find("CalamityMod/SunkenSeaBGStyle"); + public override int BiomeTorchItemType => ModContent.ItemType(); + public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.OceanNight; + public override SceneEffectPriority Priority => SceneEffectPriority.Environment; + public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon"; + // Placeholder until we get a dedicated Sunken Sea background + public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1"; + public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1"; + + // todo make this condition different than the normal burrows + public override bool IsBiomeActive(Player player) + { + bool MoreThanReefs = BiomeTileCounterSystem.SunkenSeaBurrowsTiles > BiomeTileCounterSystem.SunkenSeaReefsTiles; + bool MoreThanPolyp = BiomeTileCounterSystem.SunkenSeaBurrowsTiles > BiomeTileCounterSystem.SunkenSeaPolypTiles; + + return BiomeTileCounterSystem.SunkenSeaBurrowsTiles > 1000 && MoreThanReefs && MoreThanPolyp; + } + } +} diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index a634f65b31..67817147c9 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1525,11 +1525,12 @@ namespace CalamityMod.CalPlayer #endregion #region Biome - public bool ZoneSunkenSea => ZoneTimelessShores || ZoneRadiantReefs || ZonePolypForest || ZoneGleamingBurrows || ZoneBasaltGully; + public bool ZoneSunkenSea => ZoneTimelessShores || ZoneRadiantReefs || ZonePolypForest || ZoneGleamingBurrows || ZoneClamDen || ZoneBasaltGully; public bool ZoneTimelessShores => Player.InModBiome(); public bool ZonePolypForest => Player.InModBiome(); public bool ZoneRadiantReefs => Player.InModBiome(); public bool ZoneGleamingBurrows => Player.InModBiome(); + public bool ZoneClamDen => Player.InModBiome(); public bool ZoneBasaltGully => Player.InModBiome(); public bool ZoneSulphur => Player.InModBiome(); diff --git a/Enums/SunkenSeaBiomeFlags.cs b/Enums/SunkenSeaBiomeFlags.cs index 60de02c354..061c88f079 100644 --- a/Enums/SunkenSeaBiomeFlags.cs +++ b/Enums/SunkenSeaBiomeFlags.cs @@ -15,5 +15,6 @@ namespace CalamityMod.Enums PolypForest = 8, GleamingBurrows = 16, BasaltGully = 32, + ClamDen = 64 } } diff --git a/Localization/en-US/Mods.CalamityMod.Biomes.hjson b/Localization/en-US/Mods.CalamityMod.Biomes.hjson index b3057f8810..358dcf4571 100644 --- a/Localization/en-US/Mods.CalamityMod.Biomes.hjson +++ b/Localization/en-US/Mods.CalamityMod.Biomes.hjson @@ -110,3 +110,8 @@ TimelessShoresBiome: { DisplayName: Timeless Shores Biome TownNPCDialogueName: the Timeless Shores Biome } + +ClamDenBiome: { + DisplayName: Clam Den Biome + TownNPCDialogueName: the Clam Den Biome +} diff --git a/NPCs/SunkenSea/Clam.cs b/NPCs/SunkenSea/Clam.cs index de57dfa6b1..57b14a0f8d 100644 --- a/NPCs/SunkenSea/Clam.cs +++ b/NPCs/SunkenSea/Clam.cs @@ -3,7 +3,15 @@ using CalamityMod.BiomeManagers; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Melee; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.GameContent; using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; @@ -12,9 +20,54 @@ namespace CalamityMod.NPCs.SunkenSea { public class Clam : ModNPC { - private int hitAmount = 0; - private bool hasBeenHit = false; - private bool statChange = false; + public enum PersonalityTypes + { + Reefs = 0, + Burrows = 1, + Den = 2 + } + + public enum PhaseType + { + Idle = 0, + Attacking = 1, + Squirt = 2 + } + + public Player Target => Main.player[NPC.target]; + + public ref float CurrentPhase => ref NPC.ai[0]; + + public ref float Timer => ref NPC.ai[1]; + + public ref float Personality => ref NPC.ai[3]; + + public ref float ShellRotation => ref NPC.localAI[0]; + + #region Textures + + public static Asset bottomJawTex; + + public static Asset bottomJawTexAlgae; + + public static Asset bottomJawTexCoral; + + public static Asset algaeTex; + + public static Asset coralTex; + + public static Asset backTex; + #endregion + + public override void Load() + { + backTex = ModContent.Request(Texture + "Back"); + bottomJawTex = ModContent.Request(Texture + "Bottom"); + bottomJawTexAlgae = ModContent.Request(Texture + "BottomAlgae"); + bottomJawTexCoral = ModContent.Request(Texture + "BottomCoral"); + algaeTex = ModContent.Request(Texture + "Algae"); + coralTex = ModContent.Request(Texture + "Coral"); + } public override void SetStaticDefaults() { @@ -29,8 +82,8 @@ namespace CalamityMod.NPCs.SunkenSea public override void SetDefaults() { NPC.damage = Main.hardMode ? 60 : 30; - NPC.width = 56; - NPC.height = 38; + NPC.width = 50; + NPC.height = 30; NPC.defense = 9999; NPC.DR_NERD(0.25f); NPC.lifeMax = Main.hardMode ? 300 : 150; @@ -42,9 +95,10 @@ namespace CalamityMod.NPCs.SunkenSea AIType = -1; NPC.value = Main.hardMode ? Item.buyPrice(0, 0, 5, 0) : Item.buyPrice(0, 0, 1, 0); NPC.HitSound = SoundID.NPCHit4; - NPC.knockBackResist = 0.05f; + NPC.knockBackResist = 0; Banner = NPC.type; BannerItem = ModContent.ItemType(); + NPC.GravityIgnoresLiquid = true; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; @@ -66,122 +120,260 @@ namespace CalamityMod.NPCs.SunkenSea public override void SendExtraAI(BinaryWriter writer) { - writer.Write(hitAmount); - writer.Write(NPC.chaseable); - writer.Write(hasBeenHit); - writer.Write(statChange); + writer.Write(NPC.localAI[0]); } public override void ReceiveExtraAI(BinaryReader reader) { - hitAmount = reader.ReadInt32(); - NPC.chaseable = reader.ReadBoolean(); - hasBeenHit = reader.ReadBoolean(); - statChange = reader.ReadBoolean(); + NPC.localAI[0] = reader.ReadSingle(); + } + + public override void OnSpawn(IEntitySource source) + { + NPC.TargetClosest(); + + if (Target.Calamity().ZoneClamDen) + Personality = (int)PersonalityTypes.Den; + else if (Target.Calamity().ZoneGleamingBurrows) + Personality = (int)PersonalityTypes.Burrows; + else + Personality = (int)PersonalityTypes.Reefs; } public override void AI() { - NPC.TargetClosest(true); + NPC.TargetClosest(false); + // Always be mad during Clamity if (Main.player[NPC.target].Calamity().clamity) { - hitAmount = 3; - hasBeenHit = true; + Personality = (int)PersonalityTypes.Burrows; } - if (NPC.justHit && hitAmount < 3) + switch (CurrentPhase) { - ++hitAmount; - hasBeenHit = true; - } - NPC.chaseable = hasBeenHit; - if (hitAmount == 3) - { - if (!statChange) - { - NPC.defense = Main.hardMode ? 15 : 6; - NPC.damage = NPC.defDamage; - statChange = true; - } - if (NPC.ai[0] == 0f) - { - if (Main.netMode != NetmodeID.MultiplayerClient) + case (int)PhaseType.Idle: { - if (NPC.velocity.X != 0f || NPC.velocity.Y < 0f || (double)NPC.velocity.Y > 0.9) + NPC.velocity.X *= 0.9f; + switch (Personality) { - NPC.ai[0] = 1f; - NPC.netUpdate = true; - return; + // Aggro immediately + case (int)PersonalityTypes.Den: + { + ChangePhase((int)PhaseType.Attacking); + } + break; + // Aggro if the player is near + case (int)PersonalityTypes.Burrows: + { + if (Target.Distance(NPC.Center) < 600 && NPC.HasSight(Target.Center)) + { + ChangePhase((int)PhaseType.Attacking); + } + } + break; + // Aggro if hurt + default: + { + if (NPC.life < (NPC.lifeMax - 2)) + { + ChangePhase((int)PhaseType.Attacking); + } + } + break; } + // If it aggro'd, decrease kb resist and defense since it's no longer stuck in the ground + if (CurrentPhase == (int)PhaseType.Attacking) + { + NPC.knockBackResist = 0.05f; + NPC.defense = Main.hardMode ? 15 : 6; + } + } + break; + case (int)PhaseType.Attacking: + { + Timer++; + // Squirt + if (Timer > 0) + { + ChangePhase((int)PhaseType.Squirt); + NPC.direction = NPC.DirectionTo(Target.Center).X.DirectionalSign(); + } + } + break; + case (int)PhaseType.Squirt: + { + // Slow down. Once the clam is rested, start incrementing Timer + if (NPC.velocity.Y == 0) + { + NPC.velocity.X *= 0.8f; + // Set ai[2] to 1 + NPC.ai[2] = 1; + } + + // Increment Timer is ai[2] is 1 + if (NPC.ai[2] == 1) + { + Timer++; + } + + // When to start opening + float startOpen = 30; + // When to end opening + float endOpen = startOpen + 30; + // When to start closing + float startClose = endOpen + 20; + // When to stop closing + float endClose = startClose + 5; + // When to go to the next attack + float reset = endClose + 60; + // Rotation at its peak + float maxRotation = MathHelper.ToRadians(80); + + // Direction the player is relative to the clam + int playerPosition = NPC.DirectionTo(Target.Center).X.DirectionalSign(); + + // Shell animation + if (Timer >= startOpen && Timer <= endOpen) + { + ShellRotation = (float)Utils.AngleLerp(0, maxRotation * -NPC.spriteDirection, CalamityUtils.SineOutEasing(Utils.GetLerpValue(startOpen, endOpen, Timer, true), 0)); + } + else if (Timer >= startClose && Timer <= endClose) + { + ShellRotation = (float)Utils.AngleLerp(maxRotation * -NPC.spriteDirection, 0, CalamityUtils.SineOutEasing(Utils.GetLerpValue(startClose, endClose, Timer, true), 0)); + } + + // Fire the projectile + if (Timer == (endClose - 5)) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + Vector2 velocity = NPC.SafeDirectionTo(Target.Center, Vector2.UnitY) * 5; + + // If the player is on the other side of the clam, flip the jet so that it doesn't fire backwards + if (playerPosition != NPC.direction) + velocity.X *= -1; + + int p = Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center, velocity, ModContent.ProjectileType(), NPC.damage, 1); + Main.projectile[p].friendly = false; + Main.projectile[p].hostile = true; + Main.projectile[p].DamageType = DamageClass.Default; + } + for (int i = 0; i < 9; i++) + { + GenericBubbleParticle waterFlavored = new GenericBubbleParticle(NPC.Center, Main.rand.NextFloat(16, 22) * NPC.DirectionTo(Target.Center).RotatedBy(MathHelper.ToRadians(Main.rand.NextFloat(-45, 45))), Main.rand.NextFloat(0.3f, 0.5f), Main.rand.NextFloat(-4, 4), 5); + waterFlavored.AffectedByLight = true; + GeneralParticleHandler.SpawnParticle(waterFlavored); + } + + SoundEngine.PlaySound((Main.rand.NextBool(2) ? SoundID.Item85 : SoundID.Item86).WithPitchOffset(-0.5f), NPC.Center); + SoundEngine.PlaySound(SoundID.NPCDeath14.WithPitchOffset(1f), NPC.Center); + } + + // Go back to melee + if (Timer >= reset) + { + ChangePhase((int)PhaseType.Attacking); + } + } + break; + } + NPC.spriteDirection = NPC.direction; + /*if (!statChange) + { + NPC.defense = Main.hardMode ? 15 : 6; + NPC.damage = NPC.defDamage; + statChange = true; + } + if (NPC.ai[0] == 0f) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + if (NPC.velocity.X != 0f || NPC.velocity.Y < 0f || (double)NPC.velocity.Y > 0.9) + { NPC.ai[0] = 1f; NPC.netUpdate = true; return; } - } - else if (NPC.velocity.Y == 0f) - { - NPC.ai[2] += 1f; - int decelerationTimer = 20; - if (NPC.ai[1] == 0f) - { - decelerationTimer = 12; - } - if (NPC.ai[2] < (float)decelerationTimer) - { - NPC.velocity.X *= 0.9f; - return; - } - NPC.ai[2] = 0f; - NPC.TargetClosest(true); - if (NPC.direction == 0) - { - NPC.direction = -1; - } - NPC.spriteDirection = -NPC.direction; - NPC.ai[1] += 1f; - NPC.ai[3] += 1f; - if (NPC.ai[3] >= 4f) - { - NPC.ai[3] = 0f; - if (NPC.ai[1] == 2f) - { - float multiplierX = (float)Main.rand.Next(3, 7); - NPC.velocity.X = (float)NPC.direction * multiplierX; - NPC.velocity.Y = -8f; - NPC.ai[1] = 0f; - } - else - { - float multiplierX = (float)Main.rand.Next(5, 9); - NPC.velocity.X = (float)NPC.direction * multiplierX; - NPC.velocity.Y = -4f; - } - } + NPC.ai[0] = 1f; NPC.netUpdate = true; return; } - else + } + else if (NPC.velocity.Y == 0f) + { + NPC.ai[2] += 1f; + int decelerationTimer = 20; + if (NPC.ai[1] == 0f) { - if (NPC.direction == 1 && NPC.velocity.X < 1f) + decelerationTimer = 12; + } + if (NPC.ai[2] < (float)decelerationTimer) + { + NPC.velocity.X *= 0.9f; + return; + } + NPC.ai[2] = 0f; + NPC.TargetClosest(true); + if (NPC.direction == 0) + { + NPC.direction = -1; + } + NPC.spriteDirection = -NPC.direction; + NPC.ai[1] += 1f; + NPC.ai[3] += 1f; + if (NPC.ai[3] >= 4f) + { + NPC.ai[3] = 0f; + if (NPC.ai[1] == 2f) { - NPC.velocity.X = NPC.velocity.X + 0.1f; - return; + float multiplierX = (float)Main.rand.Next(3, 7); + NPC.velocity.X = (float)NPC.direction * multiplierX; + NPC.velocity.Y = -8f; + NPC.ai[1] = 0f; } - if (NPC.direction == -1 && NPC.velocity.X > -1f) + else { - NPC.velocity.X = NPC.velocity.X - 0.1f; - return; + float multiplierX = (float)Main.rand.Next(5, 9); + NPC.velocity.X = (float)NPC.direction * multiplierX; + NPC.velocity.Y = -4f; } } + NPC.netUpdate = true; + return; } else - NPC.damage = 0; + { + if (NPC.direction == 1 && NPC.velocity.X < 1f) + { + NPC.velocity.X = NPC.velocity.X + 0.1f; + return; + } + if (NPC.direction == -1 && NPC.velocity.X > -1f) + { + NPC.velocity.X = NPC.velocity.X - 0.1f; + return; + } + }*/ + } + + public void ChangePhase(int phaseNum, bool resetai2 = true) + { + CurrentPhase = phaseNum; + Timer = 0; + if (resetai2) + NPC.ai[2] = 0; + NPC.netUpdate = true; + } + + public override bool CanHitPlayer(Player target, ref int cooldownSlot) + { + return CurrentPhase > 0; } public override bool? CanBeHitByProjectile(Projectile projectile) { if (projectile.minion && !projectile.Calamity().overridesMinionDamagePrevention) { - return hasBeenHit; + return CurrentPhase > 0; } return null; } @@ -194,7 +386,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.frameCounter = 0.0; NPC.frame.Y = NPC.frame.Y + frameHeight; } - if (hitAmount < 3) + if (CurrentPhase == 0) { NPC.frame.Y = frameHeight * 4; } @@ -245,5 +437,23 @@ namespace CalamityMod.NPCs.SunkenSea npcLoot.Add(ItemID.PinkPearl, 40); npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType(), 2); } + + public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) + { + Texture2D tex = TextureAssets.Npc[NPC.type].Value; + Vector2 drawOffset = Vector2.UnitY * 8; + Vector2 topDrawOffset = drawOffset + new Vector2(NPC.spriteDirection * -22, -3); + bool facingRight = NPC.spriteDirection == 1; + if (facingRight) + { + topDrawOffset.X += 6; + } + Vector2 backOffset = topDrawOffset; + if (ShellRotation == 0) + spriteBatch.Draw(backTex.Value, NPC.Center - screenPos + backOffset, null, NPC.GetAlpha(drawColor), NPC.rotation, new Vector2(facingRight ? 0 : tex.Width, tex.Height), NPC.scale, NPC.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0f); + spriteBatch.Draw(tex, NPC.Center - screenPos + topDrawOffset, null, NPC.GetAlpha(drawColor), ShellRotation, new Vector2(facingRight ? 0 : tex.Width, tex.Height), NPC.scale, NPC.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0f); + spriteBatch.Draw(bottomJawTex.Value, NPC.Center - screenPos + drawOffset, null, NPC.GetAlpha(drawColor), NPC.rotation, tex.Size() / 2, NPC.scale, NPC.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0f); + return false; + } } } diff --git a/NPCs/SunkenSea/Clam.png b/NPCs/SunkenSea/Clam.png index f7eb5f074aab37354013c5434e2db1e216324032..acb6f0dd51051966480d5e44cf63e825f6704c8e 100644 GIT binary patch literal 333 zcmeAS@N?(olHy`uVBq!ia0vp^IzTMO!3-pOcK7`NQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`@PUw6AM#Pv@qsvw%uuA`GN~6jw=* zU+{kzVAym<=R8o9v%n*=n1O-s5C}7hYIrpO1s8d`IEGmGFP(6Z?}!2itLBDn|Nir@ z-|R0u`I}QY-!i*n3|s$o@IHHfEIN{D`OU%|_rIDKwM6oj?5by*X&4ZDhh&norysu?$RO<6wsy2@n6$glR2KlbT`IZxhqZOy5)OPSs0 zR(`tV>G^8Y&0o1y3CgL8B|^O+Q#q^Mmwt3wSP)Px#9#BkFMF0Q*6$T|IFf}$sNJ?Q~YJzwlAunme!2kdNBt36J9(jNO000VfQchC< z|NsC0|NsC0|9*)SRsaA3xJg7oRA_LTAP|Hj3Z1_H3%A?N1|&%2AZ;?`W?Cik zITwERHhQ_dKrC527evPpoLg6ajcq%H8^L7(!f&9lQ6or9f8Kvw!~1mweu$bt z4GL35YTk!y;2h|>7EmL&EZc^G$3?*C>V85fQyv9!P=KKW5TyC}9RTAEaJwDa0j2{Y zm>@#8z_n4J7B#wXIFulVN(&)d>_!k%fnm`EXy~0&J6_qP+6^i#cH=!pX>r>Zy4WgW9pK+ZUdWq@xdBvZWkF>ruT;iv z5T!0oeJrk!kp~{Y2&Sbq3Kk`$ny?9EDd%>MLW!HGv>sR%BPdzcP!Ln8BYsy{J3xqX zD*uF4Q1M@ACXZbprW-@EHw`N0JQlv85mZ4dS%!!gCc_9~D`|N#_KBwEVFb7@<J4K+2O6lvwa5Hvk>Sg0d`-Wr`OO$|YN)KpG@nl<3C?UJ}kb!7_p} z@Tmy1rDSCuGRtBFS;}Rn)s2NbwT3G1x6RfGre^luJZO>%&pJ$?%mX`=&4U(v(RDO} zfA2cdMXp<&ave?Jv3W?hb(8CO08ZC2;~itk;@Mzs9v~JCkDeMqy(%f2hw9596Nn`1 z=HYN7n?MOf-8@vpsu7&7BR3C-Z~M>**3CoZ4T}jpV;)r0n_Wi%Y%ven13feN3eP%_ zQp95Gq3bvePS-Kx9b>wVk>GS4|Iu~ygVS})H!SlF%L}-UFT-+D{dtn#?f?J)07*qo IM6N<$f*r|SaR2}S diff --git a/NPCs/SunkenSea/ClamAlgae.png b/NPCs/SunkenSea/ClamAlgae.png new file mode 100644 index 0000000000000000000000000000000000000000..e695d282f83c17c657f76354ed8efdffc20de9e4 GIT binary patch literal 333 zcmeAS@N?(olHy`uVBq!ia0vp^IzTMO!3-pOcK7`NQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`R{R1)46HuETEF(7H5_NDXx+r zzu^Bcz_96z&Uv6HXMsm#F#`kNArNL1)$nQn3NG?=aSXBWUpnC+-w_24R?Q9D{{81) zzu8}S@;9e)zGZgD7`FcF;C=S|Sac-Q@|%S_?te8eYKi14*;UUr(=Z_R%F~W(cQWrv zZ7RuI`<8!I(Gji7Q9m52o>l7YRWoktnzDTMb(P7Ckzeg4f9%r>bDq5K+L}{omomH0 zt^9P!)AQA)o4<0a5|mRFON4qurgB!hFa7AWvZVJ*bU>o#wWpnXgCNn{1`ISV`@iy0XB4uLSEsD@VqP|(xU#W5tp{q2Q~Tnq{v41trk{rew$dr{Md zrE3={?%DoA=@2JS)q{u)KYNzl$dS#`3%9@e%zU0`-05|G-oG_#q6_Z5pZ0If1`l@O W5CJa!GeR0bO9c3YxH56GMEkmyrA3>onrzxStFO6e?c8>tWQFt*RUpMt666>B9|9Qe zHSdiCig6ZrL>4nJ@ErnSMo|r~2B6?fPZ!4!3;($jE();-@~{ZE{Qv*hd-mO+Qh&3* z4FwDY7o&J5(2)$Du6{1-oD!M<#0_$D literal 0 HcmV?d00001 diff --git a/NPCs/SunkenSea/ClamBottomAlgae.png b/NPCs/SunkenSea/ClamBottomAlgae.png new file mode 100644 index 0000000000000000000000000000000000000000..c3f133e6c02d0abcd355cb3d42a004b566b9ce23 GIT binary patch literal 316 zcmeAS@N?(olHy`uVBq!ia0vp^MnEjW!3-pSh|F67q!^2X+?^QKos)S9O9c3YxH56GxH?$IB?gSQpGLC-#naRut@*xc!Hlmi@yT+XeLoFE*DAWQ zWs0k|nr#nuAoMC$CM3qM0q%DtPKE~bnUAJh3 zf@iQx`O9%LbxH56GxH?!ycUqdOn&d?{`klS6KW9x((Mq6v?W+~SK#H>@$S?Rm z6fgw)R|tUw3p^r=85sBufiR<}hF1enaE7OgV~BF#S-oc}g%m6mSd{;8|F>pA;DkhYVcf!_E8qHy zh^k~t1y0URmDK!ovARrJlvP8vuDJJbcIsOFyfcCm*V^=20Nu#o>FVdQ&MBb@03j!E AQvd(} literal 0 HcmV?d00001 diff --git a/NPCs/SunkenSea/ClamCoral.png b/NPCs/SunkenSea/ClamCoral.png new file mode 100644 index 0000000000000000000000000000000000000000..aad28198911f52e79b7f5867b809c801fcc72413 GIT binary patch literal 358 zcmeAS@N?(olHy`uVBq!ia0vp^IzTMO!3-pOcK7`NQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`)dPG&T+LNY{x4$hDO$G%YYPbNswRgeRMP)Jz*n36>(6>;?$%nh zZ~8}RhHJ%(W>vF%joqx(9dLZ>h37pFDqc@iSb19M#=9iJNt#@a?uXPvQ(Lkfj~8j63UmTGox#)9&t;ucLK6U@u9rXn literal 0 HcmV?d00001 diff --git a/NPCs/SunkenSea/HauntedChum.cs b/NPCs/SunkenSea/HauntedChum.cs index 59ef4255be..4bf8a36598 100644 --- a/NPCs/SunkenSea/HauntedChum.cs +++ b/NPCs/SunkenSea/HauntedChum.cs @@ -42,6 +42,9 @@ namespace CalamityMod.NPCs.SunkenSea NPC.noGravity = true; NPC.noTileCollide = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + // Scale stats in Expert and Master + CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); + CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() diff --git a/NPCs/SunkenSea/Jellyghoul.cs b/NPCs/SunkenSea/Jellyghoul.cs index d2dd52a8b2..d86b9f83e4 100644 --- a/NPCs/SunkenSea/Jellyghoul.cs +++ b/NPCs/SunkenSea/Jellyghoul.cs @@ -57,6 +57,10 @@ namespace CalamityMod.NPCs.SunkenSea // Banner = NPC.type; //BannerItem = ModContent.ItemType(); SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + + // Scale stats in Expert and Master + CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); + CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SunkenSea/KelpieSeadragon.cs b/NPCs/SunkenSea/KelpieSeadragon.cs index a4b3b0d7cf..ad507b3920 100644 --- a/NPCs/SunkenSea/KelpieSeadragon.cs +++ b/NPCs/SunkenSea/KelpieSeadragon.cs @@ -80,6 +80,9 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + // Scale stats in Expert and Master + CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); + CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SunkenSea/Leerslug.cs b/NPCs/SunkenSea/Leerslug.cs index 6dd92d64a4..780fa0bf0a 100644 --- a/NPCs/SunkenSea/Leerslug.cs +++ b/NPCs/SunkenSea/Leerslug.cs @@ -35,6 +35,9 @@ namespace CalamityMod.NPCs.SunkenSea public ref float Timer => ref NPC.ai[1]; + /// + /// Handles the visual scale for the slug + /// public Vector2 squish = new Vector2(); public Player Target => Main.player[NPC.target]; @@ -64,6 +67,10 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + + // Scale stats in Expert and Master + CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); + CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void ReceiveExtraAI(BinaryReader reader) @@ -98,31 +105,38 @@ namespace CalamityMod.NPCs.SunkenSea { case (int)PhaseType.Idle: { + // Flip direction and slow down if it's still moving from a previous cycle if (Timer == 0 && Main.rand.NextBool()) { NPC.direction *= -1; NPC.velocity.X *= 0.9f; } + // Move horizontally in short bursts else if (Timer >= Main.rand.Next(30, 90) && NPC.velocity.Y == 0 && Math.Abs(NPC.velocity.X) < 1 && NPC.ai[2] == 0) { NPC.ai[2] = 1; NPC.velocity.X = Main.rand.NextFloat(2, 4) * Main.rand.NextBool().ToDirectionInt(); } + // Increment the timer before the burst ends if (NPC.ai[2] == 1) { NPC.ai[3]++; } + // Slowdown after a burst else if (NPC.ai[2] == 2 && NPC.velocity.Y == 0) { NPC.velocity.X *= 0.9f; NPC.ai[3]++; } + // Handle movement states if (NPC.ai[3] > Main.rand.Next(20, 40)) { + // If the slug is moving, enter slowdown if (NPC.ai[2] == 1) NPC.ai[2] = 2; + // If the slug is in slowdown, reset else if (NPC.ai[2] == 2) ChangePhase((int)PhaseType.Idle); NPC.ai[3] = 0; @@ -130,6 +144,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.direction = NPC.velocity.X.DirectionalSign(); + // Aggro if (Target.active && Target.Distance(NPC.Center) < 400 && NPC.HasSight(Target.Center)) { ChangePhase((int)PhaseType.Rawr); @@ -141,6 +156,7 @@ namespace CalamityMod.NPCs.SunkenSea int roar = 40; int startAI = 70; NPC.velocity.X *= 0.9f; + // Roar in place with a lil jump if (Timer == roar) { SoundEngine.PlaySound(SoundID.Zombie7 with { Pitch = 0.7f }, NPC.Center); @@ -156,11 +172,13 @@ namespace CalamityMod.NPCs.SunkenSea break; case (int)PhaseType.Jumps: { + // Do a few hops towards the player int maxJumps = 3; if (NPC.ai[2] >= maxJumps - 1 && NPC.velocity.Y == 0) { ChangePhase((int)PhaseType.Dash); } + // Jump if (NPC.velocity.Y == 0) { NPC.velocity.Y = -5; @@ -172,20 +190,24 @@ namespace CalamityMod.NPCs.SunkenSea break; case (int)PhaseType.Dash: { + // Squash and stretch to telegraph the dash int squash = 30; int stretch = 10; Vector2 squashAmt = new Vector2(0.6f, 1.5f); RawrAnimation(squash, stretch, squashAmt); + // Slow down before dashing if (Timer < squash + 10) { NPC.velocity.X *= 0.95f; NPC.direction = NPC.DirectionTo(Target.Center).X.DirectionalSign(); } + // Dash else if (Timer == squash + 10) { NPC.velocity.X = NPC.DirectionTo(Target.Center).X.DirectionalSign() * 6; SoundEngine.PlaySound(SoundID.DD2_SkyDragonsFuryShot, NPC.Center); } + // Leave behind some hot mist particles else { if (Timer % 2 == 0) @@ -209,15 +231,18 @@ namespace CalamityMod.NPCs.SunkenSea { int squash = squashDuration; int stretch = squash + stretchDuration; + // rawrxd if (Timer == squash) { SoundEngine.PlaySound(SoundID.Zombie7 with { Pitch = 0.7f }, NPC.Center); } + // Squash if (Timer < squash) { squish.X = MathHelper.Lerp(1, squashAmt.X, Utils.GetLerpValue(0, squash, Timer, true)); squish.Y = MathHelper.Lerp(1, squashAmt.Y, Utils.GetLerpValue(0, squash, Timer, true)); } + // Stretch else if (Timer >= squash && Timer < stretch) { squish.X = MathHelper.Lerp(squashAmt.X, 1, Utils.GetLerpValue(squash, stretch, Timer, true)); @@ -233,6 +258,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.ai[2] = 0; if (resetai3) NPC.ai[3] = 0; + NPC.netUpdate = true; } public override void FindFrame(int frameHeight) diff --git a/NPCs/SunkenSea/Polyperil.cs b/NPCs/SunkenSea/Polyperil.cs index eaee0e59b8..9a166a1317 100644 --- a/NPCs/SunkenSea/Polyperil.cs +++ b/NPCs/SunkenSea/Polyperil.cs @@ -74,6 +74,9 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; + // Scale stats in Expert and Master + CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); + CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void OnSpawn(IEntitySource source) diff --git a/NPCs/SunkenSea/PolyperilTentacle.cs b/NPCs/SunkenSea/PolyperilTentacle.cs index b08fdc3677..ad7b1e57a6 100644 --- a/NPCs/SunkenSea/PolyperilTentacle.cs +++ b/NPCs/SunkenSea/PolyperilTentacle.cs @@ -71,6 +71,9 @@ namespace CalamityMod.NPCs.SunkenSea NPC.value = 0; // Banner = NPC.type; // BannerItem = ModContent.ItemType(); + // Scale stats in Expert and Master + CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); + CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SendExtraAI(BinaryWriter writer) diff --git a/NPCs/SunkenSea/Sharkoon.cs b/NPCs/SunkenSea/Sharkoon.cs index 6c6b4b3f7f..2645577fd6 100644 --- a/NPCs/SunkenSea/Sharkoon.cs +++ b/NPCs/SunkenSea/Sharkoon.cs @@ -199,6 +199,10 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; + + // Scale stats in Expert and Master + CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); + CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } #endregion diff --git a/Systems/Collections/SunkenSeaBiomeCorrespondentDict.cs b/Systems/Collections/SunkenSeaBiomeCorrespondentDict.cs index 5fb07cab3d..0b6319d9b2 100644 --- a/Systems/Collections/SunkenSeaBiomeCorrespondentDict.cs +++ b/Systems/Collections/SunkenSeaBiomeCorrespondentDict.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Systems.Collections { SunkenSeaBiomeFlags.PolypForest, (spawnInfo => spawnInfo.Player.Calamity().ZonePolypForest, GetInstance().Type) }, { SunkenSeaBiomeFlags.GleamingBurrows, (spawnInfo => spawnInfo.Player.Calamity().ZoneGleamingBurrows, GetInstance().Type) }, { SunkenSeaBiomeFlags.BasaltGully, (spawnInfo => spawnInfo.Player.Calamity().ZoneBasaltGully, GetInstance().Type) }, + { SunkenSeaBiomeFlags.ClamDen, (spawnInfo => spawnInfo.Player.Calamity().ZoneClamDen, GetInstance().Type) }, }; }