Esempio n. 1
0
 def __initData_1(self):
     '''存在数据库实例时的初始化方式'''
     petInstanceData = dbCharacterPet.getPetInfoById(self.baseInfo.id)
     self.templateId = petInstanceData.get('templateID')
     StrGrowth = petInstanceData.get('StrGrowth')
     WisGrowth = petInstanceData.get('WisGrowth')
     VitGrowth = petInstanceData.get('VitGrowth')
     DexGrowth = petInstanceData.get('DexGrowth')
     self._owner = petInstanceData.get('ownerID')
     hp = petInstanceData.get('hp')
     self.chuancheng = bool(petInstanceData.get('chuancheng'))
     self._chuancheng = bool(petInstanceData.get('_chuancheng'))
     self.flowFlag = bool(petInstanceData.get('showed'))
     self.attribute.initData(StrGrowth, WisGrowth, VitGrowth, DexGrowth, hp)
     self.level.setExp(petInstanceData.get('exp'))
     self.level.setLevel(petInstanceData.get('level'))
     if petInstanceData.get('name'):
         self.baseInfo.setName(petInstanceData.get('name', ''))
     else:
         templateinfo = dbCharacterPet.PET_TEMPLATE.get(self.templateId)
         self.baseInfo.setName(templateinfo.get('nickname', ''))
Esempio n. 2
0
 def __initData_1(self):
     '''存在数据库实例时的初始化方式'''
     petInstanceData = dbCharacterPet.getPetInfoById(self.baseInfo.id)
     self.templateId = petInstanceData.get('templateID')
     StrGrowth = petInstanceData.get('StrGrowth')
     WisGrowth = petInstanceData.get('WisGrowth')
     VitGrowth = petInstanceData.get('VitGrowth')
     DexGrowth = petInstanceData.get('DexGrowth')
     self._owner = petInstanceData.get('ownerID')
     hp = petInstanceData.get('hp')
     self.chuancheng = bool(petInstanceData.get('chuancheng'))
     self._chuancheng = bool(petInstanceData.get('_chuancheng'))
     self.flowFlag = bool(petInstanceData.get('showed'))
     self.attribute.initData(StrGrowth, WisGrowth, VitGrowth, DexGrowth, hp)
     self.level.setExp(petInstanceData.get('exp'))
     self.level.setLevel(petInstanceData.get('level'))
     if petInstanceData.get('name'):
         self.baseInfo.setName(petInstanceData.get('name',''))
     else:
         templateinfo = dbCharacterPet.PET_TEMPLATE.get(self.templateId)
         self.baseInfo.setName(templateinfo.get('nickname',''))
Esempio n. 3
0
 def __initData_1(self):
     '''存在数据库实例时的初始化方式'''
     petInstanceData = dbCharacterPet.getPetInfoById(self.baseInfo.id)
     self._templateId = petInstanceData.get('templateID')
     self._baseInfo = dbCharacterPet.PET_TEMPLATE.get(self._templateId)
     self.flowFlag = bool(petInstanceData.get('showed'))
     self._extAttribute = petInstanceData
     self.setHp(petInstanceData.get('hp',0))
     self.setLevel(petInstanceData.get('level',0))
     self.setExp(petInstanceData.get('exp',0))
     self.setQuality(petInstanceData.get('quality',0))
     self.setLifeState(petInstanceData.get('lifestate',0))
     if petInstanceData.get('name',''):
         self.baseInfo.setName(petInstanceData.get('name',''))
     else:
         self.baseInfo.setName(self._baseInfo.get('nickname'))
     self._owner = petInstanceData.get('ownerID',0)
     #初始化宠物的技能
     for i in range(1,MAXSKILLCNT+1):
         skillId = petInstanceData.get('skill_%d'%i,0)
         if skillId:
             self._skillInfo.append(skillId)
Esempio n. 4
0
 def __initData_1(self):
     '''存在数据库实例时的初始化方式'''
     petInstanceData = dbCharacterPet.getPetInfoById(self.baseInfo.id)
     self._templateId = petInstanceData.get('templateID')
     self._baseInfo = dbCharacterPet.PET_TEMPLATE.get(self._templateId)
     self.flowFlag = bool(petInstanceData.get('showed'))
     self._extAttribute = petInstanceData
     self.setHp(petInstanceData.get('hp', 0))
     self.setLevel(petInstanceData.get('level', 0))
     self.setExp(petInstanceData.get('exp', 0))
     self.setQuality(petInstanceData.get('quality', 0))
     self.setLifeState(petInstanceData.get('lifestate', 0))
     if petInstanceData.get('name', ''):
         self.baseInfo.setName(petInstanceData.get('name', ''))
     else:
         self.baseInfo.setName(self._baseInfo.get('nickname'))
     self._owner = petInstanceData.get('ownerID', 0)
     #初始化宠物的技能
     for i in range(1, MAXSKILLCNT + 1):
         skillId = petInstanceData.get('skill_%d' % i, 0)
         if skillId:
             self._skillInfo.append(skillId)