def __init__(self): propEffectData = py_util._readXml('/data/xml/PropertyEffect.xml', 'id_i') self.EFFECT_PASSIVE_PROPERTY_DATA = propEffectData passiveSkillData = py_util._readXml('/data/xml/PassiveSkillEffect.xml', 'id_i') self.EFFECT_PASSIVE_SKILL_DATA = passiveSkillData
def __init__(self): self.activityTime = py_util._readXml('/data/xml/ActivityTime.xml', 'weekDay_i') self.activities = py_util._readXml('/data/xml/Activity.xml', 'id_i') self.activityReward = {} self.activityReward = py_util._readXml('/data/xml/ActivityReward.xml', 'id_i')
def __init__(self): SkillLevelUpData = py_util._readXml( "/data/xml/SpiritLevelData_Skill.xml", "id_i") MarkLevelUpData = py_util._readXml( "/data/xml/SpiritLevelData_Mark.xml", "id_i") SkillData = py_util._readXml("/data/xml/SpiritSkillData.xml", "id_i") MarkData = py_util._readXml("/data/xml/SpiritMarkData.xml", "id_i") self.spiritData = {} self.spiritData['SkillLevelUpData'] = SkillLevelUpData self.spiritData['MarkLevelUpData'] = MarkLevelUpData self.spiritData['SkillData'] = SkillData self.spiritData['MarkData'] = MarkData
def __init__(self): #解析装备(武器,穿戴等) equipment = py_util._readXml("/data/xml/ItemEquipment.xml", "id_i") #解析宝石 jewel = py_util._readXml("/data/xml/ItemJewel.xml", "id_i") #解析普通道具(礼包或材料等) comItems = py_util._readXml("/data/xml/ItemCom.xml", "id_i") tbl = {} it = {} #合并一起,方便循环遍历 it = ChainMap(equipment, jewel, comItems) #将三种道具解析到一个table中 for _, v in it.items(): for tk, tv in v.items(): if tv[itemType]: tbl[tk] = tv return tbl
def __init__(self): self.vipDatas = {} cfgDatas = py_util._readXml("/data/xml/privilege.xml", "id_i") for k, v in cfgDatas.items(): rangeSum = v[accumulatedAmount] if rangeSum[0] > rangeSum[1]: ERROR_MSG( "VipCfgData:GetVipLevel:vip config table error:rangeSum data error" ) self.vipDatas = cfgDatas
def initForEquipValues(self): #--装备属性表 ev = py_util._readXml("/data/xml/ItemEquipValues.xml", "id_i") tbl = {} for k, v in ev.items(): #构建新key值 t = str(v[quality]) + str(v[vocation]) + str(v[type]) + str( v[level]) it = {} for tk, tv in v.items(): if tk != "id" and tk != "vocation" and tk != "type" and tk != "level" and tk != "quality": it[tk] = tv tbl[t] = it return tbl
def __init__(self, a, b): tmp = py_util._readXml('/data/xml/ArenaConfig.xml', 'key') def less(a, b): return a < b for key, value in tmp.items(): if value['value']: k = py_util.format_key_value(key, value['value'])[0] v = py_util.format_key_value(key, value['value'])[1] #TODO ������ self.m_scoreRewards = py_util._readXml( '/data/xml/ArenaScoreReward.xml', 'id_i') self.m_creditRewards4Challenge = py_util._readXml( '/data/xml/ArenaCreditReward4Challenge.xml', 'id_i') self.m_typeAndlevel2CreditRewards = {} for id, v in self.m_creditRewards4Challenge.items(): t = v[type] if self.m_creditRewards4Challenge[t] is None: self.m_creditRewards4Challenge[t] = {}
class NameDataMgr: def __init__(self): DEBUG_MSG("NameDataMgr:initData begin") self.OccidentalLast = py_util._readXml("/data/xml/NameOccidentalLast.xml", "id_i") self.OccidentalFemale = py_util._readXml("/data/xml/NameOccidentalFemale.xml", "id_i") self.OccidentalMale = py_util._readXml("/data/xml/NameOccidentalMale.xml", "id_i") self.CuteFirst = py_util._readXml("/data/xml/NameCuteFirst.xml", "id_i") self.CuteLast = py_util._readXml("/data/xml/NameCuteLast.xml", "id_i") self.OrientalLast = py_util._readXml("/data/xml/NameOrientalLast.xml", "id_i") self.OrientalFemale = py_util._readXml("/data/xml/NameOrientalFemale.xml", "id_i") self.OrientalMale = py_util._readXml("/data/xml/NameOrientalMale.xml", "id_i") self.occi_female = [] #西方 self.occi_male = [ ]#西方 self.cute = [] #可爱 self.orie_female = [] #东方 self.orie_male = [] #东方 self.count = 0 DEBUG_MSG("NameDataMgr:initData over.") def InitByDB(self,used_names): #used_name is dict #--组合名字 # --西方,姓在后 for _,lastname in self.OccidentalLast.items(): #女生名字 for _,femalname in self.OccidentalFemale.items(): name=femalname['name']+Spliter+lastname['name'] if used_names.get(name,0)==0: #TODO 在Python中,当你使用a[key]这种方式从字典中获取一个值时,若字典中不存在这个此key时就会产生一个KeyError的错误 self.occi_female.append(name) self.count = self.count + 1 for _,malename in self.OccidentalMale.items(): #男生名字 name=malename['name']+Spliter+lastname['name'] if used_names.get(name,0)==0: self.occi_male.append(name) self.count = self.count + 1 #可爱,女性名字,姓在前 for _,lastname in self.CuteLast.items(): #姓 for _,firstname in self.CuteFirst.items(): #名 name=lastname['name']+Spliter+firstname['name'] if used_names.get(name,0)==0: self.cute.append(name) self.count = self.count + 1 #东方,姓在前 for _,lastname in self.OrientalLast.items(): #男名 for _,malename in self.OrientalMale.items(): name=lastname['name']+Spliter+malename['name'] if used_names.get(name,0)==0: self.orie_male.append(name) self.count = self.count + 1 #女名 for _,femalname in self.OrientalFemale.items(): name=lastname['name']+Spliter+femalname['name'] if used_names.get(name,0)==0: self.orie_female.append(name) self.count = self.count + 1 DEBUG_MSG('NameDataMgr::InitByDB: %s' % self.count) if self.count==0: DEBUG_MSG('NameDataMgr::InitByDB: %s' % "name space is running out.")
def __init__(self): ieffect = py_util._readXml("/data/xml/ItemEffect.xml", "id_i") self.EData = ieffect
def __init__(self): cfgData = py_util._readXml('/data/xml/HpTypes.xml', 'id_i') self.cfgData = cfgData
def __init__(self): self.data = py_util._readXml("/data/xml/AvatarLevel.xml", "id_i")
def __init__(self): #ʱ���ǻ���� self.diamond_mine = py_util._readXml('/data/xml/DiamondMine.xml', 'id_i')
def __init__(self): cfgData = py_util._readXml("/data/xml/PriceList.xml", "id_i") self.cfgData = cfgData for _, v in self.cfgData.items(): self.VerifyData(v)
def __init__(self): self.role_data = py_util._readXml("/data/xml/role_data.xml", "vocation_i")
def __init__(self): DEBUG_MSG("NameDataMgr:initData begin") self.OccidentalLast = py_util._readXml("/data/xml/NameOccidentalLast.xml", "id_i") self.OccidentalFemale = py_util._readXml("/data/xml/NameOccidentalFemale.xml", "id_i") self.OccidentalMale = py_util._readXml("/data/xml/NameOccidentalMale.xml", "id_i")
def __init__(self): self.cfgData== py_util._readXml('/data/xml/ArenaLevel.xml', 'id_i')
def __init__(self): cfgDatas = py_util._readXml("/data/xml/FormulaParameters.xml", "id_i") if cfgDatas: self.cfgdatas = cfgDatas or {}