mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-26 21:22:27 -06:00
49 lines
1.6 KiB
Python
49 lines
1.6 KiB
Python
|
from direct.directnotify import DirectNotifyGlobal
|
||
|
from direct.interval.IntervalGlobal import *
|
||
|
from pandac.PandaModules import *
|
||
|
|
||
|
import MovieCamera
|
||
|
from toontown.chat.ChatGlobals import *
|
||
|
from toontown.nametag.NametagGlobals import *
|
||
|
from toontown.toonbase import TTLocalizer
|
||
|
|
||
|
|
||
|
notify = DirectNotifyGlobal.directNotify.newCategory('MovieSOS')
|
||
|
|
||
|
|
||
|
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(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)
|
||
|
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)
|