def hypermutants(self, wave): import HyperRadioactiveMutant if wave == 3: glomin = 10 else: glomin = 7 for mutidx in range(len(self.__mutants)): # Don't convert them more than once. if not isinstance(self.__mutants[mutidx], HyperRadioactiveMutant.HyperRadioactiveMutant): hypmutie = HyperRadioactiveMutant.HyperRadioactiveMutant(self.__mutants[mutidx], glomin) sq = self.__mutants[mutidx].square sq.removePiece() hypmutie.setPosition(sq) self.__mutants[mutidx] = hypmutie
def clearmutants(self): for i in range(self.height): for j in range(self.width): sq = self.getSquare(j, i) if sq.isOccupied() and sq.piece.name == "Mutant": sq.removePiece()