def destroy(self):
     super(BotAirdrop, self).destroy()
     CallbackDelayer.destroy(self)
     self.__removeMarkerArea()
     self.__removeDeliveryEffect()
     ScriptGameObject.destroy(self)
     CallbackDelayer.destroy(self)
Beispiel #2
0
    def stop(self):
        self.__isStarted = False
        import SoundGroups
        SoundGroups.g_instance.changePlayMode(0)
        aih_global_binding.clear()
        for control in self.__ctrls.itervalues():
            control.destroy()

        replayCtrl = BattleReplay.g_replayCtrl
        if replayCtrl.isRecording:
            replayCtrl.setPlayerVehicleID(0)
        if self.__remoteCameraSender is not None:
            self.__remoteCameraSender.destroy()
            self.__remoteCameraSender = None
        self.onCameraChanged.clear()
        self.onCameraChanged = None
        self.onPostmortemVehicleChanged.clear()
        self.onPostmortemVehicleChanged = None
        self.onPostmortemKillerVisionEnter.clear()
        self.onPostmortemKillerVisionEnter = None
        self.onPostmortemKillerVisionExit.clear()
        self.onPostmortemKillerVisionExit = None
        self.__targeting.enable(False)
        self.__killerVehicleID = None
        if self.__onRecreateDevice in g_guiResetters:
            g_guiResetters.remove(self.__onRecreateDevice)
        BigWorld.player().arena.onPeriodChange -= self.__onArenaStarted
        self.settingsCore.onSettingsChanged -= self.__onSettingsChanged
        BigWorld.player().consistentMatrices.onVehicleMatrixBindingChanged -= self.__onVehicleChanged
        ScriptGameObject.destroy(self)
        CallbackDelayer.destroy(self)
        return
 def __init__(self, spaceId, vEntity):
     ScriptGameObject.__init__(self, vEntity.spaceID)
     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.shadowManager = 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
     return
Beispiel #4
0
 def __init__(self):
     CallbackDelayer.__init__(self)
     ScriptGameObject.__init__(self, BigWorld.player().spaceID)
     self.__alwaysShowAimKey = None
     self.__showMarkersKey = None
     sec = self._readCfg()
     self.onCameraChanged = Event()
     self.onPostmortemVehicleChanged = Event()
     self.onPostmortemKillerVisionEnter = Event()
     self.onPostmortemKillerVisionExit = Event()
     self.__isArenaStarted = False
     self.__isStarted = False
     self.__targeting = _Targeting()
     self.__vertScreenshotCamera = _VertScreenshotCamera()
     self.__ctrls = dict()
     self.__killerVehicleID = None
     self.__isAutorotation = True
     self.__prevModeAutorotation = None
     self.__isSPG = False
     self.__isATSPG = False
     self.__isDualGun = False
     self.__isMagnetAimEnabled = False
     self.__setupCtrls(sec)
     self.__curCtrl = self.__ctrls[_CTRLS_FIRST]
     self.__ctrlModeName = _CTRLS_FIRST
     self.__isDetached = False
     self.__waitObserverCallback = None
     self.__observerVehicle = None
     self.__observerIsSwitching = False
     self.__commands = []
     self.__detachedCommands = []
     self.__remoteCameraSender = None
     self.__isGUIVisible = False
     return
Beispiel #5
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 = 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
Beispiel #6
0
 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
Beispiel #7
0
 def activate(self):
     ScriptGameObject.activate(self)
     self.model.compoundModel.position = self.__dropPoint
     self.model.compoundModel.matrix = self.descendSimulator.matrix
     self.landingAnimation.bindToCompound(self.model.compoundModel)
     self.landingAnimation.start()
     self.delayCallback(
         self.__descendTime + self.LANDING_ANIMATION_TRIGGER_OFFSET,
         self.__animateLanding)
 def __init__(self):
     BigWorld.Entity.__init__(self)
     ScriptGameObject.__init__(self, self.spaceID)
     ISelectableObject.__init__(self)
     self.__enabled = True
     self.__edged = False
     self.__clickSound = None
     self.model = None
     return
Beispiel #9
0
 def destroy(self):
     if self.inactiveCargo is not None:
         self.inactiveCargo.stopLoading = True
         self.inactiveCargo.destroy()
     self.inactiveCargo = None
     if self.cargo:
         self.cargo.stopLoading = True
     ScriptGameObject.destroy(self)
     CallbackDelayer.destroy(self)
     return
 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 __init__(self, dropID, deliveryPosition, deliveryTime):
     ScriptGameObject.__init__(self, BigWorld.player().spaceID)
     CallbackDelayer.__init__(self)
     self.owner = Svarog.GameObject(BigWorld.player().spaceID)
     self.owner.activate()
     self.owner.addComponent(self)
     Svarog.addGameObject(BigWorld.player().spaceID, self.owner)
     self.id = dropID
     self.deliveryPosition = deliveryPosition
     self.deliveryTime = deliveryTime + BigWorld.time(
     ) - BigWorld.serverTime()
     self.onFlightEnd = Event()
Beispiel #12
0
 def __init__(self, arena, bonusType, arenaType):
     ScriptGameObject.__init__(self, 0)
     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()
 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 = prereqs['collisionAssembler']
         collisionData = ((0, self.model.matrix), )
         self.collisions.connect(self.id, ColliderTypes.DYNAMIC_COLLIDER,
                                 collisionData)
     ScriptGameObject.activate(self)
Beispiel #14
0
 def onLeaveWorld(self):
     LOG_DEBUG('onLeaveWorld')
     ScriptGameObject.deactivate(self)
     ScriptGameObject.destroy(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
Beispiel #15
0
 def __init__(self):
     ScriptGameObject.__init__(self, self.spaceID)
     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 __reload(self, vDesc, vState, outfit):
     self.__clearModelAnimators()
     self.__loadState.unload()
     if self.fashion is not None:
         self.fashion.removePhysicalTracks()
     ScriptGameObject.deactivate(self)
     self.tracks = None
     self.collisionObstaclesCollector = None
     self.tessellationCollisionSensor = None
     self.shadowManager = VehicleShadowManager()
     self.shadowManager.updatePlayerTarget(None)
     self.__outfit = outfit
     self.__startBuild(vDesc, vState)
     return
 def __init__(self, dropID, deliveryPosition, teamID, yawAxis):
     self.__spaceID = BigWorld.player().spaceID
     ScriptGameObject.__init__(self, self.__spaceID)
     CallbackDelayer.__init__(self)
     self.owner = Svarog.GameObject(self.__spaceID)
     self.owner.activate()
     self.owner.addComponent(self)
     Svarog.addGameObject(self.__spaceID, self.owner)
     self.__deliveryPosition = deliveryPosition
     self.__markerArea = None
     self.__deliveryEffect = None
     self.__teamID = teamID
     self.__yawAxis = yawAxis
     self.__plannedAnimDuration = 0.0
     return
 def __init__(self, spaceID):
     ScriptGameObject.__init__(self, spaceID)
     self._vehicle = None
     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._vehicleStickers = None
     self.__vID = 0
     self.__renderState = None
     self.__frameTimestamp = 0
     self.__periodicTimerID = None
     return
 def destroy(self):
     if self.fashion is not None:
         self.fashion.removePhysicalTracks()
     if self.shadowManager is not None:
         self.shadowManager.updatePlayerTarget(None)
     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.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 #20
0
 def destroy(self):
     ScriptGameObject.destroy(self)
     CallbackDelayer.destroy(self)
Beispiel #21
0
 def destroy(self):
     ScriptGameObject.destroy(self)
     self._onUpdate.clear()
     self.__syncDataObjects.clear()