예제 #1
0
def _readProgressSection(xmlCtx, section, _):
    progressID = sub_parsers.parseID(xmlCtx, section, 'Specify a progress ID')
    conditions = []
    for _, subSec in _xml.getChildren(xmlCtx, section, 'steps'):
        conditions.append(chapter.HasIDConditions(sub_parsers.parseID(xmlCtx, subSec, 'Specify a condition ID'), sub_parsers.readConditions(xmlCtx, subSec, [])))

    return chapter.ChapterProgress(progressID, conditions)
예제 #2
0
def _readHintSection(xmlCtx, section, flags):
    hintID = sub_parsers.parseID(xmlCtx, section, 'Specify a hint ID')
    if 'item-id' in section.keys():
        itemID = sub_parsers.parseID(xmlCtx, section['item-id'],
                                     'Specify a item ID')
    else:
        _xml.raiseWrongXml(xmlCtx, section.name, 'Specify a item ID')
        return
    tags = section.keys()
    text = translation(_xml.readString(xmlCtx, section, 'text'))
    if 'arrow' in tags:
        subSec = section['arrow']
        direction = _xml.readString(xmlCtx, subSec, 'direction')
        if direction not in _AVAILABLE_DIRECTIONS:
            _xml.raiseWrongXml(
                xmlCtx, section,
                'Arrow direction {} is invalid.'.format(direction))
        arrow = _ArrowProps(direction, _xml.readBool(xmlCtx, subSec, 'loop'))
    else:
        arrow = None
    if 'padding' in tags:
        subSec = section['padding']
        padding = _Padding(_xml.readFloat(xmlCtx, subSec, 'left'),
                           _xml.readFloat(xmlCtx, subSec, 'top'),
                           _xml.readFloat(xmlCtx, subSec, 'right'),
                           _xml.readFloat(xmlCtx, subSec, 'bottom'))
    else:
        padding = None
    hint = chapter.ChainHint(hintID, itemID, text,
                             section.readBool('has-box', True), arrow, padding)
    hint.setActions(
        sub_parsers.parseActions(
            xmlCtx, _xml.getSubsection(xmlCtx, section, 'actions'), flags))
    return hint
예제 #3
0
def _readHintSection(xmlCtx, section, flags):
    hintID = sub_parsers.parseID(xmlCtx, section, 'Specify a hint ID')
    if 'item-id' in section.keys():
        itemID = sub_parsers.parseID(xmlCtx, section['item-id'], 'Specify a item ID')
    else:
        _xml.raiseWrongXml(xmlCtx, section.name, 'Specify a item ID')
        return
    tags = section.keys()
    text = translation(_xml.readString(xmlCtx, section, 'text'))
    if 'arrow' in tags:
        subSec = section['arrow']
        direction = _xml.readString(xmlCtx, subSec, 'direction')
        if direction not in _AVAILABLE_DIRECTIONS:
            _xml.raiseWrongXml(xmlCtx, section, 'Arrow direction {} is invalid.'.format(direction))
        arrow = _ArrowProps(direction, _xml.readBool(xmlCtx, subSec, 'loop'))
    else:
        arrow = None
    if 'padding' in tags:
        subSec = section['padding']
        padding = _Padding(_xml.readFloat(xmlCtx, subSec, 'left'), _xml.readFloat(xmlCtx, subSec, 'top'), _xml.readFloat(xmlCtx, subSec, 'right'), _xml.readFloat(xmlCtx, subSec, 'bottom'))
    else:
        padding = None
    hint = chapter.ChainHint(hintID, itemID, text, section.readBool('has-box', True), arrow, padding)
    hint.setActions(sub_parsers.parseActions(xmlCtx, _xml.getSubsection(xmlCtx, section, 'actions'), flags))
    return hint
예제 #4
0
def _readProgressSection(xmlCtx, section, _):
    progressID = sub_parsers.parseID(xmlCtx, section, 'Specify a progress ID')
    conditions = []
    for _, subSec in _xml.getChildren(xmlCtx, section, 'steps'):
        conditions.append(chapter.HasIDConditions(sub_parsers.parseID(xmlCtx, subSec, 'Specify a condition ID'), sub_parsers.readConditions(xmlCtx, subSec, [])))

    return chapter.ChapterProgress(progressID, conditions)
