Beispiel #1
0
 def destroy(self):
     if self.fashion is not None:
         self.fashion.removePhysicalTracks()
     if self.shadowManager is not None:
         self.shadowManager.updatePlayerTarget(None)
     if self.tracks is not None:
         self.tracks.reset()
     if self.shadowManager is not None and self.__vEntity.model is not None:
         self.shadowManager.unregisterCompoundModel(self.__vEntity.model)
     self.__clearModelAnimators()
     ScriptGameObject.deactivate(self)
     ScriptGameObject.destroy(self)
     self.__vDesc = None
     self.__vState = None
     self.__loadState.unload()
     self.__loadState.destroy()
     self.__loadState = None
     self.__curBuildInd = 0
     self.__vEntity = None
     self.__onLoadedCallback = None
     self.__onLoadedAfterRefreshCallback = None
     self.turretRotator = None
     self.undamagedStateChildren = []
     self.settingsCore.onSettingsChanged -= self.__onSettingsChanged
     self.itemsCache.onSyncCompleted -= self.__onItemsCacheSyncCompleted
     g_eventBus.removeListener(CameraRelatedEvents.CAMERA_ENTITY_UPDATED, self.__handleEntityUpdated)
     g_currentVehicle.onChanged -= self.__onVehicleChanged
     return
Beispiel #2
0
 def onEnterWorld(self, prereqs):
     LOG_DEBUG('onEnterWorld', self.__vehDescr.name, self.spaceID)
     self.model = prereqs[self.__vehDescr.name]
     self.model.matrix = self.matrix
     self.collisions = self.createComponent(BigWorld.CollisionComponent,
                                            prereqs['collisionAssembler'])
     self.__detachConfirmationTimer.onEnterWorld()
     self.__vehDescr.keepPrereqs(prereqs)
     turretDescr = self.__vehDescr.turret
     if self.isUnderWater == 0:
         self.__detachmentEffects = _TurretDetachmentEffects(
             self.model, turretDescr.turretDetachmentEffects,
             self.isCollidingWithWorld == 1)
         self.addComponent(self.__detachmentEffects)
     else:
         self.__detachmentEffects = None
     self.__hitEffects = _HitEffects(self.model)
     self.addComponent(self.__hitEffects)
     self.__componentsDesc = (self.__vehDescr.turret, self.__vehDescr.gun)
     from helpers.CallbackDelayer import CallbackDelayer
     self.__isBeingPulledCallback = CallbackDelayer()
     self.__isBeingPulledCallback.delayCallback(self.__checkIsBeingPulled(),
                                                self.__checkIsBeingPulled)
     DetachedTurret.allTurrets.append(self)
     collisionData = ((TankPartNames.getIdx(TankPartNames.TURRET),
                       self.model.matrix),
                      (TankPartNames.getIdx(TankPartNames.GUN),
                       self.model.node(TankPartNames.GUN)))
     self.collisions.connect(self.id, ColliderTypes.DYNAMIC_COLLIDER,
                             collisionData)
     ScriptGameObject.activate(self)
     return
 def __init__(self, yaw, dropPoint, landingPosition, descendTime):
     ScriptGameObject.__init__(self, BigWorld.player().spaceID)
     CallbackDelayer.__init__(self)
     self.descendSimulator = DescendSimulator(yaw, dropPoint,
                                              landingPosition, descendTime)
     self.__descendTime = descendTime
     self.__dropPoint = dropPoint
 def onLeaveWorld(self):
     super(NewYearSelectableObject, self).onLeaveWorld()
     self.__removeHighlightComponent()
     self.entityGameObject.removeComponentByType(OtherEntityComponent)
     self.entityGameObject.removeComponentByType(HighlightGroupComponent)
     self._nyController.onStateChanged -= self.__onStateChanged
     ScriptGameObject.deactivate(self)
     ScriptGameObject.destroy(self)
Beispiel #5
0
 def __init__(self):
     BigWorld.Entity.__init__(self)
     ScriptGameObject.__init__(self, self.spaceID, 'ClientSelectableObject')
     ISelectableObject.__init__(self)
     self.__enabled = True
     self.__edged = False
     self.__clickSound = None
     self.model = None
     return
 def activate(self):
     ScriptGameObject.activate(self)
     self.model.activate()
     self.model.compoundModel.position = self.__dropPoint
     self.model.compoundModel.matrix = self.descendSimulator.matrix
     self.landingAnimation.bindToCompound(self.model.compoundModel)
     self.delayCallback(
         self.__descendTime + self.LANDING_ANIMATION_TRIGGER_OFFSET,
         self.__animateLanding)
