def weaponHitObject(self, entry):
     if not entry.hasSurfacePoint() or not entry.hasInto():
         return
     if not entry.getInto().isTangible():
         return
     hitObject = entry.getIntoNodePath()
     objType = hitObject.getNetTag('objType')
     if not objType:
         return
     objType = int(objType)
     if objType == PiratesGlobals.COLL_SEA and base.cr.wantSpecialEffects:
         pos = entry.getSurfacePoint(render)
         if base.cr.activeWorld.getWater():
             entryWaterHeight = base.cr.activeWorld.getWater().calcHeight(pos[0], pos[1]) + 7.0
         else:
             entryWaterHeight = pos[2]
         splashEffect = SmallSplash.getEffect()
         if splashEffect:
             splashEffect.reparentTo(render)
             splashEffect.setPos(pos[0], pos[1], entryWaterHeight)
             splashEffect.play()
         self.cnode.setFromCollideMask(PiratesGlobals.TargetBitmask.allOff())
     elif objType == PiratesGlobals.COLL_LAND and base.cr.wantSpecialEffects:
         pos = entry.getSurfacePoint(render)
         dustCloudEffect = DustCloud.getEffect()
         if dustCloudEffect:
             dustCloudEffect.wrtReparentTo(render)
             dustCloudEffect.setPos(pos)
             dustCloudEffect.play()
         self.cnode.setFromCollideMask(PiratesGlobals.TargetBitmask.allOff())
Beispiel #2
0
    def weaponHitObject(self, entry):
        if not entry.hasSurfacePoint() or not entry.hasInto():
            return None

        if not entry.getInto().isTangible():
            return None

        hitObject = entry.getIntoNodePath()
        objType = hitObject.getNetTag("objType")
        if not objType:
            return None

        objType = int(objType)
        if objType == PiratesGlobals.COLL_SEA and base.cr.wantSpecialEffects:
            pos = entry.getSurfacePoint(render)
            if base.cr.activeWorld.getWater():
                entryWaterHeight = base.cr.activeWorld.getWater().calcHeight(pos[0], pos[1]) + 7.0
            else:
                entryWaterHeight = pos[2]
            splashEffect = SmallSplash.getEffect()
            if splashEffect:
                splashEffect.reparentTo(render)
                splashEffect.setPos(pos[0], pos[1], entryWaterHeight)
                splashEffect.play()

            self.cnode.setFromCollideMask(PiratesGlobals.TargetBitmask.allOff())
        elif objType == PiratesGlobals.COLL_LAND and base.cr.wantSpecialEffects:
            pos = entry.getSurfacePoint(render)
            dustCloudEffect = DustCloud.getEffect()
            if dustCloudEffect:
                dustCloudEffect.wrtReparentTo(render)
                dustCloudEffect.setPos(pos)
                dustCloudEffect.play()

            self.cnode.setFromCollideMask(PiratesGlobals.TargetBitmask.allOff())
 def playSplash():
     if fromWater:
         splashEffect = SmallSplash.getEffect()
         if splashEffect:
             splashEffect.reparentTo(self.av)
             splashEffect.play()
 def playSplash():
     if fromWater:
         splashEffect = SmallSplash.getEffect()
         if splashEffect:
             splashEffect.reparentTo(self.av)
             splashEffect.play()