コード例 #1
0
        public override void OnStart(StartState stat)
        {
            if (HighLogic.LoadedSceneIsEditor)
            {
                if (!ModSegSRBs.PartAvailable(ModSegSRBs.ParachuteTechName))
                {
                    Events["DisableParachute"].guiActiveEditor = false;
                    disableParachute = true;
                }

                if (!ModSegSRBs.PartAvailable(ModSegSRBs.MFCTechName))
                {
                    Events["DisableMFC"].guiActiveEditor = false;
                    disableMFC = true;
                }

                Log.Info("OnStart, (" + ModSegSRBs.PPTechName + "): " + ModSegSRBs.PartAvailable(ModSegSRBs.PPTechName));
                if (!ModSegSRBs.PartAvailable(ModSegSRBs.PPTechName))
                {
                    Events["DisablePP"].guiActiveEditor = false;
                    disablePP = true;
                }
            }
            part.RestoreVariant();
            base.OnStart(stat);
        }
コード例 #2
0
 void Start()
 {
     Log.Info("Start");
     if (HighLogic.LoadedSceneIsEditor || HighLogic.LoadedSceneIsFlight)
     {
         techPartResearched = ModSegSRBs.PartAvailable(ModSegSRBs.PPTechName);
         Log.Info("Start, techPartResearched(" + ModSegSRBs.PPTechName + "): " + techPartResearched);
         if (!techPartResearched)
         {
             // remove the fuel since it isn't being used
             if (this.part != null)
             {
                 PartResourceList prl = this.part.Resources;
                 if (prl.Contains(ModSegSRBs.SeparatronFuel))
                 {
                     part.RemoveResource(ModSegSRBs.SeparatronFuel);
                 }
             }
             if (HighLogic.LoadedScene != GameScenes.LOADING && HighLogic.LoadedScene != GameScenes.EDITOR)
             {
                 Log.Info(ModSegSRBs.PPTechName + ", not researched yet");
                 part.RemoveModule(this);
             }
         }
         else
         {
             Log.Info(ModSegSRBs.PPTechName + " researched");
         }
     }
 }
コード例 #3
0
        public float GetModuleCost(float defaultCost, ModifierStagingSituation sit)
        {
            float cost  = 0;
            float chute = 0;
            float MFT   = 0;
            float PP    = 0;

            if (part == null)
            {
                return(0);
            }

            if (!disableParachute && ModSegSRBs.PartAvailable(ModSegSRBs.ParachuteTechName))
            {
                chute = 422;
                if (part.segmentWidth > 0.725)
                {
                    chute = 1688;
                }
                if (part.segmentWidth > 1.35)
                {
                    chute = 3798;
                }
                if (part.segmentWidth > 1.975)
                {
                    chute = 6752;
                }
            }

            if (!disableMFC && ModSegSRBs.PartAvailable(ModSegSRBs.MFCTechName))
            {
                MFT = 300;
            }

            if (!disablePP && ModSegSRBs.PartAvailable(ModSegSRBs.PPTechName))
            {
                PP = 9;
                if (part.segmentWidth > 0.725)
                {
                    PP = 75;
                }
                if (part.segmentWidth > 1.35)
                {
                    PP = 600;
                }
                if (part.segmentWidth > 1.975)
                {
                    PP = 4800;
                }
            }

            cost = chute + MFT + PP;
            return(cost);
        }
コード例 #4
0
 void Start()
 {
     techPartResearched = ModSegSRBs.PartAvailable(ModSegSRBs.ParachuteTechName);
     if (!techPartResearched)
     {
         if (HighLogic.LoadedScene != GameScenes.LOADING)
         {
             Log.Info(ModSegSRBs.ParachuteTechName + ", not researched yet");
             part.RemoveModule(this);
         }
     }
     else
     {
         Log.Info(ModSegSRBs.ParachuteTechName + "researched");
     }
 }