Exemple #1
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}
Exemple #2
0
def seeScene_func(judge):
    inputS = []
    InScenePanel.seeScenePanel()
    if judge == '0':
        inputS = inputS + InScenePanel.seeSceneCharacterListPanel()
    InScenePanel.changeSceneCharacterListPanel()
    scenePath = CacheContorl.characterData['character']['0']['Position']
    sceneCharacterNameList = MapHandle.getSceneCharacterNameList(scenePath)
    if len(sceneCharacterNameList) == 1:
        CacheContorl.characterData['characterId'] = '0'
    InScenePanel.seeCharacterInfoPanel()
    inSceneCmdList1 = InScenePanel.inSceneButtonPanel()
    inputS = inputS + inSceneCmdList1
    startId1 = len(inSceneCmdList1)
    yrn = GameInit.askfor_All(inputS)
    PyCmd.clr_cmd()
    if yrn in sceneCharacterNameList:
        CacheContorl.characterData[
            'characterId'] = MapHandle.getCharacterIdByCharacterName(
                yrn, scenePath)
        seeScene_func(judge)
    elif yrn == '0':
        from script.Flow import SeeMap
        nowMap = MapHandle.getMapForPath(
            CacheContorl.characterData['character']['0']['Position'])
        CacheContorl.nowMap = nowMap
        SeeMap.seeMapFlow()
    elif yrn == '1':
        SeeCharacterAttr.seeAttrOnEveryTime_func('InScenePanel')
    elif yrn == '2':
        CacheContorl.characterData['characterId'] = '0'
        SeeCharacterAttr.seeAttrOnEveryTime_func('InScenePanel')
Exemple #3
0
def showSceneNameListPanel() -> str:
    '''
    地图下场景名称绘制面板
    '''
    titleText = TextLoading.getTextData(TextLoading.stageWordPath, '86')
    EraPrint.p(titleText)
    panelState = CacheContorl.panelState['SeeSceneNameListPanel']
    if panelState == '0':
        PyCmd.pcmd(panelStateOffText, "SeeSceneNameListPanel")
        EraPrint.p('\n')
        nowMap = CacheContorl.nowMap
        nowPosition = CacheContorl.characterData['character']['0']['Position']
        nowScene = MapHandle.getSceneIdInMapForScenePathOnMapPath(
            nowPosition, nowMap)
        nowMapMapSystemStr = MapHandle.getMapSystemPathStrForList(nowMap)
        sceneNameData = MapHandle.getSceneNameListForMapPath(
            nowMapMapSystemStr)
        sceneNameList = {}
        nullScene = nowScene
        for scene in sceneNameData:
            sceneNameList[scene] = scene + ':' + sceneNameData[scene]
        CmdButtonQueue.optionstr(None, 4, 'center', False, False,
                                 list(sceneNameList.values()), nullScene,
                                 list(sceneNameList.keys()))
    else:
        PyCmd.pcmd(panelStateOnText, 'SeeSceneNameListPanel')
        EraPrint.p('\n')
    EraPrint.plittleline()
    return 'SeeSceneNameListPanel'
Exemple #4
0
def acknowledgmentAttributeAns(inputList):
    characterId = CacheContorl.characterData['characterId']
    yrn = GameInit.askfor_All(inputList)
    showAttrHandleData = TextLoading.getTextData(TextLoading.cmdPath,
                                                 'seeAttrPanelHandle')
    PyCmd.clr_cmd()
    if yrn in panelList:
        PanelStateHandle.panelStateChange(yrn)
        acknowledgmentAttribute_func()
    elif yrn == '0':
        GameTime.initTime()
        AttrCalculation.setAttrOver(characterId)
        CharacterHandle.initCharacterList()
        SeeCharacterAttrPanel.initShowAttrPanelList()
        characterPosition = CacheContorl.characterData['character'][
            characterId]['Position']
        MapHandle.characterMoveScene(['0'], characterPosition, characterId)
        from script.Flow import Main
        Main.mainFrame_func()
    elif yrn == '1':
        CacheContorl.wframeMouse['wFrameRePrint'] = 1
        EraPrint.pnextscreen()
        SeeCharacterAttrPanel.initShowAttrPanelList()
        from script.Design import StartFlow
        StartFlow.main_func()
    elif yrn in showAttrHandleData:
        index = showAttrHandleData.index(yrn)
        index = str(index)
        CacheContorl.panelState['AttrShowHandlePanel'] = index
        acknowledgmentAttribute_func()
