Exemplo n.º 1
0
def acknowledgmentAttribute_func():
    characterId = CacheContorl.characterData['characterId']
    AttrCalculation.setAttrOver(characterId)
    inputS = []
    attrInpurList = seeAttrInEveryTime_func()
    inputS = ValueHandle.listAppendToList(attrInpurList, inputS)
    flowReturn = SeeCharacterAttrPanel.inputAttrOverPanel()
    inputS = ValueHandle.listAppendToList(flowReturn, inputS)
    acknowledgmentAttributeAns(inputS)
Exemplo n.º 2
0
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()
Exemplo n.º 3
0
def seeAttrOnEveryTime_func(oldPanel, tooOldFlow=None):
    characterId = CacheContorl.characterData['characterId']
    if oldPanel == 'InScenePanel':
        sceneId = CacheContorl.characterData['character']['0']['Position']
        characterIdList = MapHandle.getSceneCharacterIdList(sceneId)
    else:
        characterIdList = ValueHandle.dictKeysToList(
            CacheContorl.characterData['character'])
    characterIdIndex = characterIdList.index(characterId)
    inputS = []
    seeAttrList = seeAttrInEveryTime_func()
    inputS = inputS + seeAttrList
    askSeeAttr = SeeCharacterAttrPanel.askForSeeAttr()
    inputS = inputS + askSeeAttr
    yrn = GameInit.askfor_All(inputS)
    PyCmd.clr_cmd()
    showAttrHandleData = TextLoading.getTextData(TextLoading.cmdPath,
                                                 'seeAttrPanelHandle')
    characterMax = characterIdList[len(characterIdList) - 1]
    if yrn in showAttrHandleData:
        index = showAttrHandleData.index(yrn)
        index = str(index)
        CacheContorl.panelState['AttrShowHandlePanel'] = index
        seeAttrOnEveryTime_func(oldPanel, tooOldFlow)
    elif yrn in panelList:
        PanelStateHandle.panelStateChange(yrn)
        seeAttrOnEveryTime_func(oldPanel, tooOldFlow)
    elif yrn == '0':
        if characterIdIndex == 0:
            CacheContorl.characterData['characterId'] = characterMax
            seeAttrOnEveryTime_func(oldPanel, tooOldFlow)
        else:
            characterId = characterIdList[characterIdIndex - 1]
            CacheContorl.characterData['characterId'] = characterId
            seeAttrOnEveryTime_func(oldPanel, tooOldFlow)
    elif yrn == '1':
        from script.Flow import Main, SeeCharacterList, InScene
        if oldPanel == 'MainFramePanel':
            SeeCharacterAttrPanel.initShowAttrPanelList()
            CacheContorl.characterData['characterId'] = '0'
            Main.mainFrame_func()
        elif oldPanel == 'SeeCharacterListPanel':
            characterListShow = int(GameConfig.characterlist_show)
            nowPageId = characterIdIndex / characterListShow
            CacheContorl.panelState['SeeCharacterListPanel'] = nowPageId
            SeeCharacterAttrPanel.initShowAttrPanelList()
            SeeCharacterList.seeCharacterList_func(tooOldFlow)
        elif oldPanel == 'InScenePanel':
            SeeCharacterAttrPanel.initShowAttrPanelList()
            CacheContorl.characterData['characterId'] = '0'
            InScene.getInScene_func()
    elif yrn == '2':
        if characterId == characterMax:
            characterId = characterIdList[0]
            CacheContorl.characterData['characterId'] = characterId
            seeAttrOnEveryTime_func(oldPanel, tooOldFlow)
        else:
            characterId = characterIdList[characterIdIndex + 1]
            CacheContorl.characterData['characterId'] = characterId
            seeAttrOnEveryTime_func(oldPanel, tooOldFlow)
