fix: that's not supposed to be in there
This commit is contained in:
parent
cce1622a45
commit
6c06beb366
@ -849,28 +849,7 @@ class GameLogic {
|
|||||||
public static ArrayList<Event> handleThanos(GameState state, NPC thanos) {
|
public static ArrayList<Event> handleThanos(GameState state, NPC thanos) {
|
||||||
ArrayList<Event> result = new ArrayList<>();
|
ArrayList<Event> result = new ArrayList<>();
|
||||||
|
|
||||||
if(thanos.inventory.getFreeSlots() > 0) {
|
|
||||||
|
|
||||||
IntVector2 picked = null;
|
|
||||||
float lowestDistance = Integer.MAX_VALUE;
|
|
||||||
for(int x = 0; x < state.mapSize.getX(); x++) {
|
|
||||||
for(int y = 0; y < state.mapSize.getY(); y++) {
|
|
||||||
IntVector2 pos = new IntVector2(x, y);
|
|
||||||
for(Entity e: state.entities.findByPosition(pos)) {
|
|
||||||
if(e instanceof InfinityStone || (e instanceof Character && ((Character)e).inventory.getSize() > 0)) {
|
|
||||||
float distance = thanos.getPosition().distanceChebyshev(pos);
|
|
||||||
if(distance < lowestDistance) {
|
|
||||||
picked = pos;
|
|
||||||
lowestDistance = distance;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user