浏览代码

Utilisation de bresenham pour les lignes de mire

unknown 10 年之前
父节点
当前提交
a3b0ed2060
共有 12 个文件被更改,包括 95 次插入307 次删除
  1. 14 233
      DMonde.ppr
  2. 38 10
      lib/Actions.py
  3. 6 7
      lib/Case.py
  4. 3 0
      lib/Modes.py
  5. 2 3
      lib/Pinceau.py
  6. 19 45
      lib/Plateau.py
  7. 二进制
      lib/biblio/combattant
  8. 1 1
      lib/br.py
  9. 4 3
      lib/ui/ecran_principal.py
  10. 6 3
      lib/ui/mainwindow.ui
  11. 二进制
      parties/Partie1/svg/3.p
  12. 2 2
      parties/Partie1/svg/infos_sauvegarde

+ 14 - 233
DMonde.ppr

@@ -179,6 +179,7 @@ DMonde
 			lib\regles.py
 			lib\regles.py
 			lib\rsc.py
 			lib\rsc.py
 			lib\Terrain.py
 			lib\Terrain.py
+			lib\br.py
 			lib\test.py
 			lib\test.py
 			lib\VueEditionForme.py
 			lib\VueEditionForme.py
 			lib\dmF.py
 			lib\dmF.py
@@ -199,243 +200,23 @@ DMonde
 1=lib\Plateau.py
 1=lib\Plateau.py
 2=lib\Modes.py
 2=lib\Modes.py
 3=lib\Case.py
 3=lib\Case.py
-4=lib\Pinceau.py
-5=lib\bresenham.py
-6=lib\ui\corbeille_ui\dmOngletsH.py
-7=lib\ui\corbeille_ui\dmtableattaques - Copie.py
-8=lib\ui\corbeille_ui\dmtableattaques_tableAttaques.py
-9=lib\ui\dm.py
-10=lib\ui\dmOngletsH.py
-11=lib\ui\ecran_creerPlateau.py
-12=lib\ui\ecran_editionAttaques.py
-13=lib\ui\ecran_editionCombattant.py
-14=lib\ui\ecran_editionCreature.py
-15=lib\ui\ecran_editionDecor.py
-16=lib\ui\ecran_editionObjet.py
-17=lib\ui\ecran_editionQuantiteObjet.py
-18=lib\ui\ecran_editionTerrain.py
-19=lib\ui\ecran_explorateur.py
-20=lib\ui\ecran_gestionCombat.py
-21=lib\ui\ecran_panneauAttaques.py
-22=lib\ui\ecran_panneauPj.py
-23=lib\ui\ecran_principal.py
-24=lib\ui\ecran_selectionPj.py
-25=lib\ui\panneauImage.py
-26=lib\ui\ressource_rc.py
-27=lib\__init__.py
-28=lib\Actions.py
-29=lib\AEtoile.py
-30=lib\afficherSousMenu.py
-31=lib\Boucle.py
-32=lib\Cache - Copie.py
-33=lib\Cache.py
-34=lib\Combattant.py
-35=lib\Creature.py
-36=lib\Decor.py
-37=lib\EcranAffichageTexte.py
-38=lib\EcranChargerPlateau.py
-39=lib\EcranCreerPlateau.py
-40=lib\EcranEditionCombattant.py
-41=lib\EcranEditionDecor.py
-42=lib\EcranEditionObjet.py
-43=lib\EcranEditionTerrain.py
-44=lib\EcranFondPlateau.py
-45=lib\EcranGestionCombat.py
-46=lib\EcranSelectionPj.py
-47=lib\EffetsCase.py
-48=lib\EntreeSortie.py
-49=lib\fonctionsCommunes.py
-50=lib\Forme.py
-51=lib\frameAttaque.py
-52=lib\framePj.py
-53=lib\Inventaire.py
-54=lib\lancer.py
-55=lib\Objet.py
-56=lib\ObjetAction.py
-57=lib\outilsSvg.py
-58=lib\Partie.py
-59=lib\Pion.py
+4=lib\Actions.py
 [Selected Project Files]
 [Selected Project Files]
 Main=
 Main=
-Selected=lib\ui\ecran_creerPlateau.py
+Selected=DMonde.py
 [DMonde.py]
 [DMonde.py]
