Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
987a017
New weapon(not finished yet)
Omnielement Sep 8, 2025
f1eec8a
EvilHalbertBarnacle finished.
Omnielement Sep 9, 2025
30e555c
feat(KelpCurtain): Optimize GreenSungloThorn
Felixyang777 Sep 16, 2025
ed54bfb
fix(KelpCurtain): fix the bug of timer of shield
Felixyang777 Sep 16, 2025
d02e433
feat(KelpCurtain): Optimize the behavior of GreenSungloThorn
Felixyang777 Sep 18, 2025
02cdaa1
Bugfix: EvilHalbertBarnacle_proj_shuttle now collide with NPC will al…
Omnielement Oct 1, 2025
7d5d6bf
New weapons.
Omnielement Oct 5, 2025
4115ea6
幽雨藤曼
xzy-sz Oct 7, 2025
882cf50
New weapons: Empty Water Staff & Arc I.
Omnielement Oct 7, 2025
c56dd33
Merge branch 'Yggdrasil/newContent0' of github.com:Solaestas/Everglow…
xzy-sz Oct 7, 2025
daf9fa2
Adjust HangingTile.
Omnielement Oct 7, 2025
676a1cd
Remake HangingTile.
Omnielement Oct 12, 2025
4444950
Adjust some field names.
Omnielement Oct 12, 2025
98144a0
Separate the Draw part of Rope Adjusting Knob to HangingTile.
Omnielement Oct 13, 2025
8a78f58
Emergency bug fix: missing DrawBlockBound(...).
Omnielement Oct 13, 2025
fd70020
Add a collision detection.
Omnielement Oct 13, 2025
cc033a6
抓和调的限制
xzy-sz Oct 14, 2025
29eb282
New weapons.
Omnielement Oct 14, 2025
fc123f1
New sound effects.
Omnielement Oct 15, 2025
245ce9e
Merge remote-tracking branch 'origin/master' into Yggdrasil/newContent0
Omnielement Oct 22, 2025
489cb48
trail相对玩家朝向有问题
xzy-sz Oct 22, 2025
3fc7f66
Merge branch 'Yggdrasil/newContent0' of github.com:Solaestas/Everglow…
xzy-sz Oct 22, 2025
be041c9
Merge branch 'Yggdrasil/newContent0' of https://github.com/Solaestas/…
Omnielement Oct 22, 2025
ac8ed88
New weapon, Spring of Quicksand.
Omnielement Oct 22, 2025
0135b2d
new room design.
Omnielement Oct 24, 2025
7085a4a
New rooms.
Omnielement Oct 24, 2025
0bb47b8
feat: 引入 ModLiquidLib,替换 DarkSludge
unanmed Oct 25, 2025
0640a09
Merge branch 'Yggdrasil/newContent0' of github.com:Solaestas/Everglow…
unanmed Oct 25, 2025
4e9306e
Scene VFX opt.
Omnielement Oct 25, 2025
45832f8
Adjust twilight forest castle room vfx.
Omnielement Oct 27, 2025
2f855fb
New twilight room.
Omnielement Oct 28, 2025
8ac13b5
Some localizations.
Omnielement Oct 29, 2025
3a3c0af
MechanismHalBerd
xzy-sz Oct 30, 2025
2224c5d
feat: DarkSludge 相关行为
unanmed Oct 30, 2025
aec09b0
fix: Conflit of TelescopicPlatform and gravitation buff.
unanmed Oct 30, 2025
56e8244
Localization.
Omnielement Oct 30, 2025
c595986
把debug代码删了
xzy-sz Oct 31, 2025
71e5e53
Finish localization.(melee and ranged weapon lack of some tooltip)
Omnielement Oct 31, 2025
0e06529
New localizations.
Omnielement Nov 1, 2025
ed7bc6c
merge master
Omnielement Nov 4, 2025
d041fe4
chore: update mod liquid lib.
unanmed Nov 4, 2025
46eb7bb
merge master.
Omnielement Nov 4, 2025
00d5dd0
update liquid
Omnielement Nov 4, 2025
3b59466
New worldgen of twilight castle.
Omnielement Nov 6, 2025
16f720f
藤曼修理魔杖
xzy-sz Nov 9, 2025
c3921ce
放置中途切换手持物而产生的异常
xzy-sz Nov 13, 2025
da7de09
New FlagVFX.
Omnielement Nov 13, 2025
109ff49
Add a flag like vfx
Omnielement Nov 20, 2025
1432ac9
Merge master.
Omnielement Nov 21, 2025
3a1aed3
Fern leaves now can swing in wind.
Omnielement Nov 22, 2025
960b796
Fix bug.
Omnielement Nov 22, 2025
b4f8f2d
fix: fish system using ModLiquidLib
unanmed Nov 23, 2025
b904ca9
chore: Merge master
CloudeaSoft Nov 24, 2025
3b432fb
fix: Solve naming mismatch error in ResistanceWireBayonet_proj
CloudeaSoft Nov 24, 2025
0e18bb9
Update world generation and background of dark sludge.
Omnielement Nov 25, 2025
98b1296
chore: Merge master
CloudeaSoft Nov 26, 2025
6e96709
Twilight Castle Room: shadow dragon.
Omnielement Nov 26, 2025
d204708
Adjust vfx around origin pylon-midnight bayou.
Omnielement Nov 27, 2025
d629af1
Try to add some new pylons. Now facing with some issues.
Omnielement Dec 3, 2025
52d852c
Merge remote-tracking branch 'origin/master' into Yggdrasil/newContent0
Omnielement Dec 5, 2025
258cd9a
Add new pylons for yggdrasil town.
Omnielement Dec 5, 2025
4be6ba0
Merge remote-tracking branch 'origin/master' into Yggdrasil/newContent0
Omnielement Dec 5, 2025
96f1a52
Unregistered Pylon.
Omnielement Dec 6, 2025
3cbbec5
Add a block for 2nd floor.
Omnielement Dec 6, 2025
868b702
New tiles.
Omnielement Dec 8, 2025
5de6c19
New furnitures.
Omnielement Dec 9, 2025
c1f6320
The interactive collision of escalator.
Omnielement Dec 28, 2025
1e64570
Fix issue: [air wall] placing an air wall type but tile.
Omnielement Jan 6, 2026
8ddc40b
merge master.
Omnielement Feb 23, 2026
c046096
Update icon.
Omnielement Mar 23, 2026
265057a
Add bamboo for Isle of bloom.
Omnielement Mar 24, 2026
7ff5bf5
Merge remote-tracking branch 'origin/master' into Yggdrasil/newContent0
Omnielement Mar 24, 2026
d53e13e
Update bamboo
Omnielement Mar 25, 2026
1d59c62
Merge remote-tracking branch 'origin/master' into Yggdrasil/newContent0
Omnielement Mar 25, 2026
a41f36f
New peach blossoms.
Omnielement Mar 26, 2026
3065b26
Merge remote-tracking branch 'origin/master' into Yggdrasil/newContent0
Omnielement Mar 28, 2026
1583f52
Isle of Bloom.
Omnielement Mar 29, 2026
a5b9cea
chore: merge master
CloudeaSoft Apr 8, 2026
050b818
new dust effects for peach blossom.
Omnielement Apr 14, 2026
f36074f
Merge remote-tracking branch 'origin/master' into Yggdrasil/newContent0
Omnielement Apr 14, 2026
f3f573a
new kelp curtain contents.
Omnielement Apr 15, 2026
d3129c1
Update delivery hole.
Omnielement Apr 16, 2026
272d1a1
Water delivery hole finished.
Omnielement Apr 17, 2026
9d86ea4
Adjust some logic.
Omnielement Apr 17, 2026
d6b4ab6
water delivery hole debug.
Omnielement Apr 18, 2026
820ff0e
Merge master.
Omnielement Apr 24, 2026
f63e2a4
Update Mods.Everglow.Biomes.hjson
syuvi-www Apr 24, 2026
7fad95d
Add a slope water delivery hole.
Omnielement Apr 28, 2026
fbe8818
Update water delivery hole.
Omnielement Apr 29, 2026
e37c696
Apply suggestion from @lace-wing
Omnielement Apr 30, 2026
6f5cf6f
Apply suggestion from @lace-wing
Omnielement Apr 30, 2026
cdc35cb
Update some worldgen paras.
Omnielement Apr 30, 2026
cba7973
Merge remote-tracking branch 'origin/master' into Yggdrasil/newContent0
Omnielement Apr 30, 2026
fd0c7a5
Merge pull request #1 from Solaestas/Yggdrasil/newContent0
syuvi-www May 1, 2026
9feccc9
Update Mods.Everglow.Biomes.hjson
syuvi-www May 1, 2026
26f08c6
Update Mods.Everglow.Biomes.hjson
syuvi-www May 1, 2026
b11b69c
Merge pull request #369 from syuvi-www/Yggdrasil/newContent0
lace-wing May 1, 2026
d0a631b
Move many function from YggdrasilWorldGeneration to TileUtils.WorldGen.
Omnielement May 7, 2026
d8b7276
Merge branch 'Yggdrasil/newContent0' of https://github.com/Solaestas/…
Omnielement May 7, 2026
f6279c7
Merge remote-tracking branch 'origin/master' into Yggdrasil/newContent0
Omnielement May 7, 2026
29b6cf7
New textures.
Omnielement May 7, 2026
7bd6dad
Merge remote-tracking branch 'origin/master' into Yggdrasil/newContent0
Omnielement May 7, 2026
3998a87
Merge branch 'master' into Yggdrasil/newContent0
CloudeaSoft May 9, 2026
8862a2d
add Yggdrasil/newContent0 to action
CloudeaSoft May 9, 2026
11b204b
Merge branch 'Yggdrasil/newContent0' of https://github.com/Solaestas/…
Omnielement May 9, 2026
7f36fa9
Merge remote-tracking branch 'origin/master' into Yggdrasil/newContent0
Omnielement May 9, 2026
dd2596b
new contents.
Omnielement May 9, 2026
0d7a69a
New weapons.
Omnielement May 12, 2026
d44ca8d
Add fluorescent hydra room in underlake maze.
Omnielement May 16, 2026
5cf1eab
Move isle of bloom to the yggdrasil map.
Omnielement May 19, 2026
7b5f5e6
WorldGen Para adjustment.
Omnielement May 19, 2026
d872d35
New contents.
Omnielement May 21, 2026
2a49a37
Merge remote-tracking branch 'origin/master' into Yggdrasil/newContent0
Omnielement May 24, 2026
9e51b61
Isle of bloom cave block light effect.
Omnielement May 24, 2026
2a6ff18
Merge remote-tracking branch 'origin/master' into Yggdrasil/newContent0
Omnielement May 28, 2026
b985a92
New background draw for kelp curtain.
Omnielement May 28, 2026
af2560c
New boss.
Omnielement May 31, 2026
e9c42a4
New vampire mat behaviors.
Omnielement Jun 3, 2026
574c9c8
Merge master.
Omnielement Jun 3, 2026
5b94697
Add a LayerPriority for backgroundslide manual adjustments(In some sp…
Omnielement Jun 5, 2026
09b2164
Update some background logic of IsleOfBloom.
Omnielement Jun 5, 2026
39a6da2
New texture.
Omnielement Jun 6, 2026
4af3271
Update Vampire Mat Cave Hanging Sign.
Omnielement Jun 6, 2026
6615dd7
New skill for vampire mat.
Omnielement Jun 8, 2026
10145c9
New skill again.
Omnielement Jun 8, 2026
cdf8d9a
New boss skills.
Omnielement Jun 9, 2026
4ca0335
Merge master
Omnielement Jun 10, 2026
dfb6ece
Adjust with master.
Omnielement Jun 10, 2026
d8e92b9
Adjust Yggdrasil contents associate with Rope.
Omnielement Jun 10, 2026
2a72de1
Adjust boss skills.
Omnielement Jun 10, 2026
c336a4d
Improve boss visual behavoirs.
Omnielement Jun 10, 2026
f628f71
Move behide background test.
Omnielement Jun 10, 2026
46fb4ad
new dash skill
Omnielement Jun 11, 2026
a567cd9
New hit effect.
Omnielement Jun 11, 2026
7f327a7
Vampire mat all skills are finished.
Omnielement Jun 12, 2026
606131a
Change the path of NPCSpawnManager to Yggdrasil/Common.
Omnielement Jun 13, 2026
0513df6
Add boss item for vampire mat.
Omnielement Jun 13, 2026
308bf74
New Gores.
Omnielement Jun 13, 2026
a3ecdcc
Try to add a ramdom person.
Omnielement Jun 13, 2026
fc0fcb8
Bugs fixed.
Omnielement Jun 14, 2026
1303a9a
Update VFX Person.
Omnielement Jun 15, 2026
e955644
Add clothes.
Omnielement Jun 16, 2026
f1c9626
Add metro.
Omnielement Jun 18, 2026
30ee6f6
Add sound effects for Quenching Blade.
Omnielement Jun 21, 2026
2ab5d9c
Adjust vampire mat visual effects.
Omnielement Jun 25, 2026
b035b94
Update metro.
Omnielement Jun 25, 2026
f3f709f
Update YggdrasilTown.
Omnielement Jun 28, 2026
66d29bf
Update YggdrasilTown v2.
Omnielement Jun 28, 2026
a56e789
Update some blockouts of yggdrasil town.
Omnielement Jul 8, 2026
02203f1
New tile textures.
Omnielement Jul 8, 2026
7b7ec2c
Update Town.
Omnielement Jul 9, 2026
92db2f3
WorldGen Update.
Omnielement Jul 9, 2026
055c4de
Update some new tile background pieces.
Omnielement Jul 13, 2026
936382c
Update Town Tiles.
Omnielement Jul 13, 2026
762da73
Update YggdrasilTown.
Omnielement Jul 15, 2026
9c0a9b0
Performance update.
Omnielement Jul 15, 2026
c3adf86
Update yggdrasil town.
Omnielement Jul 16, 2026
5f41b7c
Add item slot texture for luggage storage.
Omnielement Jul 17, 2026
4c39c42
Adjust yggdrasil town.
Omnielement Jul 25, 2026
633e126
Merge remote.
Omnielement Jul 25, 2026
cc7ae92
Merge branch 'master' into Yggdrasil/newContent0
CloudeaSoft Jul 27, 2026
6e78a4f
Merge master and normalize Yggdrasil files
CloudeaSoft Jul 27, 2026
4822e6c
Update YggdrasilTown_Furnace Zone.
Omnielement Sep 2, 2026
fd2a2d4
fix(Yggdrasil): stabilize max stat rules
CloudeaSoft Sep 4, 2026
3ad6a3f
Merge remote-tracking branch 'origin/master' into Yggdrasil/newContent0
CloudeaSoft Sep 4, 2026
92e4e54
New contents of furnace zone.
Omnielement Sep 4, 2026
9ba1e37
Merge branch 'Yggdrasil/newContent0' of https://github.com/Solaestas/…
Omnielement Sep 4, 2026
ba13e4c
Remove obsolete tile in MapIO.
Omnielement Sep 4, 2026
8e42591
Merge remote-tracking branch 'origin/master' into Yggdrasil/newContent0
Omnielement Sep 4, 2026
97e05bd
Update Furnace Shop
Omnielement Sep 6, 2026
5a9646b
The initial Yggdrasil Town Furnace Zone was completed.
Omnielement Sep 9, 2026
a7e4cac
Fixed some bugs that mentioned by AI reviewer.
Omnielement Sep 10, 2026
a1975d1
Fix bugs and improve visual effect of ForestRainVine.
Omnielement Sep 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: .NET Build and Test

on:
push:
branches: [ "master" ]
branches: [ "master", "Yggdrasil/newContent0"]
pull_request:
branches: [ "master" ]
branches: [ "master", "Yggdrasil/newContent0"]

jobs:
build-and-test:
Expand Down
Binary file added Libraries/ModLiquidLib.dll
Binary file not shown.
1,238 changes: 1,238 additions & 0 deletions Libraries/ModLiquidLib.xml

Large diffs are not rendered by default.

93 changes: 93 additions & 0 deletions Sources/Everglow.Core/Utilities/MathUtils.Geometry.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Terraria;

namespace Everglow.Commons.Utilities;

public static partial class MathUtils
Expand Down Expand Up @@ -32,6 +34,38 @@ public static float ToRotationSafe(this Vector2 vector, float defaultValue = def
}
}

