def detailedSetting_func3(): ''' 询问玩家性经验程度流程 ''' flowReturn = CreatorCharacterPanel.detailedSetting3Panel() sexTemDataList = list(TextLoading.getTextData(TextLoading.attrTemplatePath,'SexExperience').keys()) sexTemDataList.reverse() sexTemName = sexTemDataList[flowReturn] characterSexExperienceData = AttrCalculation.getSexExperience(sexTemName) CacheContorl.characterData['character'][0].SexExperienceTem = sexTemName PyCmd.clr_cmd() detailedSetting_func8()
def detailedSetting_func3(): flowReturn = CreatorCharacterPanel.detailedSetting3Panel() sexTemDataList = ValueHandle.dictKeysToList(TextLoading.getTextData(TextLoading.attrTemplatePath,'SexExperience')) sexTemDataList = ValueHandle.reverseArrayList(sexTemDataList) sexTemName = sexTemDataList[flowReturn] if flowReturn != len(sexTemDataList) - 1: CacheContorl.featuresList['Chastity'] = '' else: pass characterSexExperienceData = AttrCalculation.getSexExperience(sexTemName) CacheContorl.temporaryCharacter['SexExperience'] = characterSexExperienceData CacheContorl.temporaryCharacter['SexGrade'] = AttrCalculation.getSexGrade(characterSexExperienceData) PyCmd.clr_cmd() detailedSetting_func4()
def detailedSetting_func3(): ''' 询问玩家性经验程度流程 ''' flowReturn = CreatorCharacterPanel.detailedSetting3Panel() sexTemDataList = list( TextLoading.getTextData(TextLoading.attrTemplatePath, 'SexExperience').keys()) sexTemDataList.reverse() sexTemName = sexTemDataList[flowReturn] if flowReturn != len(sexTemDataList) - 1: CacheContorl.featuresList['Chastity'] = '' characterSexExperienceData = AttrCalculation.getSexExperience(sexTemName) CacheContorl.temporaryCharacter[ 'SexExperience'] = characterSexExperienceData CacheContorl.temporaryCharacter['SexGrade'] = AttrCalculation.getSexGrade( characterSexExperienceData) PyCmd.clr_cmd() detailedSetting_func4()
def initAttr(self): ''' 随机生成角色属性 ''' self.Language[self.MotherTongue] = 10000 self.Birthday = AttrCalculation.getRandNpcBirthDay(self.Age) self.Height = AttrCalculation.getHeight(self.Sex,self.Age,{}) bmi = AttrCalculation.getBMI(self.WeigtTem) self.Weight = AttrCalculation.getWeight(bmi,self.Height['NowHeight']) self.BodyFat = AttrCalculation.getBodyFat(self.Sex,self.BodyFatTem) self.Measurements = AttrCalculation.getMeasurements(self.Sex,self.Height['NowHeight'],self.Weight,self.BodyFat,self.BodyFatTem) self.SexExperience = AttrCalculation.getSexExperience(self.SexExperienceTem) self.SexGrade = AttrCalculation.getSexGrade(self.SexExperience) defaultClothingData = Clothing.creatorSuit(self.ClothingTem,self.Sex) self.Clothing = {clothing:{uuid.uuid1():defaultClothingData[clothing]} if clothing in defaultClothingData else {} for clothing in self.Clothing} self.Chest = AttrCalculation.getChest(self.ChestTem,self.Birthday) self.HitPointMax = AttrCalculation.getMaxHitPoint(self.HitPointTem) self.HitPoint = self.HitPointMax self.ManaPointMax = AttrCalculation.getMaxManaPoint(self.ManaPointTem) self.ManaPoint = self.ManaPointMax self.Nature = Nature.getRandomNature() self.Status = TextLoading.getGameData(TextLoading.characterStatePath) self.WearItem = { "Wear":{key:{} for key in TextLoading.getGameData(TextLoading.wearItemPath)['Wear']}, "Item":{}, } self.Engraving = { "Pain":0, "Happy":0, "Yield":0, "Fear":0, "Resistance":0 } self.SocialContact = {social:{} for social in TextLoading.getTextData(TextLoading.stageWordPath,'144')} self.initClass() self.putOn()
def initCharacter(nowId: int, character: dict): ''' 按id生成角色属性 Keyword arguments: nowId -- 角色id character -- 角色生成模板数据 ''' AttrCalculation.initTemporaryCharacter() characterId = str(nowId) CacheContorl.characterData['character'][ characterId] = CacheContorl.temporaryCharacter.copy() AttrCalculation.setDefaultCache() characterName = character['Name'] characterSex = character['Sex'] CacheContorl.characterData['character'][characterId]['Sex'] = characterSex defaultAttr = AttrCalculation.getAttr(characterSex) defaultAttr['Name'] = characterName defaultAttr['Sex'] = characterSex AttrCalculation.setSexCache(characterSex) defaultAttr['Features'] = CacheContorl.featuresList.copy() if 'MotherTongue' in character: defaultAttr['Language'][character['MotherTongue']] = 10000 defaultAttr['MotherTongue'] = character['MotherTongue'] else: defaultAttr['Language']['Chinese'] = 10000 if 'Age' in character: ageTem = character['Age'] characterAge = AttrCalculation.getAge(ageTem) defaultAttr['Age'] = characterAge characterAgeFeatureHandle(ageTem, characterSex) defaultAttr['Features'] = CacheContorl.featuresList.copy() elif 'Features' in character: AttrCalculation.setAddFeatures(character['Features']) defaultAttr['Features'] = CacheContorl.featuresList.copy() if 'Features' in character: height = AttrCalculation.getHeight(characterSex, defaultAttr['Age'], character['Features']) else: height = AttrCalculation.getHeight(characterSex, defaultAttr['Age'], {}) defaultAttr['Height'] = height if 'Weight' in character: weightTemName = character['Weight'] else: weightTemName = 'Ordinary' if 'BodyFat' in character: bodyFatTem = character['BodyFat'] else: bodyFatTem = weightTemName bmi = AttrCalculation.getBMI(weightTemName) weight = AttrCalculation.getWeight(bmi, height['NowHeight']) defaultAttr['Weight'] = weight if defaultAttr['Age'] <= 18 and defaultAttr['Age'] >= 7: classGrade = str(defaultAttr['Age'] - 6) defaultAttr['Class'] = random.choice( CacheContorl.placeData["Classroom_" + classGrade]) bodyFat = AttrCalculation.getBodyFat(characterSex, bodyFatTem) measurements = AttrCalculation.getMeasurements(characterSex, height['NowHeight'], weight, bodyFat, bodyFatTem) defaultAttr['Measirements'] = measurements defaultAttr['Knowledge'] = {} if "SexExperience" in character: sexExperienceTem = character['SexExperience'] else: sexExperienceTem = getRandNpcSexExperienceTem(defaultAttr['Age'], defaultAttr['Sex']) defaultAttr['SexExperience'] = AttrCalculation.getSexExperience( sexExperienceTem) defaultAttr['SexGrade'] = AttrCalculation.getSexGrade( defaultAttr['SexExperience']) if 'Clothing' in character: clothingTem = character['Clothing'] else: clothingTem = 'Uniform' defaultClothingData = Clothing.creatorSuit(clothingTem, characterSex) for clothing in defaultClothingData: defaultAttr['Clothing'][clothing][ uuid.uuid1()] = defaultClothingData[clothing] CacheContorl.temporaryCharacter.update(defaultAttr) CacheContorl.featuresList = {} CacheContorl.characterData['character'][ characterId] = CacheContorl.temporaryCharacter.copy() Clothing.characterPutOnClothing(characterId) CacheContorl.temporaryCharacter = CacheContorl.temporaryCharacterBak.copy()