Ejemplo n.º 1
0
    def loadMap(self, fileName):

        partyManager = PartyManager.getPartyManager()

        # Load the map though annchienta
        loadedMap = annchienta.Map(fileName)
        # Get the actual xml
        document = xml.dom.minidom.parse(fileName)

        layers = document.getElementsByTagName("layer")
        for i in range(len(layers)):

            loadedMap.setCurrentLayer(i)
            chestElements = layers[i].getElementsByTagName("chest")

            for c in range(len(chestElements)):

                # Create a unique id in the form of filename_layer_chestnr
                uniqueId = fileName + "_" + str(i) + "_" + str(c)
                item = str(chestElements[c].getAttribute("item"))
                chest = Chest(item, uniqueId)

                if partyManager.hasRecord(uniqueId):
                    chest.setAnimation("opened")

                loadedMap.addObject(
                    chest,
                    annchienta.Point(
                        annchienta.TilePoint,
                        int(chestElements[c].getAttribute("tilex")),
                        int(chestElements[c].getAttribute("tiley"))))
                # Do not keep this reference
                chest = chest.__disown__()

        return loadedMap
Ejemplo n.º 2
0
    def load(self, filename):
        self.filename = filename
        self.document = xml.dom.minidom.parse(self.filename)

        # Let's asume this is a valid file and
        # the needed elements are there.

        # <PLAYER>
        playerElement = self.document.getElementsByTagName("player")[0]
        self.player = annchienta.Person(
            str(playerElement.getAttribute("name")),
            str(playerElement.getAttribute("xmlfile")))
        point = None
        if playerElement.hasAttribute("isox"):
            point = annchienta.Point(annchienta.IsometricPoint,
                                     int(playerElement.getAttribute("isox")),
                                     int(playerElement.getAttribute("isoy")))
        if playerElement.hasAttribute("tilex"):
            point = annchienta.Point(annchienta.TilePoint,
                                     int(playerElement.getAttribute("tilex")),
                                     int(playerElement.getAttribute("tiley")))
        self.player.setPosition(point)

        # <TEAM>
        teamElement = self.document.getElementsByTagName("team")[0]
        self.team = map(lambda e: combatant.Ally(e),
                        teamElement.getElementsByTagName("combatant"))

        # <RECORDS>
        recordsElement = self.document.getElementsByTagName("records")[0]
        self.records = recordsElement.firstChild.data.split()

        # <MAP>
        # Load this after <RECORDS> because <RECORDS> might influence <MAP>.
        mapElement = self.document.getElementsByTagName("map")[0]
        self.currentMap = annchienta.Map(
            str(mapElement.getAttribute("filename")))
        self.currentMap.setCurrentLayer(int(mapElement.getAttribute("layer")))
        self.mapManager.setCurrentMap(self.currentMap)

        # Stuff to do when everything is loaded
        self.player.setInputControl()
        self.currentMap.addObject(self.player)
        self.mapManager.cameraFollow(self.player)
        self.inputManager.setInputControlledPerson(self.player)
Ejemplo n.º 3
0
    def changeLayer(self,
                    index,
                    newPosition=annchienta.Point(annchienta.TilePoint, 2, 2),
                    fade=True):
        if fade:
            self.sceneManager.fadeOut()
        self.player.setPosition(newPosition)
        self.currentMap.removeObject(self.player)
        self.currentMap.setCurrentLayer(index)
        self.currentMap.addObject(self.player)

        # Because changing a layer can take some time:
        self.mapManager.resync()
Ejemplo n.º 4
0
    def load(self, filename):

        # Store filename for later use
        self.filename = filename
        self.document = xml.dom.minidom.parse(self.filename)

        # Let's asume this is a valid file and
        # the needed elements are there.

        # Load the playtime for profiling reasons
        playTimeElement = self.document.getElementsByTagName("playtime")[0]
        self.seconds = int(playTimeElement.getAttribute("seconds"))
        self.startTime = self.engine.getTicks()

        # Start by loading the records, because they are needed by the map
        recordsElement = self.document.getElementsByTagName("records")[0]
        self.records = str(recordsElement.firstChild.data).split()

        # Now we can safely load the map
        mapElement = self.document.getElementsByTagName("map")[0]
        self.currentMap = self.mapLoader.loadMap(
            str(mapElement.getAttribute("filename")))
        self.currentMap.setCurrentLayer(int(mapElement.getAttribute("layer")))
        self.mapManager.setCurrentMap(self.currentMap)

        # Now that we have a map we can place the player in it
        playerElement = self.document.getElementsByTagName("player")[0]
        self.player = annchienta.Person(
            str(playerElement.getAttribute("name")),
            str(playerElement.getAttribute("config")))
        playerPosition = annchienta.Point(
            annchienta.IsometricPoint, int(playerElement.getAttribute("isox")),
            int(playerElement.getAttribute("isoy")))

        # Add the player to the map and give him control
        self.currentMap.addObject(self.player, playerPosition)
        self.player.setInputControl()
        self.mapManager.cameraFollow(self.player)
        self.mapManager.cameraPeekAt(self.player, True)

        # Load our inventory
        inventoryElement = self.document.getElementsByTagName("inventory")[0]
        self.inventory = Inventory.Inventory(inventoryElement)

        # Load the team
        teamElement = self.document.getElementsByTagName("team")[0]
        self.team = map(Ally.Ally,
                        teamElement.getElementsByTagName("combatant"))