Exemplo n.º 4
0
def characterPutOnClothing(characterId: str):
    '''
    角色自动选择并穿戴服装
    Keyword arguments:
    characterId -- 角色id
    putOnData -- 与主进程共享的dict
    '''
    collocationData = {}
    characterClothingData = CacheContorl.characterData['character'][
        characterId]['Clothing']
    clothingsNameData = getClothingNameData(characterClothingData)
    clothingsPriceData = getClothingPriceData(characterClothingData)
    for clothingType in clothingsNameData:
        clothingTypeData = clothingsNameData[clothingType]
        for clothingName in clothingTypeData:
            clothingNameData = clothingTypeData[clothingName]
            clothingId = list(clothingNameData.keys())[-1]
            clothingData = characterClothingData[clothingType][clothingId]
            nowCollocationData = getClothingCollocationData(
                clothingData, clothingType, clothingsNameData,
                clothingsPriceData, characterClothingData)
            if nowCollocationData != 'None':
                nowCollocationData[clothingType] = clothingId
                nowCollocationData['Price'] += clothingsPriceData[
                    clothingType][clothingId]
                collocationData[clothingId] = nowCollocationData
    collocationPriceData = {
        collocation: collocationData[collocation]['Price']
        for collocation in collocationData
    }
    collocationId = list(
        ValueHandle.sortedDictForValues(collocationPriceData).keys())[-1]
    CacheContorl.characterData['character'][characterId][
        'PutOn'] = collocationData[collocationId]
Exemplo n.º 5
0
def seeMovePathPanel():
    inputS = []
    nowScene = CacheContorl.characterData['character']['0']['Position']
    nowMap = CacheContorl.nowMap
    nowMapStr = MapHandle.getMapSystemPathStrForList(nowMap)
    mapData = CacheContorl.mapData[nowMapStr]
    movePathInfo = TextLoading.getTextData(TextLoading.messagePath, '27')
    EraPrint.p(movePathInfo)
    EraPrint.p('\n')
    pathEdge = mapData['PathEdge']
    mapSceneId = str(MapHandle.getMapSceneIdForScenePath(nowMap, nowScene))
    scenePath = pathEdge[mapSceneId]
    scenePathList = ValueHandle.dictKeysToList(scenePath)
    try:
        scenePathList.remove(mapSceneId)
    except ValueError:
        pass
    if len(scenePathList) > 0:
        sceneCmd = []
        for scene in scenePathList:
            loadSceneData = MapHandle.getSceneDataForMap(nowMap, scene)
            sceneName = loadSceneData['SceneName']
            sceneCmd.append(sceneName)
        yrn = CmdButtonQueue.optionstr(cmdList=None,
                                       cmdListData=sceneCmd,
                                       cmdColumn=4,
                                       askfor=False,
                                       cmdSize='center')
        inputS = inputS + yrn
    else:
        errorMoveText = TextLoading.getTextData(TextLoading.messagePath, '28')
        EraPrint.p(errorMoveText)
    EraPrint.pline()
    return {'inputS': inputS, 'scenePathList': scenePathList}
Exemplo n.º 6
0
def getRandNpcSex() -> str:
    '''
    随机获取npc性别
    '''
    nowWeight = random.randint(0,sexWeightMax - 1)
    weightRegin = ValueHandle.getNextValueForList(nowWeight,sexWeightReginList)
    return sexWeightReginData[weightRegin]
Exemplo n.º 7
0
def createRandomNpc(id) -> dict:
    '''
    生成随机npc数据模板
    '''
    nowAgeWeight = random.randint(-1,ageWeightMax - 1)
    nowAgeWeightRegin = ValueHandle.getNextValueForList(nowAgeWeight,ageWeightReginList)
    ageWeightTem = ageWeightReginData[nowAgeWeightRegin]
    randomNpcSex = getRandNpcSex()
    randomNpcName = AttrText.getRandomNameForSex(randomNpcSex)
    randomNpcAgeTem = getRandNpcAgeTem(ageWeightTem)
    fatTem = getRandNpcFatTem(ageWeightTem)
    bodyFatTem = getRandNpcBodyFatTem(ageWeightTem,fatTem)
    randomNpcNewData = {
        "Name":randomNpcName,
        "Sex":randomNpcSex,
        "Age":randomNpcAgeTem,
        "Position":["0"],
        "AdvNpc":"1",
        "Weight":fatTem,
        "BodyFat":bodyFatTem
    }
    if randomNpcSex in {"Woman":1,"Futa":1}:
        randomNpcNewData['Chest'] = AttrCalculation.getRandNpcChestTem()
    else:
        randomNpcNewData['Chest'] = 'Precipice'
    CacheContorl.randomNpcList.append(randomNpcNewData)
