Sharkoon & Probesnout: Banners & Gores.

This commit is contained in:
Memes committed 2025-03-01 21:26:27 +01:00
1 parent d7ed5a8a17
commit 7bbcce679e
23 files changed
+72 -7

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 504 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

@@ -0,0 +1,7 @@
namespace CalamityMod.Items.Placeables.Banners
{
public class ProbesnoutBanner : BaseBanner
{
public override int BannerTileStyle => 130;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

@@ -0,0 +1,7 @@
namespace CalamityMod.Items.Placeables.Banners
{
public class SharkoonBanner : BaseBanner
{
public override int BannerTileStyle => 129;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

+2 -2
View File
@@ -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
{
+10 -4
View File
@@ -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<ModGore>($"{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<ModGore>($"{Name}Small{i + 1}").Type);
}
}
}
+8 -1
View File
@@ -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<BabyCannonballJellyfish>();
break;
case 129:
npc = NPCType<Sharkoon>();
break;
case 130:
npc = NPCType<Probesnout>();
break;
default:
break;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 59 KiB

+38
View File
@@ -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
/// <param name="x">The input value.</param>
public static int DirectionalSign(this float x) => (x > 0f).ToDirectionInt();
public static List<Point> GetIntersectingPointsInLine(Point start, Point end)
{
List<Point> 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<Point> GetIntersectingPointsInLine(Vector2 start, Vector2 end) => GetIntersectingPointsInLine(start.ToTileCoordinates(), end.ToTileCoordinates());
#region Easings
/// <summary>
/// Gets a value from 0 to 1 and returns an eased value.