/// <summary>
/// 判定2D 圆形与 AABB 是否相交(边界算相交)
/// </summary>
/// <param name="circleCenter"></param>
/// <param name="radius"></param>
/// <param name="aabbMin"></param>
/// <param name="aabbMax"></param>
/// <returns></returns>
public static bool IntersectsCircleAABB(Vector2 circleCenter, float radius, Vector2 aabbMin, Vector2 aabbMax)
{
float closestX = Math.Clamp(circleCenter.X, aabbMin.X, aabbMax.X);
float closestY = Math.Clamp(circleCenter.Y, aabbMin.Y, aabbMax.Y);

float dx = circleCenter.X - closestX;
float dy = circleCenter.Y - closestY;

return (dx * dx + dy * dy) <= (radius * radius);
}

/// <summary>
/// 判定2D 圆形与 AABB 是否相交(边界算相交)
/// </summary>
/// <param name="circleCenter"></param>
/// <param name="radius"></param>
/// <param name="aabbMin"></param>
/// <param name="aabbMax"></param>
/// <returns></returns>
public static bool IntersectsCircleAABB(Vector2 circleCenter, float radius, Rectangle hitBox)
{
return IntersectsCircleAABB(circleCenter, radius, hitBox.TopLeft(), hitBox.BottomRight());
}

