GetThrustLimiterFraction() публичный Метод

public GetThrustLimiterFraction ( ) : float
Результат float
Пример #1
0
        public void OverriddenFixedUpdate()
        {
            if (HighLogic.LoadedScene == GameScenes.FLIGHT)
            {
                if (UIName == "")
                {
                    UIName = part.partInfo.title;
                }
                if (FollowThrottle)
                {
                    if (reactorEngine != null)
                    {
                        ActualPowerPercent = Math.Max(throttleCurve.Evaluate(100 * this.vessel.ctrlState.mainThrottle * reactorEngine.GetThrustLimiterFraction()), CurrentPowerPercent);
                    }
                }
                else
                {
                    ActualPowerPercent = CurrentPowerPercent;
                }

                // Update reactor core integrity readout
                if (CoreIntegrity > 0)
                {
                    CoreStatus = String.Format("{0:F2} %", CoreIntegrity);
                }
                else
                {
                    CoreStatus = Localizer.Format("#LOC_NFElectrical_ModuleFissionReactor_Field_CoreStatus_Meltdown");
                }


                // Handle core damage tracking and effects
                HandleCoreDamage();
                // Heat consumption occurs if reactor is on or off
                DoHeatConsumption();

                // IF REACTOR ON
                // =============
                if (base.ModuleIsActive())
                {
                    if (TimewarpShutdown && TimeWarp.fetch.current_rate_index >= TimewarpShutdownFactor)
                    {
                        ToggleResourceConverterAction(new KSPActionParam(0, KSPActionType.Activate));
                    }

                    DoFuelConsumption();
                    DoHeatGeneration();
                }
                // IF REACTOR OFF
                // =============
                else
                {
                    // Update UI
                    if (CoreIntegrity <= 0f)
                    {
                        FuelStatus    = Localizer.Format("#LOC_NFElectrical_ModuleFissionReactor_Field_FuelStatus_Meltdown");
                        ReactorOutput = Localizer.Format("#LOC_NFElectrical_ModuleFissionReactor_Field_ReactorOutput_Meltdown");
                    }
                    else
                    {
                        FuelStatus    = Localizer.Format("#LOC_NFElectrical_ModuleFissionReactor_Field_FuelStatus_Offline");
                        ReactorOutput = Localizer.Format("#LOC_NFElectrical_ModuleFissionReactor_Field_ReactorOutput_Offline");
                    }
                }
                lastTimeWarpMult = TimeWarp.CurrentRate;
            }
        }
Пример #2
0
        public override void OnFixedUpdate()
        {
            base.OnFixedUpdate();
            if (HighLogic.LoadedScene == GameScenes.FLIGHT)
            {
                if (FollowThrottle)
                {
                    if (reactorEngine != null)
                    {
                        ActualPowerPercent = Math.Max(throttleCurve.Evaluate(100 * this.vessel.ctrlState.mainThrottle * reactorEngine.GetThrustLimiterFraction()), CurrentPowerPercent);
                    }
                }
                else
                {
                    ActualPowerPercent = CurrentPowerPercent;
                }

                // Update reactor core integrity readout
                if (CoreIntegrity > 0)
                {
                    CoreStatus = String.Format("{0:F2} %", CoreIntegrity);
                }
                else
                {
                    CoreStatus = "Complete Meltdown";
                }


                // Handle core damage tracking and effects
                HandleCoreDamage();
                // Heat consumption occurs if reactor is on or off
                DoHeatConsumption();

                // IF REACTOR ON
                // =============
                if (base.ModuleIsActive())
                {
                    DoFuelConsumption();
                    DoHeatGeneration();
                }
                // IF REACTOR OFF
                // =============
                else
                {
                    // Update UI
                    if (CoreIntegrity <= 0f)
                    {
                        FuelStatus    = "Core Destroyed";
                        ReactorOutput = "Core Destroyed";
                    }
                    else
                    {
                        FuelStatus    = "Reactor Offline";
                        ReactorOutput = "Reactor Offline";
                    }
                }
                lastTimeWarpMult = TimeWarp.CurrentRate;
            }
        }