예제 #5
0
def _readChapterTaskSection(xmlCtx, section, _):
    taskID = sub_parsers.parseID(xmlCtx, section, 'Specify a task ID')
    text = translation(_xml.readString(xmlCtx, section, 'text'))
    flagID = None
    if 'flag' in section.keys():
        flagID = _xml.readString(xmlCtx, section, 'flag')
    return chapter.ChapterTask(taskID, text, flagID=flagID)
예제 #6
0
def _readChapterTaskSection(xmlCtx, section, _):
    taskID = sub_parsers.parseID(xmlCtx, section, 'Specify a task ID')
    text = translation(_xml.readString(xmlCtx, section, 'text'))
    flagID = None
    if 'flag' in section.keys():
        flagID = _xml.readString(xmlCtx, section, 'flag')
    return chapter.ChapterTask(taskID, text, flagID=flagID)
예제 #7
0
 def _parseScenes(self, xmlCtx, section, chapter, flags, itemFlags, afterBattle, initial):
     for _, sceneSec in _xml.getChildren(xmlCtx, section, 'scenes'):
         sceneID = sub_parsers.parseID(xmlCtx, sceneSec, 'Specify a unique name for the scene')
         scene = Scene(entityID=sceneID)
         self._parseScene(xmlCtx, sceneSec, scene, flags, itemFlags, afterBattle=afterBattle)
         self._parseSharedScene(chapter, scene, flags, itemFlags)
         chapter.addScene(scene)
예제 #8
0
def _readDispatcherTriggerSection(xmlCtx, section, _, triggerID):
    triggerIDs = set()
    for _, subSec in _xml.getChildren(xmlCtx, section, 'includes'):
        triggerIDs.add(
            sub_parsers.parseID(xmlCtx, subSec, 'Specify a trigger ID'))

    return triggers.TriggersDispatcher(triggerID, triggerIDs)
예제 #9
0
def _readExitQueueEffectSection(xmlCtx, section, flags, conditions):
    flagID = sub_parsers.parseID(xmlCtx, section, 'Specify a flag ID')
    if flagID not in flags:
        flags.append(flagID)
    return effects.HasTargetEffect(flagID,
                                   _EFFECT_TYPE.EXIT_QUEUE,
                                   conditions=conditions)
예제 #10
0
def _readInternalBrowserSection(xmlCtx, section, flags, conditions):
    flagID = sub_parsers.parseID(xmlCtx, section, 'Specify a flag ID')
    if flagID not in flags:
        flags.append(flagID)
    return effects.HasTargetEffect(flagID,
                                   _EFFECT_TYPE.OPEN_INTERNAL_BROWSER,
                                   conditions=conditions)
예제 #11
0
def _readEnterModeEffectSection(xmlCtx, section, flags, conditions):
    flagID = sub_parsers.parseID(xmlCtx, section, 'Specify a flag ID')
    if flagID not in flags:
        flags.append(flagID)
    return effects.HasTargetEffect(flagID,
                                   _EFFECT_TYPE.ENTER_MODE,
                                   conditions=conditions)
예제 #12
0
 def _parseScenes(self, xmlCtx, section, chapter, flags, itemFlags, afterBattle, initial):
     for _, sceneSec in _xml.getChildren(xmlCtx, section, 'scenes'):
         sceneID = sub_parsers.parseID(xmlCtx, sceneSec, 'Specify a unique name for the scene')
         scene = Scene(entityID=sceneID)
         self._parseScene(xmlCtx, sceneSec, scene, flags, itemFlags, afterBattle=afterBattle)
         self._parseSharedScene(chapter, scene, flags, itemFlags)
         chapter.addScene(scene)
