Exemplo n.º 1
0
 def __init__(self):
     SpaceObject.__init__(self)
     self.lastActivationTime = 0
     self.activeStateDuration = 15 * const.SEC
     self.isDeactivationThreadRunning = False
     self.isActive = False
     self.deactivationCurve = None
     self.activationCurve = None
     self.lightningTransform = None
     self.arrivalCurve = None
     self.departureCurve = None
Exemplo n.º 2
0
 def __init__(self):
     SpaceObject.__init__(self)
     self.lastActivationTime = 0
     self.activeStateDuration = 15 * const.SEC
     self.isDeactivationThreadRunning = False
     self.isActive = False
     self.deactivationCurve = None
     self.activationCurve = None
     self.lightningTransform = None
     self.arrivalCurve = None
     self.departureCurve = None
Exemplo n.º 3
0
 def __init__(self):
     SpaceObject.__init__(self)
     self.activeTargetID = None
     self.fitted = False
     self.fittingThread = None
     self.turrets = []
     self.modules = {}
     self.stanceID = None
     self.lastStanceID = None
     self.cloakedCopy = None
     self.isT3LoadingLockHeld = False
     self.burning = False
     self.loadingModel = False
     self.LoadT3ShipWithThrottle = CallCombiner(self.LoadT3Ship, 1.0)
Exemplo n.º 4
0
    def LoadT3Ship(self):
        modules = self.typeData.get('slimItem').modules
        subsystems = {}
        self._LockT3Loading()
        self.loadingModel = True
        oldModel = self.model
        try:
            for _, typeID, _ in modules:
                if evetypes.GetCategoryID(typeID) == const.categorySubSystem:
                    subsystems[evetypes.GetGroupID(typeID)] = typeID

            t3ShipSvc = self.sm.GetService('t3ShipSvc')
            model = t3ShipSvc.GetTech3ShipFromDict(self.typeID, subsystems, self.typeData.get('sofRaceName', None))
            if self.released:
                return
            if model is not None:
                SpaceObject.LoadModel(self, None, loadedModel=model)
                self.Assemble()
            self.Display(1)
        finally:
            self.loadingModel = False
            self._UnlockT3Loading()

        if oldModel is not None:
            self.RemoveAndClearModel(oldModel)
Exemplo n.º 5
0
 def LoadModel(self, fileName = None, loadedModel = None):
     if self.typeID in ENVIRONMENTS:
         self.logger.debug('Not loading dungeon environment (%s), since rework is pending.', self.typeID)
         return
     if not gfxsettings.Get(gfxsettings.UI_EFFECTS_ENABLED):
         return
     SpaceObject.LoadModel(self, fileName, loadedModel)
Exemplo n.º 6
0
    def LoadT3Ship(self):
        modules = self.typeData.get('slimItem').modules
        subsystems = {}
        self._LockT3Loading()
        self.loadingModel = True
        oldModel = self.model
        try:
            for _, typeID, _ in modules:
                group = cfg.invtypes.Get(typeID).Group()
                if group.categoryID == const.categorySubSystem:
                    subsystems[group.groupID] = typeID

            t3ShipSvc = self.sm.GetService('t3ShipSvc')
            model = t3ShipSvc.GetTech3ShipFromDict(self.typeID, subsystems,
                                                   self.id)
            if model is not None:
                SpaceObject.LoadModel(self, None, loadedModel=model)
                self.Assemble()
            self.Display(1)
        finally:
            self.loadingModel = False
            self._UnlockT3Loading()

        if oldModel is not None:
            self.RemoveAndClearModel(oldModel)
Exemplo n.º 7
0
 def __init__(self):
     SpaceObject.__init__(self)
     self.exploded = False
     self.collided = False
     self.targetId = None
     self.ownerID = None
     self.sourceShipID = None
     self.sourceModuleIDList = []
     self.delayedBall = None
     self.explosionPath = ''
     self.globalsGlob = _globalsGlob
     self.trinUseNonCached = False
     self.warheadsReleased = 0
     self.totalWarheadCount = 0
     self.delayedBall = None
     self.enabled = self.globalsGlob.GetMissilesEnabled()