-TopLine=14
-Caret=38,27
+TopLine=16
+Caret=27,29
 [lib\Plateau.py]
 [lib\Plateau.py]
-TopLine=7
-Caret=1,39
-BookMark1=9,1512
+TopLine=660
+Caret=44,673
+BookMark1=9,1486
 [lib\Modes.py]
 [lib\Modes.py]
-TopLine=208
-Caret=13,225
+TopLine=580
+Caret=24,595
 [lib\Case.py]
 [lib\Case.py]
-TopLine=131
-Caret=60,138
-[lib\Pinceau.py]
-TopLine=165
-Caret=18,173
-[lib\bresenham.py]
-TopLine=1
-Caret=44,10
-[lib\ui\corbeille_ui\dmOngletsH.py]
-TopLine=1
-Caret=1,1
-[lib\ui\corbeille_ui\dmtableattaques - Copie.py]
-TopLine=1
-Caret=1,1
-[lib\ui\corbeille_ui\dmtableattaques_tableAttaques.py]
-TopLine=1
-Caret=1,1
-[lib\ui\dm.py]
-TopLine=1
-Caret=1,1
-[lib\ui\dmOngletsH.py]
-TopLine=1
-Caret=1,1
-[lib\ui\ecran_creerPlateau.py]
-TopLine=1
-Caret=1,1
-[lib\ui\ecran_editionAttaques.py]
-TopLine=1
-Caret=1,1
-[lib\ui\ecran_editionCombattant.py]
-TopLine=1
-Caret=1,1
-[lib\ui\ecran_editionCreature.py]
-TopLine=1
-Caret=1,1
-[lib\ui\ecran_editionDecor.py]
-TopLine=1
-Caret=1,1
-[lib\ui\ecran_editionObjet.py]
-TopLine=1
-Caret=1,1
-[lib\ui\ecran_editionQuantiteObjet.py]
-TopLine=1
-Caret=1,1
-[lib\ui\ecran_editionTerrain.py]
-TopLine=1
-Caret=1,1
-[lib\ui\ecran_explorateur.py]
-TopLine=1
-Caret=1,1
-[lib\ui\ecran_gestionCombat.py]
-TopLine=1
-Caret=1,1
-[lib\ui\ecran_panneauAttaques.py]
-TopLine=1
-Caret=1,1
-[lib\ui\ecran_panneauPj.py]
-TopLine=1
-Caret=1,1
-[lib\ui\ecran_principal.py]
-TopLine=1
-Caret=1,1
-[lib\ui\ecran_selectionPj.py]
-TopLine=1
-Caret=1,1
-[lib\ui\panneauImage.py]
-TopLine=1
-Caret=1,1
-[lib\ui\ressource_rc.py]
-TopLine=1
-Caret=1,1
-[lib\__init__.py]
-TopLine=1
-Caret=1,1
+TopLine=162
+Caret=15,168
 [lib\Actions.py]
 [lib\Actions.py]
