Added warp point detection
parent
c4ce0a5280
commit
ec7148e613
|
@ -40,6 +40,7 @@ namespace stardew_access.Features
|
|||
bool isColliding = isCollidingAtTile(x, y);
|
||||
var terrainFeature = Game1.currentLocation.terrainFeatures.FieldDict;
|
||||
string? door = getDoorAtTile(x, y);
|
||||
string? warp = getWarpPointAtTile(x, y);
|
||||
(CATEGORY? category, string? name) dynamicTile = getDynamicTilesInfo(x, y, lessInfo);
|
||||
string? junimoBundle = getJunimoBundleAt(x, y);
|
||||
string? resourceClump = getResourceClumpAtTile(x, y, lessInfo);
|
||||
|
@ -113,6 +114,11 @@ namespace stardew_access.Features
|
|||
toReturn = bush;
|
||||
category = CATEGORY.Bush;
|
||||
}
|
||||
else if (warp != null)
|
||||
{
|
||||
toReturn = warp;
|
||||
category = CATEGORY.Doors;
|
||||
}
|
||||
else if (door != null)
|
||||
{
|
||||
toReturn = door;
|
||||
|
@ -1164,6 +1170,27 @@ namespace stardew_access.Features
|
|||
return false;
|
||||
}
|
||||
|
||||
public static string? getWarpPointAtTile(int x, int y)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Game1.currentLocation == null) return null;
|
||||
|
||||
foreach (Warp warpPoint in Game1.currentLocation.warps)
|
||||
{
|
||||
if (warpPoint.X != x || warpPoint.Y != y) continue;
|
||||
|
||||
return $"{warpPoint.TargetName} Entrance";
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MainClass.ErrorLog($"Error while detecting warp points.\n{e.Message}");
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static string? getDoorAtTile(int x, int y)
|
||||
{
|
||||
Point tilePoint = new Point(x, y);
|
||||
|
|
Loading…
Reference in New Issue