コード例 #1
0
 public void onAnimationStateChange(ROLAnimState newState)
 {
     if (newState == ROLAnimState.STOPPED_END && HighLogic.LoadedSceneIsFlight)
     {
         engineModule.Activate();
     }
 }
コード例 #2
0
        public void ActionActivate(KSPActionParam param)
        {
            if (!currentModuleEngine.getIgnitionState)
            {
                currentModuleEngine.Activate();
            }

            currentEngineState = currentModuleEngine.getIgnitionState;
            //Debug.Log("Action currentModuleEngine.Activate(): " + ChooseOption + " new state is: " + currentEngineState);
        }
コード例 #3
0
        public void deployEngineEvent()
        {
            AnimState state = animationControl.getAnimationState();

            if (state != AnimState.STOPPED_END)
            {
                setAnimationState(AnimState.PLAYING_FORWARD);
            }
            else
            {
                engineModule.Activate();
            }
            setupGuiFields(animationControl.getAnimationState(), engineModule.EngineIgnited);
        }
コード例 #4
0
ファイル: JetWing.cs プロジェクト: Bear67/Pathfinder
        public override void OnUpdate()
        {
            base.OnUpdate();

            if (Input.GetKeyDown(KeyCode.Z) && engineActivated == false)
            {
                engine.Activate();
                engine.currentThrottle = 1.0f;
                engineActivated        = true;
            }

            if (engineActivated)
            {
                engine.currentThrottle = 1.0f;
            }

            if (Input.GetKeyDown(KeyCode.X))
            {
                engine.currentThrottle = 0f;
                engine.Shutdown();
                engineActivated = false;
            }

            if (Input.GetKey(KeyCode.T))
            {
                part.vessel.ActionGroups.SetGroup(KSPActionGroup.SAS, true);
            }
        }
コード例 #5
0
        public void SetupEngine(int engineIndex, bool isInFlight)
        {
            ModuleEnginesFX previousEngine = currentEngine;

            //Get the new current engine
            currentEngineIndex = engineIndex;
            currentEngine      = engineList[currentEngineIndex];
            currentEngineID    = currentEngine.engineID;

            int count = engineList.Count;

            for (int index = 0; index < count; index++)
            {
                engineList[index].manuallyOverridden = true;
                engineList[index].isEnabled          = false;
                engineList[index].Shutdown();
            }

            //In-flight stuff
            if (isInFlight)
            {
                currentEngine.Activate();
                currentEngine.currentThrottle = previousEngine.currentThrottle;
            }

            //Enable current engine
            currentEngine.manuallyOverridden = false;
            currentEngine.isEnabled          = true;
        }
コード例 #6
0
        public void SetupEngine(int engineIndex, bool isInFlight)
        {
            ModuleEnginesFX previousEngine = currentEngine;

            //Get the new current engine
            currentEngineIndex = engineIndex;
            currentEngine      = engineList[currentEngineIndex];
            currentEngineID    = currentEngine.engineID;

            //In-flight stuff
            if (isInFlight)
            {
                currentEngine.Activate();
                currentEngine.currentThrottle = previousEngine.currentThrottle;
                previousEngine.Shutdown();
            }

            //Disable previous engine
            previousEngine.manuallyOverridden = true;
            previousEngine.isEnabled          = false;

            //Enable current engine
            currentEngine.manuallyOverridden = false;
            currentEngine.isEnabled          = true;
        }
コード例 #7
0
ファイル: Nosecone.cs プロジェクト: Jurld/PebkacLaunchEscape2
 internal void Abort()
 {
     if (_pitchEngine != null)
     {
         _pitchEngine.Activate();
         Debug.Log(string.Format("{0} Pitch control engine fired!", _myModTag));
     }
 }
コード例 #8
0
 internal void Abort()
 {
     if (_escapeEngine != null)
     {
         _escapeEngine.Activate();
         Debug.Log(string.Format("{0} Escape motor fired!", _myModTag));
     }
 }
コード例 #9
0
        public override void OnUpdate()
        {
            if (!engineIsFX)
            {
                engineIsOn = modEng.EngineIgnited;
            }
            else
            {
                engineIsOn = modEngFX.EngineIgnited;
            }


            foreach (var anim in engineStates)
            {
                if (engineIsOn && anim.normalizedTime < WaitForAnimation)
                {
                    anim.speed = 1;
                    if (engineIsFX)
                    {
                        modEngFX.Shutdown();
                    }
                    else
                    {
                        modEng.Shutdown();
                    }
                }


                if (anim.normalizedTime >= WaitForAnimation && anim.speed > 0)
                {
                    if (engineIsFX)
                    {
                        modEngFX.Activate();
                    }
                    else
                    {
                        modEng.Activate();
                    }
                }

                if (anim.normalizedTime >= 1)
                {
                    anim.speed          = 0;
                    anim.normalizedTime = 1;
                }

                if (anim.normalizedTime >= 1 && !engineIsOn)
                {
                    anim.speed = -1;
                }

                if (anim.normalizedTime < 0)
                {
                    anim.speed          = 0;
                    anim.normalizedTime = 0;
                }
            }
        }