-TopLine=1
-Caret=1,1
-[lib\AEtoile.py]
-TopLine=1
-Caret=1,1
-[lib\afficherSousMenu.py]
-TopLine=1
-Caret=1,1
-[lib\Boucle.py]
-TopLine=1
-Caret=1,1
-[lib\Cache - Copie.py]
-TopLine=1
-Caret=1,1
-[lib\Cache.py]
-TopLine=1
-Caret=1,1
-[lib\Combattant.py]
-TopLine=1
-Caret=1,1
-[lib\Creature.py]
-TopLine=1
-Caret=1,1
-[lib\Decor.py]
-TopLine=1
-Caret=1,1
-[lib\EcranAffichageTexte.py]
-TopLine=1
-Caret=1,1
-[lib\EcranChargerPlateau.py]
-TopLine=1
-Caret=1,1
-[lib\EcranCreerPlateau.py]
-TopLine=1
-Caret=1,1
-[lib\EcranEditionCombattant.py]
-TopLine=1
-Caret=1,1
-[lib\EcranEditionDecor.py]
-TopLine=1
-Caret=1,1
-[lib\EcranEditionObjet.py]
-TopLine=1
-Caret=1,1
-[lib\EcranEditionTerrain.py]
-TopLine=1
-Caret=1,1
-[lib\EcranFondPlateau.py]
-TopLine=1
-Caret=1,1
-[lib\EcranGestionCombat.py]
-TopLine=1
-Caret=1,1
-[lib\EcranSelectionPj.py]
-TopLine=1
-Caret=1,1
-[lib\EffetsCase.py]
-TopLine=1
-Caret=1,1
-[lib\EntreeSortie.py]
-TopLine=1
-Caret=1,1
-[lib\fonctionsCommunes.py]
-TopLine=1
-Caret=1,1
-[lib\Forme.py]
-TopLine=1
-Caret=1,1
-[lib\frameAttaque.py]
-TopLine=1
-Caret=1,1
-[lib\framePj.py]
-TopLine=1
-Caret=1,1
-[lib\Inventaire.py]
-TopLine=1
-Caret=1,1
-[lib\lancer.py]
-TopLine=1
-Caret=1,1
-[lib\Objet.py]
-TopLine=1
-Caret=1,1
-[lib\ObjetAction.py]
-TopLine=1
-Caret=1,1
-[lib\outilsSvg.py]
-TopLine=1
-Caret=1,1
-[lib\Partie.py]
-TopLine=1
-Caret=1,1
-[lib\Pion.py]
-TopLine=1
-Caret=1,1
+TopLine=483
+Caret=45,494

+ 38 - 10
lib/Actions.py

@@ -6,6 +6,7 @@ import regles
 import AEtoile
 import AEtoile
 import time, threading
 import time, threading
 
 
+
 class Action(object):
 class Action(object):
     """action effectuee par un combattant sur le plateau de jeu"""
     """action effectuee par un combattant sur le plateau de jeu"""
     def __init__(self):
     def __init__(self):
@@ -318,7 +319,21 @@ class Distance(Attaque):
         self.afficherCibles(True)
         self.afficherCibles(True)
 
 
     def estValide(self):
     def estValide(self):
-        return self.plateau.estCibleAttaqueDistValide(self.plateau.pionSelectionne().position, self._coordCible, 0)
+        x1, y1 = self.plateau.pionSelectionne().position
+        z1 = self.plateau.pionSelectionne().z + self.plateau.pionSelectionne().hauteur
+        x2, y2 = self._coordCible
+        listeZ2 = []
+        if self._pionCible != None:
+            for h in range(0, self._pionCible.hauteur):
+                listeZ2.append((self._pionCible.z + h))
+        else:
+            listeZ2 = [self.plateau.cases[self._coordCible].altitude]   
+        valide = True
+        for z2 in listeZ2:
+            if not self.plateau.estCibleAttaqueDistValide((x1, y1, z1), (x2, y2, z2)):
+                valide = False
+                break
+        return valide
 
 
     def afficherCibles(self, actif):
     def afficherCibles(self, actif):
         if self._pionCible:
         if self._pionCible:
@@ -463,31 +478,44 @@ class Disque(Zone):
     def typeAttZone(self):
     def typeAttZone(self):
         return "disque"
         return "disque"
 
 
+    def activer(self, plateau, numPion):
+        super(Disque, self).activer(plateau, numPion)
+        self._rayon = self.plateau.fenetre.ui.pi_rayonAttaqueZone.value()
+        
     def majCoordCible(self, coord):
     def majCoordCible(self, coord):
         if self._coordCible in self.plateau.cases:    
         if self._coordCible in self.plateau.cases:    
             self.plateau.cases[self._coordCible].majEstCibleCurseur(False)
             self.plateau.cases[self._coordCible].majEstCibleCurseur(False)
         super(Disque, self).majCoordCible(coord)    
         super(Disque, self).majCoordCible(coord)    
 
 
     def majCibles(self):
     def majCibles(self):
-        self._casesCibles = self.plateau.zone(self._coordCible, self.rayon, 0)
+        self._casesCibles = self.plateau.zone(self._coordCible, self._rayon, 0)
 
 
     def afficherCibles(self, actif):
     def afficherCibles(self, actif):
