Beispiel #1
0
def acknowledgmentAttribute_func():
    playerId = CacheContorl.playObject['objectId']
    AttrCalculation.setAttrOver(playerId)
    inputS = []
    attrInpurList = seeAttrInEveryTime_func()
    inputS = ValueHandle.listAppendToList(attrInpurList,inputS)
    flowReturn = SeePlayerAttrPanel.inputAttrOverPanel()
    inputS = ValueHandle.listAppendToList(flowReturn,inputS)
    acknowledgmentAttributeAns(inputS)
    pass
Beispiel #2
0
def detailedSetting_func3():
    flowReturn = CreatorPlayerPanel.detailedSetting3Panel()
    sexTemDataList = ValueHandle.dictKeysToList(
        TextLoading.getTextData(TextLoading.temId, 'SexExperience'))
    sexTemDataList = ValueHandle.reverseArrayList(sexTemDataList)
    sexTemName = sexTemDataList[flowReturn]
    if flowReturn != len(sexTemDataList) - 1:
        CacheContorl.featuresList['Chastity'] = ''
    else:
        pass
    playerSexExperienceData = AttrCalculation.getSexExperience(sexTemName)
    CacheContorl.temporaryObject['SexExperience'] = playerSexExperienceData
    CacheContorl.temporaryObject['SexGrade'] = AttrCalculation.getSexGrade(
        playerSexExperienceData)
    PyCmd.clr_cmd()
    detailedSettind_func4()
Beispiel #3
0
def seeAttrInEveryTime_func():
    playerId = CacheContorl.playObject['objectId']
    showAttrHandle = CacheContorl.panelState['AttrShowHandlePanel']
    inputS = []
    playerMainAttrPanelAsk = SeePlayerAttrPanel.seePlayerMainAttrPanel(playerId)
    inputS.append(playerMainAttrPanelAsk)
    if showAttrHandle == '0':
        playerEquipmentPanelAsk = SeePlayerAttrPanel.seePlayerEquipmentPanel(playerId)
        inputS.append(playerEquipmentPanelAsk)
        playerItemPanelAsk = SeePlayerAttrPanel.seePlayerItemPanel(playerId)
        inputS.append(playerItemPanelAsk)
        pass
    elif showAttrHandle == '1':
        playerExperiencePanelAsk = SeePlayerAttrPanel.seePlayerExperiencePanel(playerId)
        inputS.append(playerExperiencePanelAsk)
        playerLevelPanelAsk = SeePlayerAttrPanel.seePlayerLevelPanel(playerId)
        inputS.append(playerLevelPanelAsk)
    elif showAttrHandle == '2':
        playerFeaturesPanelAsk = SeePlayerAttrPanel.seePlayerFeaturesPanel(playerId)
        inputS.append(playerFeaturesPanelAsk)
        playerEngravingPanelAsk = SeePlayerAttrPanel.seePlayerEngravingPanel(playerId)
        inputS.append(playerEngravingPanelAsk)
    EraPrint.pline()
    seeAttrPanelHandleAsk = SeePlayerAttrPanel.seeAttrShowHandlePanel()
    inputS = ValueHandle.listAppendToList(seeAttrPanelHandleAsk,inputS)
    return inputS
Beispiel #4
0
def seeMovePathPanel():
    inputS = []
    sceneId = CacheContorl.playObject['object']['0']['Position']
    mapId = MapHandle.getMapIdForScene(sceneId)
    mapData = CacheContorl.mapData['MapData'][mapId]
    movePathInfo = TextLoading.getTextData(TextLoading.messageId, '27')
    EraPrint.p(movePathInfo)
    EraPrint.p('\n')
    pathEdge = mapData['PathEdge']
    mapSceneId = str(MapHandle.getMapSceneIdForSceneId(mapId, sceneId))
    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(mapId, 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.messageId, '28')
        EraPrint.p(errorMoveText)
    EraPrint.pline()
    return {'inputS': inputS, 'scenePathList': scenePathList}