예제 #13
0
def _readGreetingSection(xmlCtx, section, _):
    greetingID = sub_parsers.parseID(xmlCtx, section, 'Specify a greeting ID')
    title = translation(_xml.readString(xmlCtx, section, 'title'))
    text = translation(_xml.readString(xmlCtx, section, 'text'))
    speakID = None
    if 'speak' in section.keys():
        speakID = _xml.readString(xmlCtx, section, 'speak')
    return chapter.Greeting(greetingID, title, text, speakID=speakID)
예제 #14
0
def _readGreetingSection(xmlCtx, section, _):
    greetingID = sub_parsers.parseID(xmlCtx, section, 'Specify a greeting ID')
    title = translation(_xml.readString(xmlCtx, section, 'title'))
    text = translation(_xml.readString(xmlCtx, section, 'text'))
    speakID = None
    if 'wwspeak' in section.keys():
        speakID = _xml.readString(xmlCtx, section, 'wwspeak')
    return chapter.Greeting(greetingID, title, text, speakID=speakID)
예제 #15
0
def _readExitSection(xmlCtx, section, _):
    exitID = sub_parsers.parseID(xmlCtx, section, 'Specify a exit ID')
    return chapter.Exit(exitID,
                        nextChapter=_xml.readString(xmlCtx, section,
                                                    'chapter-id'),
                        nextDelay=_xml.readFloat(xmlCtx, section,
                                                 'next-delay'),
                        finishDelay=section.readFloat('finish-delay'),
                        isSpeakOver=section.readBool('is-speak-over'))
예제 #16
0
def _readImageSection(xmlCtx, section, _):
    imageID = sub_parsers.parseID(xmlCtx, section, 'Specify a image ID')
    imageType = _xml.readString(xmlCtx, section, 'type')
    image = None
    if imageType in _IMAGE_TYPES:
        parser = _IMAGE_TYPES[imageType]
        image = parser(xmlCtx, section, imageID)
    else:
        LOG_ERROR('Image is not supported:', imageType)
    return image
예제 #17
0
def _readImageSection(xmlCtx, section, _):
    imageID = sub_parsers.parseID(xmlCtx, section, 'Specify a image ID')
    imageType = _xml.readString(xmlCtx, section, 'type')
    image = None
    if imageType in _IMAGE_TYPES:
        parser = _IMAGE_TYPES[imageType]
        image = parser(xmlCtx, section, imageID)
    else:
        LOG_ERROR('Image is not supported:', imageType)
    return image
예제 #18
0
def _readMarkerSection(xmlCtx, section, _):
    markerID = sub_parsers.parseID(xmlCtx, section, 'Specify a marker ID')
    type = _xml.readString(xmlCtx, section, 'type')
    marker = None
    if type in _MARKER_TYPES:
        parser = _MARKER_TYPES[type]
        marker = parser(xmlCtx, section, markerID, _xml.readString(xmlCtx, section, 'var-ref'))
    else:
        LOG_ERROR('Marker is not supported:', type)
    return marker
예제 #19
0
def _readMarkerSection(xmlCtx, section, _):
    markerID = sub_parsers.parseID(xmlCtx, section, 'Specify a marker ID')
    type = _xml.readString(xmlCtx, section, 'type')
    marker = None
    if type in _MARKER_TYPES:
        parser = _MARKER_TYPES[type]
        marker = parser(xmlCtx, section, markerID, _xml.readString(xmlCtx, section, 'var-ref'))
    else:
        LOG_ERROR('Marker is not supported:', type)
    return marker
예제 #20
0
    def _parseVars(self, xmlCtx, section, flags, chapter):
        gVarIDs = []
        for name, subSec in _xml.getChildren(xmlCtx, section, 'vars'):
            if name == 'var-set':
                chapter.addVarSet(sub_parsers.parseVarSet(xmlCtx, subSec, flags))
            if name == 'var-set-ref':
                gVarIDs.append(sub_parsers.parseID(xmlCtx, subSec, 'Specify a var ID'))
            _xml.raiseWrongXml(xmlCtx, name, 'Unknown tag')

        if gVarIDs:
            GlobalRefParser().parse(chapter, varIDs=gVarIDs, flags=flags)
