def __setModel(self, model): if self.__cloud is None or model is None: return else: self.__model = model self.__model.addMotor(BigWorld.Servo(self.__cloud.cloudMatrixProvider)) BigWorld.addModel(self.__model) tintFashion = BattlegroundElements.TintFashion(self.__cloud.tintColorLink) self.__model.fashion = tintFashion return
def __init__(self, mapSettings=None, startTime=None, gasAttackSettings=None, cloudModel=None): if mapSettings is None: mapSettings = _getDefaultMapSettings() if gasAttackSettings is None or startTime is None: startTime, gasAttackSettings = _getDefaultScenario() if not isinstance(mapSettings, GasAttackMapSettings): raise AssertionError soundSettings = mapSettings.soundSettings soundSettings = soundSettings is None and _getSoundSettings( )['soundSettings'] gasCloudSettings = ( gasAttackSettings.position, startTime, mapSettings.cameraProximityDist, gasAttackSettings.compressionTime, gasAttackSettings.startRadius, gasAttackSettings.endRadius, mapSettings.cloudClimbTime, mapSettings.cloudStartHeight, mapSettings.cloudEndHeight, mapSettings.edgeToCenterAngle, mapSettings.edgeToCenterAngleDelta, mapSettings.edgeToCenterDistance, mapSettings.centerSunIntensityDef, mapSettings.centerSunIntensityFwd, mapSettings.edgeSunIntensityDef, mapSettings.edgeSunIntensityFwd, mapSettings.shimmerSettings, mapSettings.centerFogSettings, mapSettings.edgeFogSettings, mapSettings.edgeToCenterFogSettings, soundSettings) self.__cloud = BattlegroundElements.GasCloud(gasCloudSettings) self.__cloud.start() self.__model = None self.model = cloudModel weather = BigWorld.weather(BigWorld.player().spaceID) weather.windAverage(*mapSettings.windSpeed.tuple()) weather.windGustiness(mapSettings.windGustiness) self.__cloud.setProximityCallback(self.__onProximity) self.__started = False self.__gasAttackEffects = GasAttackEffects(mapSettings.vehicleGAEffect, mapSettings.cameraGAEffect, gasAttackSettings.position) if _ENABLE_DEBUG_DRAW: import Flock d = Flock.DebugGizmo(BigWorld.player().spaceID, 'helpers/models/unit_cube.model') d.motor.signal = self.__cloud.cloudMatrixProvider ctrlName = BigWorld.player().inputHandler.ctrlModeName self.__cloud.enableEdgeFogEffects = ctrlName != CTRL_MODE_NAME.POSTMORTEM or BigWorld.player( ).vehicle is not None BigWorld.player( ).inputHandler.onPostmortemVehicleChanged += self.__onPostmortemVehicleChanged return