Exemple #5
0
def seeScenePanel():
    '''
    当前场景信息面板
    '''
    titleText = TextLoading.getTextData(TextLoading.stageWordPath, '75')
    EraPrint.plt(titleText)
    timeText = GameTime.getDateText()
    EraPrint.p(timeText)
    EraPrint.p(' ')
    scenePath = CacheContorl.characterData['character'][0].Position
    scenePathStr = MapHandle.getMapSystemPathStrForList(scenePath)
    mapList = MapHandle.getMapHierarchyListForScenePath(scenePath, [])
    mapPathText = ''
    mapList.reverse()
    for nowMap in mapList:
        nowMapMapSystemStr = MapHandle.getMapSystemPathStrForList(nowMap)
        mapName = CacheContorl.mapData[nowMapMapSystemStr]['MapName']
        mapPathText += mapName + '-'
    sceneData = CacheContorl.sceneData[scenePathStr].copy()
    sceneName = mapPathText + sceneData['SceneName']
    sceneInfoHead = TextLoading.getTextData(TextLoading.stageWordPath, '76')
    sceneInfo = sceneInfoHead + sceneName
    EraPrint.p(sceneInfo)
    panelState = CacheContorl.panelState['SeeSceneCharacterListPage']
    switch = panelStateOnText
    if panelState == '0':
        switch = panelStateOffText
    sceneCharacterList = sceneData['SceneCharacterData']
    if len(sceneCharacterList) > 1:
        EraPrint.p(' ')
        PyCmd.pcmd(switch, 'SeeSceneCharacterListPage')
    EraPrint.plittleline()
Exemple #6
0
def initCharacterPosition():
    '''
    初始化角色位置
    '''
    for character in CacheContorl.characterData['character']:
        characterPosition = CacheContorl.characterData['character'][character].Position
        characterDormitory = CacheContorl.characterData['character'][character].Dormitory
        characterDormitory = MapHandle.getMapSystemPathForStr(characterDormitory)
        MapHandle.characterMoveScene(characterPosition,characterDormitory,character)
Exemple #7
0
def seeMapFlow():
    '''
    地图查看流程
    '''
    while (True):
        PyCmd.clr_cmd()
        inputS = []
        mapCmd = SeeMapPanel.seeMapPanel()
        startId1 = len(mapCmd)
        inputS = inputS + mapCmd
        movePathCmdData = SeeMapPanel.seeMovePathPanel()
        movePathCmd = movePathCmdData['inputS']
        movePathList = movePathCmdData['scenePathList']
        showSceneNameListCmd = SeeMapPanel.showSceneNameListPanel()
        seeMapCmd = SeeMapPanel.backScenePanel(startId1)
        inputS = inputS + seeMapCmd + movePathCmd + [showSceneNameListCmd]
        yrn = FlowHandle.askfor_All(inputS)
        backButton = str(startId1)
        nowPosition = CacheContorl.characterData['character'][0].Position
        nowPositionMap = MapHandle.getMapForPath(nowPosition)
        upMapButton = 'Null'
        downMapButton = 'Null'
        if nowPositionMap != [] and CacheContorl.nowMap != []:
            upMapButton = str(int(startId1) + 1)
        if nowPositionMap != CacheContorl.nowMap:
            if upMapButton == 'Null':
                downMapButton = str(int(startId1) + 1)
            else:
                downMapButton = str(int(startId1) + 2)
        nowMap = CacheContorl.nowMap.copy()
        if yrn in mapCmd:
            nowTargetPath = MapHandle.getScenePathForMapSceneId(nowMap, yrn)
            CharacterMove.ownCharcterMove(nowTargetPath)
            break
        elif yrn == backButton:
            CacheContorl.nowMap = []
            CacheContorl.nowFlowId = 'in_scene'
            break
        elif yrn in movePathCmd:
            moveListId = movePathCmd.index(yrn)
            moveId = movePathList[moveListId]
            nowTargetPath = MapHandle.getScenePathForMapSceneId(nowMap, moveId)
            CharacterMove.ownCharcterMove(nowTargetPath)
            break
        elif upMapButton != 'Null' and yrn == upMapButton:
            upMapPath = MapHandle.getMapForPath(nowMap)
            CacheContorl.nowMap = upMapPath
        elif downMapButton != 'Null' and yrn == downMapButton:
            characterPosition = CacheContorl.characterData['character'][
                0].Position
            downMapSceneId = MapHandle.getMapSceneIdForScenePath(
                CacheContorl.nowMap, characterPosition)
            nowMap.append(downMapSceneId)
            CacheContorl.nowMap = nowMap
        elif yrn == showSceneNameListCmd:
            PanelStateHandle.panelStateChange(showSceneNameListCmd)
