Add collision teleport portals and ledge-safe movement in VNext dungeons

This commit is contained in:
dingo
2026-02-14 15:05:10 -05:00
parent 147e7d625d
commit 8f7098af81
9 changed files with 382 additions and 34 deletions
+8 -8
View File
@@ -572,7 +572,7 @@ public static class MobAI
float targetY = mob.SpawnY + MathF.Sin(angle) * dist;
// Check if target is walkable
if (sim.CanMoveTo(targetX, targetY))
if (sim.CanActorMoveTo(targetX, targetY))
{
mob.WanderTargetX = targetX;
mob.WanderTargetY = targetY;
@@ -693,7 +693,7 @@ public static class MobAI
float newY = mob.Y + moveY;
// Check collision for each axis separately
if (sim.CanMoveTo(newX, mob.Y))
if (sim.CanActorMoveTo(newX, mob.Y))
{
mob.X = newX;
}
@@ -703,7 +703,7 @@ public static class MobAI
mob.StuckTime += 0.05f;
}
if (sim.CanMoveTo(mob.X, newY))
if (sim.CanActorMoveTo(mob.X, newY))
{
mob.Y = newY;
}
@@ -736,12 +736,12 @@ public static class MobAI
float newX = mob.X + moveX;
float newY = mob.Y + moveY;
if (sim.CanMoveTo(newX, mob.Y))
if (sim.CanActorMoveTo(newX, mob.Y))
{
mob.X = newX;
}
if (sim.CanMoveTo(mob.X, newY))
if (sim.CanActorMoveTo(mob.X, newY))
{
mob.Y = newY;
}
@@ -754,7 +754,7 @@ public static class MobAI
foreach (float ox in offsets)
{
if (sim.CanMoveTo(mob.X + ox, mob.Y))
if (sim.CanActorMoveTo(mob.X + ox, mob.Y))
{
mob.X += ox * 0.5f;
return;
@@ -763,7 +763,7 @@ public static class MobAI
foreach (float oy in offsets)
{
if (sim.CanMoveTo(mob.X, mob.Y + oy))
if (sim.CanActorMoveTo(mob.X, mob.Y + oy))
{
mob.Y += oy * 0.5f;
return;
@@ -819,7 +819,7 @@ public static class MobAI
float spawnY = mob.Y + (float)Math.Sin(angle) * summonDistance;
// Make sure spawn position is walkable
if (!sim.CanMoveTo(spawnX, spawnY))
if (!sim.CanActorMoveTo(spawnX, spawnY))
{
// Try closer
spawnX = mob.X + (float)Math.Cos(angle) * (summonDistance * 0.5f);