-        super(Disque, self).afficherCibles(actif)
-        #si on affiche une attaque invalide
-        if not self.estValide():
+        if self.estValide():
+            super(Disque, self).afficherCibles(actif)
+        else:
+            super(Disque, self).afficherCibles(False)
             self.plateau.cases[self._coordCible].majEstCibleCurseur(actif, False)
             self.plateau.cases[self._coordCible].majEstCibleCurseur(actif, False)
 
 
+    def majRayon(self, val):
+        self._rayon = val
+        self.maj()
+
     def majItemsGraphiques(self):
     def majItemsGraphiques(self):
         self._itemLigne.setLine(QLineF(self.plateau.cases[self.plateau.pionSelectionne().position].centreGraphique, \
         self._itemLigne.setLine(QLineF(self.plateau.cases[self.plateau.pionSelectionne().position].centreGraphique, \
                                        self.plateau.cases[self._coordCible].centreGraphique))
                                        self.plateau.cases[self._coordCible].centreGraphique))
         if self.estValide():
         if self.estValide():
-            rect = self.rectEllipseCirculaire(self.plateau.cases[self._coordCible].centreGraphique, self.rayon)
+            rect = self.rectEllipseCirculaire(self.plateau.cases[self._coordCible].centreGraphique, self._rayon)
             if rect != None:
             if rect != None:
                 self._itemCible.setRect(rect)
                 self._itemCible.setRect(rect)
-            self._itemCible.setVisible(self.estValide() and rect != None)
+        self._itemCible.setVisible(self.estValide() and rect != None)
 
 
     def estValide(self):
     def estValide(self):
-        return self.plateau.estCibleAttaqueDistValide(self.plateau.pionSelectionne().position, self._coordCible)
+        x1, y1 = self.plateau.pionSelectionne().position
+        z1 = self.plateau.pionSelectionne().z + self.plateau.pionSelectionne().hauteur
+        x2, y2 = self._coordCible
+        z2 = self.plateau.cases[self._coordCible].altitude
+        return self.plateau.estCibleAttaqueDistValide((x1, y1, z1), (x2, y2, z2))
 
 
     def rectEllipseCirculaire(self, centre, rayon):
     def rectEllipseCirculaire(self, centre, rayon):
         """renvoie le QRectF definissant une ellipse ayant le QPointF pour centre et le rayon en cases entres en param
         """renvoie le QRectF definissant une ellipse ayant le QPointF pour centre et le rayon en cases entres en param
@@ -495,8 +523,8 @@ class Disque(Zone):
            verticalement le nombre de cases demandees"""
            verticalement le nombre de cases demandees"""
         rect = None
         rect = None
         if rayon > 0:
         if rayon > 0:
-            p1 = QPointF((centre.x() - (rayon*self.plateau.hCase)), (centre.y() - (rayon*self.plateau.hCase)))
-            p2 = QPointF((centre.x() + (rayon*self.plateau.hCase)), (centre.y() + (rayon*self.plateau.hCase)))
+            p1 = QPointF((centre.x() - (rayon * self.plateau.hCase)), (centre.y() - (rayon * self.plateau.hCase)))
+            p2 = QPointF((centre.x() + (rayon * self.plateau.hCase)), (centre.y() + (rayon * self.plateau.hCase)))
             if p1 != p2:
             if p1 != p2:
                 rect = QRectF()
                 rect = QRectF()
                 rect.setTopLeft(p1)
                 rect.setTopLeft(p1)

+ 6 - 7
lib/Case.py

@@ -89,11 +89,11 @@ class Case(QGraphicsPolygonItem):
         self.setFiltersChildEvents(True)
         self.setFiltersChildEvents(True)
 
 
 #        #pour afficher les coordonnees des cases:        
 #        #pour afficher les coordonnees des cases:        
-        text = QGraphicsSimpleTextItem("{}-{}".format(self.x,self.y), parent=self)
-        if self.plateau.formeCases == "H":
-            text.setPos(QPointF(((self.x*0.866)+0.2886)*self.plateau.hCase,  (self.y+k+0.5)*self.plateau.hCase))
-        else:
-            text.setPos(QPointF(self.x*self.plateau.hCase,  self.y*self.plateau.hCase))
+#         text = QGraphicsSimpleTextItem("{}-{}".format(self.x,self.y), parent=self)
+#         if self.plateau.formeCases == "H":
+#             text.setPos(QPointF(((self.x*0.866)+0.2886)*self.plateau.hCase,  (self.y+k+0.5)*self.plateau.hCase))
+#         else:
+#             text.setPos(QPointF(self.x*self.plateau.hCase,  self.y*self.plateau.hCase))
 
 
         self.logoDep = LogoDep(self)
         self.logoDep = LogoDep(self)
         self.logoDep.creer()
         self.logoDep.creer()