Exemplo n.º 8
0
def getRandomNpcData():
    if CacheContorl.randomNpcList == []:
        ageWeightMax = 0
        for i in ageWeightData:
            ageWeightMax += int(ageWeightData[i])
        for i in range(0, randomNpcMax):
            nowAgeWeight = random.randint(0, ageWeightMax - 1)
            nowAgeWeightRegin = ValueHandle.getNextValueForList(
                nowAgeWeight, ageWeightReginList)
            ageWeightTem = ageWeightReginData[str(nowAgeWeightRegin)]
            randomNpcSex = getRandNpcSex()
            randomNpcName = AttrText.getRandomNameForSex(randomNpcSex)
            randomNpcAgeTem = getRandNpcAgeTem(ageWeightTem)
            fatTem = getRandNpcFatTem(ageWeightTem)
            bodyFatTem = getRandNpcBodyFatTem(ageWeightTem, fatTem)
            randomNpcNewData = {
                "Name": randomNpcName,
                "Sex": randomNpcSex,
                "Age": randomNpcAgeTem,
                "Position": ["0"],
                "AdvNpc": "1",
                "Weight": fatTem,
                "BodyFat": bodyFatTem
            }
            CacheContorl.randomNpcList.append(randomNpcNewData)
        return CacheContorl.randomNpcList
Exemplo n.º 9
0
def seeAttrInEveryTime_func():
    characterId = CacheContorl.characterData['characterId']
    showAttrHandle = CacheContorl.panelState['AttrShowHandlePanel']
    inputS = []
    characterMainAttrPanelAsk = SeeCharacterAttrPanel.seeCharacterMainAttrPanel(
        characterId)
    inputS.append(characterMainAttrPanelAsk)
    if showAttrHandle == '0':
        characterEquipmentPanelAsk = SeeCharacterAttrPanel.seeCharacterEquipmentPanel(
            characterId)
        inputS.append(characterEquipmentPanelAsk)
        characterItemPanelAsk = SeeCharacterAttrPanel.seeCharacterItemPanel(
            characterId)
        inputS.append(characterItemPanelAsk)
    elif showAttrHandle == '1':
        characterExperiencePanelAsk = SeeCharacterAttrPanel.seeCharacterExperiencePanel(
            characterId)
        inputS.append(characterExperiencePanelAsk)
        characterLevelPanelAsk = SeeCharacterAttrPanel.seeCharacterLevelPanel(
            characterId)
        inputS.append(characterLevelPanelAsk)
    elif showAttrHandle == '2':
        characterFeaturesPanelAsk = SeeCharacterAttrPanel.seeCharacterFeaturesPanel(
            characterId)
        inputS.append(characterFeaturesPanelAsk)
        characterEngravingPanelAsk = SeeCharacterAttrPanel.seeCharacterEngravingPanel(
            characterId)
        inputS.append(characterEngravingPanelAsk)
    EraPrint.pline()
    seeAttrPanelHandleAsk = SeeCharacterAttrPanel.seeAttrShowHandlePanel()
    inputS = ValueHandle.listAppendToList(seeAttrPanelHandleAsk, inputS)
    return inputS
