bugged
stringlengths 4
228k
| fixed
stringlengths 0
96.3M
| __index_level_0__
int64 0
481k
|
---|---|---|
def buildPatch(self,log,progress): """Edits patch file as desired. Should write to log.""" pass
|
def buildPatch(self,log,progress): """Edits patch file as desired. Should write to log.""" pass
| 478,900 |
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) if self.isEnabled: self.patchFile.aliases = self.aliases
|
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) if self.isEnabled: self.patchFile.aliases = self.aliases
| 478,901 |
def saveConfig(self,configs): """Save config to configs dictionary.""" ListPatcher.saveConfig(self,configs) if self.isEnabled: importedMods = [item for item,value in self.configChecks.iteritems() if value and reModExt.search(item.s)] configs['ImportedMods'].update(importedMods)
|
def saveConfig(self,configs): """Save config to configs dictionary.""" ListPatcher.saveConfig(self,configs) if self.isEnabled: importedMods = [item for item,value in self.configChecks.iteritems() if value and reModExt.search(item.s)] configs['ImportedMods'].update(importedMods)
| 478,902 |
def importCellBlockData(cellBlock): if not cellBlock.cell.flags1.ignored: fid = cellBlock.cell.fid if fid not in cellData: cellData[fid] = {} cellData[fid+('flags',)] = {} for attr in attrs: cellData[fid][attr] = cellBlock.cell.__getattribute__(attr) for flag in flags: cellData[fid+('flags',)][flag] = cellBlock.cell.flags.__getattr__(flag)
|
def importCellBlockData(cellBlock): if not cellBlock.cell.flags1.ignored: fid = cellBlock.cell.fid if fid not in cellData: cellData[fid] = {} cellData[fid+('flags',)] = {} for attr in attrs: if tempCellData[fid][attr] != cellBlock.cell.__getattribute__(attr): cellData[fid][attr] = tempCellData[fid][attr] for flag in flags: cellData[fid+('flags',)][flag] = cellBlock.cell.flags.__getattr__(flag)
| 478,903 |
def importCellBlockData(cellBlock): if not cellBlock.cell.flags1.ignored: fid = cellBlock.cell.fid if fid not in cellData: cellData[fid] = {} cellData[fid+('flags',)] = {} for attr in attrs: cellData[fid][attr] = cellBlock.cell.__getattribute__(attr) for flag in flags: cellData[fid+('flags',)][flag] = cellBlock.cell.flags.__getattr__(flag)
|
def importCellBlockData(cellBlock): if not cellBlock.cell.flags1.ignored: fid = cellBlock.cell.fid if fid not in cellData: cellData[fid] = {} cellData[fid+('flags',)] = {} for attr in attrs: cellData[fid][attr] = cellBlock.cell.__getattribute__(attr) for flag in flags: cellData[fid+('flags',)][flag] = cellBlock.cell.flags.__getattr__(flag)
| 478,904 |
def importCellBlockData(cellBlock): if not cellBlock.cell.flags1.ignored: fid = cellBlock.cell.fid if fid not in cellData: cellData[fid] = {} cellData[fid+('flags',)] = {} for attr in attrs: cellData[fid][attr] = cellBlock.cell.__getattribute__(attr) for flag in flags: cellData[fid+('flags',)][flag] = cellBlock.cell.flags.__getattr__(flag)
|
def importCellBlockData(cellBlock): if not cellBlock.cell.flags1.ignored: fid = cellBlock.cell.fid if fid not in cellData: cellData[fid] = {} cellData[fid+('flags',)] = {} for attr in attrs: cellData[fid][attr] = cellBlock.cell.__getattribute__(attr) for flag in flags: cellData[fid+('flags',)][flag] = cellBlock.cell.flags.__getattr__(flag)
| 478,905 |
def handleCellBlock(cellBlock): modified=False for attr,value in cellData[cellBlock.cell.fid].iteritems(): if cellBlock.cell.__getattribute__(attr) != value: cellBlock.cell.__setattr__(attr,value) modified=True for flag,value in cellData[cellBlock.cell.fid+('flags',)].iteritems(): if cellBlock.cell.flags.__getattr__(flag) != value: cellBlock.cell.flags.__setattr__(flag,value) modified=True if modified: cellBlock.cell.setChanged() keep(cellBlock.cell.fid) return modified
|
def handleCellBlock(cellBlock): modified=False for attr,value in cellData[cellBlock.cell.fid].iteritems(): if cellBlock.cell.__getattribute__(attr) != value: cellBlock.cell.__setattr__(attr,value) modified=True for flag,value in cellData[cellBlock.cell.fid+('flags',)].iteritems(): if cellBlock.cell.flags.__getattr__(flag) != value: cellBlock.cell.flags.__setattr__(flag,value) modified=True if modified: cellBlock.cell.setChanged() keep(cellBlock.cell.fid) return modified
| 478,906 |
def buildPatch(self,log,progress): """Merge last version of record with patched graphics data as needed.""" if not self.isActive: return modFile = self.patchFile keep = self.patchFile.getKeeper() id_data = self.id_data type_count = {} for recClass in self.srcClasses: type = recClass.classType if type not in modFile.tops: continue type_count[type] = 0 deprint(recClass,type,type_count[type]) for record in modFile.tops[type].records: fid = record.fid if fid not in id_data: continue for attr,value in id_data[fid].iteritems(): if record.__getattribute__(attr) != value: break else: continue for attr,value in id_data[fid].iteritems(): record.__setattr__(attr,value) keep(fid) type_count[type] += 1 log.setHeader('= '+self.__class__.name) log(_("=== Source Mods")) for mod in self.sourceMods: log("* " +mod.s) log(_("\n=== Modified Records")) for type,count in sorted(type_count.items()): if count: log("* %s: %d" % (type,count))
|
def buildPatch(self,log,progress): """Merge last version of record with patched graphics data as needed.""" if not self.isActive: return modFile = self.patchFile keep = self.patchFile.getKeeper() id_data = self.id_data type_count = {} for recClass in self.srcClasses: type = recClass.classType if type not in modFile.tops: continue type_count[type] = 0 deprint(recClass,type,type_count[type]) for record in modFile.tops[type].records: fid = record.fid if fid not in id_data: continue for attr,value in id_data[fid].iteritems(): if record.__getattribute__(attr) != value: break else: continue for attr,value in id_data[fid].iteritems(): record.__setattr__(attr,value) keep(fid) type_count[type] += 1 log.setHeader('= '+self.__class__.name) log(_("=== Source Mods")) for mod in self.sourceMods: log("* " +mod.s) log(_("\n=== Modified Records")) for type,count in sorted(type_count.items()): if count: log("* %s: %d" % (type,count))
| 478,907 |
def buildPatch(self,log,progress): """Make changes to patchfile.""" if not self.isActive: return modFile = self.patchFile keep = self.patchFile.getKeeper() id_factions= self.id_factions type_count = {} for type in self.activeTypes: if type not in modFile.tops: continue type_count[type] = 0 for record in modFile.tops[type].records: fid = record.fid if fid in id_factions: newFactions = set(id_factions[fid]) curFactions = set((x.faction,x.rank) for x in record.factions) changed = newFactions - curFactions if not changed: continue doKeep = False for faction,rank in changed: for entry in record.factions: if entry.faction == faction: if entry.rank != rank: entry.rank = rank doKeep = True keep(fid) break else: entry = MelObject() entry.faction = faction entry.rank = rank entry.unused1 = 'ODB' record.factions.append(entry) doKeep = True if doKeep: record.factions = [x for x in record.factions if x.rank != -1] type_count[type] += 1 keep(fid) log.setHeader('= '+self.__class__.name) log(_("=== Source Mods/Files")) for file in self.srcFiles: log("* " +file.s) log(_("\n=== Refactioned Actors")) for type,count in sorted(type_count.items()): if count: log("* %s: %d" % (type,count))
|
def buildPatch(self,log,progress): """Make changes to patchfile.""" if not self.isActive: return modFile = self.patchFile keep = self.patchFile.getKeeper() id_factions= self.id_factions type_count = {} for type in self.activeTypes: if type not in modFile.tops: continue type_count[type] = 0 for record in modFile.tops[type].records: fid = record.fid if fid in id_factions: newFactions = set(id_factions[fid]) curFactions = set((x.faction,x.rank) for x in record.factions) changed = newFactions - curFactions if not changed: continue doKeep = False for faction,rank in changed: for entry in record.factions: if entry.faction == faction: if entry.rank != rank: entry.rank = rank doKeep = True keep(fid) break else: entry = MelObject() entry.faction = faction entry.rank = rank entry.unused1 = 'ODB' record.factions.append(entry) doKeep = True if doKeep: record.factions = [x for x in record.factions if x.rank != -1] type_count[type] += 1 keep(fid) log.setHeader('= '+self.__class__.name) log(_("=== Source Mods/Files")) for file in self.srcFiles: log("* " +file.s) log(_("\n=== Refactioned Actors")) for type,count in sorted(type_count.items()): if count: log("* %s: %d" % (type,count))
| 478,908 |
def initData(self,progress): """Get graphics from source files.""" if not self.isActive: return id_data = self.id_data recAttrs_class = self.recAttrs_class loadFactory = LoadFactory(False,*recAttrs_class.keys()) longTypes = self.longTypes & set(x.classType for x in self.recAttrs_class) progress.setFull(len(self.sourceMods)) for index,srcMod in enumerate(self.sourceMods): if srcMod not in modInfos: continue srcInfo = modInfos[srcMod] srcFile = ModFile(srcInfo,loadFactory) srcFile.load(True) srcFile.convertToLongFids(longTypes) mapper = srcFile.getLongMapper() for recClass,recAttrs in recAttrs_class.iteritems(): if recClass.classType not in srcFile.tops: continue self.srcClasses.add(recClass) for record in srcFile.tops[recClass.classType].getActiveRecords(): fid = mapper(record.fid) id_data[fid] = dict((attr,record.__getattribute__(attr)) for attr in recAttrs) progress.plus() self.longTypes = self.longTypes & set(x.classType for x in self.srcClasses) self.isActive = bool(self.srcClasses)
|
def initData(self,progress): """Get graphics from source files.""" if not self.isActive: return id_data = self.id_data recAttrs_class = self.recAttrs_class loadFactory = LoadFactory(False,*recAttrs_class.keys()) longTypes = self.longTypes & set(x.classType for x in self.recAttrs_class) progress.setFull(len(self.sourceMods)) for index,srcMod in enumerate(self.sourceMods): if srcMod not in modInfos: continue srcInfo = modInfos[srcMod] srcFile = ModFile(srcInfo,loadFactory) srcFile.load(True) srcFile.convertToLongFids(longTypes) mapper = srcFile.getLongMapper() for recClass,recAttrs in recAttrs_class.iteritems(): if recClass.classType not in srcFile.tops: continue self.srcClasses.add(recClass) for record in srcFile.tops[recClass.classType].getActiveRecords(): fid = mapper(record.fid) temp_id_data[fid] = dict((attr,record.__getattribute__(attr)) for attr in recAttrs) for master in masters: if not master in modInfos: continue if master in cachedMasters: masterFile = cachedMasters[master] else: masterInfo = modInfos[master] masterFile = ModFile(masterInfo,loadFactory) masterFile.load(True) masterFile.convertToLongFids(longTypes) cachedMasters[master] = masterFile mapper = masterFile.getLongMapper() for recClass,recAttrs in recAttrs_class.iteritems(): if recClass.classType not in masterFile.tops: continue if recClass not in self.classestemp: continue for record in masterFile.tops[recClass.classType].getActiveRecords(): fid = mapper(record.fid) if fid not in temp_id_data: continue for attr, value in temp_id_data[fid].iteritems(): if value == record.__getattribute__(attr): continue else: if fid not in id_data: id_data[fid] = dict() try: id_data[fid][attr] = temp_id_data[fid][attr] except KeyError: id_data[fid].setdefault(attr,value) progress.plus() self.longTypes = self.longTypes & set(x.classType for x in self.srcClasses) self.isActive = bool(self.srcClasses)
| 478,909 |
def buildPatch(self,log,progress): """Merge last version of record with patched graphics data as needed.""" if not self.isActive: return modFile = self.patchFile keep = self.patchFile.getKeeper() id_data = self.id_data type_count = {} for recClass in self.srcClasses: type = recClass.classType if type not in modFile.tops: continue type_count[type] = 0 #deprint(recClass,type,type_count[type]) for record in modFile.tops[type].records: fid = record.fid if fid not in id_data: continue for attr,value in id_data[fid].iteritems(): if record.__getattribute__(attr) != value: break else: continue for attr,value in id_data[fid].iteritems(): record.__setattr__(attr,value) keep(fid) type_count[type] += 1 log.setHeader('= '+self.__class__.name) log(_("=== Source Mods")) for mod in self.sourceMods: log("* " +mod.s) log(_("\n=== Modified Records")) for type,count in sorted(type_count.items()): if count: log("* %s: %d" % (type,count))
|
def buildPatch(self,log,progress): """Merge last version of record with patched graphics data as needed.""" if not self.isActive: return modFile = self.patchFile keep = self.patchFile.getKeeper() id_data = self.id_data type_count = {} for recClass in self.srcClasses: type = recClass.classType if type not in modFile.tops: continue type_count[type] = 0 #deprint(recClass,type,type_count[type]) for record in modFile.tops[type].records: fid = record.fid if fid not in id_data: continue for attr,value in id_data[fid].iteritems(): if record.__getattribute__(attr) != value: break else: continue for attr,value in id_data[fid].iteritems(): record.__setattr__(attr,value) keep(fid) type_count[type] += 1 log.setHeader('= '+self.__class__.name) log(_("=== Source Mods")) for mod in self.sourceMods: log("* " +mod.s) log(_("\n=== Modified Records")) for type,count in sorted(type_count.items()): if count: log("* %s: %d" % (type,count))
| 478,910 |
def buildPatch(self,log,progress): """Merge last version of record with patched graphics data as needed.""" if not self.isActive: return modFile = self.patchFile keep = self.patchFile.getKeeper() id_data = self.id_data type_count = {} for recClass in self.srcClasses: type = recClass.classType if type not in modFile.tops: continue type_count[type] = 0 #deprint(recClass,type,type_count[type]) for record in modFile.tops[type].records: fid = record.fid if fid not in id_data: continue for attr,value in id_data[fid].iteritems(): if record.__getattribute__(attr) != value: break else: continue for attr,value in id_data[fid].iteritems(): record.__setattr__(attr,value) keep(fid) type_count[type] += 1 log.setHeader('= '+self.__class__.name) log(_("=== Source Mods")) for mod in self.sourceMods: log("* " +mod.s) log(_("\n=== Modified Records")) for type,count in sorted(type_count.items()): if count: log("* %s: %d" % (type,count))
|
def buildPatch(self,log,progress): """Merge last version of record with patched graphics data as needed.""" if not self.isActive: return modFile = self.patchFile keep = self.patchFile.getKeeper() id_data = self.id_data type_count = {} for recClass in self.srcClasses: type = recClass.classType if type not in modFile.tops: continue type_count[type] = 0 #deprint(recClass,type,type_count[type]) for record in modFile.tops[type].records: fid = record.fid if fid not in id_data: continue for attr,value in id_data[fid].iteritems(): if record.__getattribute__(attr) != value: break else: continue for attr,value in id_data[fid].iteritems(): record.__setattr__(attr,value) keep(fid) type_count[type] += 1 log.setHeader('= '+self.__class__.name) log(_("=== Source Mods")) for mod in self.sourceMods: log("* " +mod.s) log(_("\n=== Modified Records")) for type,count in sorted(type_count.items()): if count: log("* %s: %d" % (type,count))
| 478,911 |
def buildPatch(self,log,progress): """Applies delta to patchfile.""" if not self.isActive: return keep = self.patchFile.getKeeper() id_deltas = self.id_deltas mod_count = {} for type in ('NPC_','CREA','CONT'): for record in getattr(self.patchFile,type).records: changed = False deltas = id_deltas.get(record.fid) if not deltas: continue removable = set(x.item for x in record.items) for removeItems,addEntries in reversed(deltas): if removeItems: #--Skip if some items to be removed have already been removed if not removeItems.issubset(removable): continue record.items = [x for x in record.items if x.item not in removeItems] removable -= removeItems changed = True if addEntries: current = set(x.item for x in record.items) for entry in addEntries: if entry.item not in current: record.items.append(entry) changed = True if changed: keep(record.fid) mod = record.fid[0] mod_count[mod] = mod_count.get(mod,0) + 1 #--Log log.setHeader('= '+self.__class__.name) log(_("=== Source Mods")) for mod in self.srcMods: log("* " +mod.s) log(_("\n=== Inventories Changed: %d") % (sum(mod_count.values()),)) for mod in modInfos.getOrdered(mod_count): log('* %s: %3d' % (mod.s,mod_count[mod]))
|
def buildPatch(self,log,progress): """Applies delta to patchfile.""" if not self.isActive: return keep = self.patchFile.getKeeper() id_deltas = self.id_deltas mod_count = {} for type in ('NPC_','CREA','CONT'): for record in getattr(self.patchFile,type).records: changed = False deltas = id_deltas.get(record.fid) if not deltas: continue removable = set(x.item for x in record.items) for removeItems,addEntries in reversed(deltas): if removeItems: #--Skip if some items to be removed have already been removed if not removeItems.issubset(removable): continue record.items = [x for x in record.items if x.item not in removeItems] removable -= removeItems changed = True if addEntries: current = set(x.item for x in record.items) for entry in addEntries: if entry.item not in current: record.items.append(entry) changed = True if changed: keep(record.fid) mod = record.fid[0] mod_count[mod] = mod_count.get(mod,0) + 1 #--Log log.setHeader('= '+self.__class__.name) log(_("=== Source Mods")) for mod in self.srcMods: log("* " +mod.s) log(_("\n=== Inventories Changed: %d") % (sum(mod_count.values()),)) for mod in modInfos.getOrdered(mod_count): log('* %s: %3d' % (mod.s,mod_count[mod]))
| 478,912 |
def buildPatch(self,log,progress): """Edits patch file as desired. Will write to log.""" if not self.isActive: return count = {} keep = self.patchFile.getKeeper() for record in self.patchFile.NPC_.records: race = record.race model = record.model if (model.modPath != 'Characters\_male\SkeletonBeast.nif' and model.modPath != 'Characters\_male\SkeletonBeast.NIF' ): if (race == 0x3cdc or race == 0x5b54 ): model.modPath = 'Characters\_male\SkeletonBeast.nif' model.modb_p = None #?? model.modt_p = None #?? elif record.model.modPath == 'Characters\_male\SkeletonBeast.nif': if race in (0x224fc,0x191c1,0x19204,0x00907,0x224fd,0x00d43,0x00019,0x223c8): model.modPath = 'Characters\_male\Skeleton.nif' model.modb_p = None #?? model.modt_p = None #?? keep(record.fid) srcMod = record.fid[0] count[srcMod] = count.get(srcMod,0) + 1 #--Log log.setHeader('= '+self.__class__.name) log(_('* %d Skeletons Tweaked') % (sum(count.values()),)) for srcMod in sorted(count.keys()): log(' * %3d %s' % (count[srcMod],srcMod))
|
def buildPatch(self,log,progress): """Edits patch file as desired. Will write to log.""" if not self.isActive: return count = {} keep = self.patchFile.getKeeper() for record in self.patchFile.NPC_.records: race = record.race model = record.model if (model.modPath != 'Characters\_male\SkeletonBeast.nif' and model.modPath != 'Characters\_male\SkeletonBeast.NIF' ): if (race == 0x3cdc or race == 0x5b54 ): model.modPath = 'Characters\_male\SkeletonBeast.nif' model.modb_p = None #?? model.modt_p = None #?? elif record.model.modPath == 'Characters\_male\SkeletonBeast.nif': if race in (0x224fc,0x191c1,0x19204,0x00907,0x224fd,0x00d43,0x00019,0x223c8): model.modPath = 'Characters\_male\Skeleton.nif' model.modb_p = None #?? model.modt_p = None #?? keep(record.fid) srcMod = record.fid[0] count[srcMod] = count.get(srcMod,0) + 1 #--Log log.setHeader('= '+self.__class__.name) log(_('* %d Skeletons Tweaked') % (sum(count.values()),)) for srcMod in sorted(count.keys()): log(' * %3d %s' % (count[srcMod],srcMod))
| 478,913 |
def buildPatch(self,log,progress): """Adds merged lists to patchfile.""" if not self.isActive: return keep = self.patchFile.getKeeper() worldsPatched = set() for worldBlock in self.patchFile.WRLD.worldBlocks: worldId = worldBlock.world.fid curRoad = worldBlock.road newRoad = self.world_road.get(worldId) if newRoad and (not curRoad or curRoad.points_p != newRoad.points_p or curRoad.connections_p != newRoad.connections_p ): worldBlock.road = newRoad keep(worldId) keep(newRoad.fid) worldsPatched.add((worldId[0].s,worldBlock.world.eid)) log.setHeader('= '+self.__class__.name) log(_("=== Source Mods")) for mod in self.sourceMods: log("* " +mod.s) log(_("\n=== Worlds Patched")) for modWorld in sorted(worldsPatched): log('* %s: %s' % modWorld)
|
def buildPatch(self,log,progress): """Adds merged lists to patchfile.""" if not self.isActive: return keep = self.patchFile.getKeeper() worldsPatched = set() for worldBlock in self.patchFile.WRLD.worldBlocks: worldId = worldBlock.world.fid curRoad = worldBlock.road newRoad = self.world_road.get(worldId) if newRoad and (not curRoad or curRoad.points_p != newRoad.points_p or curRoad.connections_p != newRoad.connections_p ): worldBlock.road = newRoad keep(worldId) keep(newRoad.fid) worldsPatched.add((worldId[0].s,worldBlock.world.eid)) log.setHeader('= '+self.__class__.name) log(_("=== Source Mods")) for mod in self.sourceMods: log("* " +mod.s) log(_("\n=== Worlds Patched")) for modWorld in sorted(worldsPatched): log('* %s: %s' % modWorld)
| 478,914 |
def buildPatch(self,log,progress): """Merge last version of record with patched sound data as needed.""" if not self.isActive: return modFile = self.patchFile keep = self.patchFile.getKeeper() id_data = self.id_data type_count = {} for recClass in self.srcClasses: type = recClass.classType if type not in modFile.tops: continue type_count[type] = 0 #deprint(recClass,type,type_count[type]) for record in modFile.tops[type].records: fid = record.fid if fid not in id_data: continue for attr,value in id_data[fid].items(): if record.__getattribute__(attr) != value: break else: continue for attr,value in id_data[fid].items(): record.__setattr__(attr,value) keep(fid) type_count[type] += 1 log.setHeader('= '+self.__class__.name) log(_("=== Source Mods")) for mod in self.sourceMods: log("* " +mod.s) log(_("\n=== Modified Records")) for type,count in sorted(type_count.items()): if count: log("* %s: %d" % (type,count))
|
def buildPatch(self,log,progress): """Merge last version of record with patched sound data as needed.""" if not self.isActive: return modFile = self.patchFile keep = self.patchFile.getKeeper() id_data = self.id_data type_count = {} for recClass in self.srcClasses: type = recClass.classType if type not in modFile.tops: continue type_count[type] = 0 #deprint(recClass,type,type_count[type]) for record in modFile.tops[type].records: fid = record.fid if fid not in id_data: continue for attr,value in id_data[fid].items(): if record.__getattribute__(attr) != value: break else: continue for attr,value in id_data[fid].items(): record.__setattr__(attr,value) keep(fid) type_count[type] += 1 log.setHeader('= '+self.__class__.name) log(_("=== Source Mods")) for mod in self.sourceMods: log("* " +mod.s) log(_("\n=== Modified Records")) for type,count in sorted(type_count.items()): if count: log("* %s: %d" % (type,count))
| 478,915 |
def buildPatch(self,log,progress): """Adds merged lists to patchfile.""" if not self.isActive: return patchFile = self.patchFile keep = self.patchFile.getKeeper() id_stat = self.id_stat allCounts = [] for type in self.activeTypes: if type not in patchFile.tops: continue typeFields = self.typeFields[type] count,counts = 0,{} for record in patchFile.tops[type].records: fid = record.fid stats = id_stat.get(fid) if not stats: continue modStats = tuple(record.__getattribute__(attr) for attr in typeFields) if modStats == stats[1:]: continue for attr,value in zip(typeFields,stats[1:]): record.__setattr__(attr,value) keep(fid) count += 1 counts[fid[0]] = 1 + counts.get(fid[0],0) allCounts.append((type,count,counts)) log.setHeader('= '+self.__class__.name) log(_("=== Source Mods/Files")) for file in self.srcFiles: log("* " +file.s) log(_("\n=== Modified Stats")) for type,count,counts in allCounts: if not count: continue typeName = {'ALCH':_('alch'),'AMMO':_('Ammo'),'ARMO':_('Armor'),'INGR':_('Ingr'),'MISC':_('Misc'),'WEAP':_('Weapons'),'SLGM':_('Soulgem'),'SGST':_('Sigil Stone'),'LIGH':_('Lights'),'KEYM':_('Keys'),'CLOT':_('Clothes'),'BOOK':_('Books'),'APPA':_('Apparatus')}[type] log("* %s: %d" % (typeName,count)) for modName in sorted(counts): log(" * %s: %d" % (modName.s,counts[modName]))
|
def buildPatch(self,log,progress): """Adds merged lists to patchfile.""" if not self.isActive: return patchFile = self.patchFile keep = self.patchFile.getKeeper() id_stat = self.id_stat allCounts = [] for type in self.activeTypes: if type not in patchFile.tops: continue typeFields = self.typeFields[type] count,counts = 0,{} for record in patchFile.tops[type].records: fid = record.fid stats = id_stat.get(fid) if not stats: continue modStats = tuple(record.__getattribute__(attr) for attr in typeFields) if modStats == stats[1:]: continue for attr,value in zip(typeFields,stats[1:]): record.__setattr__(attr,value) keep(fid) count += 1 counts[fid[0]] = 1 + counts.get(fid[0],0) allCounts.append((type,count,counts)) log.setHeader('= '+self.__class__.name) log(_("=== Source Mods/Files")) for file in self.srcFiles: log("* " +file.s) log(_("\n=== Modified Stats")) for type,count,counts in allCounts: if not count: continue typeName = {'ALCH':_('alch'),'AMMO':_('Ammo'),'ARMO':_('Armor'),'INGR':_('Ingr'),'MISC':_('Misc'),'WEAP':_('Weapons'),'SLGM':_('Soulgem'),'SGST':_('Sigil Stone'),'LIGH':_('Lights'),'KEYM':_('Keys'),'CLOT':_('Clothes'),'BOOK':_('Books'),'APPA':_('Apparatus')}[type] log("* %s: %d" % (typeName,count)) for modName in sorted(counts): log(" * %s: %d" % (modName.s,counts[modName]))
| 478,916 |
def getBook(objectId,eid,full,value,iconPath,modelPath,modb_p): book = MreBook(('BOOK',0,0,0,0)) book.longFids = True book.changed = True book.eid = eid book.full = full book.value = value book.weight = 0.2 book.fid = keep((GPath('Cobl Main.esm'),objectId)) book.text = '<div align="left"><font face=3 color=4444>' book.text += _("Salan's Catalog of %s\r\n\r\n") % full book.iconPath = iconPath book.model = book.getDefault('model') book.model.modPath = modelPath book.model.modb_p = modb_p book.modb = book self.patchFile.BOOK.setRecord(book) return book
|
def getBook(objectId,eid,full,value,iconPath,modelPath,modb_p): book = MreBook(('BOOK',0,0,0,0)) book.longFids = True book.changed = True book.eid = eid book.full = full book.value = value book.weight = 0.2 book.fid = keep((GPath('Cobl Main.esm'),objectId)) book.text = '<div align="left"><font face=3 color=4444>' book.text += _("Salan's Catalog of %s\r\n\r\n") % full book.iconPath = iconPath book.model = book.getDefault('model') book.model.modPath = modelPath book.model.modb_p = modb_p book.modb = book self.patchFile.BOOK.setRecord(book) return book
| 478,917 |
def loadData(self,record,ins,type,size,readId): if size == 48: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 40: unpacked = ins.unpack('10I',size,readId) elif size == 36: unpacked = ins.unpack('9I',size,readId) else: raise "Unexpected size encountered for IPDS:DATA subrecord: %s" % size unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
|
def loadData(self,record,ins,type,size,readId): if size == 48: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 40: unpacked = ins.unpack('10I',size,readId) elif size == 36: unpacked = ins.unpack('9I',size,readId) else: raise "Unexpected size encountered for IPDS:DATA subrecord: %s" % size unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
| 478,918 |
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreMgef,): recAttrs_class[recClass] = ('castingSound','boltSound','hitSound','areaSound') for recClass in (MreActi,MreLigh): recAttrs_class[recClass] = ('sound',) for recClass in (MreWthr,): recAttrs_class[recClass] = ('sound','sounds') for recClass in (MreCont,): recAttrs_class[recClass] = ('soundOpen','soundClose') for recClass in (MreDoor,): recAttrs_class[recClass] = ('soundOpen','soundClose','soundLoop') #--Needs Longs self.longTypes = set(('MGEF','ACTI','LIGH','WTHR','CONT','DOOR'))
|
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreMgef,): recAttrs_class[recClass] = ('castingSound','boltSound','hitSound','areaSound') for recClass in (MreActi,MreLigh): recAttrs_class[recClass] = ('soundLooping','soundActivation') for recClass in (MreWthr,): recAttrs_class[recClass] = ('sound','sounds') for recClass in (MreCont,): recAttrs_class[recClass] = ('soundOpen','soundClose') for recClass in (MreDoor,): recAttrs_class[recClass] = ('soundOpen','soundClose','soundLoop') #--Needs Longs self.longTypes = set(('MGEF','ACTI','LIGH','WTHR','CONT','DOOR'))
| 478,919 |
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreMgef,): recAttrs_class[recClass] = ('castingSound','boltSound','hitSound','areaSound') for recClass in (MreActi,MreLigh): recAttrs_class[recClass] = ('sound',) for recClass in (MreWthr,): recAttrs_class[recClass] = ('sound','sounds') for recClass in (MreCont,): recAttrs_class[recClass] = ('soundOpen','soundClose') for recClass in (MreDoor,): recAttrs_class[recClass] = ('soundOpen','soundClose','soundLoop') #--Needs Longs self.longTypes = set(('MGEF','ACTI','LIGH','WTHR','CONT','DOOR'))
|
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreMgef,): recAttrs_class[recClass] = ('castingSound','boltSound','hitSound','areaSound') for recClass in (MreActi,MreLigh): recAttrs_class[recClass] = ('sound',) for recClass in (MreWthr,): recAttrs_class[recClass] = ('sound','sounds') for recClass in (MreCont,): recAttrs_class[recClass] = ('soundOpen','soundClose') for recClass in (MreDoor,): recAttrs_class[recClass] = ('soundOpen','soundClose','soundLoop') #--Needs Longs self.longTypes = set(('MGEF','ACTI','LIGH','WTHR','CONT','DOOR'))
| 478,920 |
def __init__(self,attr='effects'): """Initialize elements.""" MelGroups.__init__(self,attr, MelStruct('EFID','4s',('name','REHE')), MelStruct('EFIT','5i','magnitude','area','duration','recipient','actorValue'), # MelGroup('scriptEffect', # MelEffects.MelEffectsScit(), # MelString('FULL','full'), # ), MelConditions(), )
|
def __init__(self,attr='effects'): """Initialize elements.""" MelGroups.__init__(self,attr, MelFid('EFID','baseEffect'), MelStruct('EFIT','5i','magnitude','area','duration','recipient','actorValue'), # MelGroup('scriptEffect', # MelEffects.MelEffectsScit(), # MelString('FULL','full'), # ), MelConditions(), )
| 478,921 |
# def __init__(self,attr='model',index=0):
|
# def __init__(self,attr='model',index=0):
| 478,922 |
# def __init__(self,attr='model',index=0):
|
# def __init__(self,attr='model',index=0):
| 478,923 |
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, armor, books, ingredients, keys, lights, misc, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','ARMO','BOOK','INGR','KEYM','LIGH','MISC','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(speed, value, clipRounds) zip((sfloat,int,int),fields[4:7])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, ar) zip((sfloat,int,int,int),fields[4:8])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((sfloat,int,int,),fields[4:7])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, clipsize, #-- reach, ammoUse, minSpread, spread, sightFov, baseVatsToHitChance, projectileCount, #-- minRange, maxRange, fireRate, overrideActionPoint, rumbleLeftMotorStrength, #-- rumbleRightMotorStrength, rumbleDuration, overrideDamageToWeaponMult, attackShotsPerSec, #-- reloadTime, jamTime, aimArc, rambleWavelangth, limbDmgMult, sightUsage, #-- semiAutomaticFireDelayMin, semiAutomaticFireDelayMax, criticalDamage, criticalMultiplier) zip((sfloat,int,int,int,int, sfloat,int,sfloat,sfloat,sfloat,int,int, sfloat,sfloat,sfloat,sfloat,sfloat, sfloat,sfloat,sfloat,sfloat, sfloat,sfloat,sfloat,sfloat,sfloat,sfloat, sfloat,sfloat,int,sfloat),fields[4:35])) ins.close()
|
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, armor, books, ingredients, keys, lights, misc, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','ARMO','BOOK','INGR','KEYM','LIGH','MISC','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(speed, value, clipRounds) zip((sfloat,int,int),fields[4:7])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, ar) zip((sfloat,int,int,int),fields[4:8])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((sfloat,int,int),fields[4:7])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, clipsize, #-- reach, ammoUse, minSpread, spread, sightFov, baseVatsToHitChance, projectileCount, #-- minRange, maxRange, fireRate, overrideActionPoint, rumbleLeftMotorStrength, #-- rumbleRightMotorStrength, rumbleDuration, overrideDamageToWeaponMult, attackShotsPerSec, #-- reloadTime, jamTime, aimArc, rambleWavelangth, limbDmgMult, sightUsage, #-- semiAutomaticFireDelayMin, semiAutomaticFireDelayMax, criticalDamage, criticalMultiplier) zip((sfloat,int,int,int,int, sfloat,int,sfloat,sfloat,sfloat,int,int, sfloat,sfloat,sfloat,sfloat,sfloat, sfloat,sfloat,sfloat,sfloat, sfloat,sfloat,sfloat,sfloat,sfloat,sfloat, sfloat,sfloat,int,sfloat),fields[4:35])) ins.close()
| 478,924 |
def __init__(self,types=None,aliases=None): """Initialize.""" #--type_stats[type] = ... #--AMMO: (eid, weight, value, damage, speed, epoints) #--ARMO: (eid, weight, value, health, strength) #--WEAP: (eid, weight, value, health, damage, speed, reach, epoints) self.type_stats = {'ALCH':{},'AMMO':{},'APPA':{},'ARMO':{},'BOOK':{},'CLOT':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'SGST':{},'SLGM':{},'WEAP':{}} self.type_attrs = { 'ALCH':('value', 'eid', 'full'), 'AMMO':('value', 'eid', 'full'), 'APPA':('value', 'eid', 'full'), 'ARMO':('value', 'eid', 'full'), 'BOOK':('value', 'eid', 'full'), 'CLOT':('value', 'eid', 'full'), 'INGR':('value', 'eid', 'full'), 'KEYM':('value', 'eid', 'full'), 'LIGH':('value', 'eid', 'full'), 'MISC':('value', 'eid', 'full'), 'SGST':('value', 'eid', 'full'), 'SLGM':('value', 'eid', 'full'), 'WEAP':('value', 'eid', 'full'), } self.aliases = aliases or {} #--For aliasing mod names
|
def __init__(self,types=None,aliases=None): """Initialize.""" #--type_stats[type] = ... #--AMMO: (eid, weight, value, damage, speed, epoints) #--ARMO: (eid, weight, value, health, strength) #--WEAP: (eid, weight, value, health, damage, speed, reach, epoints) self.type_stats = {'ALCH':{},'AMMO':{},'ARMO':{},'BOOK':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'WEAP':{}} self.type_attrs = { 'ALCH':('value', 'eid', 'full'), 'AMMO':('value', 'eid', 'full'), 'APPA':('value', 'eid', 'full'), 'ARMO':('value', 'eid', 'full'), 'BOOK':('value', 'eid', 'full'), 'CLOT':('value', 'eid', 'full'), 'INGR':('value', 'eid', 'full'), 'KEYM':('value', 'eid', 'full'), 'LIGH':('value', 'eid', 'full'), 'MISC':('value', 'eid', 'full'), 'SGST':('value', 'eid', 'full'), 'SLGM':('value', 'eid', 'full'), 'WEAP':('value', 'eid', 'full'), } self.aliases = aliases or {} #--For aliasing mod names
| 478,925 |
def __init__(self,types=None,aliases=None): """Initialize.""" #--type_stats[type] = ... #--AMMO: (eid, weight, value, damage, speed, epoints) #--ARMO: (eid, weight, value, health, strength) #--WEAP: (eid, weight, value, health, damage, speed, reach, epoints) self.type_stats = {'ALCH':{},'AMMO':{},'APPA':{},'ARMO':{},'BOOK':{},'CLOT':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'SGST':{},'SLGM':{},'WEAP':{}} self.type_attrs = { 'ALCH':('value', 'eid', 'full'), 'AMMO':('value', 'eid', 'full'), 'APPA':('value', 'eid', 'full'), 'ARMO':('value', 'eid', 'full'), 'BOOK':('value', 'eid', 'full'), 'CLOT':('value', 'eid', 'full'), 'INGR':('value', 'eid', 'full'), 'KEYM':('value', 'eid', 'full'), 'LIGH':('value', 'eid', 'full'), 'MISC':('value', 'eid', 'full'), 'SGST':('value', 'eid', 'full'), 'SLGM':('value', 'eid', 'full'), 'WEAP':('value', 'eid', 'full'), } self.aliases = aliases or {} #--For aliasing mod names
|
def __init__(self,types=None,aliases=None): """Initialize.""" #--type_stats[type] = ... #--AMMO: (eid, weight, value, damage, speed, epoints) #--ARMO: (eid, weight, value, health, strength) #--WEAP: (eid, weight, value, health, damage, speed, reach, epoints) self.type_stats = {'ALCH':{},'AMMO':{},'APPA':{},'ARMO':{},'BOOK':{},'CLOT':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'SGST':{},'SLGM':{},'WEAP':{}} self.type_attrs = { 'ALCH':('value', 'eid', 'full'), 'AMMO':('value', 'eid', 'full'), 'ARMO':('value', 'eid', 'full'), 'BOOK':('value', 'eid', 'full'), 'CLOT':('value', 'eid', 'full'), 'INGR':('value', 'eid', 'full'), 'KEYM':('value', 'eid', 'full'), 'LIGH':('value', 'eid', 'full'), 'MISC':('value', 'eid', 'full'), 'SGST':('value', 'eid', 'full'), 'SLGM':('value', 'eid', 'full'), 'WEAP':('value', 'eid', 'full'), } self.aliases = aliases or {} #--For aliasing mod names
| 478,926 |
def __init__(self,types=None,aliases=None): """Initialize.""" #--type_stats[type] = ... #--AMMO: (eid, weight, value, damage, speed, epoints) #--ARMO: (eid, weight, value, health, strength) #--WEAP: (eid, weight, value, health, damage, speed, reach, epoints) self.type_stats = {'ALCH':{},'AMMO':{},'APPA':{},'ARMO':{},'BOOK':{},'CLOT':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'SGST':{},'SLGM':{},'WEAP':{}} self.type_attrs = { 'ALCH':('value', 'eid', 'full'), 'AMMO':('value', 'eid', 'full'), 'APPA':('value', 'eid', 'full'), 'ARMO':('value', 'eid', 'full'), 'BOOK':('value', 'eid', 'full'), 'CLOT':('value', 'eid', 'full'), 'INGR':('value', 'eid', 'full'), 'KEYM':('value', 'eid', 'full'), 'LIGH':('value', 'eid', 'full'), 'MISC':('value', 'eid', 'full'), 'SGST':('value', 'eid', 'full'), 'SLGM':('value', 'eid', 'full'), 'WEAP':('value', 'eid', 'full'), } self.aliases = aliases or {} #--For aliasing mod names
|
def __init__(self,types=None,aliases=None): """Initialize.""" #--type_stats[type] = ... #--AMMO: (eid, weight, value, damage, speed, epoints) #--ARMO: (eid, weight, value, health, strength) #--WEAP: (eid, weight, value, health, damage, speed, reach, epoints) self.type_stats = {'ALCH':{},'AMMO':{},'APPA':{},'ARMO':{},'BOOK':{},'CLOT':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'SGST':{},'SLGM':{},'WEAP':{}} self.type_attrs = { 'ALCH':('value', 'eid', 'full'), 'AMMO':('value', 'eid', 'full'), 'APPA':('value', 'eid', 'full'), 'ARMO':('value', 'eid', 'full'), 'BOOK':('value', 'eid', 'full'), 'INGR':('value', 'eid', 'full'), 'KEYM':('value', 'eid', 'full'), 'LIGH':('value', 'eid', 'full'), 'MISC':('value', 'eid', 'full'), 'SGST':('value', 'eid', 'full'), 'SLGM':('value', 'eid', 'full'), 'WEAP':('value', 'eid', 'full'), } self.aliases = aliases or {} #--For aliasing mod names
| 478,927 |
def __init__(self,types=None,aliases=None): """Initialize.""" #--type_stats[type] = ... #--AMMO: (eid, weight, value, damage, speed, epoints) #--ARMO: (eid, weight, value, health, strength) #--WEAP: (eid, weight, value, health, damage, speed, reach, epoints) self.type_stats = {'ALCH':{},'AMMO':{},'APPA':{},'ARMO':{},'BOOK':{},'CLOT':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'SGST':{},'SLGM':{},'WEAP':{}} self.type_attrs = { 'ALCH':('value', 'eid', 'full'), 'AMMO':('value', 'eid', 'full'), 'APPA':('value', 'eid', 'full'), 'ARMO':('value', 'eid', 'full'), 'BOOK':('value', 'eid', 'full'), 'CLOT':('value', 'eid', 'full'), 'INGR':('value', 'eid', 'full'), 'KEYM':('value', 'eid', 'full'), 'LIGH':('value', 'eid', 'full'), 'MISC':('value', 'eid', 'full'), 'SGST':('value', 'eid', 'full'), 'SLGM':('value', 'eid', 'full'), 'WEAP':('value', 'eid', 'full'), } self.aliases = aliases or {} #--For aliasing mod names
|
def __init__(self,types=None,aliases=None): """Initialize.""" #--type_stats[type] = ... #--AMMO: (eid, weight, value, damage, speed, epoints) #--ARMO: (eid, weight, value, health, strength) #--WEAP: (eid, weight, value, health, damage, speed, reach, epoints) self.type_stats = {'ALCH':{},'AMMO':{},'APPA':{},'ARMO':{},'BOOK':{},'CLOT':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'SGST':{},'SLGM':{},'WEAP':{}} self.type_attrs = { 'ALCH':('value', 'eid', 'full'), 'AMMO':('value', 'eid', 'full'), 'APPA':('value', 'eid', 'full'), 'ARMO':('value', 'eid', 'full'), 'BOOK':('value', 'eid', 'full'), 'CLOT':('value', 'eid', 'full'), 'INGR':('value', 'eid', 'full'), 'KEYM':('value', 'eid', 'full'), 'LIGH':('value', 'eid', 'full'), 'MISC':('value', 'eid', 'full'), 'WEAP':('value', 'eid', 'full'), } self.aliases = aliases or {} #--For aliasing mod names
| 478,928 |
def readFromMod(self,modInfo): """Reads stats from specified mod.""" loadFactory= LoadFactory(False,MreAlch,MreAmmo,MreAppa,MreArmo,MreBook,MreClot,MreIngr,MreKeym,MreLigh,MreMisc,MreSgst,MreSlgm,MreWeap) modFile = ModFile(modInfo,loadFactory) modFile.load(True) mapper = modFile.getLongMapper() for type in self.type_stats: stats, attrs = self.type_stats[type], self.type_attrs[type] for record in getattr(modFile,type).getActiveRecords(): longid = mapper(record.fid) recordGetAttr = record.__getattribute__ stats[longid] = tuple(recordGetAttr(attr) for attr in attrs)
|
def readFromMod(self,modInfo): """Reads stats from specified mod.""" loadFactory= LoadFactory(False,MreAlch,MreAmmo,MreArmo,MreBook,MreIngr,MreKeym,MreLigh,MreMisc,MreWeap) modFile = ModFile(modInfo,loadFactory) modFile.load(True) mapper = modFile.getLongMapper() for type in self.type_stats: stats, attrs = self.type_stats[type], self.type_attrs[type] for record in getattr(modFile,type).getActiveRecords(): longid = mapper(record.fid) recordGetAttr = record.__getattribute__ stats[longid] = tuple(recordGetAttr(attr) for attr in attrs)
| 478,929 |
def writeToMod(self,modInfo): """Writes stats to specified mod.""" loadFactory= LoadFactory(True,MreAlch,MreAmmo,MreAppa,MreArmo,MreBook,MreClot,MreIngr,MreKeym,MreLigh,MreMisc,MreSgst,MreSlgm,MreWeap) modFile = ModFile(modInfo,loadFactory) modFile.load(True) mapper = modFile.getLongMapper() changed = {} #--changed[modName] = numChanged for type in self.type_stats: stats, attrs = self.type_stats[type], self.type_attrs[type] for record in getattr(modFile,type).getActiveRecords(): longid = mapper(record.fid) itemStats = stats.get(longid,None) if not itemStats: continue map(record.__setattr__,attrs,itemStats) record.setChanged() changed[longid[0]] = 1 + changed.get(longid[0],0) if changed: modFile.safeSave() return changed
|
def writeToMod(self,modInfo): """Writes stats to specified mod.""" loadFactory= LoadFactory(True,MreAlch,MreAmmo,MreArmo,MreBook,MreIngr,MreKeym,MreLigh,MreMisc,MreWeap) modFile = ModFile(modInfo,loadFactory) modFile.load(True) mapper = modFile.getLongMapper() changed = {} #--changed[modName] = numChanged for type in self.type_stats: stats, attrs = self.type_stats[type], self.type_attrs[type] for record in getattr(modFile,type).getActiveRecords(): longid = mapper(record.fid) itemStats = stats.get(longid,None) if not itemStats: continue map(record.__setattr__,attrs,itemStats) record.setChanged() changed[longid[0]] = 1 + changed.get(longid[0],0) if changed: modFile.safeSave() return changed
| 478,930 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,931 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,932 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,933 |
def __init__(self,types=None,aliases=None): """Initialize.""" self.type_stats = {'ALCH':{},'AMMO':{},'APPA':{},'ARMO':{},'BOOK':{},'CLOT':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'SGST':{},'SLGM':{},'WEAP':{}} self.type_attrs = { 'ALCH':('eid', 'full', 'weight', 'value', 'iconPath'), 'AMMO':('eid', 'full', 'weight', 'value', 'damage', 'speed', 'enchantPoints', 'iconPath'), 'APPA':('eid', 'full', 'weight', 'value', 'quality', 'iconPath'), 'ARMO':('eid', 'full', 'weight', 'value', 'health', 'strength', 'maleIconPath', 'femaleIconPath'), 'BOOK':('eid', 'full', 'weight', 'value', 'enchantPoints', 'iconPath'), 'CLOT':('eid', 'full', 'weight', 'value', 'enchantPoints', 'maleIconPath', 'femaleIconPath'), 'INGR':('eid', 'full', 'weight', 'value', 'iconPath'), 'KEYM':('eid', 'full', 'weight', 'value', 'iconPath'), 'LIGH':('eid', 'full', 'weight', 'value', 'duration', 'iconPath'), 'MISC':('eid', 'full', 'weight', 'value', 'iconPath'), 'SGST':('eid', 'full', 'weight', 'value', 'uses', 'iconPath'), 'SLGM':('eid', 'full', 'weight', 'value', 'iconPath'), 'WEAP':('eid', 'full', 'weight', 'value', 'health', 'damage', 'speed', 'reach', 'enchantPoints', 'iconPath'), } self.aliases = aliases or {} #--For aliasing mod fulls self.model = {} self.Mmodel = {} self.Fmodel = {} self.MGndmodel = {} self.FGndmodel = {}
|
def __init__(self,types=None,aliases=None): """Initialize.""" self.type_stats = {'ALCH':{},'AMMO':{},'ARMO':{},'BOOK':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'WEAP':{}} self.type_attrs = { 'ALCH':('eid', 'full', 'weight', 'value', 'iconPath'), 'AMMO':('eid', 'full', 'weight', 'value', 'damage', 'speed', 'enchantPoints', 'iconPath'), 'APPA':('eid', 'full', 'weight', 'value', 'quality', 'iconPath'), 'ARMO':('eid', 'full', 'weight', 'value', 'health', 'strength', 'maleIconPath', 'femaleIconPath'), 'BOOK':('eid', 'full', 'weight', 'value', 'enchantPoints', 'iconPath'), 'CLOT':('eid', 'full', 'weight', 'value', 'enchantPoints', 'maleIconPath', 'femaleIconPath'), 'INGR':('eid', 'full', 'weight', 'value', 'iconPath'), 'KEYM':('eid', 'full', 'weight', 'value', 'iconPath'), 'LIGH':('eid', 'full', 'weight', 'value', 'duration', 'iconPath'), 'MISC':('eid', 'full', 'weight', 'value', 'iconPath'), 'SGST':('eid', 'full', 'weight', 'value', 'uses', 'iconPath'), 'SLGM':('eid', 'full', 'weight', 'value', 'iconPath'), 'WEAP':('eid', 'full', 'weight', 'value', 'health', 'damage', 'speed', 'reach', 'enchantPoints', 'iconPath'), } self.aliases = aliases or {} #--For aliasing mod fulls self.model = {} self.Mmodel = {} self.Fmodel = {} self.MGndmodel = {} self.FGndmodel = {}
| 478,934 |
def __init__(self,types=None,aliases=None): """Initialize.""" self.type_stats = {'ALCH':{},'AMMO':{},'APPA':{},'ARMO':{},'BOOK':{},'CLOT':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'SGST':{},'SLGM':{},'WEAP':{}} self.type_attrs = { 'ALCH':('eid', 'full', 'weight', 'value', 'iconPath'), 'AMMO':('eid', 'full', 'weight', 'value', 'damage', 'speed', 'enchantPoints', 'iconPath'), 'APPA':('eid', 'full', 'weight', 'value', 'quality', 'iconPath'), 'ARMO':('eid', 'full', 'weight', 'value', 'health', 'strength', 'maleIconPath', 'femaleIconPath'), 'BOOK':('eid', 'full', 'weight', 'value', 'enchantPoints', 'iconPath'), 'CLOT':('eid', 'full', 'weight', 'value', 'enchantPoints', 'maleIconPath', 'femaleIconPath'), 'INGR':('eid', 'full', 'weight', 'value', 'iconPath'), 'KEYM':('eid', 'full', 'weight', 'value', 'iconPath'), 'LIGH':('eid', 'full', 'weight', 'value', 'duration', 'iconPath'), 'MISC':('eid', 'full', 'weight', 'value', 'iconPath'), 'SGST':('eid', 'full', 'weight', 'value', 'uses', 'iconPath'), 'SLGM':('eid', 'full', 'weight', 'value', 'iconPath'), 'WEAP':('eid', 'full', 'weight', 'value', 'health', 'damage', 'speed', 'reach', 'enchantPoints', 'iconPath'), } self.aliases = aliases or {} #--For aliasing mod fulls self.model = {} self.Mmodel = {} self.Fmodel = {} self.MGndmodel = {} self.FGndmodel = {}
|
def __init__(self,types=None,aliases=None): """Initialize.""" self.type_stats = {'ALCH':{},'AMMO':{},'APPA':{},'ARMO':{},'BOOK':{},'CLOT':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'SGST':{},'SLGM':{},'WEAP':{}} self.type_attrs = { 'ALCH':('eid', 'full', 'weight', 'value', 'largeIconPath', 'smallIconPath'), 'AMMO':('eid', 'full', 'speed', 'value', 'clipRounds', 'largeIconPath', 'smallIconPath'), 'ARMO':('eid', 'full', 'weight', 'value', 'health', 'ar', 'maleLargeIconPath', 'maleSmallIconPath', 'femaleLargeIconPath', 'femaleSmallIconPath'), 'BOOK':('eid', 'full', 'weight', 'value', 'largeIconPath', 'smallIconPath'), 'INGR':('eid', 'full', 'weight', 'value', 'iconPath'), 'KEYM':('eid', 'full', 'weight', 'value', 'iconPath'), 'LIGH':('eid', 'full', 'weight', 'value', 'duration', 'iconPath'), 'MISC':('eid', 'full', 'weight', 'value', 'iconPath'), 'SGST':('eid', 'full', 'weight', 'value', 'uses', 'iconPath'), 'SLGM':('eid', 'full', 'weight', 'value', 'iconPath'), 'WEAP':('eid', 'full', 'weight', 'value', 'health', 'damage', 'speed', 'reach', 'enchantPoints', 'iconPath'), } self.aliases = aliases or {} #--For aliasing mod fulls self.model = {} self.Mmodel = {} self.Fmodel = {} self.MGndmodel = {} self.FGndmodel = {}
| 478,935 |
def __init__(self,types=None,aliases=None): """Initialize.""" self.type_stats = {'ALCH':{},'AMMO':{},'APPA':{},'ARMO':{},'BOOK':{},'CLOT':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'SGST':{},'SLGM':{},'WEAP':{}} self.type_attrs = { 'ALCH':('eid', 'full', 'weight', 'value', 'iconPath'), 'AMMO':('eid', 'full', 'weight', 'value', 'damage', 'speed', 'enchantPoints', 'iconPath'), 'APPA':('eid', 'full', 'weight', 'value', 'quality', 'iconPath'), 'ARMO':('eid', 'full', 'weight', 'value', 'health', 'strength', 'maleIconPath', 'femaleIconPath'), 'BOOK':('eid', 'full', 'weight', 'value', 'enchantPoints', 'iconPath'), 'CLOT':('eid', 'full', 'weight', 'value', 'enchantPoints', 'maleIconPath', 'femaleIconPath'), 'INGR':('eid', 'full', 'weight', 'value', 'iconPath'), 'KEYM':('eid', 'full', 'weight', 'value', 'iconPath'), 'LIGH':('eid', 'full', 'weight', 'value', 'duration', 'iconPath'), 'MISC':('eid', 'full', 'weight', 'value', 'iconPath'), 'SGST':('eid', 'full', 'weight', 'value', 'uses', 'iconPath'), 'SLGM':('eid', 'full', 'weight', 'value', 'iconPath'), 'WEAP':('eid', 'full', 'weight', 'value', 'health', 'damage', 'speed', 'reach', 'enchantPoints', 'iconPath'), } self.aliases = aliases or {} #--For aliasing mod fulls self.model = {} self.Mmodel = {} self.Fmodel = {} self.MGndmodel = {} self.FGndmodel = {}
|
def __init__(self,types=None,aliases=None): """Initialize.""" self.type_stats = {'ALCH':{},'AMMO':{},'APPA':{},'ARMO':{},'BOOK':{},'CLOT':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'SGST':{},'SLGM':{},'WEAP':{}} self.type_attrs = { 'ALCH':('eid', 'full', 'weight', 'value', 'iconPath'), 'AMMO':('eid', 'full', 'weight', 'value', 'damage', 'speed', 'enchantPoints', 'iconPath'), 'APPA':('eid', 'full', 'weight', 'value', 'quality', 'iconPath'), 'ARMO':('eid', 'full', 'weight', 'value', 'health', 'strength', 'maleIconPath', 'femaleIconPath'), 'BOOK':('eid', 'full', 'weight', 'value', 'enchantPoints', 'iconPath'), 'CLOT':('eid', 'full', 'weight', 'value', 'enchantPoints', 'maleIconPath', 'femaleIconPath'), 'INGR':('eid', 'full', 'weight', 'value', 'iconPath'), 'KEYM':('eid', 'full', 'weight', 'value', 'largeIconPath', 'smallIconPath'), 'LIGH':('eid', 'full', 'weight', 'value', 'duration','iconPath'), 'MISC':('eid', 'full', 'weight', 'value', 'largeIconPath', 'smallIconPath'), 'WEAP':('eid', 'full', 'weight', 'value', 'health', 'damage','clipsize', 'reach','ammoUse','minSpread','spread','sightFov','baseVatsToHitChance','projectileCount', 'minRange','maxRange','fireRate','overrideActionPoint','rumbleLeftMotorStrength', 'rumbleRightMotorStrength','rumbleDuration','overrideDamageToWeaponMult','attackShotsPerSec', 'reloadTime','jamTime','aimArc','rambleWavelangth','limbDmgMult','sightUsage', 'semiAutomaticFireDelayMin','semiAutomaticFireDelayMax','criticalDamage','criticalMultiplier', 'largeIconPath', 'smallIconPath'), } self.aliases = aliases or {} #--For aliasing mod fulls self.model = {} self.Mmodel = {} self.Fmodel = {} self.MGndmodel = {} self.FGndmodel = {}
| 478,936 |
def readFromMod(self,modInfo): """Reads stats from specified mod.""" loadFactory= LoadFactory(False,MreAlch,MreAmmo,MreAppa,MreArmo,MreBook,MreClot,MreIngr,MreKeym,MreLigh,MreMisc,MreSgst,MreSlgm,MreWeap) modFile = ModFile(modInfo,loadFactory) modFile.load(True) mapper = modFile.getLongMapper() for type in self.type_stats: stats, attrs = self.type_stats[type], self.type_attrs[type] for record in getattr(modFile,type).getActiveRecords(): longid = mapper(record.fid) recordGetAttr = record.__getattribute__ stats[longid] = tuple(recordGetAttr(attr) for attr in attrs) if type in ['ALCH','AMMO','APPA','BOOK','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP']: if record.model: self.model[longid] = record.model.modPath elif type in ['CLOT','ARMO']: if record.maleBody: self.Mmodel[longid] = record.maleBody.modPath if record.maleWorld: self.MGndmodel[longid] = record.maleWorld.modPath if record.femaleBody: self.Fmodel[longid] = record.femaleBody.modPath if record.femaleWorld: self.FGndmodel[longid] = record.femaleWorld.modPath
|
def readFromMod(self,modInfo): """Reads stats from specified mod.""" loadFactory= LoadFactory(False,MreAlch,MreAmmo,MreArmo,MreBook,MreIngr,MreKeym,MreLigh,MreMisc,MreWeap) modFile = ModFile(modInfo,loadFactory) modFile.load(True) mapper = modFile.getLongMapper() for type in self.type_stats: stats, attrs = self.type_stats[type], self.type_attrs[type] for record in getattr(modFile,type).getActiveRecords(): longid = mapper(record.fid) recordGetAttr = record.__getattribute__ stats[longid] = tuple(recordGetAttr(attr) for attr in attrs) if type in ['ALCH','AMMO','APPA','BOOK','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP']: if record.model: self.model[longid] = record.model.modPath elif type in ['CLOT','ARMO']: if record.maleBody: self.Mmodel[longid] = record.maleBody.modPath if record.maleWorld: self.MGndmodel[longid] = record.maleWorld.modPath if record.femaleBody: self.Fmodel[longid] = record.femaleBody.modPath if record.femaleWorld: self.FGndmodel[longid] = record.femaleWorld.modPath
| 478,937 |
def readFromMod(self,modInfo): """Reads stats from specified mod.""" loadFactory= LoadFactory(False,MreAlch,MreAmmo,MreAppa,MreArmo,MreBook,MreClot,MreIngr,MreKeym,MreLigh,MreMisc,MreSgst,MreSlgm,MreWeap) modFile = ModFile(modInfo,loadFactory) modFile.load(True) mapper = modFile.getLongMapper() for type in self.type_stats: stats, attrs = self.type_stats[type], self.type_attrs[type] for record in getattr(modFile,type).getActiveRecords(): longid = mapper(record.fid) recordGetAttr = record.__getattribute__ stats[longid] = tuple(recordGetAttr(attr) for attr in attrs) if type in ['ALCH','AMMO','APPA','BOOK','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP']: if record.model: self.model[longid] = record.model.modPath elif type in ['CLOT','ARMO']: if record.maleBody: self.Mmodel[longid] = record.maleBody.modPath if record.maleWorld: self.MGndmodel[longid] = record.maleWorld.modPath if record.femaleBody: self.Fmodel[longid] = record.femaleBody.modPath if record.femaleWorld: self.FGndmodel[longid] = record.femaleWorld.modPath
|
def readFromMod(self,modInfo): """Reads stats from specified mod.""" loadFactory= LoadFactory(False,MreAlch,MreAmmo,MreAppa,MreArmo,MreBook,MreClot,MreIngr,MreKeym,MreLigh,MreMisc,MreSgst,MreSlgm,MreWeap) modFile = ModFile(modInfo,loadFactory) modFile.load(True) mapper = modFile.getLongMapper() for type in self.type_stats: stats, attrs = self.type_stats[type], self.type_attrs[type] for record in getattr(modFile,type).getActiveRecords(): longid = mapper(record.fid) recordGetAttr = record.__getattribute__ stats[longid] = tuple(recordGetAttr(attr) for attr in attrs) if type in ['ALCH','AMMO','BOOK','INGR','KEYM','LIGH','MISC']: if record.model: self.model[longid] = record.model.modPath elif type in ['CLOT','ARMO']: if record.maleBody: self.Mmodel[longid] = record.maleBody.modPath if record.maleWorld: self.MGndmodel[longid] = record.maleWorld.modPath if record.femaleBody: self.Fmodel[longid] = record.femaleBody.modPath if record.femaleWorld: self.FGndmodel[longid] = record.femaleWorld.modPath
| 478,938 |
def readFromMod(self,modInfo): """Reads stats from specified mod.""" loadFactory= LoadFactory(False,MreAlch,MreAmmo,MreAppa,MreArmo,MreBook,MreClot,MreIngr,MreKeym,MreLigh,MreMisc,MreSgst,MreSlgm,MreWeap) modFile = ModFile(modInfo,loadFactory) modFile.load(True) mapper = modFile.getLongMapper() for type in self.type_stats: stats, attrs = self.type_stats[type], self.type_attrs[type] for record in getattr(modFile,type).getActiveRecords(): longid = mapper(record.fid) recordGetAttr = record.__getattribute__ stats[longid] = tuple(recordGetAttr(attr) for attr in attrs) if type in ['ALCH','AMMO','APPA','BOOK','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP']: if record.model: self.model[longid] = record.model.modPath elif type in ['CLOT','ARMO']: if record.maleBody: self.Mmodel[longid] = record.maleBody.modPath if record.maleWorld: self.MGndmodel[longid] = record.maleWorld.modPath if record.femaleBody: self.Fmodel[longid] = record.femaleBody.modPath if record.femaleWorld: self.FGndmodel[longid] = record.femaleWorld.modPath
|
def readFromMod(self,modInfo): """Reads stats from specified mod.""" loadFactory= LoadFactory(False,MreAlch,MreAmmo,MreAppa,MreArmo,MreBook,MreClot,MreIngr,MreKeym,MreLigh,MreMisc,MreSgst,MreSlgm,MreWeap) modFile = ModFile(modInfo,loadFactory) modFile.load(True) mapper = modFile.getLongMapper() for type in self.type_stats: stats, attrs = self.type_stats[type], self.type_attrs[type] for record in getattr(modFile,type).getActiveRecords(): longid = mapper(record.fid) recordGetAttr = record.__getattribute__ stats[longid] = tuple(recordGetAttr(attr) for attr in attrs) if type in ['ALCH','AMMO','APPA','BOOK','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP']: if record.model: self.model[longid] = record.model.modPath elif type in ['WEAP',]: if record.model: self.model[longid] = record.model.modPath if record.shellCasingModel: self.ShellCasingmodel[longid] = record.shellCasingModel.modPath if record.scopeModel: self.Scopemodel[longid] = record.scopeModel.modPath if record.worldModel: self.Gndmodel[longid] = record.worldModel.modPath elif type in ['ARMO',]: if record.maleBody: self.Mmodel[longid] = record.maleBody.modPath if record.maleWorld: self.MGndmodel[longid] = record.maleWorld.modPath if record.femaleBody: self.Fmodel[longid] = record.femaleBody.modPath if record.femaleWorld: self.FGndmodel[longid] = record.femaleWorld.modPath
| 478,939 |
def writeToMod(self,modInfo): """Writes stats to specified mod.""" loadFactory= LoadFactory(True,MreAlch,MreAmmo,MreAppa,MreArmo,MreBook,MreClot,MreIngr,MreKeym,MreLigh,MreMisc,MreSgst,MreSlgm,MreWeap) modFile = ModFile(modInfo,loadFactory) modFile.load(True) mapper = modFile.getLongMapper() changed = {} #--changed[modName] = numChanged for type in self.type_stats: stats, attrs = self.type_stats[type], self.type_attrs[type] for record in getattr(modFile,type).getActiveRecords(): longid = mapper(record.fid) itemStats = stats.get(longid,None) if not itemStats: continue map(record.__setattr__,attrs,itemStats) record.setChanged() changed[longid[0]] = 1 + changed.get(longid[0],0) if changed: modFile.safeSave() return changed
|
def writeToMod(self,modInfo): """Writes stats to specified mod.""" loadFactory= LoadFactory(True,MreAlch,MreAmmo,MreArmo,MreBook,MreIngr,MreKeym,MreLigh,MreMisc,MreWeap) modFile = ModFile(modInfo,loadFactory) modFile.load(True) mapper = modFile.getLongMapper() changed = {} #--changed[modName] = numChanged for type in self.type_stats: stats, attrs = self.type_stats[type], self.type_attrs[type] for record in getattr(modFile,type).getActiveRecords(): longid = mapper(record.fid) itemStats = stats.get(longid,None) if not itemStats: continue map(record.__setattr__,attrs,itemStats) record.setChanged() changed[longid[0]] = 1 + changed.get(longid[0],0) if changed: modFile.safeSave() return changed
| 478,940 |
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((str,sfloat,int,int,sfloat,int,str),fields[4:11])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((str,sfloat,int,int,int,str,str),fields[4:10])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str,str),fields[4:10])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int),fields[4:8])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((str,sfloat,int,int,int,sfloat,sfloat,int,str),fields[4:13])) ins.close()
|
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, armor, books, ingredients, keys, lights, misc, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','ARMO','BOOK','INGR','KEYM','LIGH','MISC','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((str,sfloat,int,int,sfloat,int,str),fields[4:11])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((str,sfloat,int,int,int,str,str),fields[4:10])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str,str),fields[4:10])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int),fields[4:8])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((str,sfloat,int,int,int,sfloat,sfloat,int,str),fields[4:13])) ins.close()
| 478,941 |
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((str,sfloat,int,int,sfloat,int,str),fields[4:11])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((str,sfloat,int,int,int,str,str),fields[4:10])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str,str),fields[4:10])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int),fields[4:8])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((str,sfloat,int,int,int,sfloat,sfloat,int,str),fields[4:13])) ins.close()
|
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str,str),fields[4:9])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((str,sfloat,int,int,sfloat,int,str),fields[4:11])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((str,sfloat,int,int,int,str,str),fields[4:10])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str,str),fields[4:10])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str,str),fields[4:9])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str,str),fields[4:9])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str,str),fields[4:9])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int),fields[4:8])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((str,sfloat,int,int,int,sfloat,sfloat,int,str),fields[4:13])) ins.close()
| 478,942 |
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((str,sfloat,int,int,sfloat,int,str),fields[4:11])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((str,sfloat,int,int,int,str,str),fields[4:10])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str,str),fields[4:10])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int),fields[4:8])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((str,sfloat,int,int,int,sfloat,sfloat,int,str),fields[4:13])) ins.close()
|
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((str,sfloat,int,int,str,str),fields[4:10])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((str,sfloat,int,int,int,str,str),fields[4:10])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str,str),fields[4:10])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int),fields[4:8])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((str,sfloat,int,int,int,sfloat,sfloat,int,str),fields[4:13])) ins.close()
| 478,943 |
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((str,sfloat,int,int,sfloat,int,str),fields[4:11])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((str,sfloat,int,int,int,str,str),fields[4:10])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str,str),fields[4:10])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int),fields[4:8])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((str,sfloat,int,int,int,sfloat,sfloat,int,str),fields[4:13])) ins.close()
|
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((str,sfloat,int,int,sfloat,int,str),fields[4:11])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((str,sfloat,int,int,int,str,str,str,str),fields[4:13])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str,str),fields[4:10])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int),fields[4:8])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((str,sfloat,int,int,int,sfloat,sfloat,int,str),fields[4:13])) ins.close()
| 478,944 |
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((str,sfloat,int,int,sfloat,int,str),fields[4:11])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((str,sfloat,int,int,int,str,str),fields[4:10])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str,str),fields[4:10])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int),fields[4:8])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((str,sfloat,int,int,int,sfloat,sfloat,int,str),fields[4:13])) ins.close()
|
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((str,sfloat,int,int,sfloat,int,str),fields[4:11])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((str,sfloat,int,int,int,str,str),fields[4:10])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str,str),fields[4:10])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int),fields[4:8])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((str,sfloat,int,int,int,sfloat,sfloat,int,str),fields[4:13])) ins.close()
| 478,945 |
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((str,sfloat,int,int,sfloat,int,str),fields[4:11])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((str,sfloat,int,int,int,str,str),fields[4:10])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str,str),fields[4:10])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int),fields[4:8])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((str,sfloat,int,int,int,sfloat,sfloat,int,str),fields[4:13])) ins.close()
|
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str,str),fields[4:9])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((str,sfloat,int,int,sfloat,int,str),fields[4:11])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((str,sfloat,int,int,int,str,str),fields[4:10])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str,str),fields[4:10])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str,str),fields[4:9])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str,str),fields[4:9])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str,str),fields[4:9])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int),fields[4:8])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((str,sfloat,int,int,int,sfloat,sfloat,int,str),fields[4:13])) ins.close()
| 478,946 |
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((str,sfloat,int,int,sfloat,int,str),fields[4:11])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((str,sfloat,int,int,int,str,str),fields[4:10])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str,str),fields[4:10])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int),fields[4:8])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((str,sfloat,int,int,int,sfloat,sfloat,int,str),fields[4:13])) ins.close()
|
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((str,sfloat,int,int,sfloat,int,str),fields[4:11])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((str,sfloat,int,int,int,str,str),fields[4:10])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str,str),fields[4:10])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int),fields[4:8])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((str,sfloat,int,int,int,sfloat,sfloat,int,str),fields[4:13])) ins.close()
| 478,947 |
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((str,sfloat,int,int,sfloat,int,str),fields[4:11])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((str,sfloat,int,int,int,str,str),fields[4:10])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str,str),fields[4:10])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int),fields[4:8])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((str,sfloat,int,int,int,sfloat,sfloat,int,str),fields[4:13])) ins.close()
|
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((str,sfloat,int,int,sfloat,int,str),fields[4:11])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((str,sfloat,int,int,int,str,str),fields[4:10])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((str,sfloat,int,int,str,str),fields[4:10])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int,str),fields[4:8])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((str,sfloat,int,int,str),fields[4:9])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((str,sfloat,int),fields[4:8])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((str,sfloat,int,int,int,int, sfloat,int,sfloat,sfloat,sfloat,int,int, sfloat,sfloat,sfloat,sfloat,sfloat, sfloat,sfloat,sfloat,sfloat, sfloat,sfloat,sfloat,sfloat,sfloat,sfloat, sfloat,sfloat,int,sfloat,str,str),fields[4:38])) ins.close()
| 478,948 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,949 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,950 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,951 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,952 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,953 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,954 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,955 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,956 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,957 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,958 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,959 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,960 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,961 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,962 |
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 self.classestemp = set() #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreBsgn,MreLscr, MreClas, MreLtex, MreRegn): recAttrs_class[recClass] = ('iconPath',) for recClass in (MreActi, MreDoor, MreFlor, MreFurn, MreGras, MreStat, MreMstt): recAttrs_class[recClass] = ('model',) for recClass in (MreLigh,): recAttrs_class[recClass] = ('iconPath','model') for recClass in (MreAlch, MreAmmo, MreAppa, MreBook, MreIngr, MreKeym, MreMisc, MreSgst, MreSlgm, MreTree): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model') for recClass in (MreNote,): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model','texture') for recClass in (MreWeap,): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model','shellCasingModel','scopeModel','worldModel','firstPersonModel','animationType','gripAnimation','reloadAnimation') for recClass in (MreArmo, MreClot): recAttrs_class[recClass] = ('maleBody','maleWorld','maleIconPath','maleIcon','femaleBody','femaleWorld','femaleIconPath','femaleIcon','flags') for recClass in (MreCrea,): recAttrs_class[recClass] = ('model','bodyParts','nift_p','bodyPartData','impactDataset') for recClass in (MreMgef,): recAttrs_class[recClass] = ('iconPath','model','effectShader','objectDisplayShader','light') for recClass in (MreEfsh,): recAttrs_class[recClass] = ('particleTexture','fillTexture') for recClass in (MreTxst,): recAttrs_class[recClass] = ('baseImage','normalMap','environmentMapMask','growMap','parallaxMap','environmentMap','decalData','flags') for recClass in (MreExpl,): recAttrs_class[recClass] = ('imageSpaceModifier','light','impactDataset','placedImpactObject') for recClass in (MreTxst,): recAttrs_class[recClass] = ('baseImage','normalMap','environmentMapMask','growMap','parallaxMap','environmentMap','minWidth','maxWidth','minHeight','maxHeight','depth','shininess','parallaxScale','parallaxPasses','decalFlags','red','green','blue','flags') for recClass in (MreIpct,): recAttrs_class[recClass] = ('model','effectDuration','effectOrientation','angleThreshold','placementRadius','flags','minWidth','maxWidth','minHeight','maxHeight','depth','shininess','parallaxScale','parallaxPasses','decalFlags','red','green','blue','textureSet') for recClass in (MreIpds,): recAttrs_class[recClass] = ('stone','dirt','grass','metal','wood','organic','cloth','water','hollowMetal','organicBug','organicGlow') for recClass in (MreProj,): recAttrs_class[recClass] = ('model','light','muzzleFlash','explosion','muzzleFlashDuration','fadeDuration','muzzleFlashPath') #--Needs Longs self.longTypes = set(('BSGN','LSCR','CLAS','LTEX','REGN','ACTI','DOOR','FLOR','FURN','GRAS','STAT','ALCH','AMMO','BOOK','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP','TREE','ARMO','CLOT','CREA','MGEF','EFSH','TXST','EXPL','IPCT','IPDS','PROJ','NOTE','NPC_','DIAL'))
|
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 self.classestemp = set() #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreBsgn,MreLscr, MreClas, MreLtex, MreRegn): recAttrs_class[recClass] = ('iconPath',) for recClass in (MreActi, MreDoor, MreFlor, MreFurn, MreGras, MreStat, MreMstt): recAttrs_class[recClass] = ('model',) for recClass in (MreLigh,): recAttrs_class[recClass] = ('iconPath','model') for recClass in (MreAlch, MreAmmo, MreAppa, MreBook, MreIngr, MreKeym, MreMisc, MreSgst, MreSlgm, MreTree): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model') for recClass in (MreNote,): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model','texture') for recClass in (MreWeap,): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model','shellCasingModel','scopeModel','worldModel','firstPersonModel','animationType','gripAnimation','reloadAnimation') for recClass in (MreArmo, MreClot): recAttrs_class[recClass] = ('maleBody','maleWorld','maleLargeIconPath','maleSmallIconPath','femaleBody','femaleWorld','femaleLargeIconPath','femaleSmallIconPath','flags') for recClass in (MreCrea,): recAttrs_class[recClass] = ('model','bodyParts','nift_p','bodyPartData','impactDataset') for recClass in (MreMgef,): recAttrs_class[recClass] = ('iconPath','model','effectShader','objectDisplayShader','light') for recClass in (MreEfsh,): recAttrs_class[recClass] = ('particleTexture','fillTexture') for recClass in (MreTxst,): recAttrs_class[recClass] = ('baseImage','normalMap','environmentMapMask','growMap','parallaxMap','environmentMap','decalData','flags') for recClass in (MreExpl,): recAttrs_class[recClass] = ('imageSpaceModifier','light','impactDataset','placedImpactObject') for recClass in (MreTxst,): recAttrs_class[recClass] = ('baseImage','normalMap','environmentMapMask','growMap','parallaxMap','environmentMap','minWidth','maxWidth','minHeight','maxHeight','depth','shininess','parallaxScale','parallaxPasses','decalFlags','red','green','blue','flags') for recClass in (MreIpct,): recAttrs_class[recClass] = ('model','effectDuration','effectOrientation','angleThreshold','placementRadius','flags','minWidth','maxWidth','minHeight','maxHeight','depth','shininess','parallaxScale','parallaxPasses','decalFlags','red','green','blue','textureSet') for recClass in (MreIpds,): recAttrs_class[recClass] = ('stone','dirt','grass','metal','wood','organic','cloth','water','hollowMetal','organicBug','organicGlow') for recClass in (MreProj,): recAttrs_class[recClass] = ('model','light','muzzleFlash','explosion','muzzleFlashDuration','fadeDuration','muzzleFlashPath') #--Needs Longs self.longTypes = set(('BSGN','LSCR','CLAS','LTEX','REGN','ACTI','DOOR','FLOR','FURN','GRAS','STAT','ALCH','AMMO','BOOK','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP','TREE','ARMO','CLOT','CREA','MGEF','EFSH','TXST','EXPL','IPCT','IPDS','PROJ','NOTE','NPC_','DIAL'))
| 478,963 |
# def loadData(self,record,ins,type,size,readId):
|
# def loadData(self,record,ins,type,size,readId):
| 478,964 |
def mapFids(self,record,function,save=False): """Applies function to fids. If save is true, then fid is set to result of function.""" if self.subType == 'PLDT' and record.locType != 5: result = function(record.locId) if save: record.locId = result elif self.subType == 'PLD2' and record.locType2 != 5: result = function(record.locId2) if save: record.locId2 = result elif self.subType == 'PTDT' and record.targetType != 2: result = function(record.targetId) if save: record.targetId = result elif self.subType == 'PTD2' and record.targetType2 != 2: result = function(record.targetId2) if save: record.targetId2 = result
|
def mapFids(self,record,function,save=False): """Applies function to fids. If save is true, then fid is set to result of function.""" if self.subType == 'PLDT' and record.locType != 5: result = function(record.locId) if save: record.locId = result elif self.subType == 'PLD2' and record.locType2 != 5: result = function(record.locId2) if save: record.locId2 = result elif self.subType == 'PTDT' and record.targetType != 2: result = function(record.targetId) if save: record.targetId = result elif self.subType == 'PTD2' and record.targetType2 != 2: result = function(record.targetId2) if save: record.targetId2 = result
| 478,965 |
def mapFids(self,record,function,save=False): """Applies function to fids. If save is true, then fid is set to result of function.""" if self.subType == 'PLDT' and record.locType != 5: result = function(record.locId) if save: record.locId = result elif self.subType == 'PLD2' and record.locType2 != 5: result = function(record.locId2) if save: record.locId2 = result elif self.subType == 'PTDT' and record.targetType != 2: result = function(record.targetId) if save: record.targetId = result elif self.subType == 'PTD2' and record.targetType2 != 2: result = function(record.targetId2) if save: record.targetId2 = result
|
def mapFids(self,record,function,save=False): """Applies function to fids. If save is true, then fid is set to result of function.""" if self.subType == 'PLDT' and record.locType != 5: result = function(record.locId) if save: record.locId = result elif self.subType == 'PLD2' and record.locType2 != 5: result = function(record.locId2) if save: record.locId2 = result elif self.subType == 'PTDT' and record.targetType != 2: result = function(record.targetId) if save: record.targetId = result elif self.subType == 'PTD2' and record.targetType2 != 2: result = function(record.targetId2) if save: record.targetId2 = result
| 478,966 |
def mapFids(self,record,function,save=False): """Applies function to fids. If save is true, then fid is set to result of function.""" if self.subType == 'PLDT' and record.locType != 5: result = function(record.locId) if save: record.locId = result elif self.subType == 'PLD2' and record.locType2 != 5: result = function(record.locId2) if save: record.locId2 = result elif self.subType == 'PTDT' and record.targetType != 2: result = function(record.targetId) if save: record.targetId = result elif self.subType == 'PTD2' and record.targetType2 != 2: result = function(record.targetId2) if save: record.targetId2 = result
|
def mapFids(self,record,function,save=False): """Applies function to fids. If save is true, then fid is set to result of function.""" if self.subType == 'PLDT' and record.locType != 5: result = function(record.locId) if save: record.locId = result elif self.subType == 'PLD2' and record.locType2 != 5: result = function(record.locId2) if save: record.locId2 = result elif self.subType == 'PTDT' and record.targetType != 2: result = function(record.targetId) if save: record.targetId = result elif self.subType == 'PTD2' and record.targetType2 != 2: result = function(record.targetId2) if save: record.targetId2 = result
| 478,967 |
def loadData(self,record,ins,type,size,readId): if size == 102: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 86: #--Else 86 byte record (skips dispVelocity, #-- dispFalloff, dispDampner, dispSize, and damage #-- Two junk? bytes are tacked onto the end #-- Hex editing and the CS confirms that it is NOT #-- damage, so it is probably just filler unpacked = ins.unpack('11f3Bs3Bs3BsB3s6f2s',size,readId) elif size == 62: #--Else 62 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('11f3Bs3Bs3BsB3s2s',size,readId) elif size == 42: #--Else 42 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('10f2s',size,readId) elif size == 2: #--Else 2 byte record (skips everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('2s',size,readId) else: raise "Unexpected size encountered for WATR subrecord: %s" % size unpacked = unpacked[:-1] unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
|
def loadData(self,record,ins,type,size,readId): if size == 102: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 86: #--Else 86 byte record (skips dispVelocity, #-- dispFalloff, dispDampner, dispSize, and damage #-- Two junk? bytes are tacked onto the end #-- Hex editing and the CS confirms that it is NOT #-- damage, so it is probably just filler unpacked = ins.unpack('11f3Bs3Bs3BsB3s6f2s',size,readId) elif size == 62: #--Else 62 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('11f3Bs3Bs3BsB3s2s',size,readId) elif size == 42: #--Else 42 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('10f2s',size,readId) elif size == 2: #--Else 2 byte record (skips everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('2s',size,readId) else: raise "Unexpected size encountered for WATR subrecord: %s" % size unpacked = unpacked[:-1] unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
| 478,968 |
def loadData(self,record,ins,type,size,readId): if size == 102: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 86: #--Else 86 byte record (skips dispVelocity, #-- dispFalloff, dispDampner, dispSize, and damage #-- Two junk? bytes are tacked onto the end #-- Hex editing and the CS confirms that it is NOT #-- damage, so it is probably just filler unpacked = ins.unpack('11f3Bs3Bs3BsB3s6f2s',size,readId) elif size == 62: #--Else 62 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('11f3Bs3Bs3BsB3s2s',size,readId) elif size == 42: #--Else 42 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('10f2s',size,readId) elif size == 2: #--Else 2 byte record (skips everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('2s',size,readId) else: raise "Unexpected size encountered for WATR subrecord: %s" % size unpacked = unpacked[:-1] unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
|
def loadData(self,record,ins,type,size,readId): if size == 102: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 86: #--Else 86 byte record (skips dispVelocity, #-- dispFalloff, dispDampner, dispSize, and damage #-- Two junk? bytes are tacked onto the end #-- Hex editing and the CS confirms that it is NOT #-- damage, so it is probably just filler unpacked = ins.unpack('11f3Bs3Bs3BsB3s6f2s',size,readId) elif size == 62: #--Else 62 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('11f3Bs3Bs3BsB3s2s',size,readId) elif size == 42: #--Else 42 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('10f2s',size,readId) elif size == 2: #--Else 2 byte record (skips everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('2s',size,readId) else: raise "Unexpected size encountered for WATR subrecord: %s" % size unpacked = unpacked[:-1] unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
| 478,969 |
def loadData(self,record,ins,type,size,readId): if size == 102: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 86: #--Else 86 byte record (skips dispVelocity, #-- dispFalloff, dispDampner, dispSize, and damage #-- Two junk? bytes are tacked onto the end #-- Hex editing and the CS confirms that it is NOT #-- damage, so it is probably just filler unpacked = ins.unpack('11f3Bs3Bs3BsB3s6f2s',size,readId) elif size == 62: #--Else 62 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('11f3Bs3Bs3BsB3s2s',size,readId) elif size == 42: #--Else 42 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('10f2s',size,readId) elif size == 2: #--Else 2 byte record (skips everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('2s',size,readId) else: raise "Unexpected size encountered for WATR subrecord: %s" % size unpacked = unpacked[:-1] unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
|
def loadData(self,record,ins,type,size,readId): if size == 102: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 86: #--Else 86 byte record (skips dispVelocity, #-- dispFalloff, dispDampner, dispSize, and damage #-- Two junk? bytes are tacked onto the end #-- Hex editing and the CS confirms that it is NOT #-- damage, so it is probably just filler unpacked = ins.unpack('11f3Bs3Bs3BsB3s6f2s',size,readId) elif size == 62: #--Else 62 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('11f3Bs3Bs3BsB3s2s',size,readId) elif size == 42: #--Else 42 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('10f2s',size,readId) elif size == 2: #--Else 2 byte record (skips everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('2s',size,readId) else: raise "Unexpected size encountered for WATR subrecord: %s" % size unpacked = unpacked[:-1] unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
| 478,970 |
def loadData(self,record,ins,type,size,readId): if size == 102: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 86: #--Else 86 byte record (skips dispVelocity, #-- dispFalloff, dispDampner, dispSize, and damage #-- Two junk? bytes are tacked onto the end #-- Hex editing and the CS confirms that it is NOT #-- damage, so it is probably just filler unpacked = ins.unpack('11f3Bs3Bs3BsB3s6f2s',size,readId) elif size == 62: #--Else 62 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('11f3Bs3Bs3BsB3s2s',size,readId) elif size == 42: #--Else 42 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('10f2s',size,readId) elif size == 2: #--Else 2 byte record (skips everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('2s',size,readId) else: raise "Unexpected size encountered for WATR subrecord: %s" % size unpacked = unpacked[:-1] unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
|
def loadData(self,record,ins,type,size,readId): if size == 102: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 86: #--Else 86 byte record (skips dispVelocity, #-- dispFalloff, dispDampner, dispSize, and damage #-- Two junk? bytes are tacked onto the end #-- Hex editing and the CS confirms that it is NOT #-- damage, so it is probably just filler unpacked = ins.unpack('11f3Bs3Bs3BsB3s6f2s',size,readId) elif size == 62: #--Else 62 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('11f3Bs3Bs3BsB3s2s',size,readId) elif size == 42: #--Else 42 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('10f2s',size,readId) elif size == 2: #--Else 2 byte record (skips everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('2s',size,readId) else: raise "Unexpected size encountered for WATR subrecord: %s" % size unpacked = unpacked[:-1] unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
| 478,971 |
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreBsgn,MreLscr, MreClas, MreLtex, MreRegn): recAttrs_class[recClass] = ('iconPath',) for recClass in (MreActi, MreDoor, MreFlor, MreFurn, MreGras, MreStat): recAttrs_class[recClass] = ('model',) for recClass in (MreAlch, MreAmmo, MreAppa, MreBook, MreIngr, MreKeym, MreLigh, MreMisc, MreSgst, MreSlgm, MreWeap, MreTree): recAttrs_class[recClass] = ('iconPath','model') for recClass in (MreArmo, MreClot): recAttrs_class[recClass] = ('maleBody','maleWorld','maleIconPath','maleIcon','femaleBody','femaleWorld','femaleIconPath','femaleIcon','flags') for recClass in (MreCrea,): recAttrs_class[recClass] = ('model','bodyParts','nift_p','bloodSprayPath','bloodDecalPath') for recClass in (MreMgef,): recAttrs_class[recClass] = ('iconPath','model','effectShader','enchantEffect','light') for recClass in (MreEfsh,): recAttrs_class[recClass] = ('particleTexture','fillTexture') for recClass in (MreTxst,): recAttrs_class[recClass] = ('baseImage','normalMap','environmentMapMask','growMap','parallaxMap','environmentMap','decalData','flags') #--Needs Longs self.longTypes = set(('BSGN','LSCR','CLAS','LTEX','REGN','ACTI','DOOR','FLOR','FURN','GRAS','STAT','ALCH','AMMO','BOOK','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP','TREE','ARMO','CLOT','CREA','MGEF','EFSH','TXST'))
|
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreBsgn,MreLscr, MreClas, MreLtex, MreRegn): recAttrs_class[recClass] = ('iconPath',) for recClass in (MreActi, MreDoor, MreFlor, MreFurn, MreGras, MreStat): recAttrs_class[recClass] = ('model',) for recClass in (MreAlch, MreAmmo, MreAppa, MreBook, MreIngr, MreKeym, MreLigh, MreMisc, MreSgst, MreSlgm, MreWeap, MreTree): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model','shellCasingModel','scopeModel','worldModel','firstPersonModel') for recClass in (MreArmo, MreClot): recAttrs_class[recClass] = ('maleBody','maleWorld','maleIconPath','maleIcon','femaleBody','femaleWorld','femaleIconPath','femaleIcon','flags') for recClass in (MreCrea,): recAttrs_class[recClass] = ('model','bodyParts','nift_p','bloodSprayPath','bloodDecalPath') for recClass in (MreMgef,): recAttrs_class[recClass] = ('iconPath','model','effectShader','enchantEffect','light') for recClass in (MreEfsh,): recAttrs_class[recClass] = ('particleTexture','fillTexture') for recClass in (MreTxst,): recAttrs_class[recClass] = ('baseImage','normalMap','environmentMapMask','growMap','parallaxMap','environmentMap','decalData','flags') #--Needs Longs self.longTypes = set(('BSGN','LSCR','CLAS','LTEX','REGN','ACTI','DOOR','FLOR','FURN','GRAS','STAT','ALCH','AMMO','BOOK','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP','TREE','ARMO','CLOT','CREA','MGEF','EFSH','TXST'))
| 478,972 |
def __init__(self,types=None,aliases=None): """Initialize.""" #--type_stats[type] = ... #--AMMO: (eid, weight, value, damage, speed, epoints) #--ARMO: (eid, weight, value, health, strength) #--WEAP: (eid, weight, value, health, damage, speed, reach, epoints) self.type_stats = {'ALCH':{},'AMMO':{},'APPA':{},'ARMO':{},'BOOK':{},'CLOT':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'SGST':{},'SLGM':{},'WEAP':{}} self.type_attrs = { 'ALCH':('eid', 'weight', 'value'), 'AMMO':('eid', 'speed', 'flags', 'value', 'clipRounds'), 'APPA':('eid', 'weight', 'value', 'quality'), 'ARMO':('eid', 'weight', 'value', 'health', 'ar'), 'BOOK':('eid', 'weight', 'value'), 'CLOT':('eid', 'weight', 'value', 'enchantPoints'), 'INGR':('eid', 'weight', 'value'), 'KEYM':('eid', 'weight', 'value'), 'LIGH':('eid', 'weight', 'value', 'duration'), 'MISC':('eid', 'weight', 'value'), 'SGST':('eid', 'weight', 'value', 'uses'), 'SLGM':('eid', 'weight', 'value'), 'WEAP':('eid', 'weight', 'value', 'health', 'damage', 'clipsize', 'minSpread', 'spread', 'baseVatsToHitChance', 'minRange', 'maxRange', 'fireRate', 'overrideActionPoint', 'overrideDamageToWeaponMult', 'attackShotsPerSec', 'reloadTime', 'jamTime', 'criticalDamage', 'criticalMultiplier'), } self.aliases = aliases or {} #--For aliasing mod names
|
def __init__(self,types=None,aliases=None): """Initialize.""" #--type_stats[type] = ... #--AMMO: (eid, weight, value, damage, speed, epoints) #--ARMO: (eid, weight, value, health, strength) #--WEAP: (eid, weight, value, health, damage, speed, reach, epoints) self.type_stats = {'ALCH':{},'AMMO':{},'ARMO':{},'BOOK':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'WEAP':{}} self.type_attrs = { 'ALCH':('eid', 'weight', 'value'), 'AMMO':('eid', 'speed', 'flags', 'value', 'clipRounds'), 'APPA':('eid', 'weight', 'value', 'quality'), 'ARMO':('eid', 'weight', 'value', 'health', 'ar'), 'BOOK':('eid', 'weight', 'value'), 'CLOT':('eid', 'weight', 'value', 'enchantPoints'), 'INGR':('eid', 'weight', 'value'), 'KEYM':('eid', 'weight', 'value'), 'LIGH':('eid', 'weight', 'value', 'duration'), 'MISC':('eid', 'weight', 'value'), 'SGST':('eid', 'weight', 'value', 'uses'), 'SLGM':('eid', 'weight', 'value'), 'WEAP':('eid', 'weight', 'value', 'health', 'damage', 'clipsize', 'minSpread', 'spread', 'baseVatsToHitChance', 'minRange', 'maxRange', 'fireRate', 'overrideActionPoint', 'overrideDamageToWeaponMult', 'attackShotsPerSec', 'reloadTime', 'jamTime', 'criticalDamage', 'criticalMultiplier'), } self.aliases = aliases or {} #--For aliasing mod names
| 478,973 |
def __init__(self,types=None,aliases=None): """Initialize.""" #--type_stats[type] = ... #--AMMO: (eid, weight, value, damage, speed, epoints) #--ARMO: (eid, weight, value, health, strength) #--WEAP: (eid, weight, value, health, damage, speed, reach, epoints) self.type_stats = {'ALCH':{},'AMMO':{},'APPA':{},'ARMO':{},'BOOK':{},'CLOT':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'SGST':{},'SLGM':{},'WEAP':{}} self.type_attrs = { 'ALCH':('eid', 'weight', 'value'), 'AMMO':('eid', 'speed', 'flags', 'value', 'clipRounds'), 'APPA':('eid', 'weight', 'value', 'quality'), 'ARMO':('eid', 'weight', 'value', 'health', 'ar'), 'BOOK':('eid', 'weight', 'value'), 'CLOT':('eid', 'weight', 'value', 'enchantPoints'), 'INGR':('eid', 'weight', 'value'), 'KEYM':('eid', 'weight', 'value'), 'LIGH':('eid', 'weight', 'value', 'duration'), 'MISC':('eid', 'weight', 'value'), 'SGST':('eid', 'weight', 'value', 'uses'), 'SLGM':('eid', 'weight', 'value'), 'WEAP':('eid', 'weight', 'value', 'health', 'damage', 'clipsize', 'minSpread', 'spread', 'baseVatsToHitChance', 'minRange', 'maxRange', 'fireRate', 'overrideActionPoint', 'overrideDamageToWeaponMult', 'attackShotsPerSec', 'reloadTime', 'jamTime', 'criticalDamage', 'criticalMultiplier'), } self.aliases = aliases or {} #--For aliasing mod names
|
def __init__(self,types=None,aliases=None): """Initialize.""" #--type_stats[type] = ... #--AMMO: (eid, weight, value, damage, speed, epoints) #--ARMO: (eid, weight, value, health, strength) #--WEAP: (eid, weight, value, health, damage, speed, reach, epoints) self.type_stats = {'ALCH':{},'AMMO':{},'APPA':{},'ARMO':{},'BOOK':{},'CLOT':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'SGST':{},'SLGM':{},'WEAP':{}} self.type_attrs = { 'ALCH':('eid', 'weight', 'value'), 'AMMO':('eid', 'speed', 'value', 'clipRounds'), 'ARMO':('eid', 'weight', 'value', 'health', 'ar'), 'BOOK':('eid', 'weight', 'value'), 'CLOT':('eid', 'weight', 'value', 'enchantPoints'), 'INGR':('eid', 'weight', 'value'), 'KEYM':('eid', 'weight', 'value'), 'LIGH':('eid', 'weight', 'value', 'duration'), 'MISC':('eid', 'weight', 'value'), 'SGST':('eid', 'weight', 'value', 'uses'), 'SLGM':('eid', 'weight', 'value'), 'WEAP':('eid', 'weight', 'value', 'health', 'damage', 'clipsize', 'minSpread', 'spread', 'baseVatsToHitChance', 'minRange', 'maxRange', 'fireRate', 'overrideActionPoint', 'overrideDamageToWeaponMult', 'attackShotsPerSec', 'reloadTime', 'jamTime', 'criticalDamage', 'criticalMultiplier'), } self.aliases = aliases or {} #--For aliasing mod names
| 478,974 |
def __init__(self,types=None,aliases=None): """Initialize.""" #--type_stats[type] = ... #--AMMO: (eid, weight, value, damage, speed, epoints) #--ARMO: (eid, weight, value, health, strength) #--WEAP: (eid, weight, value, health, damage, speed, reach, epoints) self.type_stats = {'ALCH':{},'AMMO':{},'APPA':{},'ARMO':{},'BOOK':{},'CLOT':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'SGST':{},'SLGM':{},'WEAP':{}} self.type_attrs = { 'ALCH':('eid', 'weight', 'value'), 'AMMO':('eid', 'speed', 'flags', 'value', 'clipRounds'), 'APPA':('eid', 'weight', 'value', 'quality'), 'ARMO':('eid', 'weight', 'value', 'health', 'ar'), 'BOOK':('eid', 'weight', 'value'), 'CLOT':('eid', 'weight', 'value', 'enchantPoints'), 'INGR':('eid', 'weight', 'value'), 'KEYM':('eid', 'weight', 'value'), 'LIGH':('eid', 'weight', 'value', 'duration'), 'MISC':('eid', 'weight', 'value'), 'SGST':('eid', 'weight', 'value', 'uses'), 'SLGM':('eid', 'weight', 'value'), 'WEAP':('eid', 'weight', 'value', 'health', 'damage', 'clipsize', 'minSpread', 'spread', 'baseVatsToHitChance', 'minRange', 'maxRange', 'fireRate', 'overrideActionPoint', 'overrideDamageToWeaponMult', 'attackShotsPerSec', 'reloadTime', 'jamTime', 'criticalDamage', 'criticalMultiplier'), } self.aliases = aliases or {} #--For aliasing mod names
|
def __init__(self,types=None,aliases=None): """Initialize.""" #--type_stats[type] = ... #--AMMO: (eid, weight, value, damage, speed, epoints) #--ARMO: (eid, weight, value, health, strength) #--WEAP: (eid, weight, value, health, damage, speed, reach, epoints) self.type_stats = {'ALCH':{},'AMMO':{},'APPA':{},'ARMO':{},'BOOK':{},'CLOT':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'SGST':{},'SLGM':{},'WEAP':{}} self.type_attrs = { 'ALCH':('eid', 'weight', 'value'), 'AMMO':('eid', 'speed', 'flags', 'value', 'clipRounds'), 'APPA':('eid', 'weight', 'value', 'quality'), 'ARMO':('eid', 'weight', 'value', 'health', 'ar'), 'BOOK':('eid', 'weight', 'value'), 'INGR':('eid', 'weight', 'value'), 'KEYM':('eid', 'weight', 'value'), 'LIGH':('eid', 'weight', 'value', 'duration'), 'MISC':('eid', 'weight', 'value'), 'SGST':('eid', 'weight', 'value', 'uses'), 'SLGM':('eid', 'weight', 'value'), 'WEAP':('eid', 'weight', 'value', 'health', 'damage', 'clipsize', 'minSpread', 'spread', 'baseVatsToHitChance', 'minRange', 'maxRange', 'fireRate', 'overrideActionPoint', 'overrideDamageToWeaponMult', 'attackShotsPerSec', 'reloadTime', 'jamTime', 'criticalDamage', 'criticalMultiplier'), } self.aliases = aliases or {} #--For aliasing mod names
| 478,975 |
def __init__(self,types=None,aliases=None): """Initialize.""" #--type_stats[type] = ... #--AMMO: (eid, weight, value, damage, speed, epoints) #--ARMO: (eid, weight, value, health, strength) #--WEAP: (eid, weight, value, health, damage, speed, reach, epoints) self.type_stats = {'ALCH':{},'AMMO':{},'APPA':{},'ARMO':{},'BOOK':{},'CLOT':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'SGST':{},'SLGM':{},'WEAP':{}} self.type_attrs = { 'ALCH':('eid', 'weight', 'value'), 'AMMO':('eid', 'speed', 'flags', 'value', 'clipRounds'), 'APPA':('eid', 'weight', 'value', 'quality'), 'ARMO':('eid', 'weight', 'value', 'health', 'ar'), 'BOOK':('eid', 'weight', 'value'), 'CLOT':('eid', 'weight', 'value', 'enchantPoints'), 'INGR':('eid', 'weight', 'value'), 'KEYM':('eid', 'weight', 'value'), 'LIGH':('eid', 'weight', 'value', 'duration'), 'MISC':('eid', 'weight', 'value'), 'SGST':('eid', 'weight', 'value', 'uses'), 'SLGM':('eid', 'weight', 'value'), 'WEAP':('eid', 'weight', 'value', 'health', 'damage', 'clipsize', 'minSpread', 'spread', 'baseVatsToHitChance', 'minRange', 'maxRange', 'fireRate', 'overrideActionPoint', 'overrideDamageToWeaponMult', 'attackShotsPerSec', 'reloadTime', 'jamTime', 'criticalDamage', 'criticalMultiplier'), } self.aliases = aliases or {} #--For aliasing mod names
|
def __init__(self,types=None,aliases=None): """Initialize.""" #--type_stats[type] = ... #--AMMO: (eid, weight, value, damage, speed, epoints) #--ARMO: (eid, weight, value, health, strength) #--WEAP: (eid, weight, value, health, damage, speed, reach, epoints) self.type_stats = {'ALCH':{},'AMMO':{},'APPA':{},'ARMO':{},'BOOK':{},'CLOT':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'SGST':{},'SLGM':{},'WEAP':{}} self.type_attrs = { 'ALCH':('eid', 'weight', 'value'), 'AMMO':('eid', 'speed', 'flags', 'value', 'clipRounds'), 'APPA':('eid', 'weight', 'value', 'quality'), 'ARMO':('eid', 'weight', 'value', 'health', 'ar'), 'BOOK':('eid', 'weight', 'value'), 'CLOT':('eid', 'weight', 'value', 'enchantPoints'), 'INGR':('eid', 'weight', 'value'), 'KEYM':('eid', 'weight', 'value'), 'LIGH':('eid', 'weight', 'value', 'duration'), 'MISC':('eid', 'weight', 'value'), 'WEAP':('eid', 'weight', 'value', 'health', 'damage','clipsize', 'reach','ammoUse','minSpread','spread','sightFov','baseVatsToHitChance','projectileCount', 'minRange','maxRange','fireRate','overrideActionPoint','rumbleLeftMotorStrength', 'rumbleRightMotorStrength','rumbleDuration','overrideDamageToWeaponMult','attackShotsPerSec', 'reloadTime','jamTime','aimArc','rambleWavelangth','limbDmgMult','sightUsage', 'semiAutomaticFireDelayMin','semiAutomaticFireDelayMax','criticalDamage','criticalMultiplier'), } self.aliases = aliases or {} #--For aliasing mod names
| 478,976 |
def readFromMod(self,modInfo): """Reads stats from specified mod.""" loadFactory= LoadFactory(False,MreAlch,MreAmmo,MreAppa,MreArmo,MreBook,MreClot,MreIngr,MreKeym,MreLigh,MreMisc,MreSgst,MreSlgm,MreWeap) modFile = ModFile(modInfo,loadFactory) modFile.load(True) mapper = modFile.getLongMapper() for type in self.type_stats: stats, attrs = self.type_stats[type], self.type_attrs[type] for record in getattr(modFile,type).getActiveRecords(): longid = mapper(record.fid) recordGetAttr = record.__getattribute__ stats[longid] = tuple(recordGetAttr(attr) for attr in attrs)
|
def readFromMod(self,modInfo): """Reads stats from specified mod.""" loadFactory= LoadFactory(False,MreAlch,MreAmmo,MreArmo,MreBook,MreIngr,MreKeym,MreLigh,MreMisc,MreWeap) modFile = ModFile(modInfo,loadFactory) modFile.load(True) mapper = modFile.getLongMapper() for type in self.type_stats: stats, attrs = self.type_stats[type], self.type_attrs[type] for record in getattr(modFile,type).getActiveRecords(): longid = mapper(record.fid) recordGetAttr = record.__getattribute__ stats[longid] = tuple(recordGetAttr(attr) for attr in attrs)
| 478,977 |
def writeToMod(self,modInfo): """Writes stats to specified mod.""" loadFactory= LoadFactory(True,MreAlch,MreAmmo,MreAppa,MreArmo,MreBook,MreClot,MreIngr,MreKeym,MreLigh,MreMisc,MreSgst,MreSlgm,MreWeap) modFile = ModFile(modInfo,loadFactory) modFile.load(True) mapper = modFile.getLongMapper() changed = {} #--changed[modName] = numChanged for type in self.type_stats: stats, attrs = self.type_stats[type], self.type_attrs[type] for record in getattr(modFile,type).getActiveRecords(): longid = mapper(record.fid) itemStats = stats.get(longid,None) if not itemStats: continue map(record.__setattr__,attrs,itemStats) record.setChanged() changed[longid[0]] = 1 + changed.get(longid[0],0) if changed: modFile.safeSave() return changed
|
def writeToMod(self,modInfo): """Writes stats to specified mod.""" loadFactory= LoadFactory(True,MreAlch,MreAmmo,MreArmo,MreBook,MreIngr,MreKeym,MreLigh,MreMisc,MreWeap) modFile = ModFile(modInfo,loadFactory) modFile.load(True) mapper = modFile.getLongMapper() changed = {} #--changed[modName] = numChanged for type in self.type_stats: stats, attrs = self.type_stats[type], self.type_attrs[type] for record in getattr(modFile,type).getActiveRecords(): longid = mapper(record.fid) itemStats = stats.get(longid,None) if not itemStats: continue map(record.__setattr__,attrs,itemStats) record.setChanged() changed[longid[0]] = 1 + changed.get(longid[0],0) if changed: modFile.safeSave() return changed
| 478,978 |
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((sfloat,int,int,sfloat,int),fields[4:9])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((sfloat,int,int,int),fields[4:8])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((sfloat,int,int,),fields[4:7])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((sfloat,int,int,),fields[4:7])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((sfloat,int,int,int,sfloat,sfloat,int),fields[4:11])) ins.close()
|
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, armor, books, ingredients, keys, lights, misc, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','ARMO','BOOK','INGR','KEYM','LIGH','MISC','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((sfloat,int,int,sfloat,int),fields[4:9])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((sfloat,int,int,int),fields[4:8])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((sfloat,int,int,),fields[4:7])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((sfloat,int,int,),fields[4:7])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((sfloat,int,int,int,sfloat,sfloat,int),fields[4:11])) ins.close()
| 478,979 |
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((sfloat,int,int,sfloat,int),fields[4:9])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((sfloat,int,int,int),fields[4:8])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((sfloat,int,int,),fields[4:7])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((sfloat,int,int,),fields[4:7])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((sfloat,int,int,int,sfloat,sfloat,int),fields[4:11])) ins.close()
|
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((sfloat,int,int),fields[4:7])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((sfloat,int,int,int),fields[4:8])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((sfloat,int,int,),fields[4:7])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((sfloat,int,int,),fields[4:7])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((sfloat,int,int,int,sfloat,sfloat,int),fields[4:11])) ins.close()
| 478,980 |
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((sfloat,int,int,sfloat,int),fields[4:9])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((sfloat,int,int,int),fields[4:8])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((sfloat,int,int,),fields[4:7])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((sfloat,int,int,),fields[4:7])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((sfloat,int,int,int,sfloat,sfloat,int),fields[4:11])) ins.close()
|
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((sfloat,int,int,sfloat,int),fields[4:9])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((sfloat,int,int,int),fields[4:8])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((sfloat,int,int,),fields[4:7])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((sfloat,int,int,),fields[4:7])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((sfloat,int,int,int,sfloat,sfloat,int),fields[4:11])) ins.close()
| 478,981 |
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((sfloat,int,int,sfloat,int),fields[4:9])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((sfloat,int,int,int),fields[4:8])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((sfloat,int,int,),fields[4:7])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((sfloat,int,int,),fields[4:7])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((sfloat,int,int,int,sfloat,sfloat,int),fields[4:11])) ins.close()
|
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((sfloat,int,int,sfloat,int),fields[4:9])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((sfloat,int,int,int),fields[4:8])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((sfloat,int,int,),fields[4:7])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((sfloat,int,int,),fields[4:7])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((sfloat,int,int,int,sfloat,sfloat,int),fields[4:11])) ins.close()
| 478,982 |
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((sfloat,int,int,sfloat,int),fields[4:9])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((sfloat,int,int,int),fields[4:8])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((sfloat,int,int,),fields[4:7])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((sfloat,int,int,),fields[4:7])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((sfloat,int,int,int,sfloat,sfloat,int),fields[4:11])) ins.close()
|
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((sfloat,int,int,sfloat,int),fields[4:9])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((sfloat,int,int,int),fields[4:8])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((sfloat,int,int,),fields[4:7])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((sfloat,int,int,),fields[4:7])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((sfloat,int,int,int,sfloat,sfloat,int),fields[4:11])) ins.close()
| 478,983 |
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((sfloat,int,int,sfloat,int),fields[4:9])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((sfloat,int,int,int),fields[4:8])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((sfloat,int,int,),fields[4:7])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((sfloat,int,int,),fields[4:7])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((sfloat,int,int,int,sfloat,sfloat,int),fields[4:11])) ins.close()
|
def readFromText(self,textPath): """Reads stats from specified text file.""" alch, ammo, appa, armor, books, clothing, ingredients, keys, lights, misc, sigilstones, soulgems, weapons = [self.type_stats[type] for type in ('ALCH','AMMO','APPA','ARMO','BOOK','CLOT','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP')] aliases = self.aliases ins = bolt.CsvReader(textPath) pack,unpack = struct.pack,struct.unpack sfloat = lambda a: unpack('f',pack('f',float(a)))[0] #--Force standard precision for fields in ins: if len(fields) < 3 or fields[2][:2] != '0x': continue type,modName,objectStr,eid = fields[0:4] modName = GPath(modName) longid = (GPath(aliases.get(modName,modName)),int(objectStr[2:],16)) if type == 'ALCH': alch[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'AMMO': ammo[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, damage, speed, enchantPoints) zip((sfloat,int,int,sfloat,int),fields[4:9])) elif type == 'ARMO': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, strength) zip((sfloat,int,int,int),fields[4:8])) elif type == 'BOOK': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'CLOT': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, echantPoints) zip((sfloat,int,int,),fields[4:7])) elif type == 'INGR': armor[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'KEYM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'LIGH': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, duration) zip((sfloat,int,int,),fields[4:7])) elif type == 'MISC': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'SGST': books[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, uses) zip((sfloat,int,int,),fields[4:7])) elif type == 'SLGM': keys[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value) zip((sfloat,int),fields[4:6])) elif type == 'WEAP': weapons[longid] = (eid,) + tuple(func(field) for func,field in #--(weight, value, health, damage, speed, reach, epoints) zip((sfloat,int,int,int,int, sfloat,int,sfloat,sfloat,sfloat,int,int, sfloat,sfloat,sfloat,sfloat,sfloat, sfloat,sfloat,sfloat,sfloat, sfloat,sfloat,sfloat,sfloat,sfloat,sfloat, sfloat,sfloat,int,sfloat),fields[4:35])) ins.close()
| 478,984 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,985 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,986 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,987 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,988 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,989 |
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
|
def getSortedIds(stats): longids = stats.keys() longids.sort(key=lambda a: stats[a][0]) longids.sort(key=itemgetter(0)) return longids
| 478,990 |
def __str__(self): if self.inName: if isinstance(inName, str): return self.inName+': '+self.message return self.inName.s+': '+self.message else: return _('Unknown File: ')+self.message
|
def __str__(self): if self.inName: if isinstance(self.inName, str): return self.inName+': '+self.message return self.inName.s+': '+self.message else: return _('Unknown File: ')+self.message
| 478,991 |
def loadData(self,record,ins,type,size,readId): if size == 136: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 124: #--Else 124 byte record (skips sightUsage, semiAutomaticFireDelayMin and semiAutomaticFireDelayMax... unpacked = ins.unpack('Iff4B5fI4BffII11fIIffI',size,readId) elif size == 120: #--Else 120 byte record (skips resistType, sightUsage, semiAutomaticFireDelayMin and semiAutomaticFireDelayMax... unpacked = ins.unpack('Iff4B5fI4BffII11fIIff',size,readId) else: raise "Unexpected size encountered for WEAP:DNAM subrecord: %s" % size unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
|
def loadData(self,record,ins,type,size,readId): if size == 136: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 124: #--Else 124 byte record (skips sightUsage, semiAutomaticFireDelayMin and semiAutomaticFireDelayMax... unpacked = ins.unpack('Iff4B5fI4BffII11fIIffI',size,readId) elif size == 120: #--Else 120 byte record (skips resistType, sightUsage, semiAutomaticFireDelayMin and semiAutomaticFireDelayMax... unpacked = ins.unpack('Iff4B5fI4BffII11fIIff',size,readId) else: raise "Unexpected size encountered for WEAP:DNAM subrecord: %s" % size unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
| 478,992 |
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 self.classestemp = set() #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreMgef,): recAttrs_class[recClass] = ('castingSound','boltSound','hitSound','areaSound') for recClass in (MreActi,): recAttrs_class[recClass] = ('soundLooping','soundActivation') for recClass in (MreLigh,MreTact): recAttrs_class[recClass] = ('sound',) for recClass in (MreWthr,): recAttrs_class[recClass] = ('sounds',) for recClass in (MreCont,): recAttrs_class[recClass] = ('soundOpen','soundClose') for recClass in (MreDoor,): recAttrs_class[recClass] = ('soundOpen','soundClose','soundLoop') for recClass in (MreExpl,MreIpct,): recAttrs_class[recClass] = ('soundLevel','sound1','sound2') for recClass in (MreProj,): recAttrs_class[recClass] = ('sound','soundCountDown','soundDisable','soundLevel') for recClass in (MreAspc,): recAttrs_class[recClass] = ('soundLooping','useSoundFromRegion','environmentType') for recClass in (MreWeap,): recAttrs_class[recClass] = ('soundGunShot3D','soundGunShot2D','soundGunShot3DLooping','soundLevel') #--Needs Longs self.longTypes = set(('MGEF','ACTI','LIGH','WTHR','CONT','DOOR','EXPL','IPCT','PROJ','ASPC','SOUN','REGN'))
|
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 self.classestemp = set() #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreMgef,): recAttrs_class[recClass] = ('castingSound','boltSound','hitSound','areaSound') for recClass in (MreActi,): recAttrs_class[recClass] = ('soundLooping','soundActivation') for recClass in (MreLigh,MreTact): recAttrs_class[recClass] = ('sound',) for recClass in (MreWthr,): recAttrs_class[recClass] = ('sounds',) for recClass in (MreCont,): recAttrs_class[recClass] = ('soundOpen','soundClose') for recClass in (MreDoor,): recAttrs_class[recClass] = ('soundOpen','soundClose','soundLoop') for recClass in (MreExpl,MreIpct,): recAttrs_class[recClass] = ('soundLevel','sound1','sound2') for recClass in (MreProj,): recAttrs_class[recClass] = ('sound','soundCountDown','soundDisable','soundLevel') for recClass in (MreAspc,): recAttrs_class[recClass] = ('soundLooping','useSoundFromRegion','environmentType') for recClass in (MreWeap,): recAttrs_class[recClass] = ('soundGunShot3D','soundGunShot2D','soundGunShot3DLooping','soundLevel') #--Needs Longs self.longTypes = set(('MGEF','ACTI','LIGH','WTHR','CONT','DOOR','EXPL','IPCT','PROJ','ASPC','SOUN','REGN'))
| 478,993 |
def getEffectsSummary(self,mgef_school=None,mgef_name=None): """Return a text description of magic effects.""" mgef_school = mgef_school or bush.mgef_school mgef_name = mgef_name or bush.mgef_name buff = cStringIO.StringIO() avEffects = bush.actorValueEffects aValues = bush.actorValues buffWrite = buff.write if self.effects: school = mgef_school[self.effects[0].name] buffWrite(bush.actorValues[20+school] + '\n') for index,effect in enumerate(self.effects): if effect.scriptEffect: effectName = effect.scriptEffect.full or 'Script Effect' else: effectName = mgef_name[effect.name] if effect.name in avEffects: effectName = re.sub(_('(Attribute|Skill)'),aValues[effect.actorValue],effectName) buffWrite('o+*'[effect.recipient]+' '+effectName) if effect.magnitude: buffWrite(' '+`effect.magnitude`+'m') if effect.area: buffWrite(' '+`effect.area`+'a') if effect.duration > 1: buffWrite(' '+`effect.duration`+'d') buffWrite('\n') return buff.getvalue()
|
def getEffectsSummary(self,mgef_school=None,mgef_name=None): """Return a text description of magic effects.""" mgef_school = mgef_school or bush.mgef_school mgef_name = mgef_name or bush.mgef_name buff = cStringIO.StringIO() avEffects = bush.actorValueEffects aValues = bush.actorValues buffWrite = buff.write if self.effects: school = mgef_school[self.effects[0].name] buffWrite(bush.actorValues[20+school] + '\n') for index,effect in enumerate(self.effects): if effect.scriptEffect: effectName = effect.scriptEffect.full or 'Script Effect' else: effectName = mgef_name[effect.name] if effect.name in avEffects: effectName = re.sub(_('(Attribute|Skill)'),aValues[effect.actorValue],effectName) buffWrite('o+*'[effect.recipient]+' '+effectName) if effect.magnitude: buffWrite(' '+`effect.magnitude`+'m') if effect.area: buffWrite(' '+`effect.area`+'a') if effect.duration > 1: buffWrite(' '+`effect.duration`+'d') buffWrite('\n') return buff.getvalue()
| 478,994 |
def loadData(self,record,ins,type,size,readId): if size == 224: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 96: #--Else 96 byte record (skips particle variables, and color keys # Only used twice in test shaders (0004b6d5, 0004b6d6) unpacked = ins.unpack('B3s3I3Bs9f3Bs8fI',size,readId) else: raise "Unexpected size encountered for EFSH subrecord: %s" % size unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked, record.flags.getTrueAttrs()
|
def loadData(self,record,ins,type,size,readId): if size == 308: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 96: #--Else 96 byte record (skips particle variables, and color keys # Only used twice in test shaders (0004b6d5, 0004b6d6) unpacked = ins.unpack('B3s3I3Bs9f3Bs8fI',size,readId) else: raise "Unexpected size encountered for EFSH subrecord: %s" % size unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked, record.flags.getTrueAttrs()
| 478,995 |
def loadData(self,record,ins,type,size,readId): if size == 224: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 96: #--Else 96 byte record (skips particle variables, and color keys # Only used twice in test shaders (0004b6d5, 0004b6d6) unpacked = ins.unpack('B3s3I3Bs9f3Bs8fI',size,readId) else: raise "Unexpected size encountered for EFSH subrecord: %s" % size unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked, record.flags.getTrueAttrs()
|
def loadData(self,record,ins,type,size,readId): if size == 224: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 96: #--Else 96 byte record (skips particle variables, and color keys # Only used twice in test shaders (0004b6d5, 0004b6d6) unpacked = ins.unpack('B3s3I3Bs9f3Bs8fI',size,readId) else: raise "Unexpected size encountered for EFSH subrecord: %s" % size unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked, record.flags.getTrueAttrs()
| 478,996 |
def loadData(self,record,ins,type,size,readId): if size == 224: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 96: #--Else 96 byte record (skips particle variables, and color keys # Only used twice in test shaders (0004b6d5, 0004b6d6) unpacked = ins.unpack('B3s3I3Bs9f3Bs8fI',size,readId) else: raise "Unexpected size encountered for EFSH subrecord: %s" % size unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked, record.flags.getTrueAttrs()
|
def loadData(self,record,ins,type,size,readId): if size == 224: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 96: #--Else 96 byte record (skips particle variables, and color keys # Only used twice in test shaders (0004b6d5, 0004b6d6) unpacked = ins.unpack('B3s3I3Bs9f3Bs8fI',size,readId) else: raise "Unexpected size encountered for EFSH subrecord: %s" % size unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked, record.flags.getTrueAttrs()
| 478,997 |
def dumpData(self,record,out): target = record.__getattribute__(self.attr,None) if not target: return if record.type == 0: format,attrs = ('II',('quest','queststage')) elif record.type == 1: format,attrs = ('I',('ability',)) elif record.type == 2: format,attrs = ('HB',('entrypoint','function')) else: raise ModError(ins.inName,_('Unexpected type: %d') % record.type) values = [] valuesAppend = values.append getter = target.__getattribute__ for attr in attrs: value = getter(attr) valuesAppend(value) try: out.packSub(self.subType,format,*values) except struct.error: print self.subType,format,values raise
|
def dumpData(self,record,out): target = record.__getattribute__(self.attr) if not target: return if record.type == 0: format,attrs = ('II',('quest','queststage')) elif record.type == 1: format,attrs = ('I',('ability',)) elif record.type == 2: format,attrs = ('HB',('entrypoint','function')) else: raise ModError(ins.inName,_('Unexpected type: %d') % record.type) values = [] valuesAppend = values.append getter = target.__getattribute__ for attr in attrs: value = getter(attr) valuesAppend(value) try: out.packSub(self.subType,format,*values) except struct.error: print self.subType,format,values raise
| 478,998 |
def mapFids(self,record,function,save=False): target = record.__getattribute__(self.attr,None) if not target: return if record.type == 0: result = function(target.quest) if save: target.quest = result elif record.type == 1: result = function(target.ability) if save: target.ability = result
|
def mapFids(self,record,function,save=False): target = record.__getattribute__(self.attr) if not target: return if record.type == 0: result = function(target.quest) if save: target.quest = result elif record.type == 1: result = function(target.ability) if save: target.ability = result
| 478,999 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.