@@ -161,8 +161,7 @@ class Case(QGraphicsPolygonItem):
         for coord in lst: 
         for coord in lst: 
             if (coord[0] >= 0 and coord[1] >= 0 and coord[0] < self.plateau.nbCasesX and coord[1] < self.plateau.nbCasesY):
             if (coord[0] >= 0 and coord[1] >= 0 and coord[0] < self.plateau.nbCasesX and coord[1] < self.plateau.nbCasesY):
                 voisins.append(coord)
                 voisins.append(coord)
-        return voisins                      
-
+        return voisins                           
      
      
     ########################
     ########################
 
 

+ 3 - 0
lib/Modes.py

@@ -593,6 +593,9 @@ class PionSelectionne(ModeBasePi):
             self._action = None            
             self._action = None            
         self._action = action()
         self._action = action()
         self._action.activer(self.plateau, self._num)
         self._action.activer(self.plateau, self._num)
+    
+    def action(self):
+        return self._action
         
         
     def survol_case(self, coord):
     def survol_case(self, coord):
         if self._action:
         if self._action:

+ 2 - 3
lib/Pinceau.py

@@ -3,7 +3,7 @@ from PyQt4.QtCore import *
 from PyQt4.QtGui import *
 from PyQt4.QtGui import *
 from Terrain import Terrain
 from Terrain import Terrain
 from dmF import *
 from dmF import *
-from bresenham import casesEntre
+import br
 
 
 class Pinceau():
 class Pinceau():
     def __init__(self, plateau):
     def __init__(self, plateau):
@@ -170,7 +170,7 @@ class Pinceau():
         self.plateau.cases[coord].majEstCibleCurseur(actif)
         self.plateau.cases[coord].majEstCibleCurseur(actif)
 
 
     def selectionLigne(self, coord0, coord1):
     def selectionLigne(self, coord0, coord1):
-        retour = ligne(coord0, coord1, self.plateau.formeCases)
+        retour = br.ligne(coord0, coord1, self.plateau.formeCases)
         return retour
         return retour
 
 
     def selectionRectangle(self, coord0, coord1, plein = True):
     def selectionRectangle(self, coord0, coord1, plein = True):
@@ -228,7 +228,6 @@ class Pinceau():
                         listeCases.append(coord)
                         listeCases.append(coord)
         return listeCases
         return listeCases
 
 
-
     def selectionPot(self, coord0):
     def selectionPot(self, coord0):
         retour = [coord0]
         retour = [coord0]
         aVerifier = [coord0]
         aVerifier = [coord0]

+ 19 - 45
lib/Plateau.py

@@ -34,6 +34,7 @@ from EcranSelectionPj import EcranSelectionPj
 import regles as regles
 import regles as regles
 from outilsSvg import *
 from outilsSvg import *
 from lancer import jet, estJetValide
 from lancer import jet, estJetValide
+import br
 
 
 from operator import itemgetter, attrgetter
 from operator import itemgetter, attrgetter
 from math import *
 from math import *
@@ -242,6 +243,7 @@ class Plateau(QGraphicsScene):
         self.fenetre.connect(self.fenetre.ui.pi_attaqueDist, SIGNAL("clicked()"), self.majModeCombatAttaqueDist, Qt.UniqueConnection)
         self.fenetre.connect(self.fenetre.ui.pi_attaqueDist, SIGNAL("clicked()"), self.majModeCombatAttaqueDist, Qt.UniqueConnection)
         self.fenetre.connect(self.fenetre.ui.pi_attaqueZone, SIGNAL("clicked()"), self.majModeCombatZone, Qt.UniqueConnection)
         self.fenetre.connect(self.fenetre.ui.pi_attaqueZone, SIGNAL("clicked()"), self.majModeCombatZone, Qt.UniqueConnection)
         self.fenetre.connect(self.fenetre.ui.pi_formeAttaqueZone, SIGNAL("activated (int)"), self.majModeCombatZone, Qt.UniqueConnection)
         self.fenetre.connect(self.fenetre.ui.pi_formeAttaqueZone, SIGNAL("activated (int)"), self.majModeCombatZone, Qt.UniqueConnection)