Exemplo n.º 10
0
def initPhaseCourseHour():
    '''
    初始化各班级课时
    '''
    phaseCourseTime = TextLoading.getTextData(TextLoading.phaseCourse,
                                              'CourseTime')
    primaryWeight = TextLoading.getTextData(TextLoading.phaseCourse,
                                            'PrimarySchool')
    juniorMiddleWeight = TextLoading.getTextData(TextLoading.phaseCourse,
                                                 'JuniorMiddleSchool')
    seniorHighWeight = TextLoading.getTextData(TextLoading.phaseCourse,
                                               'SeniorHighSchool')
    nowWeightList = primaryWeight + juniorMiddleWeight + seniorHighWeight
    allClassHourData = {}
    phaseIndex = 0
    for phase in nowWeightList:
        phaseWeightRegin = ValueHandle.getReginList(phase)
        weightMax = 0
        weightMax = sum(map(int, phaseWeightRegin.keys()))
        classHourData = {}
        classHourMax = 0
        if phaseIndex <= 5:
            classHourMax = phaseCourseTime['PrimarySchool']
        elif phaseIndex <= 8:
            classHourMax = phaseCourseTime['JuniorMiddleSchool']
        else:
            classHourMax = phaseCourseTime['SeniorHighSchool']
        classHourData = {
            phaseWeightRegin[region]:
            math.ceil(classHourMax * (int(region) / weightMax))
            for region in phaseWeightRegin
        }
        nowClassHourMax = sum(classHourData.values())
        while nowClassHourMax != classHourMax:
            for course in classHourData:
                if nowClassHourMax == classHourMax:
                    break
                elif classHourData[
                        course] > 1 and nowClassHourMax > classHourMax:
                    classHourData[course] -= 1
                    nowClassHourMax -= 1
                elif nowClassHourMax < classHourMax:
                    classHourData[course] += 1
                    nowClassHourMax += 1
        while 1:
            moreHour = 0
            for course in classHourData:
                if moreHour > 0 and classHourData[course] < 14:
                    classHourData[course] += 1
                    moreHour -= 1
                elif moreHour > 0 and classHourData[course] > 14:
                    moreHour += (classHourData[course] - 14)
                    classHourData[course] -= (classHourData[course] - 14)
            if moreHour == 0:
                break
        allClassHourData[phaseIndex] = classHourData
        phaseIndex += 1
    CacheContorl.courseData['ClassHour'] = allClassHourData
    initPhaseCourseHourExperience()
Exemplo n.º 11
0
def getRandNpcSexExperienceTem(age:int,sex:str) -> str:
    '''
    按年龄范围随机获取性经验模板
    Keyword arguments:
    age -- 年龄
    sex -- 性别
    '''
    ageJudgeSexExperienceTemData = TextLoading.getTextData(TextLoading.attrTemplatePath,'AgeJudgeSexExperienceTem')
    if sex == 'Asexual':
        sex = 'Woman'
    if sex == 'Futa':
        sex = 'Man'
    nowTemData = ageJudgeSexExperienceTemData[sex]
    ageRegionList = [int(i) for i in nowTemData.keys()]
    ageRegion = str(ValueHandle.getOldValueForList(age,ageRegionList))
    ageRegionData = nowTemData[ageRegion]
    return ValueHandle.getRandomForWeight(ageRegionData)
Exemplo n.º 12
0
def getRandNpcAgeTem(agejudge: str) -> int:
    '''
    按年龄断随机生成npc年龄
    Keyword arguments:
    ageJudge -- 年龄段
    '''
    nowAgeWeightData = ageTemWeightData[agejudge]
    nowAgeTem = ValueHandle.getRandomForWeight(nowAgeWeightData)
    return nowAgeTem
Exemplo n.º 13
0
def getRandNpcBodyFatTem(ageJudge: str, bmiTem: str) -> str:
    '''
    按年龄段体脂率分布比例随机生成体脂率模板
    Keyword arguments:
    ageJudge -- 年龄段
    bmiTem -- bmi模板
    '''
    nowBodyFatData = bodyFatWeightData[ageJudge][bmiTem]
    return ValueHandle.getRandomForWeight(nowBodyFatData)
Exemplo n.º 14
0
def getRandNpcFatTem(agejudge: str) -> str:
    '''
    按人群年龄段体重分布比例随机生成体重模板
    Keyword arguments:
    agejudge -- 年龄段
    '''
    nowFatWeightData = fatWeightData[agejudge]
    nowFatTem = ValueHandle.getRandomForWeight(nowFatWeightData)
    return nowFatTem
Exemplo n.º 15
0
def getAppointNamesClothingTop(appointNameList:list,clothingTypeNameData:dict) -> str:
    '''
    获取指定服装类型数据下指定名称的服装中价值最高的服装
    Keyword arguments:
    appointNameList -- 要获取的服装名字列表
    clothingTypeNameData -- 以名字为分类的已排序的要查询的服装数据
    '''
    clothingData = {list(clothingTypeNameData[appoint].keys())[-1]:clothingTypeNameData[appoint][list(clothingTypeNameData[appoint].keys())[-1]] for appoint in appointNameList if appoint in clothingTypeNameData}
    if clothingData != {}:
        return list(ValueHandle.sortedDictForValues(clothingData).keys())[-1]
    return 'None'