Ejemplo n.º 5
0
    def getSelection(self):

        # Get layer and mapview
        layer = self.mapControl.getMap().getCurrentLayer()
        cameraPosition = self.mapControl.getMapView().getCameraPosition()

        # Set mouse position
        mousePosition = annchienta.Point(annchienta.MapPoint,
                                         self.inputManager.getMouseX(),
                                         self.inputManager.getMouseY())
        mousePosition.x += int(cameraPosition.x)
        mousePosition.y += int(cameraPosition.y)

        # Little adjust
        if self.wholeTiles:
            mousePosition.y -= int(self.mapManager.getTileHeight() / 2)

        # Initialize list
        affectedTiles = []

        # Loop through all tiles
        for y in range(layer.getHeight()):
            for x in range(layer.getWidth()):

                tile = layer.getTile(x, y)

                # Select an entire tile
                if self.wholeTiles:
                    p = tile.getPointPointer(0)
                    if (p.x - mousePosition.x)**2 + (
                            p.y - mousePosition.y)**2 < self.squaredRadius:
                        affectedTiles.append(
                            AffectedTile.AffectedTile(tile, range(4)))

                # Select points of a tile
                else:
                    points = []
                    for i in range(4):
                        p = tile.getPointPointer(i)
                        if (p.x - mousePosition.x)**2 + (
                                p.y - mousePosition.y)**2 < self.squaredRadius:
                            points.append(i)
                    if len(points):
                        affectedTiles.append(
                            AffectedTile.AffectedTile(tile, points))

        return affectedTiles
Ejemplo n.º 6
0
    def updateMap(self):

        # Update the InputManager
        self.inputManager.update()
        if not self.inputManager.running():
            self.close()

        # Drag the map with the mouse
        if self.inputManager.buttonDown(1):
            cx, cy = self.mapManager.getCameraX(), self.mapManager.getCameraY()
            self.mapManager.setCameraX(cx + self.mouseX -
                                       self.inputManager.getMouseX())
            self.mapManager.setCameraY(cy + self.mouseY -
                                       self.inputManager.getMouseY())

        self.mouseX, self.mouseY = self.inputManager.getMouseX(
        ), self.inputManager.getMouseY()

        mpoint = annchienta.Point(annchienta.ScreenPoint, self.mouseX,
                                  self.mouseY)
        if self.hasOpenedMap:
            mpoint.y += self.currentMap.getCurrentLayer().getZ()
        mpoint.convert(annchienta.IsometricPoint)
        string = "Mouse: " + str(mpoint.x) + ", " + str(mpoint.y) + " (iso) "
        mpoint.convert(annchienta.TilePoint)
        string += str(mpoint.x) + ", " + str(mpoint.y) + " (tile)"
        self.mousePositionLabel.setText(QString(string))

        # NEVER Update the MapManager
        # LEAVE THIS COMMENTED
        # self.mapManager.update()

        # Draw
        self.videoManager.clear()
        if self.hasOpenedMap:
            self.mapManager.renderFrame()
            if bool(self.gridBox.isChecked()):
                self.drawGrid()
        self.videoManager.flip()

        if self.hasOpenedMap:
            self.currentMap.depthSort()
            self.selectAndApply()
            l = self.currentMap.getCurrentLayer()
            for o in range(l.getNumberOfObjects()):
                l.getObject(o).calculateCollidingTiles()
                l.getObject(o).calculateZFromCollidingTiles()
Ejemplo n.º 7
0
    def changeMap(self,
                  newMapFileName,
                  newPosition=annchienta.Point(annchienta.TilePoint, 2, 2),
                  newLayer=0,
                  fade=True):

        if fade:
            self.sceneManager.fadeOut()

        self.player.setPosition(newPosition)
        self.currentMap.removeObject(self.player)
        self.lastMaps += [self.currentMap]
        self.currentMap = annchienta.Map(newMapFileName)
        self.currentMap.setCurrentLayer(newLayer)
        self.currentMap.addObject(self.player)
        self.mapManager.setCurrentMap(self.currentMap)

        # Because loading a map can take some time:
        self.mapManager.resync()