+        self.fenetre.connect(self.fenetre.ui.pi_rayonAttaqueZone, SIGNAL("valueChanged(int)"), self.majRayonZone, Qt.UniqueConnection)
 ##        self.fenetre.connect(self.fenetre.ui.pi_vol, SIGNAL("clicked()"), self.fenetre.barreCombatVol, Qt.UniqueConnection)
 ##        self.fenetre.connect(self.fenetre.ui.pi_vol, SIGNAL("clicked()"), self.fenetre.barreCombatVol, Qt.UniqueConnection)
         
         
         self.fenetre.connect(self.fenetre.ui.pi_finTour, SIGNAL("clicked()"), self.pionSuivant, Qt.UniqueConnection)
         self.fenetre.connect(self.fenetre.ui.pi_finTour, SIGNAL("clicked()"), self.pionSuivant, Qt.UniqueConnection)
@@ -671,6 +673,11 @@ class Plateau(QGraphicsScene):
         if action:    
         if action:    
             self.modeActif.nouvelleAction(action)      
             self.modeActif.nouvelleAction(action)      
 
 
+    def majRayonZone(self, val):
+        action = self.modeActif.action()
+        if action:
+            action.majRayon(val) 
+
     def majModeDefinirEntree(self):
     def majModeDefinirEntree(self):
         self.activerMode(Modes.CreationEntreeSortie, "E")
         self.activerMode(Modes.CreationEntreeSortie, "E")
 
 
@@ -1183,53 +1190,20 @@ class Plateau(QGraphicsScene):
         return preSelection
         return preSelection
     
     
 
 
-    def estCibleAttaqueDistValide(self, coordOrigine, coordCible, zPion = 0):
+    def estCibleAttaqueDistValide(self, coordOrigine, coordCible):
          """la case cible est elle valide pour une attaque a distance depuis la position et hauteur
          """la case cible est elle valide pour une attaque a distance depuis la position et hauteur
-            du pion selectionne? on compare pour ce faire les altitudes des cases sur la ligne de mire"""
-         casesLigneMire = []
-         #on preselectionne les cases concernees
-         preSelection = self.preSelectionCollision(self.cases[coordOrigine].centreGraphique, self.cases[coordCible].centreGraphique)
-         if coordOrigine in preSelection:
-             preSelection.remove(coordOrigine)
-         if coordCible in preSelection:
-             preSelection.remove(coordCible)    
-         for coord in preSelection:
-             ligne = QLineF(self.cases[coordOrigine].centreGraphique, self.cases[coordCible].centreGraphique)
-             ligneGraphique = QGraphicsLineItem(ligne)
-             ligneGraphique.prepareGeometryChange()
-             self.addItem(ligneGraphique)
-             if self.cases[coord].collidesWithItem(ligneGraphique, Qt.IntersectsItemShape):
-                  casesLigneMire.append(coord)
-             self.removeItem(ligneGraphique)     
-             del ligneGraphique     
-
-         #on trie les cases par distance au point d'origine (de la plus proche a la plus eloignee)
-         casesLigneMireDistance = {} #distance: coord
-         for coord in casesLigneMire:
-             distance = sqrt((coordOrigine[0] - coord[0])**2 + (coordOrigine[1] - coord[1])**2)
-             casesLigneMireDistance[coord] = distance
-
-         #on compare enfin les altitudes de chaque case en fonction de la distance
-         zOrigine = self.cases[coordOrigine].altitude + self.pionSelectionne().z + self.pionSelectionne().hauteur 
-         zCible = self.cases[coordCible].altitude + zPion
-         distanceTot = sqrt((coordCible[0] - coordOrigine[0])**2 + (coordCible[1] - coordOrigine[1])**2)
+            du pion selectionne
+            les coord sont de la forme (x, y, z)"""
          valide = True
          valide = True