Exemplo n.º 8
0
 def __init__(self):
     SpaceObject.__init__(self)
     self.exploded = False
     self.collided = False
     self.targetId = None
     self.ownerID = None
     self.sourceShipID = None
     self.sourceModuleIDList = []
     self.delayedBall = None
     self.explosionPath = ''
     self.globalsGlob = _globalsGlob
     self.trinUseNonCached = False
     self.warheadsReleased = 0
     self.totalWarheadCount = 0
     self.delayedBall = None
     self.enabled = self.globalsGlob.GetMissilesEnabled()
 def Release(self):
     if self.released:
         return
     scene = self.spaceMgr.GetScene()
     scene.backgroundObjects.fremove(self.backgroundObject)
     self.backgroundObject = None
     SpaceObject.Release(self, 'BackgroundObject')
Exemplo n.º 10
0
 def LoadModel(self, fileName=None, loadedModel=None):
     filename = self.typeData.get('graphicFile')
     model = self._LoadModelResource(filename)
     if model is not None:
         self._SetupStargateEffects(model)
     SpaceObject.LoadModel(self, loadedModel=model)
     self.SetStaticRotation()
Exemplo n.º 11
0
 def LoadModel(self, fileName = None, loadedModel = None):
     godma = self.sm.GetService('godma')
     godmaStateManager = godma.GetStateManager()
     godmaType = godmaStateManager.GetType(self.typeID)
     self.turretTypeID = godmaType.gfxTurretID
     missileTypeID = godmaType.entityMissileTypeID
     self.launcherTypeID = self.DetermineLauncherTypeFromMissileID(self.typeID, missileTypeID)
     SpaceObject.LoadModel(self)
Exemplo n.º 12
0
 def TriggerAnimation(self, state):
     if state == 'normal':
         state = shipanimation.GetAnimationStateFromStance(self.stanceID)
     SpaceObject.TriggerAnimation(self, state)
     if self.stanceID is not None and self.lastStanceID is not None:
         spaceobjaudio.PlayStateChangeAudio(self.stanceID,
                                            self.lastStanceID,
                                            self._GetGeneralAudioEntity())
Exemplo n.º 13
0
 def __init__(self):
     SpaceObject.__init__(self)
     self.activeTargetID = None
     self.fitted = False
     self.cachedShip = None
     self._skinChangeTasklet = None
     self.fittingThread = None
     self.turrets = []
     self.modules = {}
     self.stanceID = None
     self.lastStanceID = None
     self.isT3LoadingLockHeld = False
     self.burning = True
     self.loadingModel = False
     self.LoadT3ShipWithThrottle = CallCombiner(self.LoadT3Ship, 1.0)
     self._SkinLock = locks.RLock()
     self._modelChangeCallbacks = []
Exemplo n.º 14
0
 def __init__(self):
     SpaceObject.__init__(self)
     self.activeTargetID = None
     self.fitted = False
     self.cachedShip = None
     self._skinChangeTasklet = None
     self.fittingThread = None
     self.turrets = []
     self.modules = {}
     self.stanceID = None
     self.lastStanceID = None
     self.isT3LoadingLockHeld = False
     self.burning = True
     self.loadingModel = False
     self.LoadT3ShipWithThrottle = CallCombiner(self.LoadT3Ship, 1.0)
     self._SkinLock = locks.RLock()
     self._modelChangeCallbacks = []
Exemplo n.º 15
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)
Exemplo n.º 16
0
 def Release(self):
     if hasattr(self.model, 'resourceCallback'):
         self.model.resourceCallback = None
     if hasattr(self.model, 'children'):
         del self.model.children[:]
     scene = self.spaceMgr.GetScene()
     if scene:
         scene.planets.fremove(self.model)
     SpaceObject.Release(self, 'Planet')
Exemplo n.º 17
0
 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.º 18
0
 def Release(self):
     self._UnlockT3Loading()
     if self.released:
         return
     if self.model is None:
         return
     self.modules = {}
     self.KillCloakedCopy()
     self.LoadT3ShipWithThrottle = None
     SpaceObject.Release(self, 'Ship')
Exemplo n.º 19
0
 def Prepare(self):
     SpaceObject.Prepare(self)
     michelle = self.sm.GetService('michelle')
     slimItem = self.typeData.get('slimItem')
     explodedShipBall = michelle.GetBall(slimItem.launcherID)
     if explodedShipBall is not None and getattr(explodedShipBall, 'model',
                                                 None) is not None:
         self.SetBallRotation(explodedShipBall)
     else:
         self.SetRandomRotation()