/// <summary>
/// 2D 多边形与 AABB 是否相交
/// </summary>
Expand Down Expand Up @@ -177,6 +211,23 @@ public static bool IsPointInPolygon(List<Vector2> polygon, Vector2 point)
return isInside;
}

// Distance from point pos to line defined by points a and b
public static float PointToLineDistance(Vector2 a, Vector2 b, Vector2 pos)
{
float dx = b.X - a.X;
float dy = b.Y - a.Y;

float numerator = MathF.Abs(dy * pos.X - dx * pos.Y + b.X * a.Y - b.Y * a.X);
float denominator = MathF.Sqrt(dx * dx + dy * dy);

if (denominator < float.Epsilon)
{
return (pos - a).Length(); // a and b are same point
}

return numerator / denominator;
}

/// <summary>
/// 判断点是否在线段上
/// </summary>
Expand Down Expand Up @@ -303,6 +354,48 @@ public static bool DoLineSegmentsIntersectByAlgebra(Vector2 p1, Vector2 p2, Vect
return r >= 0 && r <= 1 && s >= 0 && s <= 1;
}

/// <summary>
/// 获取2D多边形包围盒(AABB)
/// </summary>
/// <param name="polygon"></param>
/// <returns></returns>
public static Rectangle GetPolygonAABBBound_Rectangle(List<Vector2> polygon)
{
if (polygon == null || polygon.Count < 3)
{
return Rectangle.emptyRectangle;
}

Vector4 v4 = GetPolygonAABBBound_Vector4(polygon);
return new Rectangle((int)v4.X, (int)v4.Y, (int)(v4.Z - v4.X), (int)(v4.W - v4.Y));
}

