Exemplo n.º 1
0
 def Explode(self):
     explosionPath, (delay, scaling) = self.GetExplosionInfo()
     if not self.exploded:
         self.sm.ScatterEvent('OnShipExplode', self.GetModel())
     return SpaceObject.Explode(self,
                                explosionURL=explosionPath,
                                managed=True,
                                delay=delay,
                                scaling=scaling)
 def Explode(self):
     if not gfxsettings.Get(gfxsettings.UI_EXPLOSION_EFFECTS_ENABLED):
         return False
     explosionURL, (delay, scaling) = self.GetExplosionInfo()
     return SpaceObject.Explode(self,
                                explosionURL=explosionURL,
                                managed=True,
                                delay=delay,
                                scaling=scaling)
Exemplo n.º 3
0
 def Explode(self):
     if not gfxsettings.Get(gfxsettings.UI_EXPLOSION_EFFECTS_ENABLED):
         return self.exploded
     if self.radius < 100.0:
         explosionURL = entityExplosionsS[self.typeID % 3]
     elif self.radius < 400.0:
         explosionURL = entityExplosionsM[self.typeID % 3]
     elif self.radius <= 900.0:
         explosionURL = entityExplosionsL[self.typeID % 3]
     if self.radius <= 900.0:
         return SpaceObject.Explode(self, explosionURL)
     if self.exploded:
         return False
     self.exploded = True
     exlosionBasePath = 'res:/Emitter/tracerexplosion/'
     if self.radius > 3000.0:
         extraPath = 'StructureDeathRadius1500.blue'
     elif self.radius > 1500.0:
         extraPath = 'StructureDeathRadius1000.blue'
     else:
         extraPath = 'StructureDeathRadius500.blue'
     explosionURL = exlosionBasePath + extraPath
     gfx = trinity.Load(explosionURL.replace('.blue', '.red'))
     if gfx is None:
         return False
     explodingObjectDisplay = [
         x for x in gfx.curveSets if x.name == 'ExplodingObjectDisplay'
     ]
     if gfx.__bluetype__ != 'trinity.EveRootTransform':
         root = trinity.EveRootTransform()
         root.children.append(gfx)
         root.name = explosionURL
         gfx = root
     self.model.translationCurve = self
     self.model.rotationCurve = None
     gfx.translationCurve = self
     self.explosionModel = gfx
     scene = self.spaceMgr.GetScene()
     scene.objects.append(gfx)
     if len(explodingObjectDisplay):
         explodingObjectDisplay = explodingObjectDisplay[0]
         explodingObjectDisplay.bindings[0].destinationObject = self.model
         self.explosionDisplayBinding = explodingObjectDisplay.bindings[0]
     return True
Exemplo n.º 4
0
 def Explode(self):
     if self.model is None:
         return
     explosionURL = 'res:/Model/Effect3/capsule_explosion.red'
     return SpaceObject.Explode(self, explosionURL)
Exemplo n.º 5
0
 def Explode(self):
     explosionURL = 'res:/Emitter/explosion_end.blue'
     scale = 0.2 + random.random() * 0.1
     return SpaceObject.Explode(self, explosionURL, scaling=scale)