예제 #21
0
    def parse(self):
        section = ResMgr.openSection(BONUSES_REFS_FILE_PATH)
        if section is None:
            _xml.raiseWrongXml(None, BONUSES_REFS_FILE_PATH, 'can not open or read')
        xmlCtx = (None, BONUSES_REFS_FILE_PATH)
        result = {}
        for _, subSec in _xml.getChildren(xmlCtx, section, 'bonuses'):
            bonusID = sub_parsers.parseID(xmlCtx, subSec, 'Specify a bonus ID')
            result[bonusID] = Bonus(subSec.readInt('id', -1), subSec.readString('message'), sub_parsers.readValues(subSec))

        return result
예제 #22
0
def _readRequestExclusiveHintEffectSection(xmlCtx, section, _, conditions):
    componentID = sub_parsers.parseID(xmlCtx, section,
                                      'missing hint target component ID')
    soundID = _xml.readStringOrNone(xmlCtx, section, 'sound')
    if soundID is None:
        soundID = 'bc_new_ui_element_button'
    if conditions is None:
        conditions = Conditions()
    conditions.insert(0, ComponentOnSceneCondition(componentID))
    return bc_effects.RequestExclusiveHintEffect(componentID,
                                                 soundID,
                                                 conditions=conditions)
예제 #23
0
def _readCheckpointSection(xmlCtx, section, flags):
    checkpointID = sub_parsers.parseID(xmlCtx, section,
                                       'missing checkpoint ID')
    checkpointConditions = sub_parsers.readConditions(
        xmlCtx, _xml.getSubsection(xmlCtx, section, 'condition'), flags)
    checkpointEffects = [
        effect for effect in (
            sub_parsers._parseEffect(xmlCtx, effectSec, flags)
            for _, effectSec in _xml.getChildren(xmlCtx, section, 'effects'))
        if effect is not None
    ]
    return Checkpoint(checkpointID, checkpointConditions, checkpointEffects)
예제 #24
0
 def _parseBonus(self, xmlCtx, section, bonuses):
     tags = section.keys()
     if 'bonus' in tags:
         subSection = section['bonus']
         return sub_parsers.parseBonus(xmlCtx, subSection)
     if 'bonus-ref' in tags:
         bonusID = sub_parsers.parseID(xmlCtx, section['bonus-ref'], 'Specify a bonus ID')
         if bonusID in bonuses:
             return bonuses[bonusID]
         _xml.raiseWrongXml(xmlCtx, section.name, 'Bonus reference {0} is not found'.format(bonusID))
     else:
         _xml.raiseWrongXml(xmlCtx, section.name, 'Bonuses is not found')
예제 #25
0
    def parse(self):
        section = ResMgr.openSection(BONUSES_REFS_FILE_PATH)
        if section is None:
            _xml.raiseWrongXml(None, BONUSES_REFS_FILE_PATH, 'can not open or read')
        xmlCtx = (None, BONUSES_REFS_FILE_PATH)
        result = {}
        for _, subSec in _xml.getChildren(xmlCtx, section, 'bonuses'):
            bonusID = sub_parsers.parseID(xmlCtx, subSec, 'Specify a bonus ID')
            bonus = sub_parsers.parseBonus(xmlCtx, subSec)
            result[bonusID] = bonus

        return result
예제 #26
0
    def _parseVars(self, xmlCtx, section, flags, chapter):
        gVarIDs = []
        for name, subSec in _xml.getChildren(xmlCtx, section, 'vars'):
            if name == 'var-set':
                chapter.addVarSet(sub_parsers.parseVarSet(xmlCtx, subSec, flags))
            elif name == 'var-set-ref':
                gVarIDs.append(sub_parsers.parseID(xmlCtx, subSec, 'Specify a var ID'))
            else:
                _xml.raiseWrongXml(xmlCtx, name, 'Unknown tag')

        if gVarIDs:
            GlobalRefParser().parse(chapter, varIDs=gVarIDs, flags=flags)