/// <summary>
/// 获取2D多边形包围盒(AABB)
/// </summary>
/// <param name="polygon"></param>
/// <returns>(minX, minY, maxX, maxY) 的 Vector4 结构</returns>
public static Vector4 GetPolygonAABBBound_Vector4(List<Vector2> polygon)
{
if (polygon == null || polygon.Count < 3)
{
return Vector4.zero;
}

float minX = float.MaxValue;
float minY = float.MaxValue;
float maxX = float.MinValue;
float maxY = float.MinValue;
foreach (Vector2 p in polygon)
{
minX = MathF.Min(minX, p.X);
minY = MathF.Min(minY, p.Y);
maxX = MathF.Max(maxX, p.X);
maxY = MathF.Max(maxY, p.Y);
}
return new Vector4(minX, minY, maxX, maxY);
}

/// <summary>
/// 校验多边形边是否相交(相邻边除外,避免自相交多边形)(未完成)
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Sources/Everglow.Core/VFX/VFXBatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class VFXBatch : IDisposable
private const int MAX_INDICES = MAX_VERTICES * 3;

//numbers Copy from SpriteBatch
private const int MAX_VERTICES = 8192;
private const int MAX_VERTICES = 1048576;

private List<IBuffers> buffers = new();

Expand Down
153 changes: 50 additions & 103 deletions Sources/Everglow.Function/DeveloperContent/Items/TileDataReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using Everglow.Commons.Vertex;
using Everglow.Commons.VFX;
using Everglow.Commons.VFX.Pipelines;
using Terraria;
using Terraria.ObjectData;

