本文整理汇总了Python中MovieCamera.chooseThrowShot方法的典型用法代码示例。如果您正苦于以下问题:Python MovieCamera.chooseThrowShot方法的具体用法?Python MovieCamera.chooseThrowShot怎么用?Python MovieCamera.chooseThrowShot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MovieCamera
的用法示例。
在下文中一共展示了MovieCamera.chooseThrowShot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: doThrows
# 需要导入模块: import MovieCamera [as 别名]
# 或者: from MovieCamera import chooseThrowShot [as 别名]
def doThrows(throws):
if len(throws) == 0:
return (None, None)
suitThrowsDict = {}
for throw in throws:
if attackAffectsGroup(throw['track'], throw['level']):
pass
else:
suitId = throw['target']['suit'].doId
if suitId in suitThrowsDict:
suitThrowsDict[suitId].append(throw)
else:
suitThrowsDict[suitId] = [throw]
suitThrows = suitThrowsDict.values()
def compFunc(a, b):
if len(a) > len(b):
return 1
elif len(a) < len(b):
return -1
return 0
suitThrows.sort(compFunc)
totalHitDict = {}
singleHitDict = {}
groupHitDict = {}
for throw in throws:
if attackAffectsGroup(throw['track'], throw['level']):
for i in xrange(len(throw['target'])):
target = throw['target'][i]
suitId = target['suit'].doId
if target['hp'] > 0:
addHit(groupHitDict, suitId, 1)
addHit(totalHitDict, suitId, 1)
else:
addHit(groupHitDict, suitId, 0)
addHit(totalHitDict, suitId, 0)
else:
suitId = throw['target']['suit'].doId
if throw['target']['hp'] > 0:
addHit(singleHitDict, suitId, 1)
addHit(totalHitDict, suitId, 1)
else:
addHit(singleHitDict, suitId, 0)
addHit(totalHitDict, suitId, 0)
notify.debug('singleHitDict = %s' % singleHitDict)
notify.debug('groupHitDict = %s' % groupHitDict)
notify.debug('totalHitDict = %s' % totalHitDict)
delay = 0.0
mtrack = Parallel()
for st in suitThrows:
if len(st) > 0:
ival = __doSuitThrows(st)
if ival:
mtrack.append(Sequence(Wait(delay), ival))
delay = delay + TOON_THROW_SUIT_DELAY
retTrack = Sequence()
retTrack.append(mtrack)
groupThrowIvals = Parallel()
groupThrows = []
for throw in throws:
if attackAffectsGroup(throw['track'], throw['level']):
groupThrows.append(throw)
for throw in groupThrows:
tracks = None
tracks = __throwGroupPie(throw, 0, groupHitDict)
if tracks:
for track in tracks:
groupThrowIvals.append(track)
retTrack.append(groupThrowIvals)
camDuration = retTrack.getDuration()
camTrack = MovieCamera.chooseThrowShot(throws, suitThrowsDict, camDuration)
return (retTrack, camTrack)