本文整理汇总了Python中toontown.toon.NPCToons.createLocalNPC方法的典型用法代码示例。如果您正苦于以下问题:Python NPCToons.createLocalNPC方法的具体用法?Python NPCToons.createLocalNPC怎么用?Python NPCToons.createLocalNPC使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.toon.NPCToons
的用法示例。
在下文中一共展示了NPCToons.createLocalNPC方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __makeShopOwnerNpc
# 需要导入模块: from toontown.toon import NPCToons [as 别名]
# 或者: from toontown.toon.NPCToons import createLocalNPC [as 别名]
def __makeShopOwnerNpc(self):
if self.shopOwnerNpc:
return
self.shopOwnerNpc = NPCToons.createLocalNPC(self.shopOwnerNpcId)
if not self.shopOwnerNpc:
self.notify.warning('No shopkeeper in this cogdominium, using FunnyFarm Sellbot FO NPCToons')
random.seed(self.doId)
shopkeeper = random.randint(7001, 7009)
self.shopOwnerNpc = NPCToons.createLocalNPC(shopkeeper)
self.shopOwnerNpc.addActive()
self.shopOwnerNpc.reparentTo(self.cage)
self.shopOwnerNpc.setPosHpr(0, -2, 0, 180, 0, 0)
self.shopOwnerNpc.loop('neutral')
示例2: load
# 需要导入模块: from toontown.toon import NPCToons [as 别名]
# 或者: from toontown.toon.NPCToons import createLocalNPC [as 别名]
def load(self):
SafeZoneLoader.SafeZoneLoader.load(self)
self.seagullSound = base.loadSfx('phase_6/audio/sfx/SZ_DD_Seagull.ogg')
self.underwaterSound = base.loadSfx('phase_4/audio/sfx/AV_ambient_water.ogg')
self.swimSound = base.loadSfx('phase_4/audio/sfx/AV_swim_single_stroke.ogg')
self.submergeSound = base.loadSfx('phase_5.5/audio/sfx/AV_jump_in_water.ogg')
self.boat = self.geom.find('**/donalds_boat')
self.dockSound = base.loadSfx('phase_6/audio/sfx/SZ_DD_dockcreak.ogg')
self.foghornSound = base.loadSfx('phase_5/audio/sfx/SZ_DD_foghorn.ogg')
self.bellSound = base.loadSfx('phase_6/audio/sfx/SZ_DD_shipbell.ogg')
self.waterSound = base.loadSfx('phase_6/audio/sfx/SZ_DD_waterlap.ogg')
if not self.boat.isEmpty():
wheel = self.boat.find('**/wheel')
if not wheel.isEmpty():
wheel.hide()
self.boat.stash()
self.donald = NPCToons.createLocalNPC(7011)
self.donald.setPos(0, -1, 3.95)
self.donald.reparentTo(self.boat)
self.donald.setHat(48, 0, 0)
random.shuffle(TTLocalizer.DonaldChatter)
self.donaldSpeech = self.donald.createTalkSequence(TTLocalizer.DonaldChatter, 15)
self.donaldSpeech.loop(0)
示例3: announceGenerate
# 需要导入模块: from toontown.toon import NPCToons [as 别名]
# 或者: from toontown.toon.NPCToons import createLocalNPC [as 别名]
def announceGenerate(self):
PurchaseManager.PurchaseManager.announceGenerate(self)
if self.hasLocalToon:
self.npc = NPCToons.createLocalNPC(2011)
self.npc.addActive()
def getDoId():
return 0
self.npc.getDoId = getDoId
def acquireDelayDelete(name):
return serialNum()
self.npc.acquireDelayDelete = acquireDelayDelete
def releaseDelayDelete(token):
pass
self.npc.releaseDelayDelete = releaseDelayDelete
def uniqueName(string):
return string
self.npc.uniqueName = uniqueName
self.accept('gagScreenIsUp', self.playMovie)
self.purchase = base.cr.playGame.hood.purchase
self.purchase.enterTutorialMode(self.ownedNewbieId)
示例4: __doSprinkle
# 需要导入模块: from toontown.toon import NPCToons [as 别名]
# 或者: from toontown.toon.NPCToons import createLocalNPC [as 别名]
def __doSprinkle(attack, recipients, hp = 0):
toon = NPCToons.createLocalNPC(attack['npcId'])
if toon == None:
return
targets = attack[recipients]
level = 4
battle = attack['battle']
track = Sequence(teleportIn(attack, toon))
def face90(target, toon, battle):
vec = Point3(target.getPos(battle) - toon.getPos(battle))
vec.setZ(0)
temp = vec[0]
vec.setX(-vec[1])
vec.setY(temp)
targetPoint = Point3(toon.getPos(battle) + vec)
toon.headsUp(battle, targetPoint)
delay = 2.5
effectTrack = Sequence()
for target in targets:
sprayEffect = BattleParticles.createParticleEffect(file='pixieSpray')
dropEffect = BattleParticles.createParticleEffect(file='pixieDrop')
explodeEffect = BattleParticles.createParticleEffect(file='pixieExplode')
poofEffect = BattleParticles.createParticleEffect(file='pixiePoof')
wallEffect = BattleParticles.createParticleEffect(file='pixieWall')
mtrack = Parallel(__getPartTrack(sprayEffect, 1.5, 0.5, [sprayEffect, toon, 0]), __getPartTrack(dropEffect, 1.9, 2.0, [dropEffect, target, 0]), __getPartTrack(explodeEffect, 2.7, 1.0, [explodeEffect, toon, 0]), __getPartTrack(poofEffect, 3.4, 1.0, [poofEffect, target, 0]), __getPartTrack(wallEffect, 4.05, 1.2, [wallEffect, toon, 0]), __getSoundTrack(level, 2, duration=3.1, node=toon), Sequence(Func(face90, target, toon, battle), ActorInterval(toon, 'sprinkle-dust')), Sequence(Wait(delay), Func(__healToon, target, hp)))
effectTrack.append(mtrack)
track.append(effectTrack)
track.append(Func(toon.setHpr, Vec3(180.0, 0.0, 0.0)))
track.append(teleportOut(attack, toon))
return track
示例5: __init__
# 需要导入模块: from toontown.toon import NPCToons [as 别名]
# 或者: from toontown.toon.NPCToons import createLocalNPC [as 别名]
def __init__(self, cr):
DistributedObject.__init__(self, cr)
FSM.__init__(self, 'ToonfestBalloonFSM')
self.avId = 0
self.flightPathIndex = 0
self.balloon = loader.loadModel('phase_6/models/events/tf_balloon')
self.balloon.reparentTo(base.render)
self.balloon.setPos(*ToonfestBalloonGlobals.BalloonBasePosition)
self.balloon.setH(250)
self.balloon.setScale(ToonfestBalloonGlobals.BalloonScale)
self.cr.parentMgr.registerParent(ToontownGlobals.SPToonfestBalloon, self.balloon)
cs = CollisionSphere(0, 0, 0, 9)
cs.setTangible(False)
self.collisionNP = self.balloon.find('**/basket_wall_collision')
self.collisionNP.node().addSolid(cs)
self.alec = NPCToons.createLocalNPC(91915)
self.alec.setPos(0.7, 0.7, 0.4)
self.alec.setH(150)
self.alec.setScale(1 / ToonfestBalloonGlobals.BalloonScale)
self.alec.initializeBodyCollisions('toon')
self.alec.setPickable(0)
self.alec.addActive()
self.alec.startBlink()
self.alec.loop('neutral')
self.flightPaths = ToonfestBalloonGlobals.generateFlightPaths(self)
self.toonFlightPaths = ToonfestBalloonGlobals.generateToonFlightPaths(self)
self.speechSequence = ToonfestBalloonGlobals.generateSpeechSequence(self)
示例6: playTutorialReward_3
# 需要导入模块: from toontown.toon import NPCToons [as 别名]
# 或者: from toontown.toon.NPCToons import createLocalNPC [as 别名]
def playTutorialReward_3(self, value):
self.tutRewardDialog_2.cleanup()
from toontown.toon import NPCToons
def doneChat1(page, elapsed = 0):
self.track2.start()
def doneChat2(elapsed):
self.track2.pause()
self.track3.start()
def uniqueName(hook):
return 'TutorialTom-' + hook
self.tutorialTom = NPCToons.createLocalNPC(20000)
self.tutorialTom.uniqueName = uniqueName
if config.GetString('language', 'english') == 'japanese':
self.tomDialogue03 = base.loadSfx('phase_3.5/audio/dial/CC_tom_movie_tutorial_reward01.ogg')
self.tomDialogue04 = base.loadSfx('phase_3.5/audio/dial/CC_tom_movie_tutorial_reward02.ogg')
self.tomDialogue05 = base.loadSfx('phase_3.5/audio/dial/CC_tom_movie_tutorial_reward03.ogg')
self.musicVolume = config.GetFloat('tutorial-music-volume', 0.5)
else:
self.tomDialogue03 = None
self.tomDialogue04 = None
self.tomDialogue05 = None
self.musicVolume = 0.9
music = base.cr.playGame.place.loader.battleMusic
if self.questList:
self.track1 = Sequence(Wait(1.0), Func(self.rewardPanel.initQuestFrame, base.localAvatar, copy.deepcopy(base.localAvatar.quests)), Wait(1.0), Sequence(*self.questList), Wait(1.0), Func(self.rewardPanel.hide), Func(camera.setPosHpr, render, 34, 19.88, 3.48, -90, -2.36, 0), Func(base.localAvatar.animFSM.request, 'neutral'), Func(base.localAvatar.setPosHpr, 40.31, 22.0, -0.47, 150.0, 360.0, 0.0), Wait(0.5), Func(self.tutorialTom.reparentTo, render), Func(self.tutorialTom.show), Func(self.tutorialTom.setPosHpr, 40.29, 17.9, -0.47, 11.31, 0.0, 0.07), Func(self.tutorialTom.animFSM.request, 'TeleportIn'), Wait(1.517), Func(self.tutorialTom.animFSM.request, 'neutral'), Func(self.acceptOnce, self.tutorialTom.uniqueName('doneChatPage'), doneChat1), Func(self.tutorialTom.addActive), Func(music.setVolume, self.musicVolume), Func(self.tutorialTom.setLocalPageChat, TTLocalizer.MovieTutorialReward3, 0, None, [self.tomDialogue03]), name='tutorial-reward-3a')
self.track2 = Sequence(Func(self.acceptOnce, self.tutorialTom.uniqueName('doneChatPage'), doneChat2), Func(self.tutorialTom.setLocalPageChat, TTLocalizer.MovieTutorialReward4, 1, None, [self.tomDialogue04]), Func(self.tutorialTom.setPlayRate, 1.5, 'right-hand-start'), Func(self.tutorialTom.play, 'right-hand-start'), Wait(self.tutorialTom.getDuration('right-hand-start') / 1.5), Func(self.tutorialTom.loop, 'right-hand'), name='tutorial-reward-3b')
self.track3 = Parallel(Sequence(Func(self.tutorialTom.setPlayRate, -1.8, 'right-hand-start'), Func(self.tutorialTom.play, 'right-hand-start'), Wait(self.tutorialTom.getDuration('right-hand-start') / 1.8), Func(self.tutorialTom.animFSM.request, 'neutral'), name='tutorial-reward-3ca'), Sequence(Wait(0.5), Func(self.tutorialTom.setChatAbsolute, TTLocalizer.MovieTutorialReward5, CFSpeech | CFTimeout, self.tomDialogue05), Wait(1.0), Func(self.tutorialTom.animFSM.request, 'TeleportOut'), Wait(self.tutorialTom.getDuration('teleport')), Wait(1.0), Func(self.playTutorialReward_4, 0), name='tutorial-reward-3cb'), name='tutorial-reward-3c')
self.track1.start()
else:
self.playTutorialReward_4(0)
return
示例7: doNPCTeleports
# 需要导入模块: from toontown.toon import NPCToons [as 别名]
# 或者: from toontown.toon.NPCToons import createLocalNPC [as 别名]
def doNPCTeleports(attacks):
npcs = []
npcDatas = []
arrivals = Sequence()
departures = Parallel()
for attack in attacks:
if attack.has_key('npcId'):
npcId = attack['npcId']
npc = NPCToons.createLocalNPC(npcId)
if npc != None:
npcs.append(npc)
attack['npc'] = npc
toon = attack['toon']
battle = attack['battle']
pos = toon.getPos(battle) + offset
hpr = toon.getHpr(battle)
npcDatas.append((npc, battle, hpr))
arrival = teleportIn(attack, npc, pos=pos)
arrivals.append(arrival)
departure = teleportOut(attack, npc)
departures.append(departure)
turns = Parallel()
unturns = Parallel()
hpr = Vec3(180.0, 0, 0)
for npc in npcDatas:
turns.append(Func(npc[0].setHpr, npc[1], npc[2]))
unturns.append(Func(npc[0].setHpr, npc[1], hpr))
arrivals.append(turns)
unturns.append(departures)
return (arrivals, unturns, npcs)
示例8: __healDance
# 需要导入模块: from toontown.toon import NPCToons [as 别名]
# 或者: from toontown.toon.NPCToons import createLocalNPC [as 别名]
def __healDance(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 = 3.0
first = 1
targetTrack = Sequence()
for target in targets:
targetToon = target["toon"]
hp = target["hp"]
reactIval = Func(__healToon, targetToon, hp, ineffective, hasInteractivePropHealBonus)
if first:
targetTrack.append(Wait(delay))
first = 0
targetTrack.append(reactIval)
hat = globalPropPool.getProp("hat")
hat2 = MovieUtil.copyProp(hat)
hats = [hat, hat2]
cane = globalPropPool.getProp("cane")
cane2 = MovieUtil.copyProp(cane)
canes = [cane, cane2]
leftHands = toon.getLeftHands()
rightHands = toon.getRightHands()
dScale = 0.5
propTrack = Sequence(
Func(MovieUtil.showProps, hats, rightHands, Point3(0.23, 0.09, 0.69), Point3(180, 0, 0)),
Func(MovieUtil.showProps, canes, leftHands, Point3(-0.28, 0.0, 0.14), Point3(0.0, 0.0, -150.0)),
MovieUtil.getScaleIntervals(hats + canes, dScale, MovieUtil.PNT3_NEARZERO, MovieUtil.PNT3_ONE),
Wait(toon.getDuration("happy-dance") - 2.0 * dScale),
MovieUtil.getScaleIntervals(hats + canes, dScale, MovieUtil.PNT3_ONE, MovieUtil.PNT3_NEARZERO),
Func(MovieUtil.removeProps, hats + canes),
)
mtrack = Parallel(
propTrack, ActorInterval(toon, "happy-dance"), __getSoundTrack(level, 0.2, duration=6.4, node=toon), targetTrack
)
track.append(Func(toon.loop, "neutral"))
track.append(Wait(0.1))
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
示例9: createNPC
# 需要导入模块: from toontown.toon import NPCToons [as 别名]
# 或者: from toontown.toon.NPCToons import createLocalNPC [as 别名]
def createNPC(self):
if not config.GetBool('want-fnaf', False):
return
self.npc = NPCToons.createLocalNPC(357)
self.npc.reparentTo(self.loader.geom)
self.npc.setPos(13, -77, 0)
self.npc.setH(180)
cNode = CollisionNode('fnaf-npc')
cNode.addSolid(CollisionSphere(0, 0, 0, 1))
cNode.setCollideMask(ToontownGlobals.WallBitmask)
cnp = self.npc.attachNewNode(cNode)
self.accept('enterfnaf-npc', self.__handleNPC)
self.panel = aspect2d.attachNewNode(CardMaker('fnaf-npc-panel').generate())
self.panel.setTexture(loader.loadTexture('phase_9/maps/tt_fnaf_news.png'))
self.panel.setScale(2, 1, 1.5)
self.panel.setPos(-1, 0, -.75)
guiButton = loader.loadModel('phase_3/models/gui/quit_button')
imageList = (guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR'))
playButton = DirectButton(text="Accept this job", image=imageList, relief=None, text_scale=.05,
command=self.__handleNPCPanelStatus, extraArgs=[1])
exitButton = DirectButton(text=TTLocalizer.GardenDropExit, image=imageList, relief=None, text_scale=.05,
command=self.__handleNPCPanelStatus, extraArgs=[0])
playButton.wrtReparentTo(self.panel)
exitButton.wrtReparentTo(self.panel)
playButton.setPos(playButton, (.69, 0, -.69))
exitButton.setPos(exitButton, (-.69, 0, -.69))
self.panel.stash()
示例10: __healJuggle
# 需要导入模块: from toontown.toon import NPCToons [as 别名]
# 或者: from toontown.toon.NPCToons import createLocalNPC [as 别名]
def __healJuggle(heal, hasInteractivePropHealBonus):
npcId = 0
if 'npcId' in heal:
npcId = heal['npcId']
toon = NPCToons.createLocalNPC(npcId)
if toon is 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
示例11: __doSmooch
# 需要导入模块: from toontown.toon import NPCToons [as 别名]
# 或者: from toontown.toon.NPCToons import createLocalNPC [as 别名]
def __doSmooch(attack, hp=0):
toon = NPCToons.createLocalNPC(attack["npcId"])
if toon == None:
return
targets = attack["toons"]
level = 2
battle = attack["battle"]
track = Sequence(teleportIn(attack, toon))
lipstick = globalPropPool.getProp("lipstick")
lipstick2 = MovieUtil.copyProp(lipstick)
lipsticks = [lipstick, lipstick2]
rightHands = toon.getRightHands()
dScale = 0.5
lipstickTrack = Sequence(
Func(MovieUtil.showProps, lipsticks, rightHands, Point3(-0.27, -0.24, -0.95), Point3(-118, -10.6, -25.9)),
MovieUtil.getScaleIntervals(lipsticks, dScale, MovieUtil.PNT3_NEARZERO, MovieUtil.PNT3_ONE),
Wait(toon.getDuration("smooch") - 2.0 * dScale),
MovieUtil.getScaleIntervals(lipsticks, dScale, MovieUtil.PNT3_ONE, MovieUtil.PNT3_NEARZERO),
)
lips = globalPropPool.getProp("lips")
dScale = 0.5
tLips = 2.5
tThrow = 115.0 / toon.getFrameRate("smooch")
dThrow = 0.5
def getLipPos(toon=toon):
toon.pose("smooch", 57)
toon.update(0)
hand = toon.getRightHands()[0]
return hand.getPos(render)
effectTrack = Sequence()
for target in targets:
lipcopy = MovieUtil.copyProp(lips)
lipsTrack = Sequence(
Wait(tLips),
Func(MovieUtil.showProp, lipcopy, render, getLipPos),
Func(lipcopy.setBillboardPointWorld),
LerpScaleInterval(lipcopy, dScale, Point3(3, 3, 3), startScale=MovieUtil.PNT3_NEARZERO),
Wait(tThrow - tLips - dScale),
LerpPosInterval(lipcopy, dThrow, Point3(target.getPos() + Point3(0, 0, target.getHeight()))),
Func(MovieUtil.removeProp, lipcopy),
)
delay = tThrow + dThrow
mtrack = Parallel(
lipstickTrack,
lipsTrack,
__getSoundTrack(level, 2, node=toon),
Sequence(ActorInterval(toon, "smooch")),
Sequence(Wait(delay), ActorInterval(target, "conked")),
Sequence(Wait(delay), Func(__healToon, target, hp)),
)
effectTrack.append(mtrack)
effectTrack.append(Func(MovieUtil.removeProps, lipsticks))
track.append(effectTrack)
track.append(teleportOut(attack, toon))
track.append(Func(target.clearChat))
return track
示例12: __healJoke
# 需要导入模块: from toontown.toon import NPCToons [as 别名]
# 或者: from toontown.toon.NPCToons import createLocalNPC [as 别名]
def __healJoke(heal, hasInteractivePropHealBonus):
npcId = 0
if heal.has_key('npcId'):
npcId = heal['npcId']
toon = NPCToons.createLocalNPC(npcId)
if toon == None:
return None
else:
toon = heal['toon']
targets = heal['target']
ineffective = heal['sidestep']
level = heal['level']
jokeIndex = heal['hpbonus'] % len(HealJokes.toonHealJokes)
if npcId != 0:
track = Sequence(MovieNPCSOS.teleportIn(heal, toon))
else:
track = Sequence(__runToHealSpot(heal))
tracks = Parallel()
fSpeakPunchline = 58
tSpeakSetup = 0.0
tSpeakPunchline = 3.0
dPunchLine = 3.0
tTargetReact = tSpeakPunchline + 1.0
dTargetLaugh = 1.5
tRunBack = tSpeakPunchline + dPunchLine
tDoSoundAnimation = tSpeakPunchline - float(fSpeakPunchline) / toon.getFrameRate('sound')
megaphone = globalPropPool.getProp('megaphone')
megaphone2 = MovieUtil.copyProp(megaphone)
megaphones = [
megaphone,
megaphone2]
hands = toon.getRightHands()
dMegaphoneScale = 0.5
tracks.append(Sequence(Wait(tDoSoundAnimation), Func(MovieUtil.showProps, megaphones, hands), MovieUtil.getScaleIntervals(megaphones, dMegaphoneScale, MovieUtil.PNT3_NEARZERO, MovieUtil.PNT3_ONE), Wait(toon.getDuration('sound') - 2.0 * dMegaphoneScale), MovieUtil.getScaleIntervals(megaphones, dMegaphoneScale, MovieUtil.PNT3_ONE, MovieUtil.PNT3_NEARZERO), Func(MovieUtil.removeProps, megaphones)))
tracks.append(Sequence(Wait(tDoSoundAnimation), ActorInterval(toon, 'sound')))
soundTrack = __getSoundTrack(level, 2.0, node = toon)
tracks.append(soundTrack)
joke = HealJokes.toonHealJokes[jokeIndex]
tracks.append(Sequence(Wait(tSpeakSetup), Func(toon.setChatAbsolute, joke[0], CFSpeech | CFTimeout)))
tracks.append(Sequence(Wait(tSpeakPunchline), Func(toon.setChatAbsolute, joke[1], CFSpeech | CFTimeout)))
reactTrack = Sequence(Wait(tTargetReact))
for target in targets:
targetToon = target['toon']
hp = target['hp']
reactTrack.append(Func(__healToon, targetToon, hp, ineffective, hasInteractivePropHealBonus))
reactTrack.append(Wait(dTargetLaugh))
for target in targets:
targetToon = target['toon']
reactTrack.append(Func(targetToon.clearChat))
tracks.append(reactTrack)
if npcId != 0:
track.append(Sequence(Wait(tRunBack), Func(toon.clearChat), *MovieNPCSOS.teleportOut(heal, toon)))
else:
tracks.append(Sequence(Wait(tRunBack), Func(toon.clearChat), *__returnToBase(heal)))
track.append(tracks)
return track
示例13: __healDance
# 需要导入模块: from toontown.toon import NPCToons [as 别名]
# 或者: from toontown.toon.NPCToons import createLocalNPC [as 别名]
def __healDance(heal, hasInteractivePropHealBonus):
npcId = 0
if heal.has_key('npcId'):
npcId = heal['npcId']
toon = NPCToons.createLocalNPC(npcId)
if toon == None:
return None
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 = 3.0
first = 1
targetTrack = Sequence()
for target in targets:
targetToon = target['toon']
hp = target['hp']
reactIval = Func(__healToon, targetToon, hp, ineffective, hasInteractivePropHealBonus)
if first:
targetTrack.append(Wait(delay))
first = 0
targetTrack.append(reactIval)
hat = globalPropPool.getProp('hat')
hat2 = MovieUtil.copyProp(hat)
hats = [
hat,
hat2]
cane = globalPropPool.getProp('cane')
cane2 = MovieUtil.copyProp(cane)
canes = [
cane,
cane2]
leftHands = toon.getLeftHands()
rightHands = toon.getRightHands()
dScale = 0.5
propTrack = Sequence(Func(MovieUtil.showProps, hats, rightHands, Point3(0.23000000000000001, 0.089999999999999997, 0.68999999999999995), Point3(180, 0, 0)), Func(MovieUtil.showProps, canes, leftHands, Point3(-0.28000000000000003, 0.0, 0.14000000000000001), Point3(0.0, 0.0, -150.0)), MovieUtil.getScaleIntervals(hats + canes, dScale, MovieUtil.PNT3_NEARZERO, MovieUtil.PNT3_ONE), Wait(toon.getDuration('happy-dance') - 2.0 * dScale), MovieUtil.getScaleIntervals(hats + canes, dScale, MovieUtil.PNT3_ONE, MovieUtil.PNT3_NEARZERO), Func(MovieUtil.removeProps, hats + canes))
mtrack = Parallel(propTrack, ActorInterval(toon, 'happy-dance'), __getSoundTrack(level, 0.20000000000000001, duration = 6.4000000000000004, node = toon), targetTrack)
track.append(Func(toon.loop, 'neutral'))
track.append(Wait(0.10000000000000001))
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
示例14: __createToonModels
# 需要导入模块: from toontown.toon import NPCToons [as 别名]
# 或者: from toontown.toon.NPCToons import createLocalNPC [as 别名]
def __createToonModels(self):
self.model_Created = 1
self.jurorToon = NPCToons.createLocalNPC(ToontownGlobals.LawbotBossBaseJurorNpcId + self.index)
self.toonScale = self.jurorToon.getScale()
jurorToonParent = render.attachNewNode('toonOriginChange')
self.jurorToon.wrtReparentTo(jurorToonParent)
self.jurorToon.setPosHpr(0, 0, -(self.jurorToon.getHeight() / 2.0), 0, -90, 0)
self.toonModel = jurorToonParent
self.toonHead = ToonHead.ToonHead()
self.toonHead.setupHead(self.jurorToon.style)
self.toonHead.reparentTo(hidden)
self.__loadToonInCannon()
示例15: load
# 需要导入模块: from toontown.toon import NPCToons [as 别名]
# 或者: from toontown.toon.NPCToons import createLocalNPC [as 别名]
def load(self):
self.sceneRoot = NodePath('scene1')
tn = TextNode('text')
tn.setText('Flippy')
tn.setAlign(tn.ACenter)
self.tnnp = self.sceneRoot.attachNewNode(tn)
self.tnnp.setPos(20, 30, 2)
self.flippy = NPCToons.createLocalNPC(2001)
self.flippy.reparentTo(self.sceneRoot)
self.flippy.setPos(0, 10, -5)
self.flippy.setH(180)