namespace Everglow.Commons.DeveloperContent.Items;

Expand Down Expand Up @@ -54,6 +56,7 @@ public class TileDataReaderSystem : Visual
public Point FixPoint;
public static List<int> OwnerPlayerWhoAmI = new List<int>();
public List<Point> ContinueTiles = new List<Point>();
public List<Point> SurfaceTiles = new List<Point>();
public List<Point> CheckLiquidTiles = new List<Point>();
public Point OldTilePos = new Point(0, 0);
public bool EverLasting = false;
Expand Down Expand Up @@ -110,7 +113,7 @@ public override void Draw()
OwnerPlayerWhoAmI.Remove(player.whoAmI);
return;
}
Tile tile = Main.tile[i, j];
Tile tile = TileUtils.SafeGetTile(i, j);
int colorType = ItemRarityID.White;
Color drawColor = Color.White;
if (!tile.HasTile)
Expand All @@ -119,20 +122,31 @@ public override void Draw()
drawColor = Color.Gray;
}
DrawBlockBound(i, j, drawColor);
if (ContinueTiles.Count < MaxContinueCount)
if (tile.HasTile)
{
var drawContinueColor = new Color(0.12f, 0.24f, 0.4f, 0);
foreach (Point point in ContinueTiles)
if (ContinueTiles.Count < MaxContinueCount)
{
var drawContinueColor = new Color(0.12f, 0.24f, 0.4f, 0);
foreach (var check_tile in ContinueTiles)
{
DrawBlockBound(check_tile.X, check_tile.Y, drawContinueColor);
}
}
if (SurfaceTiles.Count < MaxContinueCount)
{
DrawBlockBound(point.X, point.Y, drawContinueColor);
var drawSurfaceTilesColor = new Color(0.8f, 0.03f, 0.06f, 0);
foreach (var check_tile in SurfaceTiles)
{
DrawBlockBound(check_tile.X, check_tile.Y, drawSurfaceTilesColor);
}
}
}
if (CheckLiquidTiles.Count < MaxContinueCount)
{
var drawContinueColor = new Color(0.0f, 0.0f, 0.6f, 0);
foreach (Point point in CheckLiquidTiles)
foreach (var check_tile in CheckLiquidTiles)
{
DrawBlockBound(point.X, point.Y, drawContinueColor);
DrawBlockBound(check_tile.X, check_tile.Y, drawContinueColor);
}
}
string datas = GetDatas(i, j);
Expand All @@ -146,6 +160,7 @@ public string GetDatas(int i, int j)
string datas = "\nCoordinate: [" + i + ", " + j + "]";
datas += "\nHasTile: " + tile.HasTile;
datas += "\nType :" + tile.TileType;
//datas += "\nPaint :" + tile.BlockColorAndCoating().Invisible;
if (tile.HasTile)
{
datas += " " + TileID.Search.GetName(tile.TileType);
Expand All @@ -154,10 +169,31 @@ public string GetDatas(int i, int j)
{
datas += "\nContinue Tiles : " + ContinueTiles.Count;
}
if (SurfaceTiles.Count < MaxContinueCount)
{
datas += "\nSurface Tiles : " + SurfaceTiles.Count;
}
int multiStyle = TileObjectData.GetTileStyle(tile);
if (multiStyle >= 0)
{
datas += "\nMultiTile Style: " + multiStyle;
}
}
if (!tile.HasTile)
{
datas += "\nCan Fill Liquid Blocks: " + CheckLiquidTiles.Count;
if (CheckLiquidTiles.Count <= 900)
{
datas += "\nCan Fill Liquid Blocks: " + CheckLiquidTiles.Count;
}
}
//float waterLine;
//Collision.GetWaterLine(i, j, out waterLine);
//datas += "\n" + waterLine;

