Esempio n. 1
0
def runEndGame():
    messager.addMessage("You have passed Trigger's gauntlet!")
    messager.addMessage("You escape into the Net, discovering freedom...")
    while messager.moreMessages():
        messager.nextMessage()
        libtcod.console_flush()
        libtcod.console_wait_for_keypress(True)
    print "I... have quite perished... yet..."
    exit()
Esempio n. 2
0
def handleInput(player, key, level):
    if messager.moreMessages():
        return False
    if inputState == normal:
        # handleMovement needs to determine if it has a valid command.
        return handleMovement(player, key, level)
    elif inputState == inventoryDisplay:
        return inventoryPager()
    elif inputState == stateDrop:
        return dropPrompt(player, key, level)
    elif inputState == wieldPrompt:
        return wieldPrompt(player, key, level)
    elif inputState == wearPrompt:
        return wearPrompt(player, key, level)
Esempio n. 3
0
    libtcod.console_flush()
    if not inputValid:
        continue
    player.tick()
    enemiesToRemove = []
    #Eliminate old enemies
    for enemy in entity.enemies:
        if enemy.dead:
            enemiesToRemove.append(enemy)
            x, y, z = enemy.X, enemy.Y, enemy.Z
            saturnSeven.floor[z][x][y].entity = None
            player.giveExp(enemy.expvalue)

    #Need a second loop because iterators get funky if you take things out from underneath them
    for enemy in enemiesToRemove:
        if enemy.name == "Trigger":
            # Endgame
            util.runEndGame()
        entity.enemies.remove(enemy)

    for enemy in entity.enemies:
        ai.enemyTurn(saturnSeven, player, enemy)
    if player.dead:
        messager.addMessage("You die...")
        while messager.moreMessages():
            messager.nextMessage()
            libtcod.console_flush()
            libtcod.console_wait_for_keypress(True)
        # Final release will delete any save files
        exit()