def getSorts(lvl): """@summary: charge les sorts de début de combat @return: List <Sort> """ # pylint: disable=unused-argument sorts = [] sorts.append( Sort.Sort( "Beuverie", 0, 0, 0, 15, [ EffetAttire(8, cibles_possibles="Ennemis"), EffetAttire( 8, cibles_possibles="Allies", etat_requis_cibles="Saoul") ], [], 0, 99, 1, 0, 0, "ligne", True, chaine=False)) return sorts
def getSorts(lvl): """@summary: charge les sorts de début de combat @return: List <Sort> """ # pylint: disable=unused-argument sorts = [] sorts.append( Sort.Sort("Bambou Malchanceux", 0, 0, 0, 1, [ EffetEtat(EtatBoostCaracFixe("Bambou Malchanceux", 0, 1, "tacle", -23)) ], [], 0, 1, 1, 0, 0, "ligne", True, description="Retire du tacle à la cible pour 1 tour.") ) sorts.append( Sort.Sort("Coup de Bambou", 0, 2, 0, 1, [ EffetEtat(EtatBoostCaracFixe("Coup de Bambou", 0, 2, "pui", -70)), EffetEtat(Etat("Affaibli", 0, 2)), ], [], 0, 1, 1, 3, 0, "ligne", True, description="Retire de la puissance à la cible et lui applique l'état affaibli.") ) return sorts
def getSortsDebutCombat(lvl): """@summary: charge les sorts de début combat @return: List <Sort> """ # pylint: disable=unused-argument sortsDebutCombat = [] sortsDebutCombat.append( Sort.Sort("Réduction des dégâts alliés", 0, 0, 0, 0, [ EffetEtatSelf( EtatModDegPer("Réduction des dégâts alliés", 0, -1, 50, provenance="Allies")) ], [], 0, 99, 99, 0, 0, "cercle", False)) sortsDebutCombat.append( Sort.Sort("Soin si subit", 0, 0, 0, 0, [ EffetEtatSelf( EtatEffetSiSubit("Soigne allié qui l'attaque", 0, -1, EffetSoinSelonSubit(100), "Soin de fiole", "cible", "attaquant", "", "Allies")) ], [], 0, 99, 99, 0, 0, "cercle", False)) sortsDebutCombat.append( Sort.Sort("Explose", 0, 0, 0, 0, [ EffetEtatSelf( EtatEffetSiMeurt( "Explose", 0, -1, EffetDegats(22, 26, "Terre", zone=Zones.TypeZoneCercleSansCentre(2)), "Soin de fiole", "lanceur", "mouru")) ], [], 0, 99, 99, 0, 0, "cercle", False)) sortsDebutCombat.append( Sort.Sort("Trop de stimulation!", 0, 0, 0, 0, [ EffetEtatSelf( EtatEffetSiNouvelEtat("Meurt si stimulé", 0, -1, EffetTue(), "Meurt si stimulé", "porteur", "Stimulé")) ], [], 0, 99, 99, 0, 0, "cercle", False)) return sortsDebutCombat
def run(self): """ Perform the actual extraction of information. """ menu = self.options.menu self.filter = menu.get_option_by_name('filter').get_filter() sort_func_num = menu.get_option_by_name('sort_by').get_value() self.sort_desc = menu.get_option_by_name('sort_desc').get_value() self.fam_events = menu.get_option_by_name('family_events').get_value() sort_functions = _get_sort_functions(Sort.Sort(self.db)) self.sort_name = sort_functions[sort_func_num][0] self.sort_func = sort_functions[sort_func_num][1] self.sort = Sort.Sort(self.db) with DbTxn(_("Sort event changes"), self.db, batch=True) as trans: self.db.disable_signals() family_handles = self.sort_person_events(trans) if len(family_handles) > 0: self.sort_family_events(family_handles, trans) self.db.enable_signals() self.db.request_rebuild()
def __init__(self, database, options, user): """ Create the DescendantReport object that produces the report. The arguments are: database - the GRAMPS database instance options - instance of the Options class for this report user - a gen.user.User() instance This report needs the following parameters (class variables) that come in the options class. gen - Maximum number of generations to include. name_format - Preferred format to display names dups - Whether to include duplicate descendant trees """ Report.__init__(self, database, options, user) menu = options.menu self.max_generations = menu.get_option_by_name('gen').get_value() pid = menu.get_option_by_name('pid').get_value() self.center_person = database.get_person_from_gramps_id(pid) if (self.center_person == None): raise ReportError(_("Person %s is not in the Database") % pid) sort = Sort.Sort(self.database) self.by_birthdate = sort.by_birthdate #Initialize the Printinfo class self._showdups = menu.get_option_by_name('dups').get_value() numbering = menu.get_option_by_name('numbering').get_value() if numbering == "Simple": obj = PrintSimple(self._showdups) elif numbering == "de Villiers/Pama": obj = PrintVilliers() elif numbering == "Meurgey de Tupigny": obj = PrintMeurgey() else: raise AttributeError("no such numbering: '%s'" % self.numbering) marrs = menu.get_option_by_name('marrs').get_value() divs = menu.get_option_by_name('divs').get_value() # Copy the global NameDisplay so that we don't change application defaults. self._name_display = copy.deepcopy(global_name_display) name_format = menu.get_option_by_name("name_format").get_value() if name_format != 0: self._name_display.set_default_format(name_format) self.objPrint = Printinfo(self.doc, database, obj, marrs, divs, self._name_display)
def getSorts(lvl): """@summary: charge les sorts de début de combat @return: List <Sort> """ # pylint: disable=unused-argument sorts = [] sorts.append(Sort.Sort("Cawotte", 0, 4, 1, 6, [EffetInvoque("Cawotte", False, cibles_possibles="", cible_non_requise=True)], [], 0, 1, 1, 6, 0, "cercle", True, description="Invoque une Cawotte")) return sorts
def getSortsDebutCombat(lvl): """@summary: charge les sorts de début combat @return: List <Sort> """ # pylint: disable=unused-argument sortsDebutCombat = [] sortsDebutCombat.append( Sort.Sort("Strategie_iop", 0, 0, 0, 0, [ EffetEtat( EtatRedistribuerPer("Stratégie Iop", 0, -1, 50, "Ennemis|Allies", 2)) ], [], 0, 99, 99, 0, 0, "cercle", False)) return sortsDebutCombat
def getSorts(lvl): """@summary: charge les sorts de début de combat @return: List <Sort> """ # pylint: disable=unused-argument sorts = [] sorts.append( Sort.Sort("Potion Magique", 0, 0, 0, 0, [ EffetEtat(EtatBoostCaracFixe("Potion Magique", 0, 1, "pui", 150), cibles_possibles="Allies", cibles_possibles_direct="Lanceur", zone=Zones.TypeZoneCercle(2)) ], [], 0, 99, 1, 0, 0, "ligne", True)) return sorts
def getSortsDebutCombat(lvl): """@summary: charge les sorts de combat @return: List <Sort> """ # pylint: disable=unused-argument sortsDebutCombat = [] sortsDebutCombat.append( Sort.Sort("Ivresse", 0, 0, 0, 0, [ EffetEtatSelf( EtatEffetSiPorte( "Tournée Générale si porté", 0, -1, EffetEtatSelf( EtatEffetDebutTour( "Tournée Générale", 1, 1, EffetSoin(53, 81, cibles_possibles="Allies", zone=Zones.TypeZoneCercle(1)), "Tournée Générale", "cible")), "Tournée Générale", "porte")), EffetEtatSelf( EtatEffetSiLance( "Tournée Générale si lancé", 0, -1, EffetSoin(53, 81, cibles_possibles="Allies|Lanceur", zone=Zones.TypeZoneCercle(1)), "Tournée Générale")), EffetEtatSelf( EtatEffetSiLance("Tournée Générale annulé", 0, -1, EffetRetireEtat("Tournée Générale"), "Tournée Générale annulé")) ], [], 0, 99, 99, 0, 0, "cercle", False, chaine=False)) return sortsDebutCombat
def __init__(self, database, options, user): """ Create the PlaceReport object produces the Place report. The arguments are: database - the GRAMPS database instance options - instance of the Options class for this report user - instance of a gen.user.User class This report needs the following parameters (class variables) that come in the options class. places - List of places to report on. center - Center of report, person or event incpriv - Whether to include private data """ Report.__init__(self, database, options, user) self._user = user menu = options.menu places = menu.get_option_by_name('places').get_value() self.center = menu.get_option_by_name('center').get_value() self.incpriv = menu.get_option_by_name('incpriv').get_value() if self.incpriv: self.database = database else: self.database = PrivateProxyDb(database) filter_option = menu.get_option_by_name('filter') self.filter = filter_option.get_filter() self.sort = Sort.Sort(self.database) if self.filter.get_name() != '': # Use the selected filter to provide a list of place handles plist = self.database.iter_place_handles() self.place_handles = self.filter.apply(self.database, plist) else: # Use the place handles selected without a filter self.place_handles = self.__get_place_handles(places) self.place_handles.sort(key=self.sort.by_place_title_key)
def __init__(self, dbstate, uistate, people_list, track): self.dbstate = dbstate self.uistate = uistate ManagedWindow.ManagedWindow.__init__(self, uistate, track, self) self.db = dbstate.db self.my_list = people_list self.row_data = [] self.save_form = None self.topDialog = Glade() self.topDialog.connect_signals({ "on_write_table": self.on_write_table, "destroy_passed_object": self.close, "on_help_clicked": self.on_help_clicked, "on_apply_clicked": self.__dummy, "on_editor_clicked": self.__dummy, }) window = self.topDialog.toplevel window.show() self.set_window(window, self.topDialog.get_object('title'), _('Event Comparison Results')) self.eventlist = self.topDialog.get_object('treeview') self.sort = Sort.Sort(self.db) self.my_list.sort(self.sort.by_last_name) self.event_titles = self.make_event_titles() self.table_titles = [_("Person"), _("ID")] for event_name in self.event_titles: self.table_titles.append( _("%(event_name)s Date") % {'event_name': event_name}) self.table_titles.append('sort') # This won't be shown in a tree self.table_titles.append( _("%(event_name)s Place") % {'event_name': event_name}) self.build_row_data() self.draw_display() self.show()
def getSortsDebutCombat(lvl): """@summary: charge les sorts de début combat @return: List <Sort> """ # pylint: disable=unused-argument sortsDebutCombat = [] sortsDebutCombat.append( Sort.Sort("Bamboozel", 0, 0, 0, 0, [ EffetEtatSelf( EtatEffetSiSubit( "Bamboozleur", 0, -1, EffetEtat(EtatBoostCaracFixe("Karcham", 0, -1, "checkLdv", False), etat_requis="!Karcham"), "Bamboozel", "lanceur", "attaquant", "melee")), EffetEtatSelf( EtatEffetSiSubit("Bamboozleur", 0, -1, EffetPorte(etat_requis="!Saoul"), "Bamboozel", "lanceur", "attaquant", "melee")) ], [], 0, 99, 99, 0, 0, "cercle", False)) return sortsDebutCombat
def getSorts(lvl): """@summary: charge les sorts de combat @return: List <Sort> """ # pylint: disable=unused-argument sorts = [] sorts.append( Sort.Sort( "Lapino de vie", 0, 3, 0, 4, [EffetSoinPerPVMax(10, cibles_possibles="Allies|Lanceur")], [], 0, 99, 99, 0, 0, "cercle", False, description="""Soigne de 5% de la vie maximale de la cible allié.""" )) return sorts
def add_menu_options(self, menu): category_name = _("Report Options") self.__filter = FilterOption(_("Filter"), 0) self.__filter.set_help( _("Determines what people are included in the report")) menu.add_option(category_name, "filter", self.__filter) self.__filter.connect('value-changed', self.__filter_changed) self.__pid = PersonOption(_("Filter Person")) self.__pid.set_help(_("The center person for the filter")) menu.add_option(category_name, "pid", self.__pid) self.__pid.connect('value-changed', self.__update_filters) self.__update_filters() sortby = EnumeratedListOption(_('Sort by'), 0) idx = 0 for item in _get_sort_functions(Sort.Sort(self.__db)): sortby.add_item(idx, item[0]) idx += 1 sortby.set_help(_("Sorting method to use")) menu.add_option(category_name, "sortby", sortby)
def start_game(): print(id) test = s.Sort(id, numberofvalues, speed) while True: test.start_sort() pygame.display.update()
def getSortsDebutCombat(lvl): """@summary: charge les sorts de début combat @return: List <Sort> """ # pylint: disable=unused-argument sortsDebutCombat = [] activationFinDesTemps = Sort.Sort( "Fin des temps", 0, 0, 0, 0, [ EffetDegats(0, 0, "air", zone=Zones.TypeZoneCercle(3), cibles_possibles="Ennemis"), EffetTue(cibles_possibles="Lanceur") ], [], 0, 99, 99, 0, 0, "cercle", False, chaine=False) sortsDebutCombat.append( Sort.Sort( "Synchronisation", 0, 0, 0, 0, [ EffetEtatSelf( EtatEffetSiTFGenere("Synchronisation", 0, -1, [ EffetEtatSelfTF(EtatBoostBaseDegLvlBased( "toReplace", 0, -1, "Fin des temps", 190), "Rembobinage", cumulMax=1, etat_requis="!DejaBoost"), EffetEtatSelfTF(Etat("DejaBoost", 0, 1), "Rembobinage", remplaceNom=False, cumulMax=1) ], "Téléfrageur", "porteur", "porteur")), EffetEtatSelf( EtatEffetSiTFGenere( "Attente de la fin des temps", 0, -1, EffetEntiteLanceSort( "Synchro", activationFinDesTemps), "Téléfrageur", "porteur", "porteur", True, "Rembobinage")) ], [], 0, 99, 99, 0, 0, "cercle", False, description="""""", chaine=False)) return sortsDebutCombat
import cv2 as cv import math from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D import pandas as pd from Sort import * tracker = Sort() memory = {} def select_obj(img, window_name): # cv.namedWindow(window_name, cv.WINDOW_AUTOSIZE) r = cv.selectROI(window_name, img) return r def region_resize(img, r, size): # print(img) imgCrop = img[int(r[1]):int(r[1] + r[3]), int(r[0]):int(r[0] + r[2])] imgCrop = cv.resize(imgCrop, size) return imgCrop def draw_obj(img, video_frame): """ output all the bounding box in a frame """