def setHillType(self, type):
     if self.isUp:
         if (self.hillType == MoleFieldBase.HILL_MOLE or type == MoleFieldBase.HILL_BOMB or self.hillType == MoleFieldBase.HILL_BOMB) and type == MoleFieldBase.HILL_MOLE:
             return None
         
     self.hillType = type
     self.moleHead.remove()
     if type == MoleFieldBase.HILL_MOLE:
         self.moleHead = loader.loadModel('phase_12/models/bossbotHQ/mole_norm')
         self.moleColNodePath.setScale(3.0)
         self.moleHead.setH(0)
         self.mole.setBillboardAxis(localAvatar, 0)
     
     if type == MoleFieldBase.HILL_BOMB or type == MoleFieldBase.HILL_COGWHACKED:
         self.moleHead = loader.loadModel('phase_12/models/bossbotHQ/mole_cog')
         self.moleColNodePath.setScale(1.0)
         self.mole.setBillboardAxis(localAvatar, 0)
         if type == MoleFieldBase.HILL_COGWHACKED:
             self.doMoleDown()
             BattleParticles.loadParticles()
             singleGear = BattleParticles.createParticleEffect('GearExplosion', numParticles = 1)
             smallGearExplosion = BattleParticles.createParticleEffect('GearExplosion', numParticles = 10)
             bigGearExplosion = BattleParticles.createParticleEffect('BigGearExplosion', numParticles = 30)
             gears2MTrack = Track((0.0, ParticleInterval(singleGear, self.hill, worldRelative = 1, duration = 5.7000000000000002, cleanup = True)), (0.0, ParticleInterval(smallGearExplosion, self.hill, worldRelative = 0, duration = 1.2, cleanup = True)), (0.29999999999999999, ParticleInterval(bigGearExplosion, self.hill, worldRelative = 0, duration = 1.0, cleanup = True)), name = 'gears2MTrack')
             gears2MTrack.start()
             self.popIval = Sequence(Parallel(Sequence(LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.28000000000000003, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, -0.23000000000000001, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.0, 0.28000000000000003)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(-0.34999999999999998, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.28000000000000003, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.31, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, -0.32000000000000001, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.0, 0.47999999999999998)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(-0.28000000000000003, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.28999999999999998, 0.0)))), LerpPosInterval(self.mole, 0.5, Point3(0, 0, -2.5)), Func(self.setHillType, MoleFieldBase.HILL_BOMB))
             self.popIval.start()
         else:
             self.moleHead.setH(0)
     
     if type == MoleFieldBase.HILL_WHACKED:
         self.moleHead = loader.loadModel('phase_12/models/bossbotHQ/mole_hit')
         self.mole.setBillboardAxis(0)
         self.moleColNodePath.setScale(0.0)
         if self.popIval:
             self.popIval.finish()
         
         if self.downIval:
             self.downIval.finish()
         
         self.mole.setPos(0.0, 0.0, 0.0)
         self.popIval = Sequence(Parallel(Sequence(LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.17999999999999999, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, -0.13, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.0, 0.17999999999999999)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(-0.14999999999999999, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.17999999999999999, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.11, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, -0.12, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.0, 0.17999999999999999)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(-0.17999999999999999, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.13, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.17999999999999999, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, -0.14999999999999999, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.0, 0.17999999999999999)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(-0.16, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.17999999999999999, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.11, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, -0.17999999999999999, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.0, 0.17000000000000001)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(-0.17999999999999999, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.0, 0.0))), Sequence(LerpScaleInterval(self.moleHead, 0.5, 3.5), LerpScaleInterval(self.moleHead, 0.5, 1.0))), LerpPosInterval(self.mole, 0.5, Point3(0, 0, -2.5)), Func(self.setHillType, MoleFieldBase.HILL_MOLE))
         self.popIval.start()
     
     self.moleHead.reparentTo(self.mole)