Exemple #8
0
def seeMapPanel() -> list:
    '''
    地图绘制面板
    '''
    inputS = []
    titleText = TextLoading.getTextData(TextLoading.stageWordPath, '78')
    nowMap = CacheContorl.nowMap
    nowMapMapSystemStr = MapHandle.getMapSystemPathStrForList(nowMap)
    mapName = CacheContorl.mapData[nowMapMapSystemStr]['MapName']
    EraPrint.plt(titleText + ': ' + mapName + ' ')
    inputS = inputS + MapHandle.printMap(nowMap)
    return inputS
Exemple #9
0
def identicalMapMove(characterId, nowMap, nowMapSceneId, targetMapSceneId):
    movePath = MapHandle.getPathfinding(nowMap, nowMapSceneId,
                                        targetMapSceneId)
    if movePath != 'End' and movePath != 'Null':
        nowTargetSceneId = movePath['Path'][1]
        nowNeedTime = movePath['Time'][1]
        nowCharacterPosition = MapHandle.getScenePathForMapSceneId(
            nowMap, nowMapSceneId)
        nowTargetPosition = MapHandle.getScenePathForMapSceneId(
            nowMap, nowTargetSceneId)
        MapHandle.characterMoveScene(nowCharacterPosition, nowTargetPosition,
                                     characterId)
        GameTime.subTimeNow(nowNeedTime)
    return movePath
Exemple #10
0
def initGameStart():
    '''
    用于结束角色创建正式开始游戏的初始化流程
    '''
    CharacterHandle.initCharacterDormitory()
    CharacterHandle.initCharacterPosition()
    Course.initPhaseCourseHour()
    Interest.initCharacterInterest()
    Course.initCharacterKnowledge()
    Course.initClassTeacher()
    Course.initClassTimeTable()
    characterPosition = CacheContorl.characterData['character'][0].Position
    MapHandle.characterMoveScene(['0'],characterPosition,0)
    CacheContorl.nowFlowId = 'main'
Exemple #11
0
def seeScenePanel():
    '''
    当前场景信息面板
    '''
    titleText = TextLoading.getTextData(TextLoading.stageWordPath, '75')
    EraPrint.plt(titleText)
    timeText = GameTime.getDateText()
    EraPrint.p(timeText)
    EraPrint.p(' ')
    scenePath = CacheContorl.characterData['character']['0']['Position']
    scenePathStr = MapHandle.getMapSystemPathStrForList(scenePath)
    sceneData = CacheContorl.sceneData[scenePathStr].copy()
    sceneName = sceneData['SceneName']
    sceneInfoHead = TextLoading.getTextData(TextLoading.stageWordPath, '76')
    sceneInfo = sceneInfoHead + sceneName
    EraPrint.p(sceneInfo)
    panelState = CacheContorl.panelState['SeeSceneCharacterListPage']
    switch = panelStateOnText
    if panelState == '0':
        switch = panelStateOffText
    sceneCharacterList = sceneData['SceneCharacterData']
    if len(sceneCharacterList) > 1:
        EraPrint.p(' ')
        PyCmd.pcmd(switch, 'SeeSceneCharacterListPage')
    EraPrint.plittleline()
Exemple #12
0
def seeMapPanel():
    inputS = []
    titleText = TextLoading.getTextData(TextLoading.stageWordPath, '78')
    EraPrint.plt(titleText)
    nowMap = CacheContorl.nowMap
    inputS = inputS + MapHandle.printMap(nowMap)
    return inputS