Beispiel #5
0
def seeAttrOnEveryTime_func(oldPanel,tooOldFlow = None):
    objectId = CacheContorl.playObject['objectId']
    if oldPanel == 'InScenePanel':
        sceneId = CacheContorl.playObject['object']['0']['Position']
        objectIdList = MapHandle.getScenePlayerIdList(sceneId)
    else:
        objectIdList = ValueHandle.dictKeysToList(CacheContorl.playObject['object'])
    objectIdIndex = objectIdList.index(objectId)
    inputS = []
    seeAttrList = seeAttrInEveryTime_func()
    inputS = inputS + seeAttrList
    askSeeAttr = SeePlayerAttrPanel.askForSeeAttr()
    inputS = inputS + askSeeAttr
    yrn = GameInit.askfor_All(inputS)
    PyCmd.clr_cmd()
    showAttrHandleData = TextLoading.getTextData(TextLoading.cmdId, 'seeAttrPanelHandle')
    objectMax = objectIdList[len(objectIdList) - 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 objectIdIndex == 0:
            CacheContorl.playObject['objectId'] = objectMax
            seeAttrOnEveryTime_func(oldPanel,tooOldFlow)
        else:
            playerId = objectIdList[objectIdIndex - 1]
            CacheContorl.playObject['objectId'] = playerId
            seeAttrOnEveryTime_func(oldPanel,tooOldFlow)
    elif yrn == '1':
        if oldPanel == 'MainFramePanel':
            import Flow.Main as mainframe
            SeePlayerAttrPanel.initShowAttrPanelList()
            CacheContorl.playObject['objectId'] = '0'
            mainframe.mainFrame_func()
        elif oldPanel == 'SeePlayerListPanel':
            SeePlayerAttrPanel.initShowAttrPanelList()
            import Flow.SeePlayerList as seeplayerlist
            seeplayerlist.seePlayerList_func(tooOldFlow)
        elif oldPanel == 'InScenePanel':
            SeePlayerAttrPanel.initShowAttrPanelList()
            import Flow.InScene as inscene
            CacheContorl.playObject['objectId'] = '0'
            inscene.getInScene_func()
    elif yrn == '2':
        if objectId == objectMax:
            objectId = objectIdList[0]
            CacheContorl.playObject['objectId'] = objectId
            seeAttrOnEveryTime_func(oldPanel,tooOldFlow)
        else:
            objectId = objectIdList[objectIdIndex  + 1]
            CacheContorl.playObject['objectId'] = objectId
            seeAttrOnEveryTime_func(oldPanel,tooOldFlow)
    pass
Beispiel #6
0
def initCharacterList():
    characterListPath = os.path.join(gamepath,'data',language,'character')
    characterList = GameData.getPathList(characterListPath)
    for i in range(0,len(characterList)):
        AttrCalculation.initTemporaryObject()
        playerId = str(i + 1)
        CacheContorl.playObject['object'][playerId] = CacheContorl.temporaryObject.copy()
        AttrCalculation.setDefaultCache()
        characterDataName = characterList[i]
        characterAttrTemPath = os.path.join(characterListPath,characterDataName,'AttrTemplate.json')
        characterData = GameData._loadjson(characterAttrTemPath)
        characterName = characterData['Name']
        characterSex = characterData['Sex']
        characterSexTem = TextLoading.getTextData(TextLoading.temId,'TemList')[characterSex]
        CacheContorl.playObject['object'][playerId]['Sex'] = characterSex
        characterDataKeys = ValueHandle.dictKeysToList(characterData)
        defaultAttr = AttrCalculation.getAttr(characterSexTem)
        defaultAttr['Name'] = characterName
        defaultAttr['Sex'] = characterSex
        AttrCalculation.setSexCache(characterSex)
        defaultAttr['Features'] = CacheContorl.featuresList.copy()
        if 'Age' in characterDataKeys:
            ageTem = characterData['Age']
            characterAge = AttrCalculation.getAge(ageTem)
            defaultAttr['Age'] = characterAge
        elif 'Features' in characterDataKeys:
            AttrCalculation.setAddFeatures(characterData['Features'])
            defaultAttr['Features'] = CacheContorl.featuresList.copy()
        temList = AttrCalculation.getTemList()
        height = AttrCalculation.getHeight(temList[characterSex], defaultAttr['Age'])
        defaultAttr['Height'] = height
        if 'Weight' in characterData:
            weightTemName = characterData['Weight']
        else:
            weightTemName = 'Ordinary'
        weight = AttrCalculation.getWeight(weightTemName, height['NowHeight'])
        defaultAttr['Weight'] = weight
        measurements = AttrCalculation.getMeasurements(temList[characterSex], height['NowHeight'], weightTemName)
        defaultAttr['Measurements'] = measurements
        for keys in defaultAttr:
            CacheContorl.temporaryObject[keys] = defaultAttr[keys]
        CacheContorl.featuresList = {}
        CacheContorl.playObject['object'][playerId] = CacheContorl.temporaryObject.copy()
        CacheContorl.temporaryObject = CacheContorl.temporaryObjectBak.copy()
    initPlayerPosition()
    pass
Beispiel #7
0
def getCharacterIdList():
    playerData = CacheContorl.playObject['object']
    playerList = ValueHandle.dictKeysToList(playerData)
    return playerList
Beispiel #8
0
def getCharacterIndexMax():
    playerData = CacheContorl.playObject['object']
    playerMax = ValueHandle.indexDictKeysMax(playerData) - 1
    return playerMax
Beispiel #9
0
def getFontDataList():
    FontPath = os.path.join(gamepath, 'data', 'FontConfig.json')
    FontData = GameData._loadjson(FontPath)
    fontList = ValueHandle.dictKeysToList(FontData)
    return fontList
Beispiel #10
0
def getAgeTemList():
    list = ValueHandle.dictKeysToList(templateData["AgeTem"])
    return list
Beispiel #11
0
def getPathfinding(mapId,nowNode,targetNode,pathNodeList = [],pathTimeList = [],pathTime = 0,pathList = [],timeList = []):
    mapId = int(mapId)
    nowNode = str(nowNode)
    targetNode = str(targetNode)
    mapData = CacheContorl.mapData['MapData'][mapId]
    pathEdge = mapData['PathEdge']
    targetListDict = pathEdge[nowNode]
    targetList = ValueHandle.dictKeysToList(targetListDict)
    if nowNode == targetNode:
        return 'End'
    else:
        for i in range(0,len(targetList)):
            target = targetList[i]
            if target in pathNodeList:
                pass
            else:
                targetTime = targetListDict[target]
                pathTime = pathTime + targetTime
                findPath = pathNodeList.copy()
                if findPath == []:
                    findPath = [nowNode]
                    findTime = [0]
                else:
                    findTime = pathTimeList.copy()
                findPath.append(target)
                findTime.append(targetTime)
                if target == targetNode:
                    pathList.append(findPath)
                    timeList.append(findTime)
                else:
                    pathEdgeNow = pathEdge[target].copy()
                    pathEdgeNow.pop(nowNode)
                    targetNodeInTargetList = pathEdgeNow
                    targetNodeInTargetToList = ValueHandle.dictKeysToList(targetNodeInTargetList)
                    for i in range(0,len(targetNodeInTargetToList)):
                        targetNodeInTarget = targetNodeInTargetToList[i]
                        findPath.append(targetNodeInTarget)
                        findTime.append(targetNodeInTargetList[targetNodeInTarget])
                        pathData = getPathfinding(mapId,targetNodeInTarget,targetNode,findPath,findTime,pathTime,pathList,timeList)
                        if pathData == 'Null':
                            pass
                        elif pathData == 'End':
                            pass
                        else:
                            pathList.append(pathData['Path'])
                            timeList.append(pathData['Time'])
        if len(pathList) > 0:
            pathId = 0
            needTime = 'Null'
            for i in range(0,len(timeList)):
                nowTime = 0
                for index in range(0,len(timeList[i])):
                    if index == 0:
                        needTime = 0
                    nowTime = needTime + timeList[i][index]
                if needTime == 'Null' or nowTime < needTime:
                    needTime = nowTime
                    pathId = i
            pathData = {'Path':pathList[pathId],'Time':timeList[pathId]}
            return pathData
        else:
            return 'Null'