本文整理汇总了Python中toontown.battle.BattleProps.globalPropPool.getProp函数的典型用法代码示例。如果您正苦于以下问题:Python getProp函数的具体用法?Python getProp怎么用?Python getProp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getProp函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, parent = hidden):
NodePath.__init__(self)
self.assign(globalPropPool.getProp('wake'))
self.reparentTo(parent)
tformNode = self.getChild(0)
tformNode.setZ(0.1)
self.startNodePath = self.find('**/+SequenceNode')
self.startSeqNode = self.startNodePath.node()
self.startSeqNode.setName('start')
self.startSeqNode.setPlayRate(0)
self.cycleNodePath = NodePath(SequenceNode(0, 'cycle'))
self.cycleNodePath.reparentTo(tformNode)
self.cycleSeqNode = self.cycleNodePath.node()
self.endNodePath = NodePath(SequenceNode(0, 'end'))
self.endNodePath.reparentTo(tformNode)
self.endSeqNode = self.endNodePath.node()
children = self.startNodePath.getChildren()
for child in children[12:16]:
child.reparentTo(self.cycleNodePath)
for child in children[16:]:
child.reparentTo(self.endNodePath)
self.tracks = []
self.rate = None
self.trackId = Wake.wakeCount
Wake.wakeCount += 1
self.setBin('fixed', 10, 1)
self.hide()
return
示例2: __init__
def __init__(self, parent = hidden):
NodePath.__init__(self)
self.assign(globalPropPool.getProp('ripples'))
self.reparentTo(parent)
self.getChild(0).setZ(0.10000000000000001)
self.seqNode = self.find('**/+SequenceNode').node()
self.seqNode.setPlayRate(0)
self.track = None
self.trackId = Ripples.rippleCount
Ripples.rippleCount += 1
self.setBin('fixed', 100, 1)
self.hide()
示例3: load
def load(self):
self.root = NodePath('ToonfestCog')
self.parentNode = NodePath('Parent')
self.parentNode.reparentTo(render)
self.root.reparentTo(render)
path = 'phase_13/models/parties/cogPinata_'
self.actor = Actor.Actor(path + 'actor', {'idle': path + 'idle_anim',
'down': path + 'down_anim',
'up': path + 'up_anim',
'bodyHitBack': path + 'bodyHitBack_anim',
'bodyHitFront': path + 'bodyHitFront_anim',
'headHitBack': path + 'headHitBack_anim',
'headHitFront': path + 'headHitFront_anim'})
self.actor.reparentTo(self.root)
self.temp_transform = Mat4()
self.head_locator = self.actor.attachNewNode('temphead')
self.bodyColl = CollisionTube(0, 0, 1, 0, 0, 5.75, 0.75)
self.bodyColl.setTangible(1)
self.bodyCollNode = CollisionNode('ToonfestCog-Body-Collision')
self.bodyCollNode.setCollideMask(ToontownGlobals.PieBitmask)
self.bodyCollNode.addSolid(self.bodyColl)
self.bodyCollNodePath = self.root.attachNewNode(self.bodyCollNode)
self.headColl = CollisionTube(0, 0, 3, 0, 0, 3.0, 1.5)
self.headColl.setTangible(1)
self.headCollNode = CollisionNode('ToonfestCog-Head-Collision')
self.headCollNode.setCollideMask(ToontownGlobals.PieBitmask)
self.headCollNode.addSolid(self.headColl)
self.headCollNodePath = self.root.attachNewNode(self.headCollNode)
self.arm1Coll = CollisionSphere(1.65, 0, 3.95, 1.0)
self.arm1Coll.setTangible(1)
self.arm1CollNode = CollisionNode('ToonfestCog-Arm1-Collision')
self.arm1CollNode.setCollideMask(ToontownGlobals.PieBitmask)
self.arm1CollNode.addSolid(self.arm1Coll)
self.arm1CollNodePath = self.root.attachNewNode(self.arm1CollNode)
self.arm2Coll = CollisionSphere(-1.65, 0, 3.45, 1.0)
self.arm2Coll.setTangible(1)
self.arm2CollNode = CollisionNode('ToonfestCog-Arm2-Collision')
self.arm2CollNode.setCollideMask(ToontownGlobals.PieBitmask)
self.arm2CollNode.addSolid(self.arm2Coll)
self.arm2CollNodePath = self.root.attachNewNode(self.arm2CollNode)
splatName = 'splat-creampie'
self.splat = globalPropPool.getProp(splatName)
self.splat.setBillboardPointEye()
self.splatType = globalPropPool.getPropType(splatName)
self.pieHitSound = globalBattleSoundCache.getSound('AA_wholepie_only.ogg')
self.upSound = globalBattleSoundCache.getSound('AV_jump_to_side.ogg')
self.hole = loader.loadModel('phase_13/models/parties/cogPinataHole')
self.hole.setTransparency(True)
self.hole.setP(-90.0)
self.hole.setScale(3)
self.hole.setBin('ground', 3)
self.hole.reparentTo(self.parentNode)
taskMgr.doMethodLater(60, self.toggleCog, 'toggle-cog', extraArgs=[])
示例4: leftHand
def leftHand(prop=None):
"""
parents the optional <prop> to the target's left hand node.
"""
target = spellbook.getTarget()
leftHand = target.find('**/leftHand')
if prop is None:
for child in leftHand.getChildren():
child.removeNode()
else:
for child in leftHand.getChildren():
child.removeNode()
requestedProp = globalPropPool.getProp(prop)
requestedProp.reparentTo(leftHand)
示例5: __init__
def __init__(self, activity, toon, position, team):
self.activity = activity
self.position = position
self.toon = toon
self.team = team
self.netTimeSentToStartByHit = 0
self.kaboomTrack = None
self.locator = None
self.teamSpot = self.activity.getIndex(self.toon.doId, self.team)
splatName = 'splat-creampie'
self.splat = globalPropPool.getProp(splatName)
self.splat.setBillboardPointEye()
self.splatType = globalPropPool.getPropType(splatName)
self.pieHitSound = globalBattleSoundCache.getSound('AA_wholepie_only.ogg')
return
示例6: __init__
def __init__(self, parent = hidden, fBillboard = 1, wantSound = 0):
NodePath.__init__(self)
self.assign(globalPropPool.getProp('suit_explosion_dust'))
if fBillboard:
self.setBillboardAxis()
self.reparentTo(parent)
self.seqNode = self.find('**/+SequenceNode').node()
self.seqNode.setFrameRate(0)
self.wantSound = wantSound
if self.wantSound and not DustCloud.sounds:
DustCloud.sounds[SFX.poof] = loader.loadSfx(SFXPATHS[SFX.poof])
self.track = None
self.trackId = DustCloud.dustCloudCount
DustCloud.dustCloudCount += 1
self.setBin('fixed', 100, 1)
self.hide()
示例7: load
def load(self):
self.head = loader.loadModel(self.filePrefix + '-head-zero')
for anim in AnimList:
self.animDict[anim] = '%s-%s-%s' % (GenericModel, 'head', anim)
self.headActor = Actor(self.head, self.animDict)
self.headActor.hide()
self.headActor.setBin("fixed", 40)
self.headActor.setDepthTest(True)
self.headActor.setDepthWrite(True)
self.headActor.reparentTo(self)
self.headActor.setHpr(-90, 0, 270)
self.headActor.setScale(0.021)
self.headActor.setPos(-0.25, 0.0, 0.75)
self.headActor.setPlayRate(2.0, 'turn2Fb')
self.headActor.loop('Ff_neutral')
self.eyes = loader.loadModel('phase_10/models/cogHQ/CashBotBossEyes.bam')
self.eyes.setPosHprScale(4.5, 0, -2.5, 90, 90, 0, 0.4, 0.4, 0.4)
self.eyes.reparentTo(self.headActor)
self.eyes.hide()
self.stars = globalPropPool.getProp('stun')
self.stars.setPosHprScale(7, 0, 0, 0, 0, -90, 3, 3, 3)
self.stars.loop('stun')
self.safe = loader.loadModel('phase_10/models/cogHQ/CBSafe.bam')
self.safe.reparentTo(self.headActor)
self.safe.setPosHpr(-1, 0, 0.2, 0, -90, 90)
self.safe.setBin("fixed", 40)
self.safe.setDepthTest(True)
self.safe.setDepthWrite(True)
self.safe.hide()
self.headActor.show()
self.healthBar = DirectWaitBar(parent=self, pos=(0, 0, 0.85), relief=DGG.SUNKEN,
frameSize=(-1.75, 1.75, -0.3, 0.3),
borderWidth=(0.02, 0.02), scale=0.1, range=1, sortOrder=50,
frameColor=(0.5, 0.5, 0.5, 0.5), barColor=(0.75, 0.75, 1.0, 0.8), text='',
text_scale=0.35, text_fg=(1, 1, 1, 1), text_align=TextNode.ACenter,
text_pos=(0, -0.05), text_font=getSuitFont())
self.updateHealthBar(self.maxHp)
示例8: __init__
def __init__(self, cogIndex, suitType, game, cogSpeed):
self.cogIndex = cogIndex
self.suitType = suitType
self.game = game
self.cogSpeed = cogSpeed
suit = Suit.Suit()
d = SuitDNA.SuitDNA()
d.newSuit(suitType)
suit.setDNA(d)
suit.pose('walk', 0)
self.suit = suit
self.goal = CTGG.NoGoal
self.goalId = CTGG.InvalidGoalId
self.lastLocalTimeStampFromAI = 0
self.lastPosFromAI = Point3(0, 0, 0)
self.lastThinkTime = 0
self.doneAdjust = False
self.barrel = CTGG.NoBarrelCarried
self.signalledAtReturnPos = False
self.defaultPlayRate = 1.0
self.netTimeSentToStartByHit = 0
self.velocity = Vec3(0, 0, 0)
self.oldVelocity = Vec3(0, 0, 0)
self.acceleration = Vec3(0, 0, 0)
self.bodyLength = self.CollisionRadius * 2
self.cruiseDistance = 2 * self.bodyLength
self.maxVelocity = self.cogSpeed
self.maxAcceleration = 5.0
self.perceptionRange = 10
self.notify.debug('cogSpeed=%s' % self.cogSpeed)
self.kaboomSound = loader.loadSfx('phase_4/audio/sfx/MG_cannon_fire_alt.ogg')
self.kaboom = loader.loadModel('phase_4/models/minigames/ice_game_kaboom')
self.kaboom.setScale(2.0)
self.kaboom.setBillboardPointEye()
self.kaboom.hide()
self.kaboomTrack = None
self.explodeTrack = None
splatName = 'splat-creampie'
self.splat = globalPropPool.getProp(splatName)
self.splat.setBillboardPointEye()
self.splatType = globalPropPool.getPropType(splatName)
self.pieHitSound = globalBattleSoundCache.getSound('AA_wholepie_only.ogg')
return
示例9: __showSplat
def __showSplat(self, position):
if self.kaboomTrack is not None and self.kaboomTrack.isPlaying():
self.kaboomTrack.finish()
if not self.pieHitSound:
self.notify.warning('Trying to play hit sound on destroyed player')
return
splatName = 'splat-creampie'
self.splat = globalPropPool.getProp(splatName)
self.splat.setBillboardPointEye()
self.splat.reparentTo(render)
self.splat.setPos(self.toon, position)
self.splat.setY(self.toon, bound(self.splat.getY(), self.toon.getHeight() / 2.0, position.getY()))
self.splat.setAlphaScale(1.0)
targetscale = 0.75
def setSplatAlpha(amount):
self.splat.setAlphaScale(amount)
self.kaboomTrack = Parallel(SoundInterval(self.pieHitSound, node=self.toon, volume=1.0, cutOff=PartyGlobals.PARTY_COG_CUTOFF), Sequence(Func(self.splat.showThrough), Parallel(Sequence(LerpScaleInterval(self.splat, duration=0.175, scale=targetscale, startScale=Point3(0.1, 0.1, 0.1), blendType='easeOut'), Wait(0.175)), Sequence(Wait(0.1), LerpFunc(setSplatAlpha, duration=1.0, fromData=1.0, toData=0.0, blendType='easeOut'))), Func(self.splat.cleanup), Func(self.splat.removeNode)))
self.kaboomTrack.start()
return
示例10: __init__
def __init__(self, parent = hidden, wantParticles = 1):
NodePath.__init__(self, parent)
self.assign(parent.attachNewNode('splash'))
self.splashdown = globalPropPool.getProp('splashdown')
self.splashdown.reparentTo(self)
self.splashdown.setZ(-0.01)
self.splashdown.setScale(0.4)
ta = TransparencyAttrib.make(TransparencyAttrib.MBinary)
self.splashdown.node().setAttrib(ta, 1)
self.splashdown.setBin('fixed', 130, 1)
self.ripples = Ripples(self)
self.ripples.setBin('fixed', 120, 1)
self.wantParticles = 1
if self.wantParticles:
self.pSystem = BattleParticles.createParticleEffect('SplashLines')
self.pSystem.setScale(0.4)
self.pSystem.setBin('fixed', 150, 1)
self.particles = self.pSystem.particlesDict.get('particles-1')
self.track = None
self.trackId = Splash.splashCount
Splash.splashCount += 1
self.setBin('fixed', 100, 1)
self.hide()
示例11: __showSplat
def __showSplat(self, position, direction, hot = False):
if self.kaboomTrack is not None and self.kaboomTrack.isPlaying():
self.kaboomTrack.finish()
self.clearHitInterval()
splatName = 'splat-creampie'
self.splat = globalPropPool.getProp(splatName)
self.splat.setBillboardPointEye()
self.splat.reparentTo(render)
self.splat.setPos(self.root, position)
self.splat.setAlphaScale(1.0)
if not direction == 1.0:
self.splat.setColorScale(PartyGlobals.CogActivitySplatColors[0])
if self.currentFacing > 0.0:
facing = 'HitFront'
else:
facing = 'HitBack'
else:
self.splat.setColorScale(PartyGlobals.CogActivitySplatColors[1])
if self.currentFacing > 0.0:
facing = 'HitBack'
else:
facing = 'HitFront'
if hot:
targetscale = 0.75
part = 'head'
else:
targetscale = 0.5
part = 'body'
def setSplatAlpha(amount):
self.splat.setAlphaScale(amount)
self.hitInterval = Sequence(ActorInterval(self.actor, part + facing, loop=0), Func(self.actor.loop, 'idle'))
self.hitInterval.start()
self.kaboomTrack = Parallel(SoundInterval(self.pieHitSound, volume=1.0, node=self.actor, cutOff=PartyGlobals.PARTY_COG_CUTOFF), Sequence(Func(self.splat.showThrough), Parallel(Sequence(LerpScaleInterval(self.splat, duration=0.175, scale=targetscale, startScale=Point3(0.1, 0.1, 0.1), blendType='easeOut'), Wait(0.175)), Sequence(Wait(0.1), LerpFunc(setSplatAlpha, duration=1.0, fromData=1.0, toData=0.0, blendType='easeOut'))), Func(self.splat.cleanup), Func(self.splat.removeNode)))
self.kaboomTrack.start()
return