Beispiel #7
0
 def destroy(self):
     super(BotAirdrop, self).destroy()
     CallbackDelayer.destroy(self)
     if BattleReplay.g_replayCtrl.isPlaying:
         g_replayEvents.onTimeWarpStart -= self.__onReplayTimeWarpStart
     self.__removeMarkerArea()
     self.__removeDeliveryEffect()
     ScriptGameObject.destroy(self)
     CallbackDelayer.destroy(self)
 def __init__(self, arena, bonusType, arenaType):
     ScriptGameObject.__init__(self, arena.gameSpace.spaceID, 'ClientArenaComponentSystem')
     self.bonusType = bonusType
     self.arenaType = arenaType
     self.arena = weakref.ref(arena)
     self._onUpdate = {ARENA_UPDATE.SYNC_OBJECTS: self.__onFullSyncObjectReceived,
      ARENA_UPDATE.SYNC_OBJECTS_DIFF: self.__onSyncObjectUpdateReceived}
     self.__syncDataObjects = {}
     for k, _ in ARENA_SYNC_OBJECT_NAMES.iteritems():
         self.__syncDataObjects[k] = ArenaSyncObject()
Beispiel #9
0
 def onLeaveWorld(self):
     ScriptGameObject.deactivate(self)
     ScriptGameObject.destroy(self)
     self.__removeHighlightComponent()
     if self.__clickSound is not None:
         if self.__clickSound.isPlaying:
             self.__clickSound.stop()
         self.__clickSound.releaseMatrix()
         self.__clickSound = None
     return
Beispiel #10
0
 def onLeaveWorld(self):
     ScriptGameObject.deactivate(self)
     ScriptGameObject.destroy(self)
     if self.__clickSound is not None:
         if self.__clickSound.isPlaying:
             self.__clickSound.stop()
         self.__clickSound.releaseMatrix()
         self.__clickSound = None
     self.setHighlight(False)
     return
Beispiel #11
0
 def onLeaveWorld(self):
     LOG_DEBUG('onLeaveWorld')
     ScriptGameObject.deactivate(self)
     DetachedTurret.allTurrets.remove(self)
     self.__detachConfirmationTimer.cancel()
     self.__detachConfirmationTimer = None
     self.__isBeingPulledCallback.destroy()
     self.__isBeingPulledCallback = None
     if self.__vehicleStickers is not None:
         self.__vehicleStickers.detach()
         self.__vehicleStickers = None
     return
 def __init__(self, stateName, stateProperties, entityId, trigger, spaceID):
     ScriptGameObject.__init__(self, spaceID, 'DestructibleEntityState')
     self.__entityId = entityId
     self.__stateName = stateName
     self.__stateProperties = stateProperties
     self.__guiNode = None
     self.__active = False
     self.__visualModel = None
     self.__damageStickers = dict()
     self.__effectsPlayer = None
     self.__trigger = trigger
     return
Beispiel #13
0
 def __init__(self, dropID, deliveryPosition, teamID, yawAxis,
              deliveryTime):
     self.__spaceID = BigWorld.player().spaceID
     ScriptGameObject.__init__(self, self.__spaceID)
     CallbackDelayer.__init__(self)
     self.__deliveryTime = deliveryTime
     self.__deliveryPosition = deliveryPosition
     self.__markerArea = None
     self.__deliveryEffect = None
     self.__teamID = teamID
     self.__yawAxis = yawAxis
     self.__plannedAnimDuration = 0.0
     return
Beispiel #14
0
 def onEnterWorld(self, prereqs):
     if not self.modelName:
         return
     if self.modelName not in prereqs.failedIDs:
         model = prereqs[self.modelName]
         self.model = model
         self.filter = BigWorld.DumbFilter()
         self.model.addMotor(BigWorld.Servo(self.matrix))
         self.collisions = self.createComponent(
             BigWorld.CollisionComponent, prereqs['collisionAssembler'])
         collisionData = ((0, self.model.matrix), )
         self.collisions.connect(self.id, ColliderTypes.DYNAMIC_COLLIDER,
                                 collisionData)
     ScriptGameObject.activate(self)
