def doSOSs(calls):
    if len(calls) == 0:
        return (None, None)

    def callerFunc(toon, handle):
        toon.setChatAbsolute(TTLocalizer.MovieSOSCallHelp % handle.getName(), CFSpeech | CFTimeout)
        handle.d_battleSOS(handle.doId)

    def calleeFunc(toon, handle):
        toon.setChatAbsolute(TTLocalizer.MovieSOSCallHelp % handle.getName(), CFSpeech | CFTimeout)

    def observerFunc(toon):
        toon.setChatAbsolute(TTLocalizer.MovieSOSObserverHelp, CFSpeech | CFTimeout)

    mtrack = Sequence()
    for c in calls:
        toon = c['toon']
        targetType = c['targetType']
        handle = c['target']
        mtrack.append(Wait(0.5))
        if targetType == 'observer':
            ival = Func(observerFunc, toon)
        elif targetType == 'caller':
            ival = Func(callerFunc, toon, handle)
        elif targetType == 'callee':
            ival = Func(calleeFunc, toon, handle)
        else:
            notify.error('invalid target type: %s' % targetType)
        mtrack.append(ival)
        mtrack.append(Wait(2.0))
        notify.debug('toon: %s calls for help' % toon.getName())

    camDuration = mtrack.getDuration()
    camTrack = MovieCamera.chooseSOSShot(toon, camDuration)
    return (mtrack, camTrack)
Beispiel #2
0
def doSOSs(calls):
    if len(calls) == 0:
        return (None, None)
    
    
    def callerFunc(toon, handle):
        toon.setChatAbsolute(Localizer.MovieSOSCallHelp % handle.getName(), CFSpeech | CFTimeout)
        handle.d_battleSOS(toonbase.localToon.doId)

    
    def calleeFunc(toon, handle):
        toon.setChatAbsolute(Localizer.MovieSOSCallHelp % handle.getName(), CFSpeech | CFTimeout)

    
    def observerFunc(toon):
        toon.setChatAbsolute(Localizer.MovieSOSObserverHelp, CFSpeech | CFTimeout)

    ivals = []
    for c in calls:
        toon = c['toon']
        targetType = c['targetType']
        handle = c['target']
        ivals.append(WaitInterval(0.5))
        if targetType == 'observer':
            ival = FunctionInterval(observerFunc, extraArgs = [
                toon])
        elif targetType == 'caller':
            ival = FunctionInterval(callerFunc, extraArgs = [
                toon,
                handle])
        elif targetType == 'callee':
            ival = FunctionInterval(calleeFunc, extraArgs = [
                toon,
                handle])
        else:
            notify.error('ivalid target type: %s' % targetType)
        ivals.append(ival)
        ivals.append(WaitInterval(2.0))
        notify.debug('toon: %s calls for help' % toon.getName())
    
    mtrack = Track(ivals)
    camDuration = mtrack.getDuration()
    camTrack = MovieCamera.chooseSOSShot(toon, camDuration)
    return (mtrack, camTrack)
Beispiel #3
0
def doSOSs(calls):
    if len(calls) == 0:
        return (None, None)

    def callerFunc(toon, handle):
        toon.setChatAbsolute(Localizer.MovieSOSCallHelp % handle.getName(),
                             CFSpeech | CFTimeout)
        handle.d_battleSOS(toonbase.localToon.doId)

    def calleeFunc(toon, handle):
        toon.setChatAbsolute(Localizer.MovieSOSCallHelp % handle.getName(),
                             CFSpeech | CFTimeout)

    def observerFunc(toon):
        toon.setChatAbsolute(Localizer.MovieSOSObserverHelp,
                             CFSpeech | CFTimeout)

    ivals = []
    for c in calls:
        toon = c['toon']
        targetType = c['targetType']
        handle = c['target']
        ivals.append(WaitInterval(0.5))
        if targetType == 'observer':
            ival = FunctionInterval(observerFunc, extraArgs=[toon])
        else:
            if targetType == 'caller':
                ival = FunctionInterval(callerFunc, extraArgs=[toon, handle])
            else:
                if targetType == 'callee':
                    ival = FunctionInterval(calleeFunc,
                                            extraArgs=[toon, handle])
                else:
                    notify.error('ivalid target type: %s' % targetType)
        ivals.append(ival)
        ivals.append(WaitInterval(2.0))
        notify.debug('toon: %s calls for help' % toon.getName())

    mtrack = Track(ivals)
    camDuration = mtrack.getDuration()
    camTrack = MovieCamera.chooseSOSShot(toon, camDuration)
    return (mtrack, camTrack)
    return