Exemplo n.º 16
0
def detailedSetting_func8():
    flowReturn = CreatorCharacterPanel.detailedSetting8Panel()
    weightTemData = TextLoading.getTextData(TextLoading.attrTemplatePath,'WeightTem')
    weightTemList = ValueHandle.dictKeysToList(weightTemData)
    weightTem = weightTemList[int(flowReturn)]
    characterHeight = CacheContorl.temporaryCharacter['Height']
    characterBmi = AttrCalculation.getBMI(weightTem)
    characterWeight = AttrCalculation.getWeight(characterBmi, characterHeight['NowHeight'])
    characterSex = CacheContorl.temporaryCharacter['Sex']
    characterBodyFat = AttrCalculation.getBodyFat(characterSex,weightTem)
    characterMeasurements = AttrCalculation.getMeasurements(characterSex, characterHeight['NowHeight'], characterWeight,characterBodyFat,weightTem)
    CacheContorl.temporaryCharacter['Weight'] = characterWeight
    CacheContorl.temporaryCharacter['BodyFat'] = characterBodyFat
    CacheContorl.temporaryCharacter['Measurements'] = characterMeasurements
    SeeCharacterAttr.acknowledgmentAttribute_func()
Exemplo n.º 17
0
def initNameRegion(nameData:dict,manJudge:int):
    '''
    初始化性别名字随机权重
    Keyword arguments:
    nameData -- 名字数据
    manJudge -- 类型校验(0:男,1:女,2:姓)
    '''
    regionList = ValueHandle.getReginList(nameData)
    if manJudge == 0:
        CacheContorl.boysRegionList = regionList
        CacheContorl.boysRegionIntList = list(map(int,regionList))
    elif manJudge == 1:
        CacheContorl.girlsRegionList = regionList
        CacheContorl.girlsRegionIntList = list(map(int,regionList))
    else:
        CacheContorl.familyRegionList = regionList
        CacheContorl.familyRegionIntList = list(map(int,regionList))
Exemplo n.º 18
0
def getClothingNameData(clothingsData:dict) -> dict:
    '''
    按服装的具体名称对服装进行分类,获取同类下各服装的价值数据
    Keyword arguments:
    clothingsData -- 要分类的所有服装数据
    '''
    clothingNameData = {}
    for clothingType in clothingsData:
        clothingTypeData = clothingsData[clothingType]
        clothingNameData.setdefault(clothingType,{})
        for clothing in clothingTypeData:
            clothingData = clothingTypeData[clothing]
            clothingName = clothingData['Name']
            clothingNameData[clothingType].setdefault(clothingName,{})
            clothingNameData[clothingType][clothingName][clothing] = clothingData['Price'] + clothingData['Cleanliness']
        clothingNameData[clothingType] = {clothingName:ValueHandle.sortedDictForValues(clothingNameData[clothingType][clothingName]) for clothingName in clothingNameData[clothingType]}
    return clothingNameData
Exemplo n.º 19
0
def sortSceneCharacterId(scenePathStr: str):
    '''
    对场景上的角色按好感度进行排序
    Keyword arguments:
    scenePath -- 场景路径
    '''
    nowSceneCharacterIntimateData = {}
    for character in CacheContorl.sceneData[scenePathStr][
            'SceneCharacterData']:
        nowSceneCharacterIntimateData[character] = CacheContorl.characterData[
            'character'][character]['Intimate']
    newSceneCharacterIntimateData = sorted(
        nowSceneCharacterIntimateData.items(),
        key=lambda x: (x[1], -int(x[0])),
        reverse=True)
    newSceneCharacterIntimateData = ValueHandle.twoBitArrayToDict(
        newSceneCharacterIntimateData)
    CacheContorl.sceneData[scenePathStr][
        'SceneCharacterData'] = newSceneCharacterIntimateData
