Example #1
0
        public static void BadOrbit(int FGIAvoid)
        {
            print("[BMSHyperdrive]: Activating BMSHyperdrive.BadStuff.BadOrbit. Cleverly inventing new destination.");
            ScreenMessages.PostScreenMessage("Unfortunately, your jump drive malfunctioned, and it will now be taking you to anywhere but your destination.", 7, ScreenMessageStyle.UPPER_CENTER);
            List <CelestialBody> Bodies = FlightGlobals.Bodies;

            System.Random rnd       = new System.Random();
            int           TargetFGI = rnd.Next(1, Bodies.Count);

            if (TargetFGI != FGIAvoid)
            {
                WarpDriver.MedTechWarp(Bodies[TargetFGI], 1200000);
            }
            else
            {
                int NewTarget = rnd.Next(1, Bodies.Count);
                if (NewTarget == FGIAvoid)
                {
                    print("[IID]: Error. Could not go to anywhere but the target. Unexisting vessel.");
                    ScreenMessages.PostScreenMessage("The infinite improbability drive has failed, and will now unexist you.", 7, ScreenMessageStyle.UPPER_CENTER);
                    Unexist();
                }
                else
                {
                    WarpDriver.MedTechWarp(Bodies[FGIAvoid], 1200000);
                }
            }
        }
Example #2
0
        public virtual void BMSHyperdrive()
        {
            try
            {
                float RandomLimitValue = (PlanetCount + 1);
                print("[BMSHyperdrive]: Bodies loaded. Number of bodies: " + PlanetCount + ".");

                if (Bodies[TargetFGI] != null)
                {
                    print(Utils.Log("starting. Jumping to body: " + Bodies[TargetFGI] + "."));
                    ScreenMessages.PostScreenMessage(Utils.Log("starting.Jumping to body: " + Bodies[TargetFGI] + "."), 5, ScreenMessageStyle.UPPER_CENTER);
                    WarpDriver.LowTechWarp(Bodies[TargetFGI], timeError);
                }
                else
                {
                    Debug.LogError("Exception: List " + Bodies + "Contains no instance of an object with type CelestialBody at list place " + TargetFGI + ".");
                    ScreenMessages.PostScreenMessage("Sorry, the BMSHyperdrive cannot jump to that location. We also cannot open the pod bay doors. Blame the engineers.", 5, ScreenMessageStyle.UPPER_CENTER);
                    throw new NullReferenceException();
                    return;
                }
            }
            catch (NullReferenceException nre)
            {
                Debug.LogError(nre.Message);
                Debug.LogError("List " + Bodies + "Contains no instance of an object with type CelestialBody at list place " + TargetFGI + ".");
            }
        }
Example #3
0
        public virtual void BackHomeDrive()
        {
            List <CelestialBody> Bodies = FlightGlobals.Bodies;

            ScreenMessages.PostScreenMessage("[BMSHyperdrive]: starting.Jumping to body: " + Bodies[1] + ".", 5, ScreenMessageStyle.UPPER_CENTER);
            WarpDriver.LowTechWarp(Bodies[1], 23000);
        }
Example #4
0
        public virtual void BMSHyperdrive()
        {
            List <CelestialBody> Bodies = FlightGlobals.Bodies;
            int   PlanetCount           = Bodies.Count;
            float RandomLimitValue      = (PlanetCount + 1);

            print(Utils.Log("Bodies loaded. Number of bodies: " + PlanetCount + "."));
            System.Random rnd            = new System.Random();
            int           TargetFGI      = rnd.Next(1, PlanetCount);
            int           ProbabilityGen = rnd.Next(1, (int)Unexistor2);

            if (ProbabilityGen == 32 && settings.allowExistFail)
            {
                BadStuff.Unexist();
            }
            if (ProbabilityGen == 73 && settings.allowKerbalDeath)
            {
                BadStuff.CrewDie();
            }
            if (ProbabilityGen == 42 && settings.allowBadOrbit)
            {
                BadStuff.BadOrbit(TargetFGI);
            }
            else
            {
                if (Bodies[TargetFGI] != null)
                {
                    print(Utils.Log("starting. Jumping to body: " + Bodies[TargetFGI] + "."));
                    ScreenMessages.PostScreenMessage("BMSHyperdrive starting.Jumping to body: " + Bodies[TargetFGI] + ".", 5, ScreenMessageStyle.UPPER_CENTER);
                    WarpDriver.MedTechWarp(Bodies[TargetFGI], timeError);
                }
                else
                {
                    Debug.Log(Utils.Log("NullReferenceException: List " + Bodies + "Contains no instance of an object of type CelestialBody at index " + TargetFGI + "."));
                    ScreenMessages.PostScreenMessage("Sorry, the BMSHyperdrive cannot jump to that location. We also cannot open the pod bay doors. Blame the engineers.", 5, ScreenMessageStyle.UPPER_CENTER);
                    NullRef();
                    return;
                }
            }
        }
Example #5
0
        public virtual void BMSHyperdrive()
        {
            List <CelestialBody> Bodies = FlightGlobals.Bodies;
            int PlanetCount             = Bodies.Count;
            int RandomLimiter           = (PlanetCount + 1);

            print(Utils.Log("Bodies loaded. Number of bodies: " + PlanetCount + "."));
            System.Random rnd = new System.Random();
            //Linux is the best- TMSP
            int TargetFGI = rnd.Next(1, RandomLimiter);

            if (Bodies[TargetFGI] != null)
            {
                ScreenMessages.PostScreenMessage("BMSHyperdrive starting.Jumping to body: " + Bodies[TargetFGI] + ".", 5, ScreenMessageStyle.UPPER_CENTER);
                print(Utils.Log("starting. Jumping to body: " + Bodies[TargetFGI] + "."));
                WarpDriver.MedTechWarp(Bodies[TargetFGI], timeError);
            }
            else
            {
                ScreenMessages.PostScreenMessage("Sorry, the BMSHyperdrive cannot jump to that location. We also cannot open the pod bay doors. Blame the engineers.", 5, ScreenMessageStyle.UPPER_CENTER);
                NullRef();
                return;
            }
        }
Example #6
0
        public virtual void Eeloo()
        {
            List <CelestialBody> Bodies = FlightGlobals.Bodies;

            WarpDriver.MedTechWarp(Bodies[16], 23000);
        }
Example #7
0
        public virtual void NobodyLikesDres()
        {
            List <CelestialBody> Bodies = FlightGlobals.Bodies;

            WarpDriver.MedTechWarp(Bodies[15], 23000);
        }
Example #8
0
        public virtual void ThatOneSpeck()
        {
            List <CelestialBody> Bodies = FlightGlobals.Bodies;

            WarpDriver.MedTechWarp(Bodies[13], 23000);
        }
Example #9
0
        public virtual void BoppingBop()
        {
            List <CelestialBody> Bodies = FlightGlobals.Bodies;

            WarpDriver.MedTechWarp(Bodies[11], 23000);
        }
Example #10
0
        public virtual void JoolIsCool()
        {
            List <CelestialBody> Bodies = FlightGlobals.Bodies;

            WarpDriver.MedTechWarp(Bodies[8], 23000);
        }
Example #11
0
        public virtual void ILikeIke()
        {
            List <CelestialBody> Bodies = FlightGlobals.Bodies;

            WarpDriver.MedTechWarp(Bodies[7], 23000);
        }
Example #12
0
        public virtual void BackHomeDrive()
        {
            List <CelestialBody> Bodies = FlightGlobals.Bodies;

            WarpDriver.MedTechWarp(Bodies[1], 23000);
        }