Example #2
0
 def setHillType(self, type):
     if self.isUp:
         if (self.hillType == MoleFieldBase.HILL_MOLE or type == MoleFieldBase.HILL_BOMB or self.hillType == MoleFieldBase.HILL_BOMB) and type == MoleFieldBase.HILL_MOLE:
             return None
         
     self.hillType = type
     self.moleHead.remove()
     if type == MoleFieldBase.HILL_MOLE:
         self.moleHead = loader.loadModel('phase_12/models/bossbotHQ/mole_norm')
         self.moleColNodePath.setScale(3.0)
         self.moleHead.setH(0)
         self.mole.setBillboardAxis(localAvatar, 0)
     
     if type == MoleFieldBase.HILL_BOMB or type == MoleFieldBase.HILL_COGWHACKED:
         self.moleHead = loader.loadModel('phase_12/models/bossbotHQ/mole_cog')
         self.moleColNodePath.setScale(1.0)
         self.mole.setBillboardAxis(localAvatar, 0)
         if type == MoleFieldBase.HILL_COGWHACKED:
             self.doMoleDown()
             BattleParticles.loadParticles()
             singleGear = BattleParticles.createParticleEffect('GearExplosion', numParticles = 1)
             smallGearExplosion = BattleParticles.createParticleEffect('GearExplosion', numParticles = 10)
             bigGearExplosion = BattleParticles.createParticleEffect('BigGearExplosion', numParticles = 30)
             gears2MTrack = Track((0.0, ParticleInterval(singleGear, self.hill, worldRelative = 1, duration = 5.7000000000000002, cleanup = True)), (0.0, ParticleInterval(smallGearExplosion, self.hill, worldRelative = 0, duration = 1.2, cleanup = True)), (0.29999999999999999, ParticleInterval(bigGearExplosion, self.hill, worldRelative = 0, duration = 1.0, cleanup = True)), name = 'gears2MTrack')
             gears2MTrack.start()
             self.popIval = Sequence(Parallel(Sequence(LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.28000000000000003, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, -0.23000000000000001, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.0, 0.28000000000000003)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(-0.34999999999999998, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.28000000000000003, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.31, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, -0.32000000000000001, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.0, 0.47999999999999998)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(-0.28000000000000003, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.28999999999999998, 0.0)))), LerpPosInterval(self.mole, 0.5, Point3(0, 0, -2.5)), Func(self.setHillType, MoleFieldBase.HILL_BOMB))
             self.popIval.start()
         else:
             self.moleHead.setH(0)
     
     if type == MoleFieldBase.HILL_WHACKED:
         self.moleHead = loader.loadModel('phase_12/models/bossbotHQ/mole_hit')
         self.mole.setBillboardAxis(0)
         self.moleColNodePath.setScale(0.0)
         if self.popIval:
             self.popIval.finish()
         
         if self.downIval:
             self.downIval.finish()
         
         self.mole.setPos(0.0, 0.0, 0.0)
         self.popIval = Sequence(Parallel(Sequence(LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.17999999999999999, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, -0.13, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.0, 0.17999999999999999)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(-0.14999999999999999, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.17999999999999999, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.11, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, -0.12, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.0, 0.17999999999999999)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(-0.17999999999999999, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.13, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.17999999999999999, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, -0.14999999999999999, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.0, 0.17999999999999999)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(-0.16, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.17999999999999999, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.11, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, -0.17999999999999999, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.0, 0.17000000000000001)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(-0.17999999999999999, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.0, 0.0))), Sequence(LerpScaleInterval(self.moleHead, 0.5, 3.5), LerpScaleInterval(self.moleHead, 0.5, 1.0))), LerpPosInterval(self.mole, 0.5, Point3(0, 0, -2.5)), Func(self.setHillType, MoleFieldBase.HILL_MOLE))
         self.popIval.start()
     
     self.moleHead.reparentTo(self.mole)
