diff --git a/Gores/SunkenSea/Probesnout/Probesnout1.png b/Gores/SunkenSea/Probesnout/Probesnout1.png new file mode 100644 index 0000000000..c0b8f8adb0 Binary files /dev/null and b/Gores/SunkenSea/Probesnout/Probesnout1.png differ diff --git a/Gores/SunkenSea/Probesnout/Probesnout2.png b/Gores/SunkenSea/Probesnout/Probesnout2.png new file mode 100644 index 0000000000..3de6b17ddb Binary files /dev/null and b/Gores/SunkenSea/Probesnout/Probesnout2.png differ diff --git a/Gores/SunkenSea/Probesnout/Probesnout3.png b/Gores/SunkenSea/Probesnout/Probesnout3.png new file mode 100644 index 0000000000..c8f50fa486 Binary files /dev/null and b/Gores/SunkenSea/Probesnout/Probesnout3.png differ diff --git a/Gores/SunkenSea/Probesnout/Probesnout4.png b/Gores/SunkenSea/Probesnout/Probesnout4.png new file mode 100644 index 0000000000..cf0133ad3c Binary files /dev/null and b/Gores/SunkenSea/Probesnout/Probesnout4.png differ diff --git a/Gores/SunkenSea/Probesnout/ProbesnoutGold1.png b/Gores/SunkenSea/Probesnout/ProbesnoutGold1.png new file mode 100644 index 0000000000..d31b36eb5b Binary files /dev/null and b/Gores/SunkenSea/Probesnout/ProbesnoutGold1.png differ diff --git a/Gores/SunkenSea/Probesnout/ProbesnoutGold2.png b/Gores/SunkenSea/Probesnout/ProbesnoutGold2.png new file mode 100644 index 0000000000..03ffdc3538 Binary files /dev/null and b/Gores/SunkenSea/Probesnout/ProbesnoutGold2.png differ diff --git a/Gores/SunkenSea/Probesnout/ProbesnoutGold3.png b/Gores/SunkenSea/Probesnout/ProbesnoutGold3.png new file mode 100644 index 0000000000..6bef3c6981 Binary files /dev/null and b/Gores/SunkenSea/Probesnout/ProbesnoutGold3.png differ diff --git a/Gores/SunkenSea/Probesnout/ProbesnoutGold4.png b/Gores/SunkenSea/Probesnout/ProbesnoutGold4.png new file mode 100644 index 0000000000..3585353385 Binary files /dev/null and b/Gores/SunkenSea/Probesnout/ProbesnoutGold4.png differ diff --git a/Gores/SunkenSea/Sharkoon/Sharkoon1.png b/Gores/SunkenSea/Sharkoon/Sharkoon1.png new file mode 100644 index 0000000000..a397daba9c Binary files /dev/null and b/Gores/SunkenSea/Sharkoon/Sharkoon1.png differ diff --git a/Gores/SunkenSea/Sharkoon/Sharkoon2.png b/Gores/SunkenSea/Sharkoon/Sharkoon2.png new file mode 100644 index 0000000000..a43f486c3a Binary files /dev/null and b/Gores/SunkenSea/Sharkoon/Sharkoon2.png differ diff --git a/Gores/SunkenSea/Sharkoon/Sharkoon3.png b/Gores/SunkenSea/Sharkoon/Sharkoon3.png new file mode 100644 index 0000000000..37ded0e054 Binary files /dev/null and b/Gores/SunkenSea/Sharkoon/Sharkoon3.png differ diff --git a/Gores/SunkenSea/Sharkoon/Sharkoon4.png b/Gores/SunkenSea/Sharkoon/Sharkoon4.png new file mode 100644 index 0000000000..14c6732baf Binary files /dev/null and b/Gores/SunkenSea/Sharkoon/Sharkoon4.png differ diff --git a/Gores/SunkenSea/Sharkoon/SharkoonSmall1.png b/Gores/SunkenSea/Sharkoon/SharkoonSmall1.png new file mode 100644 index 0000000000..5d5a8ff043 Binary files /dev/null and b/Gores/SunkenSea/Sharkoon/SharkoonSmall1.png differ diff --git a/Gores/SunkenSea/Sharkoon/SharkoonSmall2.png b/Gores/SunkenSea/Sharkoon/SharkoonSmall2.png new file mode 100644 index 0000000000..a50626462c Binary files /dev/null and b/Gores/SunkenSea/Sharkoon/SharkoonSmall2.png differ diff --git a/Items/Placeables/Banners/ProbesnoutBanner.cs b/Items/Placeables/Banners/ProbesnoutBanner.cs new file mode 100644 index 0000000000..7ba93318b5 --- /dev/null +++ b/Items/Placeables/Banners/ProbesnoutBanner.cs @@ -0,0 +1,7 @@ +namespace CalamityMod.Items.Placeables.Banners +{ + public class ProbesnoutBanner : BaseBanner + { + public override int BannerTileStyle => 130; + } +} diff --git a/Items/Placeables/Banners/ProbesnoutBanner.png b/Items/Placeables/Banners/ProbesnoutBanner.png new file mode 100644 index 0000000000..40c40de9f3 Binary files /dev/null and b/Items/Placeables/Banners/ProbesnoutBanner.png differ diff --git a/Items/Placeables/Banners/SharkoonBanner.cs b/Items/Placeables/Banners/SharkoonBanner.cs new file mode 100644 index 0000000000..a8bfa5301c --- /dev/null +++ b/Items/Placeables/Banners/SharkoonBanner.cs @@ -0,0 +1,7 @@ +namespace CalamityMod.Items.Placeables.Banners +{ + public class SharkoonBanner : BaseBanner + { + public override int BannerTileStyle => 129; + } +} diff --git a/Items/Placeables/Banners/SharkoonBanner.png b/Items/Placeables/Banners/SharkoonBanner.png new file mode 100644 index 0000000000..6dcf32bad3 Binary files /dev/null and b/Items/Placeables/Banners/SharkoonBanner.png differ diff --git a/NPCs/SunkenSea/Probesnout.cs b/NPCs/SunkenSea/Probesnout.cs index 1c138250c2..90f0d198b1 100644 --- a/NPCs/SunkenSea/Probesnout.cs +++ b/NPCs/SunkenSea/Probesnout.cs @@ -203,9 +203,9 @@ namespace CalamityMod.NPCs.SunkenSea // While it doesn't have any obstacles in front of it, run away in a straight line. // Try to manuever if there are any obstacles. var headedDirection = CurrentPredator.DirectionTo(NPC.Center) * 200f; - // bool tileNotWater = GetIntersectingPoints(NPC.Center, NPC.Center + headedDirection).Any(point => Main.tile[point].IsTileSolid() || Main.tile[point].LiquidAmount < 255); + bool tileNotWater = GetIntersectingPointsInLine(NPC.Center, NPC.Center + headedDirection).Any(point => Main.tile[point].IsTileSolid() || Main.tile[point].LiquidAmount < 255); - if (false) + if (tileNotWater) { do { diff --git a/NPCs/SunkenSea/Sharkoon.cs b/NPCs/SunkenSea/Sharkoon.cs index 020db79c93..6a7045e509 100644 --- a/NPCs/SunkenSea/Sharkoon.cs +++ b/NPCs/SunkenSea/Sharkoon.cs @@ -435,15 +435,21 @@ namespace CalamityMod.NPCs.SunkenSea public override void HitEffect(NPC.HitInfo hit) { - for (int k = 0; k < 5; k++) + for (int k = 0; k < 25; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.RedMoss, hit.HitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { - for (int k = 0; k < 25; k++) + if (CanExplode) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.RedMoss, hit.HitDirection, -1f, 0, default, 1f); + for (int i = 0; i < 4; i++) + Gore.NewGoreDirect(NPC.GetSource_Death(), NPC.Center, new Vector2(hit.HitDirection, -1f), Mod.Find($"{Name}{i + 1}").Type); + } + else + { + for (int i = 0; i < 2; i++) + Gore.NewGoreDirect(NPC.GetSource_Death(), NPC.Center, new Vector2(hit.HitDirection, -1f), Mod.Find($"{Name}Small{i + 1}").Type); } } } diff --git a/Tiles/MonsterBanner.cs b/Tiles/MonsterBanner.cs index d8bf954874..db5c9265c8 100644 --- a/Tiles/MonsterBanner.cs +++ b/Tiles/MonsterBanner.cs @@ -1,4 +1,5 @@ -using CalamityMod.NPCs.Abyss; +using CalamityMod.Items.Placeables.Banners; +using CalamityMod.NPCs.Abyss; using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.AquaticScourge; using CalamityMod.NPCs.Astral; @@ -457,6 +458,12 @@ namespace CalamityMod.Tiles case 128: npc = NPCType(); break; + case 129: + npc = NPCType(); + break; + case 130: + npc = NPCType(); + break; default: break; } diff --git a/Tiles/MonsterBanner.png b/Tiles/MonsterBanner.png index 45376746f3..d919ca0c1f 100644 Binary files a/Tiles/MonsterBanner.png and b/Tiles/MonsterBanner.png differ diff --git a/Utilities/MathematicalUtils.cs b/Utilities/MathematicalUtils.cs index 3f37f46b43..371d956ac7 100644 --- a/Utilities/MathematicalUtils.cs +++ b/Utilities/MathematicalUtils.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Security.Cryptography.Xml; using Microsoft.Xna.Framework; using ReLogic.Threading; using Terraria; @@ -224,6 +225,43 @@ namespace CalamityMod /// The input value. public static int DirectionalSign(this float x) => (x > 0f).ToDirectionInt(); + public static List GetIntersectingPointsInLine(Point start, Point end) + { + List intersectingCells = []; + + int dx = Math.Abs(end.X - start.X); + int dy = Math.Abs(end.Y - start.Y); + int sx = start.X < end.X ? 1 : -1; + int sy = start.Y < end.Y ? 1 : -1; + int err = dx - dy; + + while (true) + { + // Add the current cell to the list + intersectingCells.Add(start); + + // Check if we've reached the end point + if (start == end) + break; + + int e2 = 2 * err; + if (e2 > -dy) + { + err -= dy; + start.X += sx; + } + if (e2 < dx) + { + err += dx; + start.Y += sy; + } + } + + return intersectingCells; + } + + public static List GetIntersectingPointsInLine(Vector2 start, Vector2 end) => GetIntersectingPointsInLine(start.ToTileCoordinates(), end.ToTileCoordinates()); + #region Easings /// /// Gets a value from 0 to 1 and returns an eased value.