Exemplo n.º 20
0
def getSceneToSceneMapList(nowScenePath: list,
                           targetScenePath: list) -> 'str_common,list':
    '''
    获取场景到场景之间需要经过的地图列表
    如果两个场景属于同一地图并在同一层级,则返回common
    Keyword arguments:
    nowScenePath -- 当前场景路径
    targetScenePath -- 目标场景路径
    '''
    sceneAffiliation = judgeSceneAffiliation(nowScenePath, targetScenePath)
    if sceneAffiliation == 'common':
        return 'common'
    elif sceneAffiliation == 'subordinate':
        return getMapHierarchyListForScenePath(nowScenePath, targetScenePath)
    elif sceneAffiliation == 'nobelonged':
        commonMap = getCommonMapForScenePath(nowScenePath, targetScenePath)
        nowSceneToCommonMap = getMapHierarchyListForScenePath(
            nowScenePath, commonMap)
        targetSceneToCommonMap = getMapHierarchyListForScenePath(
            targetScenePath, commonMap)
        commonMapToTargetScene = ValueHandle.reverseArrayList(
            targetSceneToCommonMap)
        return nowSceneToCommonMap + commonMapToTargetScene[1:]
Exemplo n.º 21
0
 def putOn(self):
     '''
     角色自动选择并穿戴服装
     Keyword arguments:
     characterId -- 角色服装数据
     '''
     characterClothingData = self.Clothing
     collocationData = {}
     clothingsNameData = Clothing.getClothingNameData(characterClothingData)
     clothingsPriceData = Clothing.getClothingPriceData(characterClothingData)
     for clothingType in clothingsNameData:
         clothingTypeData = clothingsNameData[clothingType]
         for clothingName in clothingTypeData:
             clothingNameData = clothingTypeData[clothingName]
             clothingId = list(clothingNameData.keys())[-1]
             clothingData = characterClothingData[clothingType][clothingId]
             nowCollocationData = Clothing.getClothingCollocationData(clothingData,clothingType,clothingsNameData,clothingsPriceData,characterClothingData)
             if nowCollocationData != 'None':
                 nowCollocationData[clothingType] = clothingId
                 nowCollocationData['Price'] += clothingsPriceData[clothingType][clothingId]
                 collocationData[clothingId] = nowCollocationData
     collocationPriceData = {collocation:collocationData[collocation]['Price'] for collocation in collocationData}
     collocationId = list(ValueHandle.sortedDictForValues(collocationPriceData).keys())[-1]
     self.PutOn = collocationData[collocationId]
Exemplo n.º 22
0
def getCharacterIdList():
    characterData = CacheContorl.characterData['character']
    characterList = ValueHandle.dictKeysToList(characterData)
    return characterList
Exemplo n.º 23
0
def getRandNpcAgeTem(agejudge):
    nowAgeWeightData = ageTemWeightData[agejudge]
    nowAgeTem = ValueHandle.getRandomForWeight(nowAgeWeightData)
    return nowAgeTem
Exemplo n.º 24
0
def getRandNpcBodyFatTem(ageJudge, bmiTem):
    nowBodyFatData = bodyFatWeightData[ageJudge][bmiTem]
    return ValueHandle.getRandomForWeight(nowBodyFatData)
Exemplo n.º 25
0
def getRandNpcFatTem(agejudge):
    nowFatWeightData = fatWeightData[agejudge]
    nowFatTem = ValueHandle.getRandomForWeight(nowFatWeightData)
    return nowFatTem
Exemplo n.º 26
0
def getRandNpcSex():
    nowWeight = random.randint(0, sexWeightMax - 1)
    weightRegin = ValueHandle.getNextValueForList(nowWeight,
                                                  sexWeightReginList)
    return sexWeightReginData[str(weightRegin)]
Exemplo n.º 27
0
# 获取目录中的角色模板
def getDirCharacterTem(character):
    characterAttrTemPath = os.path.join(characterListPath, character,
                                        'AttrTemplate.json')
    return GameData._loadjson(characterAttrTemPath)


randomNpcMax = int(GameConfig.random_npc_max)
randomTeacherProportion = int(GameConfig.proportion_teacher)
randomStudentProportion = int(GameConfig.proportion_student)
ageWeightData = {
    "Teacher": randomTeacherProportion,
    "Student": randomStudentProportion
}
ageWeightReginData = ValueHandle.getReginList(ageWeightData)
ageWeightReginList = ValueHandle.getListKeysIntList(
    list(ageWeightReginData.keys()))


