def __healJuggle(heal, hasInteractivePropHealBonus): npcId = 0 if 'npcId' in heal: npcId = heal['npcId'] toon = NPCToons.createLocalNPC(npcId) if toon == None: return else: toon = heal['toon'] targets = heal['target'] ineffective = heal['sidestep'] level = heal['level'] if npcId != 0: track = Sequence(MovieNPCSOS.teleportIn(heal, toon)) else: track = Sequence(__runToHealSpot(heal)) delay = 4.0 first = 1 targetTrack = Sequence() for target in targets: targetToon = target['toon'] hp = target['hp'] reactIval = Func(__healToon, targetToon, hp, ineffective, hasInteractivePropHealBonus) if first == 1: targetTrack.append(Wait(delay)) first = 0 targetTrack.append(reactIval) cube = globalPropPool.getProp('cubes') cube2 = MovieUtil.copyProp(cube) cubes = [cube, cube2] hips = [toon.getLOD(toon.getLODNames()[0]).find('**/joint_hips'), toon.getLOD(toon.getLODNames()[1]).find('**/joint_hips')] cubeTrack = Sequence(Func(MovieUtil.showProps, cubes, hips), MovieUtil.getActorIntervals(cubes, 'cubes'), Func(MovieUtil.removeProps, cubes)) mtrack = Parallel(cubeTrack, __getSoundTrack(level, 0.7, duration=7.7, node=toon), ActorInterval(toon, 'juggle'), targetTrack) track.append(mtrack) if npcId != 0: track.append(MovieNPCSOS.teleportOut(heal, toon)) else: track.append(__returnToBase(heal)) for target in targets: targetToon = target['toon'] track.append(Func(targetToon.clearChat)) return track
def __healTickle(heal, hasInteractivePropHealBonus): toon = heal['toon'] target = heal['target']['toon'] hp = heal['target']['hp'] ineffective = heal['sidestep'] level = heal['level'] track = Sequence(__runToHealSpot(heal)) feather = globalPropPool.getProp('feather') feather2 = MovieUtil.copyProp(feather) feathers = [feather, feather2] hands = toon.getRightHands() def scaleFeathers(feathers, toon = toon, target = target): toon.pose('tickle', 63) toon.update(0) hand = toon.getRightHands()[0] horizDistance = Vec3(hand.getPos(render) - target.getPos(render)) horizDistance.setZ(0) distance = horizDistance.length() if target.style.torso[0] == 's': distance -= 0.5 else: distance -= 0.3 featherLen = 2.4 scale = distance / (featherLen * hand.getScale(render)[0]) for feather in feathers: feather.setScale(scale) tFeatherScaleUp = 0.5 dFeatherScaleUp = 0.5 dFeatherScaleDown = 0.5 featherTrack = Parallel(MovieUtil.getActorIntervals(feathers, 'feather'), Sequence(Wait(tFeatherScaleUp), Func(MovieUtil.showProps, feathers, hands), Func(scaleFeathers, feathers), MovieUtil.getScaleIntervals(feathers, dFeatherScaleUp, MovieUtil.PNT3_NEARZERO, feathers[0].getScale)), Sequence(Wait(toon.getDuration('tickle') - dFeatherScaleDown), MovieUtil.getScaleIntervals(feathers, dFeatherScaleDown, None, MovieUtil.PNT3_NEARZERO))) tHeal = 3.0 mtrack = Parallel(featherTrack, ActorInterval(toon, 'tickle'), __getSoundTrack(level, 1, node=toon), Sequence(Wait(tHeal), Func(__healToon, target, hp, ineffective, hasInteractivePropHealBonus), ActorInterval(target, 'cringe', startTime=20.0 / target.getFrameRate('cringe')))) track.append(mtrack) track.append(Func(MovieUtil.removeProps, feathers)) track.append(__returnToBase(heal)) track.append(Func(target.clearChat)) return track