def do_attack(self, dissapear=False): entity = self.bg.tiles[(self.x, self.y)].entity if entity and entity.can_be_attacked(): if not entity.is_ally(self): entity.get_attacked(self) if dissapear: self.dissapear()
def update(self): super(Orb, self).update() if self.alive: for (pos_x, pos_y) in itertools.product([-1,0,1], [-1,0,1]): if self.bg.is_inside(self.x+pos_x, self.y+pos_y): entity = self.bg.tiles[(self.x+pos_x), (self.y+pos_y)].entity if entity and not entity.is_ally(self) and entity not in self.attacked_entities: entity.get_attacked(self) self.attacked_entities.append(entity)
def __init__(self, battleground, side=entity.NEUTRAL_SIDE, x=-1, y=-1, char=None, color=libtcod.red, power=5, duration=10): super(Lava, self).__init__(battleground, side, x, y, char, color) self.power = power self.original_duration = duration self.duration = duration self.bg.tiles[(self.x, self.y)].hover(color) self.burning_status = status.Poison(None, power=1, tbt=2, ticks=1, name="Burnt") entity = self.bg.tiles[(self.x, self.y)].entity if entity: entity.get_attacked(self)
def update(self): super(Orb, self).update() if self.alive: for (pos_x, pos_y) in itertools.product([-1, 0, 1], [-1, 0, 1]): if self.bg.is_inside(self.x + pos_x, self.y + pos_y): entity = self.bg.tiles[(self.x + pos_x), (self.y + pos_y)].entity if entity and not entity.is_ally( self) and entity not in self.attacked_entities: entity.get_attacked(self) self.attacked_entities.append(entity)
def do_attack(self): entity = self.bg.tiles[(self.x, self.y)].entity if entity is not None and entity not in self.entities_attacked and entity.can_be_attacked( ): entity.get_attacked(self) self.entities_attacked.append(entity)
def do_attack(self): entity = self.bg.tiles[(self.x, self.y)].entity if entity is not None and entity not in self.entities_attacked and entity.can_be_attacked(): entity.get_attacked(self) self.entities_attacked.append(entity)