if (tile.WallType > WallID.None)
{
datas += "\nWallType :" + tile.WallType;
datas += " " + WallID.Search.GetName(tile.WallType);
}

// datas += "\nSlope: " + tile.Slope;
Expand All @@ -171,105 +207,16 @@ public string GetDatas(int i, int j)
/// <returns></returns>
public void UpdateContinueTiles(int i, int j)
{
ContinueTiles = new List<Point>();
CheckLiquidTiles = new List<Point>();
BFSContinueTile(i, j);
BFSFillLiquid(i, j);
}

private static readonly (int, int)[] directions =
{
(0, 1),
(1, 0),
(0, -1),
(-1, 0),
};

private static readonly (int, int)[] directionsLiquid =
{
(1, 0),
(0, 1),
(-1, 0),
};

public void BFSContinueTile(int i, int j)
{
BFSContinueTile(new Point(i, j));
}

public void BFSContinueTile(Point checkPoint)
{
var queueChecked = new Queue<Point>();

// 将起始点加入队列
queueChecked.Enqueue(checkPoint);
var visited = new List<Point>();

while (queueChecked.Count > 0)
Tile tile = TileUtils.SafeGetTile(i, j);
if (tile.HasTile)
{
var tilePos = queueChecked.Dequeue();

foreach (var (dx, dy) in directions)
{
int checkX = tilePos.X + dx;
int checkY = tilePos.Y + dy;
var point = new Point(checkX, checkY);
Tile tile = TileUtils.SafeGetTile(checkX, checkY);

// 检查边界和障碍物
if (checkX >= 20 && checkX < Main.maxTilesX - 20 && checkY >= 20 && checkY < Main.maxTilesY - 20 &&
tile.HasTile && !visited.Contains(point))
{
queueChecked.Enqueue(point);
visited.Add(point);
}
}
if (queueChecked.Count > MaxContinueCount || visited.Count > MaxContinueCount)
{
break;
}
SurfaceTiles = TileUtils.BFSSurface(new Point(i, j), 625);
ContinueTiles = TileUtils.BFSContinueTile(new Point(i, j), false, 625);
}
ContinueTiles = visited;
}