Exemple #13
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)
Exemple #14
0
def characterMove(characterId, targetScene):
    characterId = str(characterId)
    nowPosition = CacheContorl.characterData['character'][characterId][
        'Position']
    sceneHierarchy = MapHandle.judgeSceneAffiliation(nowPosition, targetScene)
    if sceneHierarchy == '0':
        mapPath = MapHandle.getCommonMapForScenePath(nowPosition, targetScene)
        nowMapSceneId = MapHandle.getMapSceneIdForScenePath(
            mapPath, nowPosition)
        targetMapSceneId = MapHandle.getMapSceneIdForScenePath(
            mapPath, targetScene)
        moveEnd = identicalMapMove(characterId, mapPath, nowMapSceneId,
                                   targetMapSceneId)
    else:
        moveEnd = differenceMapMove(characterId, targetScene)
    return moveEnd
Exemple #15
0
def seeMapFlow():
    PyCmd.clr_cmd()
    inputS = []
    mapCmd = SeeMapPanel.seeMapPanel()
    startId1 = len(mapCmd)
    inputS = inputS + mapCmd
    movePathCmdData = SeeMapPanel.seeMovePathPanel()
    movePathCmd = movePathCmdData['inputS']
    movePathList = movePathCmdData['scenePathList']
    seeMapCmd = SeeMapPanel.backScenePanel(startId1)
    inputS = inputS + seeMapCmd + movePathCmd
    yrn = FlowHandle.askfor_All(inputS)
    backButton = str(startId1)
    nowPosition = CacheContorl.characterData['character']['0']['Position']
    nowPositionMap = MapHandle.getMapForPath(nowPosition)
    upMapButton = 'Null'
    downMapButton = 'Null'
    if nowPositionMap != [] and CacheContorl.nowMap != []:
        upMapButton = str(int(startId1) + 1)
    if nowPositionMap != CacheContorl.nowMap:
        if upMapButton == 'Null':
            downMapButton = str(int(startId1) + 1)
        else:
            downMapButton = str(int(startId1) + 2)
    nowMap = CacheContorl.nowMap
    if yrn in mapCmd:
        nowTargetPath = MapHandle.getScenePathForMapSceneId(nowMap,yrn)
        CharacterMove.ownCharcterMove(nowTargetPath)
    elif yrn == backButton:
        CacheContorl.nowMap = []
        import script.Flow.InScene as inscene
        inscene.getInScene_func()
    elif yrn in movePathCmd:
        moveListId = movePathCmd.index(yrn)
        moveId = movePathList[moveListId]
        nowTargetPath = MapHandle.getScenePathForMapSceneId(nowMap,moveId)
        CharacterMove.ownCharcterMove(nowTargetPath)
    elif upMapButton != 'Null' and yrn == upMapButton:
        upMapPath = MapHandle.getMapForPath(nowMap)
        CacheContorl.nowMap = upMapPath
        seeMapFlow()
    elif downMapButton != 'Null' and yrn == downMapButton:
        characterPosition = CacheContorl.characterData['character']['0']['Position']
        downMapSceneId = MapHandle.getMapSceneIdForScenePath(CacheContorl.nowMap,characterPosition)
        downMapPath = nowMap.append(downMapSceneId)
        CacheContorl.nowMap = downMapPath
        seeMapFlow()
Exemple #16
0
def initGameStart():
    '''
    用于结束角色创建正式开始游戏的初始化流程
    '''
    GameTime.initTime()
    AttrCalculation.setAttrOver('0')
    Course.initPhaseCourseHour()
    CharacterHandle.initCharacterList()
    Interest.initCharacterInterest()
    Course.initCharacterKnowledge()
    Course.initClassTeacher()
    Course.initClassTimeTable()
    SeeCharacterAttrPanel.initShowAttrPanelList()
    characterPosition = CacheContorl.characterData['character']['0'][
        'Position']
    MapHandle.characterMoveScene(['0'], characterPosition, '0')
    CacheContorl.nowFlowId = 'main'
Exemple #17
0
def characterMove(characterId:str,targetScene:list) -> 'MoveEnd:str_Null,str_End,list':
    '''
    通用角色移动控制
    Keyword arguments:
    characterId -- 角色id
    targetScene -- 寻路目标场景(在地图系统下的绝对坐标)
    '''
    nowPosition = CacheContorl.characterData['character'][characterId].Position
    sceneHierarchy = MapHandle.judgeSceneAffiliation(nowPosition,targetScene)
    if sceneHierarchy == 'common':
        mapPath = MapHandle.getCommonMapForScenePath(nowPosition,targetScene)
        nowMapSceneId = MapHandle.getMapSceneIdForScenePath(mapPath,nowPosition)
        targetMapSceneId = MapHandle.getMapSceneIdForScenePath(mapPath,targetScene)
        moveEnd = identicalMapMove(characterId,mapPath,nowMapSceneId,targetMapSceneId)
    else:
        moveEnd = differenceMapMove(characterId,targetScene)
    return moveEnd
