Search in sources :

Example 6 with Moongate

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;
}
Also used : Vector3(com.badlogic.gdx.math.Vector3) Moongate(objects.Moongate)

Aggregations

Moongate (objects.Moongate)6 Vector3 (com.badlogic.gdx.math.Vector3)4 BaseMap (objects.BaseMap)2 FileHandle (com.badlogic.gdx.files.FileHandle)1 AtlasRegion (com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion)1 TextureAtlasData (com.badlogic.gdx.graphics.g2d.TextureAtlas.TextureAtlasData)1 Region (com.badlogic.gdx.graphics.g2d.TextureAtlas.TextureAtlasData.Region)1 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)1 File (java.io.File)1 JAXBContext (javax.xml.bind.JAXBContext)1 Unmarshaller (javax.xml.bind.Unmarshaller)1 MapSet (objects.MapSet)1 Portal (objects.Portal)1 Tile (objects.Tile)1 TileSet (objects.TileSet)1