Пример #1
0
        void RunLightningJoke()
        {
            if (newFlight)
            {
                if (bubble == null)
                {
                    GUIStyle txt = new GUIStyle(GUI.skin.label);
                    txt.normal.textColor = Color.black;
                    txt.alignment        = TextAnchor.MiddleCenter;
                    bubble = new SpeechBubble(txt);
                    bubble.bubbleHeight = 100;
                    bubble.offsetY      = 75;
                    bubble.offsetX      = 50;
                    bubble.bubbleWidth  = 250;
                }

                if (vessel.missionTime > 10 && vessel.missionTime < 13)
                {
                    DrawLightning();

                    if (!lightningSound.isPlaying)
                    {
                        lightningSound.Play();
                    }

                    if (vessel.missionTime > 11 && !lockedControls)
                    {
                        LockControls();
                        lockedControls = true;
                    }
                }
                else
                {
                    if (vessel.missionTime > 14 && !startedTutorial)
                    {
                        tutorial.StartTutorial();
                        startedTutorial = true;
                    }

                    if ((vessel.GetCrewCount() > 0) && (vessel.missionTime > 18) && (vessel.missionTime < 22))
                    {
                        bubble.drawBubble(new Vector2(vessel.GetVesselCrew()[0].KerbalRef.screenPos.x + (vessel.GetVesselCrew()[0].KerbalRef.avatarSize / 2), vessel.GetVesselCrew()[0].KerbalRef.screenPos.y), "KSC, the controls are all locked up!\nThat lightning took them out!", Color.white);
                    }

                    if (vessel.missionTime > 18 && !disabledSelf)
                    {
                        core.GetComputerModule <MechJebModuleJokeObscurePanel>().enabled = false;
                        core.GetComputerModule <MechJebModuleJokeObscurePanel>().hidden  = false;
                        disabledSelf = true;
                    }

                    if ((vessel.GetCrewCount() > 0) && (!core.GetComputerModule <MechJebModuleJokeObscurePanel>().t4) && (vessel.missionTime > 24))
                    {
                        bubble.drawBubble(new Vector2(vessel.GetVesselCrew()[0].KerbalRef.screenPos.x + (vessel.GetVesselCrew()[0].KerbalRef.avatarSize / 2), vessel.GetVesselCrew()[0].KerbalRef.screenPos.y), "Set SCE to AUX on the Obscure Control Panel!", Color.white);
                    }
                }
            }
        }
 public override void drawGUI(int baseWindowID)
 {
     if (goToBeach && (part.vessel.rootPart.protoModuleCrew.Count > 0))
     {
         if (bubble == null)
         {
             GUIStyle txt = new GUIStyle(GUI.skin.label);
             txt.normal.textColor = Color.black;
             txt.alignment        = TextAnchor.MiddleCenter;
             bubble = new SpeechBubble(txt);
         }
         bubble.drawBubble(new Vector2(part.vessel.rootPart.protoModuleCrew[0].KerbalRef.screenPos.x + (part.vessel.rootPart.protoModuleCrew[0].KerbalRef.avatarSize / 2), part.vessel.rootPart.protoModuleCrew[0].KerbalRef.screenPos.y), "Let's go to the beach!", Color.white);
     }
 }