def moveFig(self): if self.selectedFig!=None and self.turn()[1].moveReady==True: if self.selectedFig!=self.minotaur: if (list(self.selectedFig.pos) in self.turn()[1].startPos and self.dice==6) or (self.cheatmode == True) or (list(self.selectedFig.pos) not in self.turn()[1].startPos): self.selectedFig.move(_mapTools.mousePos(),self.dice) elif self.selectedFig==self.minotaur: self.selectedFig.move(_mapTools.mousePos())
def selectFig(self): if self.dice=='Minotaur': self.selectedFig = self.minotaur else: fpositions = [list(self.turn()[1].figs[i].pos) for i in range(3)] if _mapTools.mousePos() in fpositions: self.selectedFig = self.turn()[1].figs[fpositions.index(_mapTools.mousePos())]
def checkWall1(self): p = _mapTools.mousePos() self.initChoices = ([0, 1], [0, -1], [1, 0], [-1, 0]) if self.grid[p[1]][p[0]] == 0 and self.movingWall == None: for m in self.initChoices: newp = _array(p) + _array(m) if self.grid[newp[1]][newp[0]] == 0: self.movingWall = [p]
def rollDice(self): if _mapTools.mousePos() == [33,10]: dice = _random.randint(1,7) if dice == 2: dice = 'Minotaur' if dice == 1: dice = 'Wall' self.dice=dice self.selectedFig = None self.nextTurn()
def moveWall(self): if self.controller.dice == 'Wall' and _mapTools.mousePos( )[0] < 33 and _mapTools.mousePos()[1] < 33 and self.controller.turn( )[1].moveReady == True: if self.grid[_mapTools.mousePos()[1]][_mapTools.mousePos( )[0]] == 2 and self.controller.turn()[1].walldel == True: self.movingWall = None self.delWall() else: if self.movingWall == None: self.checkWall1() elif len(self.movingWall) == 1: correct = self.checkWall2() if self.movingWall != None: if correct == True: self.move(self.movingWall) self.movingWall = None if self.cheatmode == False: self.controller.turn()[1].moveReady = False
def delWall(self): for w in self.walls: if _mapTools.mousePos() in w: break self.walls.remove(w) self.grid[w[0][1]][w[0][0]] = 0 self.grid[w[1][1]][w[1][0]] = 0 #Allows unlimited wall deletions per turn in cheat mode if self.cheatmode == False: self.controller.turn()[1].walldel = False
def forceRoll(self): if _mapTools.mousePos() == [33,14]: dice = self.getDice() dice +=1 if dice == 7: dice = 1 if dice == 2: dice = 'Minotaur' self.selectedFig=self.minotaur elif dice == 1: dice = 'Wall' self.selectedFig=None elif dice == 3: self.selectedFig=None self.dice=dice
def checkWall2(self): newp = _mapTools.mousePos() correct = False if self.movingWall != None: p = self.movingWall[0] if newp == p: self.movingWall = None else: moveChoices = [ list(_array(p) + _array(m)) for m in self.initChoices if self.grid[(_array(p) + _array(m))[1]][(_array(p) + _array(m))[0]] == 0 ] if newp in moveChoices: self.movingWall.append(newp) correct = True return correct
def forceTurn(self): if _mapTools.mousePos() == [33, 12]: self.nextTurn()