Beispiel #15
0
 def __init__(self):
     ScriptGameObject.__init__(self, self.spaceID, 'DetachedTurret')
     self.__vehDescr = vehicles.VehicleDescr(
         compactDescr=self.vehicleCompDescr)
     self.filter = BigWorld.WGTurretFilter()
     self.__detachConfirmationTimer = SynchronousDetachment(self)
     self.__detachConfirmationTimer.onInit()
     self.__detachmentEffects = None
     self.targetFullBounds = True
     self.targetCaps = [1]
     self.__isBeingPulledCallback = None
     self.__hitEffects = None
     self.__vehicleStickers = None
     return
 def __init__(self, spaceID):
     ScriptGameObject.__init__(self, spaceID, CgfTankNodes.TANK_ROOT)
     self._vehicle = None
     self.__wheelsGameObject = ScriptGameObject(spaceID, 'Tank.Wheels.Root')
     self.__filter = None
     self.__typeDesc = None
     self.crashedTracksController = None
     self.__currentDamageState = VehicleDamageState()
     self.__currTerrainMatKind = [-1] * MATKIND_COUNT
     self.__currTerrainGroundType = [-1] * MATKIND_COUNT
     self.__terrainEffectMaterialNames = [''] * MATKIND_COUNT
     self._chassisDecal = VehicleDecal(self)
     self.__splodge = None
     self.__boundEffects = None
     self._splineTracks = None
     self.flyingInfoProvider = self.createComponent(
         Vehicular.FlyingInfoProvider)
     self.__trackScrollCtl = BigWorld.PyTrackScroll()
     self.__trackScrollCtl.setFlyingInfo(
         DataLinks.createBoolLink(self.flyingInfoProvider,
                                  'isLeftSideFlying'),
         DataLinks.createBoolLink(self.flyingInfoProvider,
                                  'isRightSideFlying'))
     self.__weaponEnergy = 0.0
     self.__outfit = None
     self.__systemStarted = False
     self.__isAlive = True
     self._isTurretDetached = False
     self.__isObserver = False
     self.__attachments = []
     self.__modelAnimators = []
     self.turretMatrix = None
     self.gunMatrix = None
     self.__allLodCalculators = []
     self._commonScroll = 0.0
     self._commonSlip = 0.0
     self._compoundModel = None
     self.__fashions = None
     self.__filterRetrievers = []
     self.__filterRetrieverGameObjects = []
     self._vehicleStickers = None
     self._vehicleInfo = {}
     self.__vID = 0
     self.__renderMode = None
     self.__frameTimestamp = 0
     self.__periodicTimerID = None
     self.undamagedStateChildren = []
     self.createComponent(VehicleAppearanceComponent, self)
     self._loadingQueue = []
     return
 def onEnterWorld(self, prereqs):
     if self._selfDestroyCheck():
         return
     super(NewYearSelectableObject, self).onEnterWorld(prereqs)
     if prereqs.has_key('collisionAssembler'):
         self.collisions = self.createComponent(BigWorld.CollisionComponent, prereqs['collisionAssembler'])
         collisionData = ((0, self.matrix),)
         self.collisions.connect(self.id, ColliderTypes.DYNAMIC_COLLIDER, collisionData)
         ScriptGameObject.activate(self)
     if self.outlineModelName:
         state = {'modelName': self.outlineModelName,
          'edgeMode': self.edgeMode,
          'anchorName': self.anchorName,
          'selectionGroupIdx': self.selectionGroupIdx}
         self.entityGameObject.createComponent(OtherEntityComponent, state, NewYearSelectableObject)
     if self.enabled:
         self.__addHighlightComponent()
     if self.selectionGroupIdx:
         self.entityGameObject.createComponent(HighlightGroupComponent, self.selectionGroupIdx)
     self._nyController.onStateChanged += self.__onStateChanged
     self.__onStateChanged()
Beispiel #18
0
 def __init__(self, spaceId, vEntity):
     ScriptGameObject.__init__(self, vEntity.spaceID, 'HangarVehicleAppearance')
     self.__loadState = _LoadStateNotifier()
     self.__curBuildInd = 0
     self.__vDesc = None
     self.__vState = None
     size = len(TankPartNames.ALL)
     self.__fashions = VehiclePartsTuple(*([None] * size))
     self.__repaintHandlers = [None] * size
     self.__camoHandlers = [None] * size
     self.__projectionDecalsHandlers = [None] * size
     self.__projectionDecalsUpdater = None
     self.__spaceId = spaceId
     self.__vEntity = weakref.proxy(vEntity)
     self.__onLoadedCallback = None
     self.__onLoadedAfterRefreshCallback = None
     self.__vehicleStickers = None
     self.__isVehicleDestroyed = False
     self.__outfit = None
     self.__staticTurretYaw = 0.0
     self.__staticGunPitch = 0.0
     self.__anchorsHelpers = None
     self.__anchorsParams = None
     self.__attachments = []
     self.__modelAnimators = []
     self._modelCollisions = None
     self._crashedModelCollisions = None
     self.shadowManager = None
     self.turretRotator = None
     cfg = hangarCFG()
     self.__currentEmblemsAlpha = cfg['emblems_alpha_undamaged']
     self.__showMarksOnGun = self.settingsCore.getSetting('showMarksOnGun')
     self.settingsCore.onSettingsChanged += self.__onSettingsChanged
     self.itemsCache.onSyncCompleted += self.__onItemsCacheSyncCompleted
     g_eventBus.addListener(CameraRelatedEvents.CAMERA_ENTITY_UPDATED, self.__handleEntityUpdated)
     g_currentVehicle.onChanged += self.__onVehicleChanged
     self.undamagedStateChildren = []
     return