Exemple #18
0
def getInScene_func():
    PyCmd.clr_cmd()
    scenePath = CacheContorl.characterData['character']['0']['Position']
    MapHandle.sortSceneCharacterId(scenePath)
    CacheContorl.nowMap = MapHandle.getMapForPath(scenePath)
    scenePathStr = MapHandle.getMapSystemPathStrForList(scenePath)
    sceneData = CacheContorl.sceneData[scenePathStr].copy()
    sceneCharacterList = sceneData['SceneCharacterData']
    if '0' not in sceneCharacterList:
        characterIdList = ['0']
        sceneCharacterList = sceneCharacterList + characterIdList
        CacheContorl.sceneData[scenePathStr][
            'SceneCharacterData'] = sceneCharacterList
    if len(sceneCharacterList) > 1:
        CacheContorl.characterData['characterId'] = sceneCharacterList[0]
        seeScene_func('0')
    else:
        seeScene_func('1')
Exemple #19
0
def getCharacterDormitoryPathText(characterId: str) -> str:
    '''
    获取角色宿舍路径描述信息
    Keyword arguments:
    characterId -- 角色Id
    Return arguments:
    mapPathStr -- 宿舍路径描述文本
    '''
    dormitory = CacheContorl.characterData['character'][characterId].Dormitory
    dormitoryPath = MapHandle.getMapSystemPathForStr(dormitory)
    mapList = MapHandle.getMapHierarchyListForScenePath(dormitoryPath, [])
    mapPathText = TextLoading.getTextData(TextLoading.stageWordPath, '143')
    mapList.reverse()
    for nowMap in mapList:
        nowMapMapSystemStr = MapHandle.getMapSystemPathStrForList(nowMap)
        mapName = CacheContorl.mapData[nowMapMapSystemStr]['MapName']
        mapPathText += mapName + '-'
    mapPathText += CacheContorl.sceneData[dormitory]['SceneName']
    return mapPathText
Exemple #20
0
def seeSceneCharacterListPanel():
    inputS = []
    seeCharacterText = TextLoading.getTextData(TextLoading.messagePath,'26')
    EraPrint.p(seeCharacterText)
    EraPrint.p('\n')
    scenePath = CacheContorl.characterData['character']['0']['Position']
    nameList = MapHandle.getSceneCharacterNameList(scenePath,True)
    nameList = getNowPageNameList(nameList)
    inputS = CmdButtonQueue.optionstr('',cmdColumn=10,cmdSize='center',askfor=False,cmdListData=nameList)
    return inputS
Exemple #21
0
def changeSceneCharacterListPanel() -> list:
    '''
    当前场景角色列表页切换控制面板
    '''
    nameListMax = int(GameConfig.in_scene_see_player_max)
    nowPage = int(CacheContorl.panelState['SeeSceneCharacterListPanel'])
    scenePath = CacheContorl.characterData['character']['0']['Position']
    scenePathStr = MapHandle.getMapSystemPathStrForList(scenePath)
    sceneCharacterNameList = MapHandle.getSceneCharacterNameList(scenePathStr)
    characterMax = len(sceneCharacterNameList)
    pageMax = math.floor(characterMax / nameListMax)
    pageText = '(' + str(nowPage) + '/' + str(pageMax) + ')'
    inputS = CmdButtonQueue.optionint(CmdButtonQueue.changescenecharacterlist,
                                      cmdColumn=5,
                                      askfor=False,
                                      cmdSize='center')
    EraPrint.printPageLine(sample='-', string=pageText)
    EraPrint.pl()
    return inputS
