From befa8982a0a8d929e65a23b66040671a45181ef4 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Sun, 14 Feb 2021 19:31:46 +0900 Subject: new thins --- .../dungeon/mechanics/DungeonBreakableWall.java | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java') diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java index 5ba3f21c..5fa994e0 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java @@ -27,7 +27,16 @@ public class DungeonBreakableWall implements DungeonMechanic, RouteBlocker { if (state.equalsIgnoreCase("navigate")) { Set base; Set preRequisites = base = new HashSet(); - ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint()); + + int leastY = Integer.MAX_VALUE; + OffsetPoint thatPt = null; + for (OffsetPoint offsetPoint : secretPoint.getOffsetPointList()) { + if (offsetPoint.getY() < leastY) { + thatPt = offsetPoint; + leastY = offsetPoint.getY(); + } + } + ActionMoveNearestAir actionMove = new ActionMoveNearestAir(thatPt); preRequisites.add(actionMove); preRequisites = actionMove.getPreRequisite(); for (String str : preRequisite) { @@ -50,7 +59,16 @@ public class DungeonBreakableWall implements DungeonMechanic, RouteBlocker { preRequisites = actionClick.getPreRequisite(); } { - ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint()); + + int leastY = Integer.MAX_VALUE; + OffsetPoint thatPt = null; + for (OffsetPoint offsetPoint : secretPoint.getOffsetPointList()) { + if (offsetPoint.getY() < leastY) { + thatPt = offsetPoint; + leastY = offsetPoint.getY(); + } + } + ActionMoveNearestAir actionMove = new ActionMoveNearestAir(thatPt); preRequisites.add(actionMove); preRequisites = actionMove.getPreRequisite(); } -- cgit