Beispiel #19
0
    def __assembleNonDamagedOnly(self, resourceRefs, isPlayer, lodLink, lodStateLink):
        model_assembler.assembleTerrainMatKindSensor(self, lodStateLink, self.spaceID)
        model_assembler.assembleRecoil(self, lodLink)
        model_assembler.assembleMultiGunRecoil(self, lodLink)
        model_assembler.assembleGunLinkedNodesAnimator(self)
        model_assembler.assembleCollisionObstaclesCollector(self, lodStateLink, self.typeDescriptor)
        model_assembler.assembleTessellationCollisionSensor(self, lodStateLink)
        wheelsScroll = None
        wheelsSteering = None
        generalWheelsAnimatorConfig = self.typeDescriptor.chassis.generalWheelsAnimatorConfig
        if generalWheelsAnimatorConfig is not None:
            scrollableWheelsCount = generalWheelsAnimatorConfig.getNonTrackWheelsCount()
            wheelsScroll = []
            for _ in xrange(scrollableWheelsCount):
                retrieverGameObject = ScriptGameObject(self.spaceID)
                retriever = retrieverGameObject.createComponent(NetworkFilters.FloatFilterRetriever)
                wheelsScroll.append(DataLinks.createFloatLink(retriever, 'value'))
                self.filterRetrievers.append(retriever)
                self.filterRetrieverGameObjects.append(retrieverGameObject)

            steerableWheelsCount = generalWheelsAnimatorConfig.getSteerableWheelsCount()
            wheelsSteering = []
            for _ in xrange(steerableWheelsCount):
                retrieverGameObject = ScriptGameObject(self.spaceID)
                retriever = retrieverGameObject.createComponent(NetworkFilters.FloatFilterRetriever)
                wheelsSteering.append(DataLinks.createFloatLink(retriever, 'value'))
                self.filterRetrievers.append(retriever)
                self.filterRetrieverGameObjects.append(retrieverGameObject)

        self.wheelsAnimator = model_assembler.createWheelsAnimator(self, ColliderTypes.VEHICLE_COLLIDER, self.typeDescriptor, lambda : self.wheelsState, wheelsScroll, wheelsSteering, self.splineTracks, lodStateLink)
        if self.customEffectManager is not None:
            self.customEffectManager.setWheelsData(self)
        suspensionLodLink = lodStateLink
        if 'wheeledVehicle' in self.typeDescriptor.type.tags:
            wheeledLodCalculator = self.wheelsGameObject.createComponent(Vehicular.LodCalculator, DataLinks.linkMatrixTranslation(self.compoundModel.matrix), True, WHEELED_CHASSIS_PRIORITY_GROUP, isPlayer)
            self.allLodCalculators.append(wheeledLodCalculator)
            suspensionLodLink = wheeledLodCalculator.lodStateLink
        model_assembler.assembleSuspensionIfNeed(self, suspensionLodLink)
        model_assembler.assembleLeveredSuspensionIfNeed(self, suspensionLodLink)
        self.__assembleSwinging(lodLink)
        model_assembler.assembleBurnoutProcessor(self)
        model_assembler.assembleSuspensionSound(self, lodLink, isPlayer)
        model_assembler.assembleHullAimingController(self)
        self.trackNodesAnimator = model_assembler.createTrackNodesAnimator(self, self.typeDescriptor, lodStateLink)
        model_assembler.assembleTracks(resourceRefs, self.typeDescriptor, self, self.splineTracks, False, lodStateLink)
        model_assembler.assembleVehicleTraces(self, self.filter, lodStateLink)
        return
 def __init__(self):
     NewYearVisualObject.__init__(self)
     ScriptGameObject.__init__(self, self.spaceID)
     ISelectableObject.__init__(self)
     self.__enabled = True
 def destroy(self):
     ScriptGameObject.destroy(self)
     CallbackDelayer.destroy(self)
 def destroy(self):
     ScriptGameObject.destroy(self)
     self._onUpdate.clear()
     self.__syncDataObjects.clear()