Exemple #1
0
 def fire(self):
     if self.target is None:
         object.remove_object(self)
         return
     else:
         t = self.frame / 100
         self.x = (1 - t) * self.x + t * self.target_x
         self.y = (1 - t) * self.y + t * self.target_y
Exemple #2
0
 def update(self):
     self.frame += 1
     self.fire()
     if self.target_x - 30 < self.x < self.target_x + 30 and self.target_y - 30 < self.y < self.target_y + 30:
         object.remove_object(self)
         self.target.hp -= self.attack_power
     if self.target.hp < 1:
         object.remove_object(self)
Exemple #3
0
 def update(self):
     self.frame += 1
     self.fire()
     if self.target_x - 30 < self.x < self.target_x + 30 and self.target_y - 30 < self.y < self.target_y + 30:
         object.remove_object(self)
         self.target.hp -= self.attack_power
         if not self.target.drawing_poison_effect:
             self.target.poison(self.poison_damage)
     if self.target.hp < 1:
         object.remove_object(self)
Exemple #4
0
 def update(self):
     self.frame += 1
     self.fire()
     if self.target_x - 30 < self.x < self.target_x + 30 and self.target_y - 30 < self.y < self.target_y + 30:
         object.remove_object(self)
         self.target.hp -= self.attack_power
         self.lock_chance = random.randint(0, 50)
         if self.lock_chance == 1:
             self.target.lock()
     if self.target.hp < 1:
         object.remove_object(self)