当前位置: 首页>>代码示例>>Python>>正文


Python MovieCamera.chooseSOSShot方法代码示例

本文整理汇总了Python中MovieCamera.chooseSOSShot方法的典型用法代码示例。如果您正苦于以下问题:Python MovieCamera.chooseSOSShot方法的具体用法?Python MovieCamera.chooseSOSShot怎么用?Python MovieCamera.chooseSOSShot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MovieCamera的用法示例。


在下文中一共展示了MovieCamera.chooseSOSShot方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: doSOSs

# 需要导入模块: import MovieCamera [as 别名]
# 或者: from MovieCamera import chooseSOSShot [as 别名]
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)
开发者ID:ToontownBattlefront,项目名称:Toontown-Battlefront,代码行数:37,代码来源:MovieSOS.py

示例2: doSOSs

# 需要导入模块: import MovieCamera [as 别名]
# 或者: from MovieCamera import chooseSOSShot [as 别名]
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)
开发者ID:Toonerz,项目名称:Toontown-2003,代码行数:46,代码来源:MovieSOS.py

示例3: doSOSs

# 需要导入模块: import MovieCamera [as 别名]
# 或者: from MovieCamera import chooseSOSShot [as 别名]
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
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:43,代码来源:MovieSOS.py


注:本文中的MovieCamera.chooseSOSShot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。