def available_actions(self): """ Changes the base available actions, if the enemy is alive only allow the player to attack or flee otherwise the default moves """ if self.enemy.is_alive(): return [Actions.Flee(tile=self), Actions.Attack(enemy=self.enemy)] else: moves = self.adjacent_moves() moves.append(Actions.ViewInventory()) moves.append(Actions.Quit()) return moves
def set_available_actions(self): """ Changes the base available actions, if the enemy is alive only allow the player to attack or flee otherwise the default moves """ if self.enemy.is_alive(): self.all_moves = [ Actions.Flee(tile=self), Actions.Attack(combatClass=self.enemyCombat) ] self.all_moves.append(Actions.ViewInventory()) self.all_moves.append(Actions.Equip()) self.all_moves.append(Actions.ViewCharacter()) # self.all_moves.append(Actions.Quit()) else: self.all_moves = self.adjacent_movements self.all_moves.append(Actions.ViewInventory()) self.all_moves.append(Actions.Equip()) self.all_moves.append(Actions.ViewCharacter())
def available_actions(self): if self.enemy.is_alive(): return [Actions.Flee(tile=self), Actions.Attack(enemy=self.enemy)] else: return self.adjacent_moves()