Exemple #22
0
def getInScene_func():
    '''
    用于进入场景界面的流程
    '''
    PyCmd.clr_cmd()
    scenePath = CacheContorl.characterData['character'][0].Position
    scenePathStr = MapHandle.getMapSystemPathStrForList(scenePath)
    MapHandle.sortSceneCharacterId(scenePathStr)
    CacheContorl.nowMap = MapHandle.getMapForPath(scenePath)
    sceneData = CacheContorl.sceneData[scenePathStr].copy()
    sceneCharacterList = sceneData['SceneCharacterData']
    if 0 not in sceneCharacterList:
        characterIdList = [0]
        sceneCharacterList = sceneCharacterList + characterIdList
        CacheContorl.sceneData[scenePathStr][
            'SceneCharacterData'] = sceneCharacterList
    if len(sceneCharacterList
           ) > 1 and CacheContorl.characterData['characterId'] == 0:
        nowNameList = MapHandle.getSceneCharacterNameList(scenePathStr)
        nowNameList.remove(CacheContorl.characterData['character'][0].Name)
        CacheContorl.characterData[
            'characterId'] = MapHandle.getCharacterIdByCharacterName(
                nowNameList[0], scenePathStr)
        if CacheContorl.oldCharacterId != 0:
            CacheContorl.characterData[
                'characterId'] = CacheContorl.oldCharacterId
            CacheContorl.oldCharacterId = 0
    if len(sceneCharacterList) > 1:
        seeScene_func(True)
    else:
        seeScene_func(False)
Exemple #23
0
def seeSceneCharacterListPanel() -> list:
    '''
    当前场景角色列表面板
    '''
    inputS = []
    seeCharacterText = TextLoading.getTextData(TextLoading.messagePath, '26')
    EraPrint.p(seeCharacterText)
    EraPrint.p('\n')
    scenePath = CacheContorl.characterData['character']['0']['Position']
    scenePathStr = MapHandle.getMapSystemPathStrForList(scenePath)
    nameList = MapHandle.getSceneCharacterNameList(scenePathStr, True)
    nameList = getNowPageNameList(nameList)
    characterId = CacheContorl.characterData['characterId']
    characterData = CacheContorl.characterData['character'][characterId]
    characterName = characterData['Name']
    inputS = CmdButtonQueue.optionstr('',
                                      cmdColumn=10,
                                      cmdSize='center',
                                      askfor=False,
                                      cmdListData=nameList,
                                      nullCmd=characterName)
    return inputS
Exemple #24
0
def seeScenePanel():
    titleText = TextLoading.getTextData(TextLoading.stageWordPath,'75')
    EraPrint.plt(titleText)
    timeText = GameTime.getDateText()
    EraPrint.p(timeText)
    EraPrint.p(' ')
    scenePath = CacheContorl.characterData['character']['0']['Position']
    scenePathStr = MapHandle.getMapSystemPathStrForList(scenePath)
    sceneData = CacheContorl.sceneData[scenePathStr].copy()
    sceneName = sceneData['SceneName']
    sceneInfoHead = TextLoading.getTextData(TextLoading.stageWordPath, '76')
    sceneInfo = sceneInfoHead + sceneName
    EraPrint.p(sceneInfo)
    EraPrint.plittleline()
Exemple #25
0
def showSceneNameListPanel() -> str:
    '''
    地图下场景名称绘制面板
    '''
    titleText = TextLoading.getTextData(TextLoading.stageWordPath, '86')
    EraPrint.p(titleText)
    panelState = CacheContorl.panelState['SeeSceneNameListPanel']
    if panelState == '0':
        PyCmd.pcmd(panelStateOffText, "SeeSceneNameListPanel")
        EraPrint.p('\n')
        nowMap = CacheContorl.nowMap
        nowMapMapSystemStr = MapHandle.getMapSystemPathStrForList(nowMap)
        sceneNameData = MapHandle.getSceneNameListForMapPath(
            nowMapMapSystemStr)
        sceneNameList = []
        for scene in sceneNameData:
            sceneNameList.append(scene + ':' + sceneNameData[scene])
        EraPrint.plist(sceneNameList, 5, 'center')
    else:
        PyCmd.pcmd(panelStateOnText, 'SeeSceneNameListPanel')
        EraPrint.p('\n')
    EraPrint.plittleline()
    return 'SeeSceneNameListPanel'