-         for coord in casesLigneMireDistance:
-              if self.cases[coord].terrain.visibilite == False:
-                  valide = False
-                  break
-              else:  
-                  if zOrigine >= zCible:
-                      z = (zOrigine - zCible) * (casesLigneMireDistance[coord] / distanceTot)
-                  else:
-                      z = (zCible - zOrigine) * ((distanceTot - casesLigneMireDistance[coord]) / distanceTot)
-                  if self.cases[coord].estOccupee(int(z)):
-                      if self.modeParam["pionCibleAttaqueDist"] != None:
-                          if self.cases[coord].estOccupeePar(int(z)) != self.modeParam["pionCibleAttaqueDist"]:
-                              valide = False
-                      else:        
-                          valide = False
-                      break
+         if coordOrigine[0] != coordCible[0] and coordOrigine[1] != coordCible[1]:
+             casesLigneMire = br.ligne(coordOrigine, coordCible, self.formeCases)
+             casesLigneMire.remove(coordOrigine)
+             casesLigneMire.remove(coordCible)
+             for coord in casesLigneMire:
+                x, y, z = coord
+                if self.cases[(x,y)].estOccupee(z): 
+                    valide = False
+                    break
          return valide       
          return valide       
                       
                       
     def pionSurCase(self, coord):
     def pionSurCase(self, coord):

二进制
lib/biblio/combattant


+ 1 - 1
lib/br.py

@@ -4,7 +4,7 @@ from math import *
 from dmF import *
 from dmF import *
 
 
 def ligne(coord1, coord2, formeCases = "H"):
 def ligne(coord1, coord2, formeCases = "H"):
-    if coord1 != coord2:
+    if coord1[0] != coord2[0] and coord1[1] != coord2[1]:
         if len(coord1) == 2 and len(coord2) == 2:
         if len(coord1) == 2 and len(coord2) == 2:
             retour = _ligne2d(coord1, coord2, formeCases)
             retour = _ligne2d(coord1, coord2, formeCases)
         elif len(coord1) == 3 and len(coord2) == 3:
         elif len(coord1) == 3 and len(coord2) == 3:

+ 4 - 3
lib/ui/ecran_principal.py

@@ -2,7 +2,7 @@
 
 
 # Form implementation generated from reading ui file 'mainwindow.ui'
 # Form implementation generated from reading ui file 'mainwindow.ui'
 #
 #
-# Created: Fri Jul 03 16:01:17 2015
+# Created: Thu Jul 09 16:34:50 2015
 #      by: PyQt4 UI code generator 4.10.4
 #      by: PyQt4 UI code generator 4.10.4
 #
 #
 # WARNING! All changes made in this file will be lost!
 # WARNING! All changes made in this file will be lost!
@@ -960,6 +960,7 @@ class Ui_principal(object):
         font.setBold(True)
         font.setBold(True)
         font.setWeight(75)
         font.setWeight(75)
         self.pi_rayonAttaqueZone.setFont(font)
         self.pi_rayonAttaqueZone.setFont(font)
+        self.pi_rayonAttaqueZone.setMinimum(1)
         self.pi_rayonAttaqueZone.setObjectName(_fromUtf8("pi_rayonAttaqueZone"))
         self.pi_rayonAttaqueZone.setObjectName(_fromUtf8("pi_rayonAttaqueZone"))
         self.pi_deplacement = QtGui.QToolButton(self.pi_actions)
         self.pi_deplacement = QtGui.QToolButton(self.pi_actions)
         self.pi_deplacement.setGeometry(QtCore.QRect(10, 10, 61, 31))
         self.pi_deplacement.setGeometry(QtCore.QRect(10, 10, 61, 31))
@@ -1270,7 +1271,7 @@ class Ui_principal(object):
         self.grp_deroulement.setWidgetResizable(True)
         self.grp_deroulement.setWidgetResizable(True)
         self.grp_deroulement.setObjectName(_fromUtf8("grp_deroulement"))
         self.grp_deroulement.setObjectName(_fromUtf8("grp_deroulement"))
         self.grp_deroulement_contenu = QtGui.QWidget()
         self.grp_deroulement_contenu = QtGui.QWidget()
