use of objects.Moongate in project ultimate-java by pantinor.
the class GameScreen method getDestinationForMoongate.
private Vector3 getDestinationForMoongate(Moongate m) {
Vector3 dest = new Vector3(m.getX(), m.getY(), 0);
String destGate = null;
if (feluccaphase == m.getDm1()) {
destGate = m.getD1();
}
if (feluccaphase == m.getDm2()) {
destGate = m.getD2();
}
if (feluccaphase == m.getDm3()) {
destGate = m.getD3();
}
if (destGate.equals("shrine of spirituality")) {
if (context.getParty().canEnterShrine(Virtue.SPIRITUALITY)) {
loadNextMap(Maps.SHRINE_SPIRITUALITY, 0, 0);
} else {
log("Thou dost not bear the rune of entry!");
log("A strange force keeps you out!");
}
return null;
}
for (Moongate dm : context.getCurrentMap().getMoongates()) {
if (dm.getName().equals(destGate)) {
dest = new Vector3(dm.getX(), dm.getY(), 0);
}
}
return dest;
}
Aggregations