Ejemplo n.º 1
0
 def load(self):
     self.root = NodePath('PartyCog-%d' % self.id)
     self.root.reparentTo(self.parentNode)
     path = 'phase_13/models/parties/cogPinata_'
     self.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.setBlend(
         frameBlend=config.GetBool('interpolate-animations', True))
     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('PartyCog-%d-Body-Collision' %
                                       self.id)
     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('PartyCog-%d-Head-Collision' %
                                       self.id)
     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('PartyCog-%d-Arm1-Collision' %
                                       self.id)
     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('PartyCog-%d-Arm2-Collision' %
                                       self.id)
     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)
 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=[])
Ejemplo n.º 3
0
    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)
        # cache the walk anim
        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

        # steering loosely based on boid code game programming gems #1
        # "Portions Copyright (C) Steven Woodcock, 2000"
        self.velocity = Vec3(0, 0, 0)
        self.oldVelocity = Vec3(0, 0, 0)
        self.acceleration = Vec3(0, 0, 0)
        self.bodyLength = self.CollisionRadius * 2
        # Desired distance from closest neighbor when flying.
        self.cruiseDistance = 2 * self.bodyLength
        self.maxVelocity = self.cogSpeed
        # Maximum magnitude of acceleration as a fraction of maxSpeed.
        self.maxAcceleration = 5.0
        self.perceptionRange = 6
        self.notify.debug('cogSpeed=%s' % self.cogSpeed)

        self.kaboomSound = loader.loadSfx(
            "phase_4/audio/sfx/MG_cannon_fire_alt.mp3")
        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

        splatName = 'splat-creampie'
        self.splat = globalPropPool.getProp(splatName)
        self.splat.setBillboardPointEye()
        self.splatType = globalPropPool.getPropType(splatName)

        self.pieHitSound = globalBattleSoundCache.getSound(
            'AA_wholepie_only.mp3')
 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')
 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
Ejemplo n.º 6
0
 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
 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
Ejemplo n.º 8
0
    def load(self):
        self.root = NodePath("PartyCog-%d" % self.id)
        self.root.reparentTo(self.parentNode)

        path = "phase_13/models/parties/cogPinata_"
        self.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("PartyCog-%d-Body-Collision" %
                                          self.id)
        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("PartyCog-%d-Head-Collision" %
                                          self.id)
        self.headCollNode.setCollideMask(ToontownGlobals.PieBitmask)
        self.headCollNode.addSolid(self.headColl)
        self.headCollNodePath = self.root.attachNewNode(self.headCollNode)

        # Cog's Left Arm
        self.arm1Coll = CollisionSphere(1.65, 0, 3.95, 1.0)
        self.arm1Coll.setTangible(1)
        self.arm1CollNode = CollisionNode("PartyCog-%d-Arm1-Collision" %
                                          self.id)
        self.arm1CollNode.setCollideMask(ToontownGlobals.PieBitmask)
        self.arm1CollNode.addSolid(self.arm1Coll)
        self.arm1CollNodePath = self.root.attachNewNode(self.arm1CollNode)

        # Cog's Right Arm
        self.arm2Coll = CollisionSphere(-1.65, 0, 3.45, 1.0)
        self.arm2Coll.setTangible(1)
        self.arm2CollNode = CollisionNode("PartyCog-%d-Arm2-Collision" %
                                          self.id)
        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.mp3')
        self.upSound = globalBattleSoundCache.getSound('AV_jump_to_side.mp3')

        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)