-        self.grp_deroulement_contenu.setGeometry(QtCore.QRect(0, 0, 756, 588))
+        self.grp_deroulement_contenu.setGeometry(QtCore.QRect(0, 0, 100, 30))
         palette = QtGui.QPalette()
         palette = QtGui.QPalette()
         brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
         brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
         brush.setStyle(QtCore.Qt.SolidPattern)
         brush.setStyle(QtCore.Qt.SolidPattern)
@@ -1619,7 +1620,7 @@ class Ui_principal(object):
         self.cbt_panneauHaut.setCurrentIndex(1)
         self.cbt_panneauHaut.setCurrentIndex(1)
         self.cbt_panneauGauche.setCurrentIndex(1)
         self.cbt_panneauGauche.setCurrentIndex(1)
         self.cbt_panneauBas.setCurrentIndex(1)
         self.cbt_panneauBas.setCurrentIndex(1)
-        self.cbt_panneauDroite.setCurrentIndex(1)
+        self.cbt_panneauDroite.setCurrentIndex(2)
         self.cp_ongletsListes.setCurrentIndex(3)
         self.cp_ongletsListes.setCurrentIndex(3)
         self.pi_ongletsListes.setCurrentIndex(0)
         self.pi_ongletsListes.setCurrentIndex(0)
         self.tabStatutAppli.setCurrentIndex(2)
         self.tabStatutAppli.setCurrentIndex(2)

+ 6 - 3
lib/ui/mainwindow.ui

@@ -1279,7 +1279,7 @@
                </size>
                </size>
               </property>
               </property>
               <property name="currentIndex">
               <property name="currentIndex">
-               <number>1</number>
+               <number>2</number>
               </property>
               </property>
               <widget class="QWidget" name="cbt_panneauDroite0"/>
               <widget class="QWidget" name="cbt_panneauDroite0"/>
               <widget class="QWidget" name="cbt_panneauDroite1">
               <widget class="QWidget" name="cbt_panneauDroite1">
@@ -2910,6 +2910,9 @@ selectionné</string>
                       <bold>true</bold>
                       <bold>true</bold>
                      </font>
                      </font>
                     </property>
                     </property>
+                    <property name="minimum">
+                     <number>1</number>
+                    </property>
                    </widget>
                    </widget>
                    <widget class="QToolButton" name="pi_deplacement">
                    <widget class="QToolButton" name="pi_deplacement">
                     <property name="geometry">
                     <property name="geometry">
@@ -3847,8 +3850,8 @@ selectionné</string>
             <rect>
             <rect>
              <x>0</x>
              <x>0</x>
              <y>0</y>
              <y>0</y>
-             <width>756</width>
-             <height>588</height>
+             <width>100</width>
+             <height>30</height>
             </rect>
             </rect>
            </property>
            </property>
            <property name="palette">
            <property name="palette">

二进制
parties/Partie1/svg/3.p


+ 2 - 2
parties/Partie1/svg/infos_sauvegarde

@@ -1,3 +1,3 @@
 €}q(U1}q(UnomUsfUdateCreationGAÕe¦Ï+SøUdateSvgGAÕe§
 €}q(U1}q(UnomUsfUdateCreationGAÕe¦Ï+SøUdateSvgGAÕe§
--/UchapitreU1UenCours‰Upublic‰uU0}q(UnomUtestUdateCreationGAÕe¤/c•�UdateSvgGAÕe¤4iº^UchapitreU1UenCours‰Upublic‰uU2}q(UnomqUfsdfqUdateCreationqGAÕe§9Õ`BUdateSvgqGAÕe§E>{Uchapitreq	U1UenCoursq
-‰Upublicq‰uu.
+-/UchapitreU1UenCours‰Upublic‰uU0}q(UnomUtestUdateCreationGAÕe¤/c•�UdateSvgGAÕe¤4iº^UchapitreU1UenCours‰Upublic‰uU3}q(UnomqUghjqUdateCreationqGAÕg ŠŠ-UdateSvgqGAÕg¡^G;dUchapitreq	U1UenCoursq
+‰Upublicq‰uU2}q(UnomUfsdfUdateCreationGAÕe§9Õ`BUdateSvgGAÕe§E>{UchapitreU1UenCours‰Upublic‰uu.