def _onJoueurInteractionQuelconque(self, x, y, c, direction): if self._penseePossible.voir() is True and self._boiteOutils.interrupteurs["panneauLu"].voir() is True and self._boiteOutils.interrupteurs["porteOuverte"].voir() is False: self._boiteOutils.ajouterPensee("What? An enigma? Hm, let me check in my books...") self._boiteOutils.ajouterPensee("I've always been fascinated by the love of storytelling among poor men.") self._boiteOutils.ajouterPensee("Tell them a story, and they will be happy for the day. Fascinating.") if self._etapeTraitement == 5 and directions.directionContraire(direction) == self._directionRegard: self._finirDeplacementSP() self._lancerTrajetEtoile(self._boiteOutils.cheminVersPosition, self._xTile, self._yTile, self._c, 37, 26) self._coince = True Horloge.initialiser(id(self), "Coince", 3000)
def _prevenirEvenementActionJoueur(self, evenement, x, y, c, appui, directionJoueur, abs, ord, directionEvenement): """Prévient un évènement <evenement> des actions du joueur.""" if ( (abs == x+1 or abs == x-1) and ord == y) or ( (ord == y+1 or ord == y-1) and abs == x): evenement.onJoueurProche(x, y, c, directionJoueur) if appui is True: (xVisee, yVisee) = directions.ajusterCoupleCoordonneesLorsDeplacement(x,y,directionJoueur,enTile=True) if xVisee == abs and yVisee == ord: if directionJoueur == directions.directionContraire(directionEvenement): evenement.onJoueurInteraction(x, y, c, directionJoueur, enFace=True) else: evenement.onJoueurInteraction(x, y, c, directionJoueur, enFace=False) else: evenement.onJoueurProche(x, y, c, directionJoueur) elif abs == x and ord == y: evenement.onJoueurDessus(x, y, c, directionJoueur) if appui is True: evenement.onJoueurInteraction(x, y, c, directionJoueur, enFace=False, dessus=True)