예제 #27
0
 def _parseBonus(self, xmlCtx, section, bonuses):
     tags = section.keys()
     if 'bonus' in tags:
         subSection = section['bonus']
         return Bonus(subSection.readInt('id', -1), subSection.readString('message'), sub_parsers.readValues(subSection))
     if 'bonus-ref' in tags:
         bonusID = sub_parsers.parseID(xmlCtx, section['bonus-ref'], 'Specify a bonus ID')
         if bonusID in bonuses:
             return bonuses[bonusID]
         _xml.raiseWrongXml(xmlCtx, section.name, 'Bonus reference {0} is not found'.format(bonusID))
     else:
         _xml.raiseWrongXml(xmlCtx, section.name, 'Bonuses is not found')
예제 #28
0
def _readHintSection(xmlCtx, section, _):
    hintID = sub_parsers.parseID(xmlCtx, section, 'Specify a hint ID')
    text = translation(_xml.readString(xmlCtx, section, 'text'))
    if 'image' in section.keys():
        image = chapter.SimpleImagePath(None, _xml.readString(xmlCtx, section, 'image'))
    elif 'image-ref' in section.keys():
        image = _xml.readString(xmlCtx, section, 'image-ref')
    else:
        image = chapter.SimpleImagePath()
    speakID = None
    if 'speak' in section.keys():
        speakID = _xml.readString(xmlCtx, section, 'speak')
    return chapter.SimpleHint(hintID, text, image, speakID=speakID)
예제 #29
0
def _readHintSection(xmlCtx, section, _):
    hintID = sub_parsers.parseID(xmlCtx, section, 'Specify a hint ID')
    text = translation(_xml.readString(xmlCtx, section, 'text'))
    if 'image' in section.keys():
        image = chapter.SimpleImagePath(None, _xml.readString(xmlCtx, section, 'image'))
    elif 'image-ref' in section.keys():
        image = _xml.readString(xmlCtx, section, 'image-ref')
    else:
        image = chapter.SimpleImagePath()
    speakID = None
    if 'wwspeak' in section.keys():
        speakID = _xml.readString(xmlCtx, section, 'wwspeak')
    return chapter.SimpleHint(hintID, text, image, speakID=speakID)
예제 #30
0
def _readLinearCheckpointControllerTriggerSection(xmlCtx, section, _,
                                                  triggerID):
    checkpointsSequence = [
        sub_parsers.parseID(xmlCtx, subSec,
                            'missing checkpoint ID in sequence')
        for _, subSec in _xml.getChildren(xmlCtx, section, 'sequence')
    ]
    return sub_parsers.readValidateVarTriggerSection(
        xmlCtx,
        section,
        triggerID,
        bc_triggers.LinearCheckpointControllerTrigger,
        checkpointsSequence=checkpointsSequence)
예제 #31
0
def readTutorialSettingSection(xmlCtx, section, flags):
    settingID = sub_parsers.parseID(xmlCtx, section, 'Specify a setting ID')
    settingName = None
    if 'setting-name' in section.keys():
        settingName = _xml.readString(xmlCtx, section, 'setting-name')
    else:
        _xml.raiseWrongXml(xmlCtx, section.name, 'Specify a setting name')
    settingValue = None
    if 'setting-value' in section.keys():
        settingValue = _xml.readBool(xmlCtx, section, 'setting-value')
    else:
        _xml.raiseWrongXml(xmlCtx, section.name, 'Specify a setting value')
    return chapter.TutorialSetting(settingID, settingName, settingValue)
예제 #32
0
파일: __init__.py 프로젝트: kblw/wot_client
 def parse(self, chapter, varIDs = None, flags = None):
     if varIDs is None:
         varIDs = []
     if flags is None:
         flags = []
     section = ResMgr.openSection(GLOBAL_REFS_FILE_PATH)
     if section is None:
         _xml.raiseWrongXml(None, GLOBAL_REFS_FILE_PATH, 'can not open or read')
     xmlCtx = (None, GLOBAL_REFS_FILE_PATH)
     if len(varIDs):
         for _, subSec in _xml.getChildren(xmlCtx, section, 'vars'):
             varID = sub_parsers.parseID(xmlCtx, subSec, 'Specify a var ID')
             if varID in varIDs:
                 chapter.addVarSet(sub_parsers.parseVarSet(xmlCtx, subSec, flags))
