Ejemplo n.º 1
0
def pickList(): #Renvoie la liste des objets ramassables
    global items, pick
    items = Map.isItem(Player.getPosition())
    if items == 0:
        return "Il n'y a pas d'objets dans cette zone."
    elif Player.isItem() == 6:
        return "Vous n'avez plus de place dans votre inventaire."
    else:
        pick = 1
        return "Quel objet voulez-vous ramasser? (Tapez le numero correspondant) ~~~~~~~~~~~~~~~~~~~~~~~~~~ " + Map.getItemList(Player.getPosition())
Ejemplo n.º 2
0
def getAction(): # Traite les interactions clavier
    global pick, use, throw
    while 1:
        command = raw_input()
        if len(command) == 0:
            return baseDescript()
        command = command.split()
        if command[0] == controls[0]:
            return altDescript() 
        elif command[0] == controls[1]:
            return move(command[0])
        elif command[0] == controls[2]:
            return move(command[0])
        elif command[0] == controls[3]:
            return move(command[0])
        elif command[0] == controls[4]:
            return move(command[0])
        elif command[0] == controls[5]:
            return "AAAAAAAAAARGH!!!!!!!"
        elif command[0] == controls[6]:
            return attack()
        elif command[0] == controls[7]:
            return useList()
        elif command[0] == controls[8]:
            return throwList()
        elif command[0] == controls[9]:
            return pickList()
        elif command[0] == "w" and Map.isItem(Player.getPosition()) >= 1:
            if pick == 1:
                return pickItem(Player.getPosition(),0)
            elif use == 1:
                return useItem(0)
            elif throw == 1:
                return throwItem(Player.getPosition(),0)
        elif command[0] == "x" and Map.isItem(Player.getPosition()) >= 1:
            if pick == 1:
                return pickItem(Player.getPosition(),1)
            elif use == 1:
                return useItem(1)
            elif throw == 1:
                return throwItem(Player.getPosition(),1)
        elif command[0] == "c" and Map.isItem(Player.getPosition()) >= 1:
            if pick == 1:
                return pickItem(Player.getPosition(),2)
            elif use == 1:
                return useItem(2)
            elif throw == 1:
                return throwItem(Player.getPosition(),2)
        elif command[0] == "v" and Map.isItem(Player.getPosition()) >= 1:
            if pick == 1:
                return pickItem(Player.getPosition(),3)
            elif use == 1:
                return useItem(3)
            elif throw == 1:
                throwItem(Player.getPosition(),3)
        elif command[0] == "b" and Map.isItem(Player.getPosition()) >= 1:
            if pick == 1:
                return pickItem(Player.getPosition(),4)
            elif use == 1:
                return useItem(4)
            elif throw == 1:
                return throwItem(Player.getPosition(),4)
        elif command[0] == "n" and Map.isItem(Player.getPosition()) >= 1:
            if pick == 1:
                return pickItem(Player.getPosition(),5)
            elif use == 1:
                return useItem(5)
            elif throw == 1:
                return throwItem(Player.getPosition(),5)
        elif command[0] == controls[10]:
            exitGame()
        else:
            return baseDescript()