Exemplo n.º 20
0
 def __init__(self):
     SpaceObject.__init__(self)
     self.textureSet = None
     self.loaded = False
     self.isInflightPlanet = True
     self.rotatePlanet = False
     self.rotationApplied = False
     self.audioStarted = False
     self.attributes = None
     self.modelRes = []
     self.modelPath = None
     self.heightMapResPath1 = ''
     self.heightMapResPath2 = ''
     self.largeTextures = False
     self.districts = {}
     self.districtsInfo = {}
     self.districtContainer = trinity.EveTransform()
     self.districtContainer.name = 'Districts'
     self.districtExplosions = trinity.EveTransform()
     self.districtExplosions.name = 'Explosions'
Exemplo n.º 21
0
 def __init__(self):
     SpaceObject.__init__(self)
     self.textureSet = None
     self.loaded = False
     self.isInflightPlanet = True
     self.rotatePlanet = False
     self.rotationApplied = False
     self.audioStarted = False
     self.attributes = None
     self.modelRes = []
     self.modelPath = None
     self.heightMapResPath1 = ''
     self.heightMapResPath2 = ''
     self.largeTextures = False
     self.districts = {}
     self.districtsInfo = {}
     self.districtContainer = trinity.EveTransform()
     self.districtContainer.name = 'Districts'
     self.districtExplosions = trinity.EveTransform()
     self.districtExplosions.name = 'Explosions'
Exemplo n.º 22
0
 def ReleaseAll(self):
     if self.model:
         self.model.target = None
         self.model.explosionCallback = None
         SpaceObject.Release(self, 'Missile')
     if self.delayedBall:
         self.globalsGlob.DestroyClientBall(self.delayedBall)
         self.delayedBall = None
     warheadsLeft = self.totalWarheadCount - self.warheadsReleased
     self.warheadsReleased = self.totalWarheadCount
     if warheadsLeft != 0:
         self.explosionManager.Cancel(self.explosionPath, count=warheadsLeft)
Exemplo n.º 23
0
 def LoadModel(self, fileName=None, loadedModel=None):
     npcStation = cfg.mapSolarSystemContentCache.npcStations.get(
         self.id, None)
     if npcStation:
         graphicID = npcStation.graphicID
         graphicFile = cfg.graphics.Get(graphicID).graphicFile
     else:
         graphicFile = self.typeData.get('graphicFile')
     SpaceObject.LoadModel(self, fileName=graphicFile)
     self.fx = self.sm.GetService('FxSequencer')
     self.stationState = pos.STRUCTURE_ONLINE
     self.HandleStateChange()
Exemplo n.º 24
0
 def Release(self):
     self._UnlockT3Loading()
     if self.released:
         return
     if self.model is None:
         return
     self.modules = {}
     self.LoadT3ShipWithThrottle = None
     SpaceObject.Release(self, 'Ship')
     self._modelChangeCallbacks = []
     audsvc = self.sm.GetServiceIfRunning('audio')
     if audsvc.lastLookedAt == self:
         audsvc.lastLookedAt = None
Exemplo n.º 25
0
 def Assemble(self):
     SpaceObject.Assemble(self)
     warpDisruptionStartTime = self.typeData[
         'slimItem'].warpDisruptionStartTime
     if warpDisruptionStartTime is None:
         return
     godmaStateManager = self.sm.GetService('godma').GetStateManager()
     godmaType = godmaStateManager.GetType(self.typeID)
     effectRadius = godmaType.warpScrambleRange
     if effectRadius:
         scale = self.model.scaling[0] / 20000.0 * effectRadius
         self.model.scaling = (scale, scale, scale)
     timeNow = blue.os.GetSimTime()
     if blue.os.TimeDiffInMs(warpDisruptionStartTime, timeNow) < 10000.0:
         for cs in self.model.curveSets:
             cs.Play()