예제 #33
0
    def parse(self):
        section = ResMgr.openSection(BONUSES_REFS_FILE_PATH)
        if section is None:
            _xml.raiseWrongXml(None, BONUSES_REFS_FILE_PATH,
                               'can not open or read')
        xmlCtx = (None, BONUSES_REFS_FILE_PATH)
        result = {}
        for _, subSec in _xml.getChildren(xmlCtx, section, 'bonuses'):
            bonusID = sub_parsers.parseID(xmlCtx, subSec, 'Specify a bonus ID')
            result[bonusID] = Bonus(subSec.readInt('id', -1),
                                    subSec.readString('message'),
                                    sub_parsers.readValues(subSec))

        return result
예제 #34
0
 def parse(self, chapter, varIDs=None, flags=None):
     if varIDs is None:
         varIDs = []
     if flags is None:
         flags = []
     section = ResMgr.openSection(GLOBAL_REFS_FILE_PATH)
     if section is None:
         _xml.raiseWrongXml(None, GLOBAL_REFS_FILE_PATH,
                            'can not open or read')
     xmlCtx = (None, GLOBAL_REFS_FILE_PATH)
     if len(varIDs):
         for _, subSec in _xml.getChildren(xmlCtx, section, 'vars'):
             varID = sub_parsers.parseID(xmlCtx, subSec, 'Specify a var ID')
             if varID in varIDs:
                 chapter.addVarSet(
                     sub_parsers.parseVarSet(xmlCtx, subSec, flags))
예제 #35
0
def readLoadViewDataSection(xmlCtx, section, flags):
    settingID = sub_parsers.parseID(xmlCtx, section, 'Specify a setting ID')
    alias = None
    if 'alias' in section.keys():
        alias = _xml.readString(xmlCtx, section, 'alias')
    else:
        _xml.raiseWrongXml(xmlCtx, section.name, 'Specify a setting name')
    scope = EVENT_BUS_SCOPE.DEFAULT
    if 'scope' in section.keys():
        scope = _xml.readInt(xmlCtx, section, 'scope')
    else:
        _xml.raiseWrongXml(xmlCtx, section.name, 'Specify a setting value')
    ctx = None
    if 'context' in section.keys():
        ctx = readVarValue('asDict', section['context'])
    return chapter.LoadViewData(settingID, alias, scope, ctx)
예제 #36
0
 def _parseBonus(self, xmlCtx, section, bonuses):
     tags = section.keys()
     if 'bonus' in tags:
         subSection = section['bonus']
         return Bonus(subSection.readInt('id', -1),
                      subSection.readString('message'),
                      sub_parsers.readValues(subSection))
     if 'bonus-ref' in tags:
         bonusID = sub_parsers.parseID(xmlCtx, section['bonus-ref'],
                                       'Specify a bonus ID')
         if bonusID in bonuses:
             return bonuses[bonusID]
         _xml.raiseWrongXml(
             xmlCtx, section.name,
             'Bonus reference {0} is not found'.format(bonusID))
     else:
         _xml.raiseWrongXml(xmlCtx, section.name, 'Bonuses is not found')
예제 #37
0
def readSaveTutorialSettingSection(xmlCtx, section, _, conditions):
    settingID = sub_parsers.parseID(xmlCtx, section, 'Specify a setting ID')
    return effects.HasTargetEffect(settingID, _EFFECT_TYPE.SAVE_TUTORIAL_SETTING, conditions=conditions)
예제 #38
0
def _readInternalBrowserSection(xmlCtx, section, flags, conditions):
    flagID = sub_parsers.parseID(xmlCtx, section, 'Specify a flag ID')
    if flagID not in flags:
        flags.append(flagID)
    return effects.HasTargetEffect(flagID, _EFFECT_TYPE.OPEN_INTERNAL_BROWSER, conditions=conditions)