Ejemplo n.º 8
0
    def changeMap(self,
                  newMapFileName,
                  newPosition=annchienta.Point(annchienta.TilePoint, 2, 2),
                  newLayer=0,
                  fade=True):

        if fade:
            self.sceneManager.fade()

        # Remove player from map
        self.currentMap.removeObject(self.player)

        self.lastMaps += [self.currentMap]
        self.currentMap = self.mapLoader.loadMap(newMapFileName)
        self.currentMap.setCurrentLayer(newLayer)
        self.currentMap.addObject(self.player, newPosition)
        self.mapManager.setCurrentMap(self.currentMap)
        self.mapManager.cameraPeekAt(self.player, True)

        # Because loading a map can take some time:
        self.mapManager.resync()
Ejemplo n.º 9
0
        "strength", "defense", "magic", "resistance", "health", "maxhealth"
    ]
    for stat in stats:
        s = int(1.5 *
                sum(map(lambda t: t.status.get(stat), partyManager.team)))
        jelobatEnemy.status.set(stat, s)


# Persons for scenes
player = partyManager.player
esana = annchienta.Person("esana", "locations/prison/esana.xml")
inyse = annchienta.Person("inyse", "locations/tetia/inyse.xml")
jelobat = annchienta.Person("jelobat", "locations/anpere/jelobat.xml")

# Set positions.
jelobat.setPosition(annchienta.Point(annchienta.TilePoint, 11, 6))
esana.setPosition(annchienta.Point(annchienta.TilePoint, 9, 14))
inyse.setPosition(annchienta.Point(annchienta.TilePoint, 11, 14))
player.setPosition(annchienta.Point(annchienta.TilePoint, 13, 14))

# Add persons to map
thisMap.addObject(esana)
thisMap.addObject(inyse)
thisMap.addObject(jelobat)

thisMap.depthSort()

# Init dialog
sceneManager.initDialog([player, esana, inyse, jelobat])

# First part of scene, ends with flashback of murder.
Ejemplo n.º 10
0
videoManager = annchienta.getVideoManager()
partyManager = PartyManager.getPartyManager()
sceneManager = SceneManager.getSceneManager()

currentMap = partyManager.getCurrentMap()

august = partyManager.getPlayer()

# Addobject and stuff...
march = annchienta.Person("march", "locations/common/march.xml")
avril = annchienta.Person("avril", "locations/common/avril.xml")
enthavos = annchienta.Person("enthavos", "locations/unknown/enthavos.xml")

position = august.getPosition().to(annchienta.TilePoint)
currentMap.addObject(
    march, annchienta.Point(annchienta.TilePoint, position.x + 1, position.y))
currentMap.addObject(
    avril, annchienta.Point(annchienta.TilePoint, position.x + 2, position.y))
currentMap.addObject(enthavos, annchienta.Point(annchienta.TilePoint, 19, 23))
sceneManager.initDialog([august, march, avril, enthavos])
august.lookAt(enthavos)
march.lookAt(enthavos)
avril.lookAt(enthavos)

sceneManager.speak(enthavos, "Good. I have been waiting for you.")
sceneManager.speak(avril, "En... Enthavos?!")
sceneManager.speak(august, "What the?")
sceneManager.speak(enthavos, "This means the time is near for me. Follow.")
sceneManager.move(enthavos, annchienta.Point(annchienta.TilePoint, 18, 19))
sceneManager.move(enthavos, annchienta.Point(annchienta.TilePoint, 17, 18))
sceneManager.move(enthavos, annchienta.Point(annchienta.TilePoint, 16, 18))
Ejemplo n.º 11
0
import annchienta
import PartyManager, SceneManager, BattleManager

mapManager = annchienta.getMapManager()
videoManager = annchienta.getVideoManager()
partyManager = PartyManager.getPartyManager()
sceneManager = SceneManager.getSceneManager()

currentMap = partyManager.getCurrentMap()

partyManager.addRecord("fleet_met_pirates")

# Create a whole bunch of objects/persons and set them to
# their positions.
august = partyManager.getPlayer()
august.setPosition(annchienta.Point(annchienta.TilePoint, 4, 4))

march = annchienta.Person("march", "locations/common/march.xml")
currentMap.addObject(march, annchienta.Point(annchienta.TilePoint, 4, 5))

avril = annchienta.Person("avril", "locations/common/avril.xml")
currentMap.addObject(avril, annchienta.Point(annchienta.TilePoint, 4, 6))

pirate1 = annchienta.Person("emenver", "locations/fleet/pirate1.xml")
currentMap.addObject(pirate1, annchienta.Point(annchienta.TilePoint, 7, 5))