Exemple #26
0
def initGameStart():
    '''
    用于结束角色创建正式开始游戏的初始化流程
    '''
    GameTime.initTime()
    AttrCalculation.setAttrOver('0')
    Course.initPhaseCourseHour()
    CharacterHandle.initCharacterList()
    characterSuit = Clothing.creatorSuit(
        'Uniform', CacheContorl.characterData['character']['0']['Sex'])
    for clothing in characterSuit:
        CacheContorl.characterData['character']['0']['Clothing'][clothing][
            uuid.uuid1()] = characterSuit[clothing]
    Clothing.characterPutOnClothing('0')
    Interest.initCharacterInterest()
    Course.initCharacterKnowledge()
    Course.initClassTeacher()
    Course.initClassTimeTable()
    SeeCharacterAttrPanel.initShowAttrPanelList()
    characterPosition = CacheContorl.characterData['character']['0'][
        'Position']
    MapHandle.characterMoveScene(['0'], characterPosition, '0')
    CacheContorl.nowFlowId = 'main'
Exemple #27
0
def seeMovePathPanel() -> dict:
    '''
    当前场景可直接通往的移动路径绘制面板
    '''
    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 = list(scenePath.keys())
    if mapSceneId in scenePathList:
        remove(mapSceneId)
    if len(scenePathList) > 0:
        sceneCmd = []
        for scene in scenePathList:
            nowMapStr = MapHandle.getMapSystemPathStrForList(nowMap)
            loadSceneData = MapHandle.getSceneDataForMap(nowMapStr, 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}
Exemple #28
0
def backScenePanel(startId):
    seeMapCmd = []
    nowPosition = CacheContorl.characterData['character']['0']['Position']
    nowMap = MapHandle.getMapForPath(nowPosition)
    cmdData = TextLoading.getTextData(TextLoading.cmdPath,
                                      CmdButtonQueue.seemap)
    seeMapCmd.append(cmdData[0])
    if nowMap != [] and CacheContorl.nowMap != []:
        seeMapCmd.append(cmdData[1])
    if nowMap != CacheContorl.nowMap:
        seeMapCmd.append(cmdData[2])
    mapCmdList = CmdButtonQueue.optionint(cmdList=None,
                                          cmdListData=seeMapCmd,
                                          cmdColumn=3,
                                          askfor=False,
                                          cmdSize='center',
                                          startId=startId)
    return mapCmdList
Exemple #29
0
def backScenePanel(startId: str) -> list:
    '''
    查看场景页面基础命令绘制面板
    Keyword arguments:
    startId -- 面板命令起始id
    '''
    seeMapCmd = []
    nowPosition = CacheContorl.characterData['character'][0].Position
    nowMap = MapHandle.getMapForPath(nowPosition)
    cmdData = TextLoading.getTextData(TextLoading.cmdPath,
                                      CmdButtonQueue.seemap)
    seeMapCmd.append(cmdData[0])
    if nowMap != [] and CacheContorl.nowMap != []:
        seeMapCmd.append(cmdData[1])
    if nowMap != CacheContorl.nowMap:
        seeMapCmd.append(cmdData[2])
    mapCmdList = CmdButtonQueue.optionint(cmdList=None,
                                          cmdListData=seeMapCmd,
                                          cmdColumn=3,
                                          askfor=False,
                                          cmdSize='center',
                                          startId=startId)
    return mapCmdList
Exemple #30
0
def identicalMapMove(characterId:str,nowMap:list,nowMapSceneId:str,targetMapSceneId:str) -> 'MoveEnd:str_Null,str_End,list':
    '''
    角色在相同地图层级内移动
    Keyword arguments:
    characterId -- 角色id
    nowMap -- 当前地图路径
    nowMapSceneId -- 当前角色所在场景(当前地图层级下的相对坐标)
    targetMapSceneId -- 寻路目标场景(当前地图层级下的相对坐标)
    '''
    nowMapStr = MapHandle.getMapSystemPathStrForList(nowMap)
    movePath = MapHandle.getPathfinding(nowMapStr,nowMapSceneId,targetMapSceneId)
    if movePath != 'End' and movePath != 'Null':
        nowTargetSceneId = movePath['Path'][0]
        nowNeedTime = movePath['Time'][0]
        nowCharacterPosition = MapHandle.getScenePathForMapSceneId(nowMap,nowMapSceneId)
        nowTargetPosition = MapHandle.getScenePathForMapSceneId(nowMap,nowTargetSceneId)
        MapHandle.characterMoveScene(nowCharacterPosition,nowTargetPosition,characterId)
        GameTime.subTimeNow(nowNeedTime)
    return movePath