예제 #39
0
def _readExitQueueEffectSection(xmlCtx, section, flags, conditions):
    flagID = sub_parsers.parseID(xmlCtx, section, 'Specify a flag ID')
    if flagID not in flags:
        flags.append(flagID)
    return effects.HasTargetEffect(flagID, _EFFECT_TYPE.EXIT_QUEUE, conditions=conditions)
예제 #40
0
def _readCheckpointReachedCondition(xmlCtx, section, state):
    checkpointID = sub_parsers.parseID(xmlCtx, section,
                                       'missing checkpoint ID in condition')
    return bc_conditions.CheckpointReachedCondition(checkpointID, state=state)
예제 #41
0
def _readRemoveMarkerSection(xmlCtx, section, _, conditions):
    markerID = sub_parsers.parseID(xmlCtx, section, 'Specify a marker ID')
    return effects.HasTargetEffect(markerID, _EFFECT_TYPE.REMOVE_MARKER, conditions=conditions)
예제 #42
0
def _readShowGreetingSection(xmlCtx, section, _, conditions):
    greetingID = sub_parsers.parseID(xmlCtx, section, 'Specify a greeting ID')
    return effects.HasTargetEffect(greetingID, _EFFECT_TYPE.SHOW_GREETING, conditions=conditions)
예제 #43
0
def _readTeleportSection(xmlCtx, section, _, conditions):
    pointID = sub_parsers.parseID(xmlCtx, section, 'Specify a point ID')
    return effects.HasTargetEffect(pointID, _EFFECT_TYPE.TELEPORT, conditions=conditions)
예제 #44
0
def _readSetBootcampNationEffectSection(xmlCtx, section, _, conditions):
    varID = sub_parsers.parseID(xmlCtx, section,
                                'missing selected nation variable ID')
    return effects.HasTargetEffect(varID,
                                   _EFFECT_TYPE.SAVE_ACCOUNT_SETTING,
                                   conditions=conditions)
예제 #45
0
def _reaLoadViewSection(xmlCtx, section, _, conditions):
    viewID = parseID(xmlCtx, section, 'Specify a view ID')
    return effects.HasTargetEffect(viewID,
                                   effects.EFFECT_TYPE.LOAD_VIEW,
                                   conditions=conditions)
예제 #46
0
def _readNextTaskSection(xmlCtx, section, _, conditions):
    taskID = sub_parsers.parseID(xmlCtx, section, 'Specify a next task ID')
    return effects.HasTargetEffect(taskID, _EFFECT_TYPE.NEXT_TASK, conditions=conditions)
예제 #47
0
def readSaveAccountSettingSection(xmlCtx, section, _, conditions):
    settingID = sub_parsers.parseID(xmlCtx, section, 'Specify a setting ID')
    return effects.HasTargetEffect(settingID, _EFFECT_TYPE.SAVE_ACCOUNT_SETTING, conditions=conditions)
예제 #48
0
def _readDispatcherTriggerSection(xmlCtx, section, _, triggerID):
    triggerIDs = set()
    for _, subSec in _xml.getChildren(xmlCtx, section, 'includes'):
        triggerIDs.add(sub_parsers.parseID(xmlCtx, subSec, 'Specify a trigger ID'))

    return triggers.TriggersDispatcher(triggerID, triggerIDs)
예제 #49
0
def _readExitSection(xmlCtx, section, _):
    exitID = sub_parsers.parseID(xmlCtx, section, 'Specify a exit ID')
    return chapter.Exit(exitID, nextChapter=_xml.readString(xmlCtx, section, 'chapter-id'), nextDelay=_xml.readFloat(xmlCtx, section, 'next-delay'), finishDelay=section.readFloat('finish-delay'), isSpeakOver=section.readBool('is-speak-over'))
예제 #50
0
def _readShowGreetingSection(xmlCtx, section, _, conditions):
    greetingID = sub_parsers.parseID(xmlCtx, section, 'Specify a greeting ID')
    return effects.HasTargetEffect(greetingID,
                                   _EFFECT_TYPE.SHOW_GREETING,
                                   conditions=conditions)