def run(self): self.vida.setValue(self.health) while self.health > 0: proximity = self.parent.juego.checkproximity(self) if len(proximity) != 0: for item in proximity: if item.equipo != self.name and checkdistance(self, item) <= 40: QTest.qWait(1000) self.attack(item) self.image.hide() self.vida.hide() self.parent.juego.items.remove(self)
def atacar(self, item): if checkdistance(self, item) < 60: item.health -= self.dano
def atacar(self, item): if checkdistance(self, item) < self.distancia: item.health -= self.dano - item.resistencia