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
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)
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)
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)
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)
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')
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()
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)
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())
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 = []
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 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')
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)
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')
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()
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'
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)
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()
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
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()
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)
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
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)
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)
def Release(self): if self.released: return self.ReleaseSun() SpaceObject.Release(self, 'Sun')
def __init__(self): SpaceObject.__init__(self) self.useGodRays = False self.godRaysLoaded = False
def __init__(self): SpaceObject.__init__(self) if Asteroid._asteroidEnvironment is None: Asteroid._asteroidEnvironment = AsteroidEnvironment()
def __init__(self): SpaceObject.__init__(self)
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
def __init__(self): SpaceObject.__init__(self) self.targetNebulaPath = None self.wormholeSize = 1.0 self.wormholeAge = 1
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)
def __init__(self): SpaceObject.__init__(self) self.bountyTextParam = None self.bountyImageParam = None self.advertImageParam = None self.headlineTextParam = None