コード例 #10
0
ファイル: Jettison.cs プロジェクト: Jurld/PebkacLaunchEscape2
 internal void Jettison()
 {
     if (_jettisonEngine != null)
     {
         // fire the jettison motor
         _jettisonEngine.Activate();
         Debug.Log(string.Format("{0} LES jettison engine fired!", _myModTag));
     }
 }
コード例 #11
0
        /// <summary>
        /// Tells the controller to start the engine.
        /// </summary>
        public virtual void StartEngine()
        {
            getCurrentEngine();
            if (engine == null)
            {
                return;
            }

            engine.Activate();
        }
コード例 #12
0
 public override void OnActive()
 {
     if (animationModule.animState == ROLAnimState.STOPPED_END)
     {
         engineModule?.Activate();
     }
     else
     {
         DeployEngineEvent();
         if (engineModule && engineModule.EngineIgnited)
         {
             engineModule.Shutdown();
         }
     }
 }
コード例 #13
0
        public void Activate()
        {
            switch (engineType)
            {
            case EngineType.Engine:
                engineModule.Activate();
                break;

            case EngineType.EngineFx:
                engineModuleFx.Activate();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
コード例 #14
0
 public void Timelon(float tiempo)
 {
     timer += Time.deltaTime;
     if (timer < tiempo)
     {
         deployed = false;
         motor.Shutdown();
     }
     if (timer >= tiempo)
     {
         motor.Activate();
         deployed = true;
         sale     = true;
         enespera = false;
         timer    = 0;
     }
 }
コード例 #15
0
 private void activateEngine()
 {
     if (engineSwitch != null)
     {
         engineSwitch.Events["ModeEvent"].Invoke();
         String          id    = engineSwitch.secondaryEngineID;
         ModuleEnginesFX engFx = null;
         foreach (PartModule module in part.Modules)
         {
             engFx = module as ModuleEnginesFX;
             if (engFx != null && engFx.engineID == id)
             {
                 engFx.Activate();
             }
         }
     }
 }
コード例 #16
0
        public override void RepairPart()
        {
            engine = part.FindModuleImplementing <ModuleEngines>();
            if (engine == null)
            {
                engineFX = part.FindModuleImplementing <ModuleEnginesFX>();
            }
            switch (failureType)
            {
            case "Fuel Flow Failure":
                if (engine != null)
                {
                    engine.Activate();
                }
                else
                {
                    engineFX.Activate();
                }
                Debug.Log("[UPFM]: Re-activated " + SYP.ID);
                break;

            case "Underthrust":
                if (engine != null)
                {
                    engine.thrustPercentage = 100;
                }
                else
                {
                    engineFX.thrustPercentage = 100;
                }
                Debug.Log("[UPFM]: Reset Thrust on " + SYP.ID);
                break;

            case "Gimbal Failure":
                gimbal.gimbalLock = false;
                break;

            case "Fuel Line Leak":
                CancelInvoke("LeakFuel");
                break;

            default:
                return;
            }
        }
コード例 #17
0
ファイル: EngineValue.cs プロジェクト: silky/KOS
        private bool SetEngineFxSuffix(string suffixName, object value, ModuleEnginesFX moduleEnginesFx)
        {
            switch (suffixName)
            {
            case "ACTIVE":
                var activate = Convert.ToBoolean(value);
                if (activate)
                {
                    moduleEnginesFx.Activate();
                }
                else
                {
                    moduleEnginesFx.Shutdown();
                }
                return(true);

            case "THRUSTLIMIT":
                var throttlePercent = (float)Convert.ToDouble(value);
                moduleEnginesFx.thrustPercentage = throttlePercent;
                return(true);
            }
            return(base.SetSuffix(suffixName, value));
        }
コード例 #18
0
 public void ActivateAction(KSPActionParam param)
 {
     currentEngine.Activate();
 }
コード例 #19
0
ファイル: EngineValue.cs プロジェクト: vosechu/KOS
 private bool SetEngineFxSuffix(string suffixName, object value, ModuleEnginesFX moduleEnginesFx)
 {
     switch (suffixName)
     {
         case "ACTIVE":
             var activate = (bool) value;
             if (activate)
             {
                 moduleEnginesFx.Activate();
             }
             else
             {
                 moduleEnginesFx.Shutdown();
             }
             return true;
         case "THRUSTLIMIT":
             var throttlePercent = (float) value;
             moduleEnginesFx.thrustPercentage = throttlePercent;
             return false;
     }
     return base.SetSuffix(suffixName, value);
 }