diff --git a/NPCs/SunkenSea/AlphaSeaMinnow.cs b/NPCs/SunkenSea/AlphaSeaMinnow.cs index f1960dc854..0e44693c23 100644 --- a/NPCs/SunkenSea/AlphaSeaMinnow.cs +++ b/NPCs/SunkenSea/AlphaSeaMinnow.cs @@ -262,29 +262,12 @@ namespace CalamityMod.NPCs.SunkenSea { public override void SetStaticDefaults() { - Main.npcFrameCount[Type] = 8; - Main.npcCatchable[Type] = true; - NPCID.Sets.CountsAsCritter[Type] = true; this.HideFromBestiary(); base.SetStaticDefaults(); } public override void SetDefaults() { - NPC.npcSlots = 0.1f; - NPC.noGravity = true; - NPC.damage = 0; - NPC.width = 40; - NPC.height = 32; - NPC.defense = 0; - NPC.lifeMax = 5; - NPC.aiStyle = -1; - AIType = -1; - NPC.HitSound = SoundID.NPCHit1; - NPC.DeathSound = SoundID.NPCDeath1; - //Banner = NPC.type; - //BannerItem = ModContent.ItemType(); - NPC.chaseable = false; - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + base.SetDefaults(); NPC.rarity = 3; NPC.catchItem = ModContent.ItemType(); } diff --git a/NPCs/SunkenSea/BabyGhostBell.cs b/NPCs/SunkenSea/BabyGhostBell.cs index bfa05e9ab3..ab59f8140e 100644 --- a/NPCs/SunkenSea/BabyGhostBell.cs +++ b/NPCs/SunkenSea/BabyGhostBell.cs @@ -1,6 +1,8 @@ using System; +using System.Collections.Generic; using System.IO; using CalamityMod.BiomeManagers; +using CalamityMod.Enums; using CalamityMod.Items.Accessories; using CalamityMod.Items.Critters; using CalamityMod.Items.Fishing.SunkenSeaCatches; @@ -20,7 +22,7 @@ using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.SunkenSea { - public class BabyGhostBell : ModNPC + public class BabyGhostBell : SunkenSeaNPC { public bool hasBeenHit = false; public static Texture2D RadiantTexture; @@ -39,7 +41,11 @@ namespace CalamityMod.NPCs.SunkenSea Gold = 5 } - public static Asset GlowTexture; + protected override List PreyIDs => new List(); + + protected override List PredatorIDs => new List(); + + protected override SunkenSeaBiomeFlags BiomeDesignation => SunkenSeaBiomeFlags.GleamingBurrows; public override void SetStaticDefaults() { @@ -252,7 +258,7 @@ namespace CalamityMod.NPCs.SunkenSea public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.Player.Calamity().ZoneSunkenSea && spawnInfo.Water && !spawnInfo.Player.Calamity().clamity) + if (spawnInfo.Player.Calamity().ZoneGleamingBurrows && spawnInfo.Water && !spawnInfo.Player.Calamity().clamity) { return SpawnCondition.CaveJellyfish.Chance * 1.5f; } diff --git a/NPCs/SunkenSea/KelpieSeadragon.cs b/NPCs/SunkenSea/KelpieSeadragon.cs index 78d693fafe..a4b3b0d7cf 100644 --- a/NPCs/SunkenSea/KelpieSeadragon.cs +++ b/NPCs/SunkenSea/KelpieSeadragon.cs @@ -353,7 +353,7 @@ namespace CalamityMod.NPCs.SunkenSea public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.Player.Calamity().ZoneSunkenSea && spawnInfo.Water && !spawnInfo.Player.Calamity().clamity) + if (spawnInfo.Player.Calamity().ZonePolypForest && spawnInfo.Water && !spawnInfo.Player.Calamity().clamity) { return SpawnCondition.CaveJellyfish.Chance * 0.9f; } diff --git a/NPCs/SunkenSea/Probesnout.cs b/NPCs/SunkenSea/Probesnout.cs index e04e5115a0..83cd8f5aed 100644 --- a/NPCs/SunkenSea/Probesnout.cs +++ b/NPCs/SunkenSea/Probesnout.cs @@ -14,6 +14,7 @@ using Terraria.DataStructures; using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; +using Terraria.ModLoader.Utilities; using static CalamityMod.CalamityUtils; using static Terraria.ModLoader.ModContent; @@ -40,7 +41,7 @@ namespace CalamityMod.NPCs.SunkenSea [ // NPCType(), NPCType(), - // NPCType(), + NPCType(), // NPCType(), // NPCType(), ]; @@ -352,6 +353,8 @@ namespace CalamityMod.NPCs.SunkenSea } } + public override bool CanBeHitByNPC(NPC attacker) => PredatorIDs.Contains(attacker.type); + #endregion #region Drawing & Animation @@ -419,6 +422,16 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToWater = false; } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.Water && !spawnInfo.Player.Calamity().clamity) + { + if (spawnInfo.Player.Calamity().ZoneRadiantReefs) + return SpawnCondition.CaveJellyfish.Chance * 0.3f; + } + return 0f; + } + #endregion #region Syncing @@ -464,5 +477,15 @@ namespace CalamityMod.NPCs.SunkenSea Gore.NewGoreDirect(NPC.GetSource_Death(), NPC.Center, new Vector2(hit.HitDirection, -1f), Mod.Find($"{Name}{i + 1}").Type); } } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.Water && !spawnInfo.Player.Calamity().clamity) + { + if (spawnInfo.Player.Calamity().ZoneRadiantReefs) + return SpawnCondition.CaveJellyfish.Chance * 0.015f; + } + return 0f; + } } } diff --git a/NPCs/SunkenSea/SandProwler.cs b/NPCs/SunkenSea/SandProwler.cs index cbd94b0016..9673888bc8 100644 --- a/NPCs/SunkenSea/SandProwler.cs +++ b/NPCs/SunkenSea/SandProwler.cs @@ -570,7 +570,7 @@ namespace CalamityMod.NPCs.SunkenSea public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (Main.hardMode && spawnInfo.Player.Calamity().ZoneSunkenSea && spawnInfo.Water && + if (Main.hardMode && spawnInfo.Player.Calamity().ZonePolypForest && spawnInfo.Water && !NPC.AnyNPCs(ModContent.NPCType()) && !spawnInfo.Player.Calamity().clamity && !spawnInfo.PlayerSafe) return SpawnCondition.CaveJellyfish.Chance * 0.3f; diff --git a/NPCs/SunkenSea/SeaMinnow.cs b/NPCs/SunkenSea/SeaMinnow.cs index 463c0bf572..5acb5b2eb5 100644 --- a/NPCs/SunkenSea/SeaMinnow.cs +++ b/NPCs/SunkenSea/SeaMinnow.cs @@ -300,32 +300,17 @@ namespace CalamityMod.NPCs.SunkenSea { public override void SetStaticDefaults() { - Main.npcFrameCount[Type] = 8; - Main.npcCatchable[Type] = true; - NPCID.Sets.CountsAsCritter[Type] = true; this.HideFromBestiary(); base.SetStaticDefaults(); } + public override void SetDefaults() { - NPC.npcSlots = 0.1f; - NPC.noGravity = true; - NPC.damage = 0; - NPC.width = 36; - NPC.height = 22; - NPC.defense = 0; - NPC.lifeMax = 5; - NPC.aiStyle = -1; - AIType = -1; - NPC.HitSound = SoundID.NPCHit1; - NPC.DeathSound = SoundID.NPCDeath1; - Banner = NPC.type; - BannerItem = ModContent.ItemType(); - NPC.chaseable = false; - NPC.catchItem = (short)ModContent.ItemType(); - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + base.SetDefaults(); + NPC.catchItem = (short)ModContent.ItemType(); NPC.rarity = 3; } + public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 5; k++) diff --git a/NPCs/SunkenSea/Sharkoon.cs b/NPCs/SunkenSea/Sharkoon.cs index 25418299c5..6c6b4b3f7f 100644 --- a/NPCs/SunkenSea/Sharkoon.cs +++ b/NPCs/SunkenSea/Sharkoon.cs @@ -13,6 +13,7 @@ using Terraria.DataStructures; using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; +using Terraria.ModLoader.Utilities; using static CalamityMod.CalamityUtils; using static Terraria.ModLoader.ModContent; @@ -519,6 +520,16 @@ namespace CalamityMod.NPCs.SunkenSea } } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.Water && !spawnInfo.Player.Calamity().clamity) + { + if (spawnInfo.Player.Calamity().ZoneRadiantReefs) + return SpawnCondition.CaveJellyfish.Chance * 0.2f; + } + return 0f; + } + #endregion #region Drawing & Animation