Esempio n. 1
0
def getRandNpcSex() -> str:
    '''
    随机获取npc性别
    '''
    nowWeight = random.randint(0,sexWeightMax - 1)
    weightRegin = ValueHandle.getNextValueForList(nowWeight,sexWeightReginList)
    return sexWeightReginData[weightRegin]
Esempio n. 2
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
Esempio n. 3
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)
Esempio n. 4
0
def getRandNpcSex():
    nowWeight = random.randint(0, sexWeightMax - 1)
    weightRegin = ValueHandle.getNextValueForList(nowWeight,
                                                  sexWeightReginList)
    return sexWeightReginData[str(weightRegin)]