pirate2 = annchienta.Person("hoche", "locations/fleet/pirate2.xml")
currentMap.addObject(pirate2, annchienta.Point(annchienta.TilePoint, 7, 6))

# Init our dialog.
sceneManager.initDialog([august, march, avril, pirate1, pirate2])
Ejemplo n.º 12
0
    videoManager.drawStringCentered(
        f1, "Non fueram, non sum, nescio, non ad me pertinet.",
        videoManager.getScreenWidth() / 2, 100)
    videoManager.drawStringCentered(
        f2,
        "I haven't been, I am not, I don't know, nothing touches me at all.",
        videoManager.getScreenWidth() / 2, 120)
    videoManager.drawStringCentered(f2, "- Found on an epitaph.",
                                    videoManager.getScreenWidth() / 2, 135)
    f1, f2 = 0, 0
    sceneManager.waitForClick()
    sceneManager.fadeOut(255, 255, 255, 3000)
    mapManager.resync()

    partyManager.addRecord("prison_awakening")
    player.setPosition(annchienta.Point(annchienta.TilePoint, 8, 5))
    sceneManager.initDialog([player])
    sceneManager.thoughts("Ouch...")
    sceneManager.thoughts("My head is all fuzzy-like...")
    sceneManager.speak(player, "Where the heck am I?")
    sceneManager.move(player, annchienta.Point(annchienta.TilePoint, 8, 2))
    sceneManager.speak(player, "This can't be prison?")
    sceneManager.move(player, annchienta.Point(annchienta.TilePoint, 9, 2))
    sceneManager.speak(player, "And why... Why can't I remember anything?")
    sceneManager.move(player, annchienta.Point(annchienta.TilePoint, 7, 2))
    sceneManager.speak(player, "What the heck is going on?")
    sceneManager.thoughts("Last thing I remember...")
    sceneManager.thoughts(
        "We were on a mission... It had something to do with stealing something... It... it can't be, they never could've caught us..."
    )
    sceneManager.thoughts(
Ejemplo n.º 13
0
    sceneManager.speak(august, "I guess... finally...")

    sceneManager.speak(
        august, "We had been searching these Inaran areas for three weeks.",
        True)
    sceneManager.speak(
        august,
        "We were young and full of hope. We would join the Fifth Guard, the elite section of our army.",
        True)
    sceneManager.speak(
        august,
        "Being in that section had been my dream since my older brother died protecting it.",
        True)

    sceneManager.move(laustwan, annchienta.Point(annchienta.TilePoint, 16, 18))
    sceneManager.speak(laustwan, "Puko!")

    sceneManager.speak(august, "Can we leave the Laustwan here?")
    sceneManager.speak(
        march,
        "Sure. He will find it's way to another master, they always do.")
    sceneManager.speak(laustwan, "Gri-huk.")

    sceneManager.speak(
        avril,
        "Well, you've been really helpful... I'm glad we had you with us. You are free now."
    )

    sceneManager.speak(laustwan, "Hog-hu.")
Ejemplo n.º 14
0
    if not partyManager.hasRecord("unknown_found_wood"):
        sceneManager.speak( august, "Some dry wood or something similar is nessecary here." )
    if not partyManager.hasRecord("unknown_found_food"):
        sceneManager.speak( august, "I wonder if we could find something edible." )
        if partyManager.hasRecord("unknown_found_wood"):
            sceneManager.speak( august, "Perhaps if I can find a good fishing spot..." )

    sceneManager.quitDialog()

else:

    # Addobject and stuff...
    march = annchienta.Person( "march", "locations/common/march.xml" )
    avril = annchienta.Person( "avril", "locations/common/avril.xml" )
    enthavos = annchienta.Person( "enthavos", "locations/unknown/enthavos.xml" )
    august.setPosition( annchienta.Point( annchienta.TilePoint, 18, 17 ) )
    currentMap.addObject( march, annchienta.Point( annchienta.TilePoint, 17, 15 ) )
    currentMap.addObject( avril, annchienta.Point( annchienta.TilePoint, 19, 15 ) )
    currentMap.addObject( enthavos, annchienta.Point( annchienta.TilePoint, 0, 0 ) )
    sceneManager.initDialog( [august, march, avril, enthavos] )
    sceneManager.fade()

    partyManager.addRecord( "unknown_night" )

    sceneManager.speak( august, "So... let me light this fire..." )

    # Start fire
    campfire = currentMap.getObject( "campfire" )
    campfire.setAnimation( "burn" )

    sceneManager.speak( march, "I think I know where we are." )
Ejemplo n.º 15
0
mapManager = annchienta.getMapManager()
sceneManager = scene.getSceneManager()
partyManager = party.getPartyManager()

player = partyManager.player
pp = player.getPosition()
layer = mapManager.getCurrentMap().getCurrentLayer()

guards = []
# find all guards
for i in range(layer.getNumberOfObjects()):
    if str(layer.getObject(i).getName())=="guard":
        guards.append( layer.getObject(i) )

# select the closest guard
guard = None
dist = 0
for g in guards:
    d = pp.distance( g.getPosition() )
    if d<=dist or guard is None:
        dist = d
        guard = g

if guard is not None:
    sceneManager.initDialog( [guard, player] )
    mapManager.renderFrame()
    sceneManager.speak( guard, "Hey, you!" )
    sceneManager.quitDialog()
    player.setPosition( annchienta.Point( annchienta.TilePoint, 3, 29 ) )
    partyManager.refreshMap()
Ejemplo n.º 16
0
mapManager = annchienta.getMapManager()
videoManager = annchienta.getVideoManager()
partyManager = PartyManager.getPartyManager()
sceneManager = SceneManager.getSceneManager()
battleManager = BattleManager.getBattleManager()

currentMap = partyManager.getCurrentMap()

august = partyManager.getPlayer()

# Addobject and stuff...
march = annchienta.Person("march", "locations/common/march.xml")
avril = annchienta.Person("avril", "locations/common/avril.xml")
enthavos = annchienta.Person("enthavos", "locations/unknown/enthavos.xml")

position = annchienta.Point(annchienta.TilePoint, 17, 20)
august.setPosition(position)
currentMap.addObject(
    march, annchienta.Point(annchienta.TilePoint, position.x + 1, position.y))
currentMap.addObject(
    avril, annchienta.Point(annchienta.TilePoint, position.x + 2, position.y))
currentMap.addObject(
    enthavos,
    annchienta.Point(annchienta.TilePoint, position.x + 1, position.y - 3))
sceneManager.initDialog([august, march, avril, enthavos])

sceneManager.move([august, march, avril, enthavos], [
    annchienta.Point(annchienta.TilePoint, 17, 6),
    annchienta.Point(annchienta.TilePoint, 17, 7),
    annchienta.Point(annchienta.TilePoint, 17, 8),
    annchienta.Point(annchienta.TilePoint, 19, 7)
Ejemplo n.º 17
0
    def selectAndApply(self):

        needsRecompiling = False

        # SELECT PART

        self.selected.clear()

        layer = self.currentMap.getCurrentLayer()

        mouse = annchienta.Point(annchienta.ScreenPoint,
                                 self.inputManager.getMouseX(),
                                 self.inputManager.getMouseY())
        mouse.y += self.currentMap.getCurrentLayer().getZ()

        if self.inputManager.buttonDown(0):
            if bool(self.wholeTiles.isChecked()):
                for y in range(0, layer.getHeight()):
                    for x in range(0, layer.getWidth()):
                        tile = layer.getTile(x, y)
                        if tile.hasPoint(mouse):
                            self.selected.tiles.append(
                                tiles.AffectedTile(tile, True, True, True,
                                                   True))
                            needsRecompiling = True
            else:
                # Move the mouse a little
                mouse.convert(annchienta.ScreenPoint)
                #mouse.x -= self.mapManager.getTileWidth()/4
                mouse.y += self.mapManager.getTileHeight() / 2
                mouse.convert(annchienta.IsometricPoint)
                # Create a new pseudo-tilegrid
                grid = []
                gridh, gridw = layer.getHeight() + 2, layer.getWidth() + 2
                for y in range(0, gridh):
                    for x in range(0, gridw):
                        point = annchienta.Point(annchienta.TilePoint, x, y, 0)
                        point.convert(annchienta.IsometricPoint)
                        grid.append(point)
                # Now check for collision
                for y in range(gridh - 1):
                    for x in range(gridw - 1):
                        if mouse.isEnclosedBy(grid[(y) * gridw + (x)],
                                              grid[(y + 1) * gridw + (x + 1)]):
                            if x - 1 in range(
                                    layer.getWidth()) and y - 1 in range(
                                        layer.getHeight()):
                                self.selected.tiles.append(
                                    tiles.AffectedTile(
                                        layer.getTile(x - 1, y - 1), False,
                                        False, True, False))
                            if x in range(layer.getWidth()) and y - 1 in range(
                                    layer.getHeight()):
                                self.selected.tiles.append(
                                    tiles.AffectedTile(layer.getTile(x, y - 1),
                                                       False, True, False,
                                                       False))
                            if x - 1 in range(layer.getWidth()) and y in range(
                                    layer.getHeight()):
                                self.selected.tiles.append(
                                    tiles.AffectedTile(layer.getTile(x - 1,
                                                                     y), False,
                                                       False, False, True))
                            if x in range(layer.getWidth()) and y in range(
                                    layer.getHeight()):
                                self.selected.tiles.append(
                                    tiles.AffectedTile(layer.getTile(x,
                                                                     y), True,
                                                       False, False, False))
                            needsRecompiling = True

        # APPLY PART

        if bool(self.zGroupBox.isChecked()):
            for at in self.selected.tiles:
                for p in at.points:
                    at.tile.setZ(p, int(self.tileZBox.value()))

        if bool(self.tileGroupBox.isChecked()):
            for at in self.selected.tiles:
                for p in at.points:
                    at.tile.setSurface(p, self.tileset.selectedTile)

        if bool(self.tileSideGroupBox.isChecked()):
            for at in self.selected.tiles:
                at.tile.setSideSurface(self.tileset.selectedTileSide)
                at.tile.setSideSurfaceOffset(
                    int(self.tileSideOffsetBox.value()))

        if bool(self.obstructionGroupBox.isChecked()):
            for at in self.selected.tiles:
                at.tile.setObstructionType(
                    int(self.obstructionTypeBox.currentIndex()))

        for at in self.selected.tiles:
            at.tile.setShadowed(bool(self.shadowedBox.isChecked()))
Ejemplo n.º 18
0
partyManager = party.getPartyManager()
sceneManager = scene.getSceneManager()

player = partyManager.player
bardolph = partyManager.currentMap.getPerson("bardolph")
jelobat = partyManager.currentMap.getPerson("jelobat")

sceneManager.initDialog([player, bardolph, jelobat])

jelobat.lookAt(bardolph)

sceneManager.speak(jelobat, "Aelaan, help me!")
sceneManager.speak(
    bardolph,
    "Stay away! I don't know what he told you, but this man is an assassin!")
sceneManager.speak(jelobat,
                   "I... what? You don't believe that, Aelaan, do you?")
sceneManager.speak(bardolph, "Don't listen to him! Stay out of this!")
sceneManager.speak(jelobat, "Trust me, Aelaan! We'll get through this!")

pos = player.getPosition().to(annchienta.IsometricPoint)
pos.x += 30

sceneManager.move(player, pos)

sceneManager.quitDialog()

# Now change the map again, we're back on the ship
partyManager.changeMap("locations/anpere/ship.xml",
                       annchienta.Point(annchienta.TilePoint, 13, 7))
Ejemplo n.º 19
0
        sceneManager.text(
            "August:\nWe all thought about a lot of things. We thought we were going to die.",
            None, True)
        sceneManager.text(
            "August:\nMy brother had been killed by Enthavos in the Fifth Guard, and my mother had recently passed away. And my father... I had never known him.",
            None, True)
        sceneManager.text(
            "August:\nI don't think I was really afraid of dying. Avril started talking about her sister.",
            None, True)
        sceneManager.text(
            "August:\nHow she missed her... How cruel it is she hadn't been able to say goodbye.",
            None, True)
        sceneManager.text(
            "August:\nAt some point Avril said being in the Fifth Guard had really lost his meaning somehow.",
            None, True)
        sceneManager.text("August:\nWe were all getting very pessimistic.",
                          None, True)
        sceneManager.text(
            "August:\nThat must've been the point when we hit land.", None,
            True)
        sceneManager.text("August:\nWhere were we?", None, True)

        partyManager.changeMap("locations/unknown/beach_start.xml",
                               annchienta.Point(annchienta.TilePoint, 15, 15),
                               0, False)
        battleManager.delayNextBattle()

mapManager.resync()

sceneManager.quitDialog()
Ejemplo n.º 20
0
import PartyManager, SceneManager, BattleManager

mapManager = annchienta.getMapManager()
videoManager = annchienta.getVideoManager()
partyManager = PartyManager.getPartyManager()
sceneManager = SceneManager.getSceneManager()

currentMap = partyManager.getCurrentMap()

august = partyManager.getPlayer()

# Addobject and stuff...
march = annchienta.Person("march", "locations/common/march.xml")
avril = annchienta.Person("avril", "locations/common/avril.xml")

currentMap.addObject(march, annchienta.Point(annchienta.TilePoint, 22, 7))
currentMap.addObject(avril, annchienta.Point(annchienta.TilePoint, 24, 7))
sceneManager.initDialog([august, march, avril])

sceneManager.move(august, annchienta.Point(annchienta.TilePoint, 23, 7))
avril.lookAt(august)

sceneManager.speak(august, "Laustwan?")
sceneManager.speak(
    avril,
    "Laustwan indeed. I wonder why someone would lock them up? You could just order them to stay, right?"
)
sceneManager.speak(march, "Is this the secret Kyzano was talking about?")
sceneManager.speak(avril,
                   "Doesn't seem like their is something wrong with them.")
sceneManager.speak(august, "But why would someone need that many of them?")
Ejemplo n.º 21
0
# If we have inyse or not.
inyseInParty = partyManager.hasRecord("tetia_met_inyse")

baniran = annchienta.getPassiveObject()
player = partyManager.player
esana = annchienta.Person("esana", "locations/prison/esana.xml")
inyse = 0
if inyseInParty:
    inyse = annchienta.Person("inyse", "locations/tetia/inyse.xml")

sceneManager.initDialog([baniran, player, esana] +
                        ([inyse] if inyseInParty else []))

pp = player.getPosition().to(annchienta.IsometricPoint)
bp = baniran.getPosition().to(annchienta.IsometricPoint)
ep = annchienta.Point(annchienta.IsometricPoint,
                      pp.x + (30 if bp.x < pp.x else -30), pp.y)
ip = annchienta.Point(annchienta.IsometricPoint, pp.x, pp.y + 30)

esana.setPosition(pp)
partyManager.currentMap.addObject(esana)
if inyseInParty:
    inyse.setPosition(pp)
    partyManager.currentMap.addObject(inyse)
    sceneManager.move([inyse, esana], [ip, ep])
else:
    sceneManager.move(esana, ep)

esana.lookAt(baniran)
player.lookAt(baniran)

if not partyManager.hasRecord("tetia_met_baniran"):
Ejemplo n.º 22
0
            "All I want from you is a tiny little favor. When I was still alive, I was a famous trapper."
        )
        sceneManager.speak(krelshar,
                           "Until one day, I was ambushed by wolves...")
        sceneManager.speak(
            krelshar,
            "I want you to go back into the woods and kill some wolves. Four should be enough."
        )
        a = sceneManager.chat(krelshar, "How about that, you filthy worms?", [
            "We'll go and hunt wolves down.",
            "Hunt your wolves yourself, you demon!"
        ])
        if a == 1:
            fight_krelshar()
        else:
            player.setPosition(annchienta.Point(annchienta.TilePoint, 8, 13))

elif not partyManager.hasRecord("tasumian_passed_krelshar"):

    needed = 4 - sum(
        map(lambda i: partyManager.hasRecord("tasumian_killed_wolf" + str(i)),
            range(1, 5)))

    if needed == 0:
        sceneManager.speak(
            krelshar, "Good... that will teach them... you can pass now.")
        partyManager.addRecord("tasumian_passed_krelshar")
        player.setPosition(annchienta.Point(annchienta.TilePoint, 8, 13))
    else:
        a = sceneManager.chat(
            krelshar, "You need to kill " + str(needed) + " more wolves...",
Ejemplo n.º 23
0
import annchienta, scene, party
import combatant, xml.dom.minidom
import battle

mapManager = annchienta.getMapManager()
audioManager = annchienta.getAudioManager()
partyManager = party.getPartyManager()
sceneManager = scene.getSceneManager()

inyse = partyManager.currentMap.getPerson("inyse")
player = partyManager.player
esana = annchienta.Person("esana", "locations/prison/esana.xml")
esana.setPosition(annchienta.Point(annchienta.TilePoint, 7, 2))
partyManager.currentMap.addObject(esana)

sceneManager.initDialog([inyse, player, esana])

player.lookAt(inyse)
esana.lookAt(inyse)

sceneManager.speak(player, "Inyse! What is happening?")
sceneManager.speak(inyse, "Do I look like I know?")
sceneManager.speak(player,
                   "But who sent these? How did these ghosts get here?")
sceneManager.speak(
    inyse, "I'm not sure, but apparently, someone who doesn't like us.")
sceneManager.speak(player,
                   "Come on, Esana, we have to help! Inyse, are you alright?")
sceneManager.speak(
    inyse,
    "Could've taken them on my own, but fine. Might have gotten nasty if one more had shown up."
Ejemplo n.º 24
0
import annchienta
import PartyManager, SceneManager, BattleManager

mapManager = annchienta.getMapManager()
videoManager = annchienta.getVideoManager()
partyManager = PartyManager.getPartyManager()
sceneManager = SceneManager.getSceneManager()

currentMap = partyManager.getCurrentMap()

partyManager.addRecord("facilities_met_banver")

# Create a whole bunch of objects/persons and set them to
# their positions.
august = partyManager.getPlayer()
august.setPosition(annchienta.Point(annchienta.TilePoint, 8, 12))

march = annchienta.Person("march", "locations/common/march.xml")
currentMap.addObject(march, annchienta.Point(annchienta.TilePoint, 9, 12))

avril = annchienta.Person("avril", "locations/common/avril.xml")
currentMap.addObject(avril, annchienta.Point(annchienta.TilePoint, 7, 12))

ship = annchienta.StaticObject("ship", "locations/facilities/ship.xml")
currentMap.addObject(ship, annchienta.Point(annchienta.TilePoint, 5, 6))

kyzano = annchienta.Person("kyzano", "locations/unknown/enthavos.xml")
currentMap.addObject(kyzano, annchienta.Point(annchienta.TilePoint, 7, 7))

banver = annchienta.Person("banver", "locations/facilities/banver.xml")
currentMap.addObject(banver, annchienta.Point(annchienta.TilePoint, 7, 8))
Ejemplo n.º 25
0
    sceneManager.quitDialog()

else:

    partyManager.addRecord("kimen_inspected_plant")

    sceneManager.speak(august,
                       "What are these plants? Let's have a closer look...")

    sceneManager.quitDialog()

    # Calculate new positions and add actors.
    plantPosition = plant.getPosition().to(annchienta.TilePoint)

    august.setPosition(
        annchienta.Point(annchienta.TilePoint, plantPosition.x + 1,
                         plantPosition.y + 1))

    march = annchienta.Person("march", "locations/common/march.xml")
    currentMap.addObject(
        march,
        annchienta.Point(annchienta.TilePoint, plantPosition.x + 2,
                         plantPosition.y + 1))

    avril = annchienta.Person("avril", "locations/common/avril.xml")
    currentMap.addObject(
        avril,
        annchienta.Point(annchienta.TilePoint, plantPosition.x + 1,
                         plantPosition.y + 2))

    captain = annchienta.Person("captain", "locations/kimen/captain.xml")
    currentMap.addObject(
Ejemplo n.º 26
0
partyManager = party.getPartyManager()
sceneManager = scene.getSceneManager()

# Create persons
player = partyManager.player
esana = annchienta.Person("esana", "locations/prison/esana.xml")
inyse = annchienta.Person("inyse", "locations/tetia/inyse.xml")

# Add them to the map
partyManager.currentMap.addObject(esana)
partyManager.currentMap.addObject(inyse)

# Find positions.
pp = player.getPosition().to(annchienta.IsometricPoint)
ip = annchienta.Point(annchienta.IsometricPoint, pp.x - 30, pp.y)
ep = annchienta.Point(annchienta.IsometricPoint, pp.x + 30, pp.y)

# Set positions.
esana.setPosition(pp)
inyse.setPosition(pp)
pp.y += 30

# Init and move to right positions.
sceneManager.initDialog([player, esana, inyse])
sceneManager.move([player, esana, inyse], [pp, ep, ip])

# Some dialog now.
sceneManager.speak(esana, "I really can't believe we're doing this.")
sceneManager.speak(
    inyse,
Ejemplo n.º 27
0
partyManager = PartyManager.getPartyManager()
sceneManager = SceneManager.getSceneManager()

currentMap = partyManager.getCurrentMap()

partyManager.addRecord("inaran_cave3_scene")

# Create a whole bunch of objects/persons and set them to
# their positions.
august = partyManager.getPlayer()
augustPosition = august.getPosition().to(annchienta.TilePoint)

march = annchienta.Person("march", "locations/common/march.xml")
currentMap.addObject(
    march,
    annchienta.Point(annchienta.TilePoint, augustPosition.x + 1,
                     augustPosition.y))

avril = annchienta.Person("avril", "locations/common/avril.xml")
currentMap.addObject(
    avril,
    annchienta.Point(annchienta.TilePoint, augustPosition.x,
                     augustPosition.y + 1))

# Init our dialog.
sceneManager.initDialog([august, march, avril])

sceneManager.speak(
    avril,
    "I still don't feel really good about leaving the Laustwan. Are you sure he will survive?"
)
sceneManager.speak(
Ejemplo n.º 28
0
videoManager = annchienta.getVideoManager()
partyManager = PartyManager.getPartyManager()
sceneManager = SceneManager.getSceneManager()

currentMap = partyManager.getCurrentMap()

august = partyManager.getPlayer()

# Addobject and stuff...
march = annchienta.Person("march", "locations/common/march.xml")
avril = annchienta.Person("avril", "locations/common/avril.xml")

position = august.getPosition().to(annchienta.TilePoint)
currentMap.addObject(
    march,
    annchienta.Point(annchienta.TilePoint, position.x + 1, position.y - 1))
currentMap.addObject(
    avril,
    annchienta.Point(annchienta.TilePoint, position.x + 1, position.y + 1))
sceneManager.initDialog([august, march, avril])

sceneManager.speak(
    august,
    "It wasn't long before we reached the end of the mountains, like Kyzano had told us. But when we arrived...",
    True)

position.x -= 5

sceneManager.move([august, march, avril], [
    annchienta.Point(annchienta.TilePoint, position.x, position.y),
    annchienta.Point(annchienta.TilePoint, position.x + 1, position.y - 1),