protected override void DI_Update() { if (this.HasFailed) { chute.deploymentState = ModuleParachute.deploymentStates.SEMIDEPLOYED; chute.Deploy(); } }
public void Deploy() { if (parachute) { parachute.Deploy(); } else if (realChute.HasEvent("Deploy chute")) { realChute.TriggerEvent("Deploy Chute"); } }
public void DeployChutes() { foreach (var pair in vesselState.parachutes) { Part p = pair.Key; List <ModuleParachute> mlist = p.Modules.GetModules <ModuleParachute>(); for (int i = 0; i < mlist.Count; i++) { ModuleParachute chute = mlist[i]; if (chute.deploymentState == ModuleParachute.deploymentStates.STOWED && chute.deploymentSafeState == ModuleParachute.deploymentSafeStates.SAFE) { chute.Deploy(); } } } }
void DeployParachutes() { if (vesselState.mainBody.atmosphere && deployChutes) { for (int i = 0; i < vesselState.parachutes.Count; i++) { ModuleParachute p = vesselState.parachutes[i]; // what is the ASL at which we should deploy this parachute? It is the actual deployment height above the surface + the ASL of the predicted landing point. double LandingSiteASL = LandingAltitude; double ParachuteDeployAboveGroundAtLandingSite = p.deployAltitude * this.parachutePlan.Multiplier; double ASLDeployAltitude = ParachuteDeployAboveGroundAtLandingSite + LandingSiteASL; if (p.part.inverseStage >= limitChutesStage && p.deploymentState == ModuleParachute.deploymentStates.STOWED && ASLDeployAltitude > vesselState.altitudeASL && p.deploymentSafeState == ModuleParachute.deploymentSafeStates.SAFE) { p.Deploy(); //Debug.Log("Deploying parachute " + p.name + " at " + ASLDeployAltitude + ". (" + LandingSiteASL + " + " + ParachuteDeployAboveGroundAtLandingSite +")"); } } } }
public void FixedUpdate() { if (!HighLogic.LoadedSceneIsFlight) { return; } if (!aborting) { return; } if (vessel.verticalSpeed >= 0) { return; } if (vessel.altitude > drogueChute.deployAltitude) { aborting = false; return; } if (vessel.FindPartModuleImplementing <ModuleBdbMercuryLES>() == null) { if (vessel.radarAltitude < mainChute.deployAltitude) { part.FindModulesImplementing <ModuleDecouple>().FirstOrDefault().Decouple(); mainChute.Deploy(); ModuleBdbMercuryLandingBag bag = vessel.FindPartModuleImplementing <ModuleBdbMercuryLandingBag>(); if (bag != null) { bag.Arm(); } aborting = false; } else if (vessel.radarAltitude < drogueChute.deployAltitude) { drogueChute.Deploy(); } } }
public void Deploy() { parachute.Deploy(); }
//============================================================================================================================================ public void EngageChute() { //FAR Compatibility =) if (assemblyFARUsed == true) { foreach (Part EnabledPart in EnabledPartList) { if (EnabledPart.Modules.Contains ("RealChuteFAR")) { //FerramAerospaceResearch.RealChuteLite.RealChuteFAR RCF = new FerramAerospaceResearch.RealChuteLite.RealChuteFAR (); //RCF = EnabledPart.FindModuleImplementing<FerramAerospaceResearch.RealChuteLite.RealChuteFAR> (); ChuteFARModuleReference = EnabledPart.Modules ["RealChuteFAR"]; PropertyInfo ChuteFARModuleDeploymentState = ChuteFARModuleReference.GetType().GetProperty("deploymentState"); RoboBrakes_ParaEnabledCount++; ChuteFARDeploymentString = ChuteFARModuleReference.Fields.GetValue ("depState").ToString (); //Repack if Chute was already Cut if ((ChuteFARDeploymentString == "CUT") && (IsLanded == false) && (RoboBrakes_CHUTEAUTO == true)) { //Bypassing RealChutes Repacking Method so we don't have to EVA - Also we can't set 'canRepack' bool as it is read only :-/ ChuteFARModuleDeploymentState.SetValue(ChuteFARModuleReference, 1, null); ChuteFARModuleReference.part.Effect ("rcrepack"); ChuteFARModuleReference.part.stackIcon.SetIconColor (XKCDColors.White); ChuteFARModuleReference.part.DragCubes.SetCubeWeight ("PACKED", 1); ChuteFARModuleReference.part.DragCubes.SetCubeWeight ("RCDEPLOYED", 0); print ("ROBOBRAKES - RealChute " + EnabledPart.name + " was already Cut! Repacked Automatically!"); } //Deploy Chute if ((RoboBrakes_CHUTEREADY == true && RoboBrakes_CHUTEAUTO == true)) { RoboBrakes_CHUTEREADY = false; //Deploy Real Chute ChuteFARModuleReference.SendMessage("ActivateRC"); } //Repack Chute Automatically if (ChuteFARDeploymentString == "DEPLOYED" | ChuteFARDeploymentString == "PREDEPLOYED") { if (RoboBrakes_CUTCHUTE == true) { RoboBrakes_CUTCHUTE = false; //Cut Real Chute ChuteFARModuleReference.SendMessage("Cut"); //Bypassing RealChutes Repacking Method so we don't have to EVA - Also we can't set 'canRepack' bool as it is read only :-/ ChuteFARModuleDeploymentState.SetValue(ChuteFARModuleReference, 1, null); ChuteFARModuleReference.part.Effect ("rcrepack"); ChuteFARModuleReference.part.stackIcon.SetIconColor (XKCDColors.White); ChuteFARModuleReference.part.DragCubes.SetCubeWeight ("PACKED", 1); ChuteFARModuleReference.part.DragCubes.SetCubeWeight ("RCDEPLOYED", 0); print ("ROBOBRAKES - RealChute " + EnabledPart.name + " was Cut & Repacked Automatically!"); } } } } } foreach (Part EnabledPart in EnabledPartList) { //Module Parachutes //--------------------------------------------------------------------------------------------------------------------- if (EnabledPart.Modules.Contains ("ModuleParachute")) { ModuleParachute MPA = new ModuleParachute (); MPA = EnabledPart.FindModuleImplementing<ModuleParachute> (); RoboBrakes_ParaEnabledCount++; //Repack the Chute automatically if it has been manually cut if ((MPA.deploymentState.Equals (ModuleParachute.deploymentStates.CUT)) && (IsLanded == false) && (RoboBrakes_CHUTEAUTO == true)) { MPA.Repack (); print ("ROBOBRAKES - Chute " + EnabledPart.name + " was already Cut! Repacked Automatically!"); } //Deploy Chute if ((RoboBrakes_AUTOMATICBRAKE_ACTIVE == true && RoboBrakes_CHUTEAUTO == true)) { if (RoboBrakes_CHUTEREADY == true) { RoboBrakes_CHUTEREADY = false; MPA.Deploy (); } } //Repack Chute if (MPA.deploymentState.Equals (ModuleParachute.deploymentStates.DEPLOYED)) { if (RoboBrakes_CUTCHUTE == true) { RoboBrakes_CUTCHUTE = false; MPA.CutParachute (); MPA.Repack (); print ("ROBOBRAKES - Chute " + EnabledPart.name + " was Cut & Repacked Automatically!"); } } } } }