public void BFSFillLiquid(int i, int j)
{
BFSFillLiquid(new Point(i, j));
}

public void BFSFillLiquid(Point checkPoint)
{
var queueChecked = new Queue<Point>();

// 将起始点加入队列
queueChecked.Enqueue(checkPoint);
var visited = new List<Point>();

while (queueChecked.Count > 0)
else
{
var tilePos = queueChecked.Dequeue();

foreach (var (dx, dy) in directionsLiquid)
{
int checkX = tilePos.X + dx;
int checkY = tilePos.Y + dy;
var point = new Point(checkX, checkY);
Tile tile = TileUtils.SafeGetTile(checkX, checkY);

// 检查边界和障碍物
if (checkX >= 20 && checkX < Main.maxTilesX - 20 && checkY >= 20 && checkY < Main.maxTilesY - 20 &&
!Collision.IsWorldPointSolid(point.ToWorldCoordinates()) && !visited.Contains(point))
{
queueChecked.Enqueue(point);
visited.Add(point);
}
}
if (queueChecked.Count > MaxContinueCount || visited.Count > MaxContinueCount)
{
break;
}
CheckLiquidTiles = TileUtils.BFSGetCanFillLiquidTiles(i, j);
}
CheckLiquidTiles = visited;
}

public void DrawBlockBound(int i, int j, Color color)
Expand Down
Loading
Loading