Exemplo n.º 1
0
    def _parseScene(self,
                    xmlCtx,
                    section,
                    scene,
                    flags,
                    itemFlags,
                    afterBattle=False,
                    frontEffects=False):
        for _, subSec in _xml.getChildren(xmlCtx, section, 'gui-items'):
            item = sub_parsers._parseGuiItem(xmlCtx, subSec, flags, itemFlags)
            if item is not None:
                scene.addGuiItem(item)

        front = -1
        for _, subSec in _xml.getChildren(xmlCtx, section, 'post-effects'):
            effect = sub_parsers._parseEffect(xmlCtx,
                                              subSec,
                                              flags,
                                              afterBattle=afterBattle)
            if effect is not None:
                if frontEffects:
                    front += 1
                scene.addPostEffect(effect, front=front)

        front = -1
        for _, subSec in _xml.getChildren(xmlCtx, section, 'runtime-effects'):
            effect = sub_parsers._parseEffect(xmlCtx,
                                              subSec,
                                              flags,
                                              afterBattle=afterBattle)
            if effect is not None:
                if frontEffects:
                    front += 1
                scene.addEffect(effect, front=front)
Exemplo n.º 2
0
    def _parseGlobalRuntimeEffects(self, xmlCtx, section, flags, chapter):
        subSec = _xml.getSubsection(xmlCtx, section, 'global-runtime-effects', False)
        if subSec is not None:
            priorities = (('pre-scene', False), ('post-scene', True))
            for tagName, isPostScene in priorities:
                for _, effectSec in _xml.getChildren(xmlCtx, subSec, tagName, False):
                    effect = sub_parsers._parseEffect(xmlCtx, effectSec, flags)
                    if effect is not None:
                        chapter.addGlobalEffect(effect, isPostScene)

        return
Exemplo n.º 3
0
    def __parseScene(self, xmlCtx, section, scene, flags, itemFlags, afterBattle = False, frontEffects = False):
        for _, subSec in _xml.getChildren(xmlCtx, section, 'gui-items'):
            item = sub_parsers._parseGuiItem(xmlCtx, subSec, flags, itemFlags)
            if item is not None:
                scene.addGuiItem(item)

        front = -1
        for _, subSec in _xml.getChildren(xmlCtx, section, 'post-effects'):
            effect = sub_parsers._parseEffect(xmlCtx, subSec, flags, afterBattle=afterBattle)
            if effect is not None:
                if frontEffects:
                    front += 1
                scene.addPostEffect(effect, front=front)

        front = -1
        for _, subSec in _xml.getChildren(xmlCtx, section, 'runtime-effects'):
            effect = sub_parsers._parseEffect(xmlCtx, subSec, flags, afterBattle=afterBattle)
            if effect is not None:
                if frontEffects:
                    front += 1
                scene.addEffect(effect, front=front)
Exemplo n.º 4
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)