Exemplo n.º 26
0
 def LoadModel(self, fileName = None, loadedModel = None):
     groupID = self.typeData.get('groupID')
     typeID = self.typeData.get('typeID')
     groupGraphics = cfg.groupGraphics.get(groupID, None)
     graphicID = None
     if hasattr(groupGraphics, 'graphicIDs'):
         variationID = self.id % len(groupGraphics.graphicIDs)
         graphicID = groupGraphics.graphicIDs[variationID]
     elif hasattr(groupGraphics, 'typeIDs'):
         graphicIDs = groupGraphics.typeIDs.get(typeID, None).graphicIDs
         variationID = self.id % len(graphicIDs)
         graphicID = graphicIDs[variationID]
     graphicFile = GetGraphicFile(graphicID)
     if graphicFile:
         SpaceObject.LoadModel(self, fileName=graphicFile)
         Asteroid._asteroidEnvironment.Add(self)
     else:
         self.logger.error('Could not load model for asteroid. groupID: %s, typeID: %s, graphicID: %s', groupID, typeID, graphicID)
Exemplo n.º 27
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.º 28
0
    def RemoveAndClearModel(self, model, scene = None):
        if model is None:
            return
        if type(model) == trinity.EveMissile:
            del model.warheads[1:]
            whPrime = model.warheads[0]
            del whPrime.observers[:]
            for cs in model.curveSets:
                toKeep = []
                for binding in cs.bindings:
                    if type(binding.destinationObject) != trinity.EveMissileWarhead:
                        toKeep.append(binding)
                    elif binding.destinationObject == whPrime:
                        toKeep.append(binding)

                del cs.bindings[:]
                cs.bindings.extend(toKeep)

        SpaceObject.RemoveAndClearModel(self, model, scene=scene)
Exemplo n.º 29
0
    def RemoveAndClearModel(self, model, scene=None):
        """
        Clears warheads and curve bindings added in Prepare, returning the
        model to its initial state so we can recycle it. Calls the base method
        to do the normal cleanup from the scene.
        """
        if model is None:
            return
        if type(model) == trinity.EveMissile:
            del model.warheads[1:]
            whPrime = model.warheads[0]
            for cs in model.curveSets:
                toKeep = []
                for binding in cs.bindings:
                    if type(binding.destinationObject
                            ) != trinity.EveMissileWarhead:
                        toKeep.append(binding)
                    elif binding.destinationObject == whPrime:
                        toKeep.append(binding)

                del cs.bindings[:]
                cs.bindings.extend(toKeep)

        SpaceObject.RemoveAndClearModel(self, model, scene=scene)
Exemplo n.º 30
0
 def Release(self):
     if self.released:
         return
     self.ReleaseSun()
     SpaceObject.Release(self, 'Sun')
Exemplo n.º 31
0
 def __init__(self):
     SpaceObject.__init__(self)
     self.useGodRays = False
     self.godRaysLoaded = False
Exemplo n.º 32
0
 def __init__(self):
     SpaceObject.__init__(self)
     if Asteroid._asteroidEnvironment is None:
         Asteroid._asteroidEnvironment = AsteroidEnvironment()
Exemplo n.º 33
0
 def __init__(self):
     SpaceObject.__init__(self)
Exemplo n.º 34
0
 def __init__(self):
     SpaceObject.__init__(self)
     self.useGodRays = False
     self.godRaysLoaded = False
Exemplo n.º 35
0
 def Explode(self):
     if self.model is None:
         return
     explosionURL = 'res:/Model/Effect3/capsule_explosion.red'
     return SpaceObject.Explode(self, explosionURL)
 def __init__(self):
     SpaceObject.__init__(self)
     self.modules = {}
     self.fitted = False
Exemplo n.º 37
0
 def __init__(self):
     SpaceObject.__init__(self)
Exemplo n.º 38
0
 def __init__(self):
     SpaceObject.__init__(self)
     self.targetNebulaPath = None
     self.wormholeSize = 1.0
     self.wormholeAge = 1
Exemplo n.º 39
0
 def LoadModel(self, fileName=None, loadedModel=None):
     gender = GENDER_FEMALE
     if self.typeID != const.typeCorpseFemale:
         gender = GENDER_MALE
     path = GetRandomCorpsePath(gender, self.id)
     SpaceObject.LoadModel(self, path)
Exemplo n.º 40
0
 def __init__(self):
     SpaceObject.__init__(self)
     self.bountyTextParam = None
     self.bountyImageParam = None
     self.advertImageParam = None
     self.headlineTextParam = None