Beispiel #4
0
def doSOSs(calls):
    if len(calls) == 0:
        return None, None

    def callerFunc(toon, handle):
        toon.setChatAbsolute(
            TTLocalizer.MovieSOSCallHelp %
            handle.getName(), CFSpeech | CFTimeout)
        base.cr.ttrFriendsManager.sendUpdate('sendTalkWhisper', [handle.doId, 'I Need Help In A Battle!!!'])

    def calleeFunc(toon, handle):
        toon.setChatAbsolute(
            TTLocalizer.MovieSOSCallHelp %
            handle.getName(), CFSpeech | CFTimeout)

    def observerFunc(toon):
        toon.setChatAbsolute(
            TTLocalizer.MovieSOSObserverHelp,
            CFSpeech | CFTimeout)

    mtrack = Sequence()
    for c in calls:
        toon = c['toon']
        targetType = c['targetType']
        handle = c['target']
        mtrack.append(Wait(0.5))
        if targetType == 'observer':
            ival = Func(observerFunc, toon)
        elif targetType == 'caller':
            ival = Func(callerFunc, toon, handle)
        elif targetType == 'callee':
            ival = Func(calleeFunc, toon, handle)
        else:
            notify.error('invalid target type: %s' % targetType)
        mtrack.append(ival)
        mtrack.append(Wait(2.0))
        notify.debug('toon: %s calls for help' % toon.getName())

    camDuration = mtrack.getDuration()
    camTrack = MovieCamera.chooseSOSShot(toon, camDuration)
    return mtrack, camTrack
Beispiel #5
0
def doSOSs(calls):
    """ doSOSs(calls)
        Calls for help occur in the following order:
        right to left, one at a time
    """
    if (len(calls) == 0):
        return (None, None)
    # setChatAbsolute gets around the speedchat
    def callerFunc(toon, handle):
        toon.setChatAbsolute(TTLocalizer.MovieSOSCallHelp %
                             handle.getName(), CFSpeech | CFTimeout)
        handle.d_battleSOS(base.localAvatar.doId)
    def calleeFunc(toon, handle):
        toon.setChatAbsolute(TTLocalizer.MovieSOSCallHelp %
                             handle.getName(), CFSpeech | CFTimeout)
    def observerFunc(toon):
        toon.setChatAbsolute(TTLocalizer.MovieSOSObserverHelp,
                             CFSpeech | CFTimeout)
    mtrack = Sequence()
    for c in calls:
        toon = c['toon']
        targetType = c['targetType']
        handle = c['target']
        mtrack.append(Wait(0.5))
        if (targetType == 'observer'):
            ival = Func(observerFunc, toon)
        elif (targetType == 'caller'):
            ival = Func(callerFunc, toon, handle)
        elif (targetType == 'callee'):
            ival = Func(calleeFunc, toon, handle)
        else:
            notify.error('invalid target type: %s' % targetType)
        mtrack.append(ival)
        # Hold on the word balloon for 2 seconds
        mtrack.append(Wait(2.0))
        notify.debug('toon: %s calls for help' % toon.getName())

    camDuration = mtrack.getDuration()
    camTrack = MovieCamera.chooseSOSShot(toon, camDuration)
    return (mtrack, camTrack)