Example #3
0
    def setHillType(self, type):
        if self.isUp and (((self.hillType == MoleFieldBase.HILL_MOLE) and
                           (type == MoleFieldBase.HILL_BOMB)) or
                          ((self.hillType == MoleFieldBase.HILL_BOMB) and
                           (type == MoleFieldBase.HILL_MOLE))):
            return
        self.hillType = type
        self.moleHead.remove()
        if type == MoleFieldBase.HILL_MOLE:
            self.moleHead = loader.loadModel(
                "phase_12/models/bossbotHQ/mole_norm")
            self.moleColNodePath.setScale(3.0)
            self.moleHead.setH(0)
            self.mole.setBillboardAxis(localAvatar, 0)
        if type == MoleFieldBase.HILL_BOMB or type == MoleFieldBase.HILL_COGWHACKED:
            self.moleHead = loader.loadModel(
                "phase_12/models/bossbotHQ/mole_cog")
            self.moleColNodePath.setScale(1.0)
            self.mole.setBillboardAxis(localAvatar, 0)
            if type == MoleFieldBase.HILL_COGWHACKED:
                self.doMoleDown()
                BattleParticles.loadParticles()
                #smallGears = BattleParticles.createParticleEffect(file='gearExplosionSmall')
                singleGear = BattleParticles.createParticleEffect(
                    'GearExplosion', numParticles=1)
                smallGearExplosion = BattleParticles.createParticleEffect(
                    'GearExplosion', numParticles=10)
                bigGearExplosion = BattleParticles.createParticleEffect(
                    'BigGearExplosion', numParticles=30)
                #gearPoint = Point3(self.hill.getX(render), self.hill.getY(render), self.hill.getZ(render))
                #smallGears.setPos(gearPoint)
                #singleGear.setPos(gearPoint)
                #smallGears.setDepthWrite(False)
                #singleGear.setDepthWrite(False)
                #smallGearExplosion.setPos(gearPoint)
                #bigGearExplosion.setPos(gearPoint)
                #smallGearExplosion.setDepthWrite(False)
                #bigGearExplosion.setDepthWrite(False)
                gears2MTrack = Track((0.0,
                                      ParticleInterval(singleGear,
                                                       self.hill,
                                                       worldRelative=1,
                                                       duration=5.7,
                                                       cleanup=True)),
                                     (0.0,
                                      ParticleInterval(smallGearExplosion,
                                                       self.hill,
                                                       worldRelative=0,
                                                       duration=1.2,
                                                       cleanup=True)),
                                     (0.3,
                                      ParticleInterval(bigGearExplosion,
                                                       self.hill,
                                                       worldRelative=0,
                                                       duration=1.0,
                                                       cleanup=True)),
                                     name='gears2MTrack')
                #gearTrack = Parallel(gears2MTrack)
                #gearTrack.start()
                gears2MTrack.start()

                self.popIval = Sequence(
                    Parallel(
                        Sequence(
                            LerpPosInterval(self.moleHead, 0.05,
                                            Point3(0.28, 0.0, 0.0)),
                            LerpPosInterval(self.moleHead, 0.05,
                                            Point3(0.0, -0.23, 0.0)),
                            LerpPosInterval(self.moleHead, 0.05,
                                            Point3(0.0, 0.0, 0.28)),
                            LerpPosInterval(self.moleHead, 0.05,
                                            Point3(-0.35, 0.0, 0.0)),
                            LerpPosInterval(self.moleHead, 0.05,
                                            Point3(0.0, 0.28, 0.0)),
                            LerpPosInterval(self.moleHead, 0.05,
                                            Point3(0.31, 0.0, 0.0)),
                            LerpPosInterval(self.moleHead, 0.05,
                                            Point3(0.0, -0.32, 0.0)),
                            LerpPosInterval(self.moleHead, 0.05,
                                            Point3(0.0, 0.0, 0.48)),
                            LerpPosInterval(self.moleHead, 0.05,
                                            Point3(-0.28, 0.0, 0.0)),
                            LerpPosInterval(self.moleHead, 0.05,
                                            Point3(0.0, 0.29, 0.0)),
                        ), ),
                    LerpPosInterval(self.mole, 0.5, Point3(0, 0, -2.5)),
                    Func(self.setHillType, MoleFieldBase.HILL_BOMB),
                )
                self.popIval.start()

            else:
                self.moleHead.setH(0)

        if type == MoleFieldBase.HILL_WHACKED:
            self.moleHead = loader.loadModel(
                "phase_12/models/bossbotHQ/mole_hit")
            self.mole.setBillboardAxis(0)
            self.moleColNodePath.setScale(0.0)
            if self.popIval:
                self.popIval.finish()
            if self.downIval:
                self.downIval.finish()
            self.mole.setPos(0.0, 0.0, 0.0)
            self.popIval = Sequence(
                Parallel(
                    Sequence(
                        LerpPosInterval(self.moleHead, 0.05,
                                        Point3(0.18, 0.0, 0.0)),
                        LerpPosInterval(self.moleHead, 0.05,
                                        Point3(0.0, -0.13, 0.0)),
                        LerpPosInterval(self.moleHead, 0.05,
                                        Point3(0.0, 0.0, 0.18)),
                        LerpPosInterval(self.moleHead, 0.05,
                                        Point3(-0.15, 0.0, 0.0)),
                        LerpPosInterval(self.moleHead, 0.05,
                                        Point3(0.0, 0.18, 0.0)),
                        LerpPosInterval(self.moleHead, 0.05,
                                        Point3(0.11, 0.0, 0.0)),
                        LerpPosInterval(self.moleHead, 0.05,
                                        Point3(0.0, -0.12, 0.0)),
                        LerpPosInterval(self.moleHead, 0.05,
                                        Point3(0.0, 0.0, 0.18)),
                        LerpPosInterval(self.moleHead, 0.05,
                                        Point3(-0.18, 0.0, 0.0)),
                        LerpPosInterval(self.moleHead, 0.05,
                                        Point3(0.0, 0.13, 0.0)),
                        LerpPosInterval(self.moleHead, 0.05,
                                        Point3(0.18, 0.0, 0.0)),
                        LerpPosInterval(self.moleHead, 0.05,
                                        Point3(0.0, -0.15, 0.0)),
                        LerpPosInterval(self.moleHead, 0.05,
                                        Point3(0.0, 0.0, 0.18)),
                        LerpPosInterval(self.moleHead, 0.05,
                                        Point3(-0.16, 0.0, 0.0)),
                        LerpPosInterval(self.moleHead, 0.05,
                                        Point3(0.0, 0.18, 0.0)),
                        LerpPosInterval(self.moleHead, 0.05,
                                        Point3(0.11, 0.0, 0.0)),
                        LerpPosInterval(self.moleHead, 0.05,
                                        Point3(0.0, -0.18, 0.0)),
                        LerpPosInterval(self.moleHead, 0.05,
                                        Point3(0.0, 0.0, 0.17)),
                        LerpPosInterval(self.moleHead, 0.05,
                                        Point3(-0.18, 0.0, 0.0)),
                        LerpPosInterval(self.moleHead, 0.05,
                                        Point3(0.0, 0.0, 0.0)),
                    ),
                    Sequence(
                        LerpScaleInterval(self.moleHead, 0.5, 3.5),
                        LerpScaleInterval(self.moleHead, 0.5, 1.0),
                    ),
                ),
                LerpPosInterval(self.mole, 0.5, Point3(0, 0, -2.5)),
                Func(self.setHillType, MoleFieldBase.HILL_MOLE),
            )
            self.popIval.start()
        self.moleHead.reparentTo(self.mole)