|
|
@@ -1225,7 +1225,7 @@ class Plateau(QGraphicsScene):
|
|
|
#on parcourt les faces des polygones des cases, et on ne garde que ceux qui n'ont pas de case 'en face'
|
|
|
for coord in listeCases:
|
|
|
polygone = case.polygone(coord[0], coord[1])
|
|
|
- voisins = self.lstCoordAdjacentes(coord[0], coord[1])
|
|
|
+ voisins = self.lstCoordAdjacentes(coord[0], coord[1])
|
|
|
|
|
|
for i in range(0, len(voisins)):
|
|
|
if not voisins[i] in listeCases:
|
|
|
@@ -1262,12 +1262,15 @@ class Plateau(QGraphicsScene):
|
|
|
return polygone
|
|
|
|
|
|
def lstCoordAdjacentes(self, x, y):
|
|
|
- """renvoie la liste des coordonnees adjacentes, sans condition d'existence sur le plateau
|
|
|
+ """renvoie la liste des coordonnees adjacentes, !!!! sans condition d'existence sur le plateau !!!!
|
|
|
attention: l'ordre est important"""
|
|
|
if self.formeCases == "H":
|
|
|
- voisins = [(x, y-1), (x+1, y-1), (x+1, y), (x, y+1), (x-1, y), (x-1, y-1)]
|
|
|
+ if 1 == (x % 2):
|
|
|
+ voisins = [(x, y-1), (x+1, y), (x+1, y+1), (x, y+1), (x-1, y+1), (x-1, y)]
|
|
|
+ else:
|
|
|
+ voisins = [(x, y-1), (x+1, y-1), (x+1, y), (x, y+1), (x-1, y), (x-1, y-1)]
|
|
|
else:
|
|
|
- voisins = [(x, y-1), (x+1, y), (x, y+1), (x-1, y)]
|
|
|
+ voisins = [(x, y-1), (x+1, y-1), (x+1, y), (x+1, y+1), (x, y+1), (x-1, y+1), (x-1, y), (x-1, y-1)]
|
|
|
return voisins
|
|
|
|
|
|
def coordCentreListeCases(self, listeCases):
|
|
|
@@ -1869,13 +1872,8 @@ class Plateau(QGraphicsScene):
|
|
|
pion = self.pionDecorSelectionne()
|
|
|
|
|
|
if pion != None:
|
|
|
- if self.proj.deplacementValide():
|
|
|
- if self.modePrincipal == "combat":
|
|
|
- self.majInfosPion()
|
|
|
+ if self.proj.projectionValide():
|
|
|
pion.majPosition(self.proj.coord(), self.proj.nbRotations())
|
|
|
- self.majModeCombat("aucun")
|
|
|
- else:
|
|
|
- print("Deplacement impossible!")
|
|
|
|
|
|
def afficherChampDeplacement(self, actif):
|
|
|
"""cree et affiche ou efface et detruit le champ de deplacement du pion selectionne"""
|