v2.1.3: fixed action and minor pathfinding errors with mine action
This commit is contained in:
@@ -1049,6 +1049,7 @@ public class Hero extends Char {
|
||||
private boolean actOpenChest( HeroAction.OpenChest action ) {
|
||||
int dst = action.dst;
|
||||
if (Dungeon.level.adjacent( pos, dst ) || pos == dst) {
|
||||
path = null;
|
||||
|
||||
Heap heap = Dungeon.level.heaps.get( dst );
|
||||
if (heap != null && (heap.type != Type.HEAP && heap.type != Type.FOR_SALE)) {
|
||||
@@ -1095,6 +1096,7 @@ public class Hero extends Char {
|
||||
private boolean actUnlock( HeroAction.Unlock action ) {
|
||||
int doorCell = action.dst;
|
||||
if (Dungeon.level.adjacent( pos, doorCell )) {
|
||||
path = null;
|
||||
|
||||
boolean hasKey = false;
|
||||
int door = Dungeon.level.map[doorCell];
|
||||
@@ -1140,8 +1142,9 @@ public class Hero extends Char {
|
||||
}
|
||||
|
||||
public boolean actMine(HeroAction.Mine action){
|
||||
if (Dungeon.level.adjacent(pos, action.dst)
|
||||
&& (Dungeon.level.map[action.dst] == Terrain.WALL || Dungeon.level.map[action.dst] == Terrain.WALL_DECO)
|
||||
if (Dungeon.level.adjacent(pos, action.dst)){
|
||||
path = null;
|
||||
if ((Dungeon.level.map[action.dst] == Terrain.WALL || Dungeon.level.map[action.dst] == Terrain.WALL_DECO)
|
||||
&& Dungeon.level.insideMap(action.dst)){
|
||||
sprite.attack(action.dst, new Callback() {
|
||||
@Override
|
||||
@@ -1174,14 +1177,21 @@ public class Hero extends Char {
|
||||
Dungeon.observe();
|
||||
|
||||
spendAndNext(TICK);
|
||||
ready();
|
||||
}
|
||||
});
|
||||
return false;
|
||||
} else {
|
||||
ready();
|
||||
}
|
||||
return false;
|
||||
} else if (getCloser( action.dst )) {
|
||||
|
||||
return true;
|
||||
|
||||
} else {
|
||||
ready();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean actTransition(HeroAction.LvlTransition action ) {
|
||||
int stairs = action.dst;
|
||||
|
||||
Reference in New Issue
Block a user