# 获取随机npc数据
def getRandomNpcData():
    if CacheContorl.randomNpcList == []:
        ageWeightMax = 0
        for i in ageWeightData:
            ageWeightMax += int(ageWeightData[i])
        for i in range(0, randomNpcMax):
            nowAgeWeight = random.randint(0, ageWeightMax - 1)
            nowAgeWeightRegin = ValueHandle.getNextValueForList(
                nowAgeWeight, ageWeightReginList)
            ageWeightTem = ageWeightReginData[str(nowAgeWeightRegin)]
Exemplo n.º 28
0
language = GameConfig.language
gamepath = GamePathConfig.gamepath

roleAttrPath = os.path.join(gamepath,'data',language,'RoleAttributes.json')
roleAttrData = GameData._loadjson(roleAttrPath)
sexData = roleAttrData['Sex']
equipmentPath = os.path.join(gamepath,'data',language,'Equipment.json')
equipmentData = GameData._loadjson(equipmentPath)
boysNameListData = TextLoading.getTextData(TextLoading.nameListPath,'Boys')
girlsNameListData = TextLoading.getTextData(TextLoading.nameListPath,'Girls')
familyNameListData = TextLoading.getTextData(TextLoading.familyNameListPath,'FamilyNameList')
boysNameMax = len(boysNameListData)
girlsNameMax = len(girlsNameListData)
sortFamilyIndex = sorted(familyNameListData.items(),key=lambda x:x[1])

familyRegionList = ValueHandle.getReginList(familyNameListData)
boysRegionList = ValueHandle.getReginList(boysNameListData)
girlsRegionList = ValueHandle.getReginList(girlsNameListData)

familyRegionIntList = ValueHandle.getListKeysIntList(familyRegionList)
boysRegionIntList = ValueHandle.getListKeysIntList(boysRegionList)
girlsRegionIntList = ValueHandle.getListKeysIntList(girlsRegionList)

#获取性经验文本
def getSexExperienceText(sexList,sexName):
    mouthExperience = TextLoading.getTextData(TextLoading.stageWordPath,'19') + str(sexList['mouthExperience'])
    bosomExperience = TextLoading.getTextData(TextLoading.stageWordPath,'20') + str(sexList['bosomExperience'])
    vaginaExperience = TextLoading.getTextData(TextLoading.stageWordPath,'21') + str(sexList['vaginaExperience'])
    clitorisExperience = TextLoading.getTextData(TextLoading.stageWordPath,'22') + str(sexList['clitorisExperience'])
    anusExperience = TextLoading.getTextData(TextLoading.stageWordPath,'23') + str(sexList['anusExperience'])
    penisExperience = TextLoading.getTextData(TextLoading.stageWordPath,'24') + str(sexList['penisExperience'])
Exemplo n.º 29
0
def getDirCharacterTem(character: int) -> dict:
    '''
    获取预设角色模板数据
    '''
    return TextLoading.getCharacterData(character)['AttrTemplate']


randomNpcMax = int(GameConfig.random_npc_max)
randomTeacherProportion = int(GameConfig.proportion_teacher)
randomStudentProportion = int(GameConfig.proportion_student)
ageWeightData = {
    "Teacher": randomTeacherProportion,
    "Student": randomStudentProportion
}
ageWeightReginData = ValueHandle.getReginList(ageWeightData)
ageWeightReginList = list(map(int, ageWeightReginData.keys()))
ageWeightMax = sum(
    [int(ageWeightData[ageWeight]) for ageWeight in ageWeightData])


def getRandomNpcData() -> list:
    '''
    生成所有随机npc的数据模板
    '''
    if CacheContorl.randomNpcList == []:
        list(map(createRandomNpc, range(randomNpcMax)))
        return CacheContorl.randomNpcList


def createRandomNpc(id) -> dict:
Exemplo n.º 30
0
def getRandNpcChestTem() -> str:
    '''
    随机获取npc罩杯模板
    '''
    return ValueHandle.getRandomForWeight(chestTemWeightData)