コード例 #1
0
    void ShowPopup(string phrase)
    {
        if (phase < skipToPhase)
        {
            return;
        }
        if (popupShownThisPhase)
        {
            return;
        }

        if (popup != null)
        {
            popup.Kill();
        }

        popupShownThisPhase = true;

        popup   = new SHGUIview();
        popup.x = 32 - (int)(phrase.Length / 2);
        popup.y = 11;
        AddSubView(popup);

        popup.AddSubView(new SHGUIrect(-1, -1, phrase.Length, 1));
        popup.AddSubView(new SHGUIframe(-1, -1, phrase.Length, 1, 'r'));
        popup.AddSubView(new SHGUItext(phrase, 0, 0, 'r'));
    }
コード例 #2
0
ファイル: SHGUIluasandbox.cs プロジェクト: kubazz/SHTerminal
    //FUNCTIONS

    public void Log(string msg)
    {
        SHGUItempview t = new SHGUItempview(1f);

        t.PunchIn(1f);
        t.overrideFadeOutSpeed = 100000f;
        t.AddSubView(new SHGUItext(msg, 0, 0, 'z'));
        parent.AddSubView(t);
    }
コード例 #3
0
    override public void Update()
    {
        base.Update();

        if (fade < .99f)
        {
            return;
        }

        if (currentView != null && currentView is SHGUIguruchatwindow)
        {
            (currentView as SHGUIguruchatwindow).x = 32 - (int)((currentView as SHGUIguruchatwindow).width / 2);
            (currentView as SHGUIguruchatwindow).y = 11 - (int)((currentView as SHGUIguruchatwindow).height / 2);
        }

        if (Random.value > .97f)
        {
            for (int i = 0; i < 1; ++i)
            {
                SHGUItempview t      = new SHGUItempview(.5f);
                string        number = "0";
                if (Random.value > .5f)
                {
                    number = "1";
                }
                t.AddSubView(new SHGUItext(number, Random.Range(0, 64), Random.Range(0, 24), 'w'));

                background.AddSubView(t);
            }
        }

        background.hidden = true;

        ShowNextItemWhenReady();
    }
コード例 #4
0
ファイル: APPtreedudeintro.cs プロジェクト: kubazz/SHTerminal
    void PreparePrompters()
    {
        prompters        = new SHGUIview();
        prompters.hidden = true;

        SHGUIprompter p1 = new SHGUIprompter(32 - 10, 6, 'w');

        p1.SetInput("^M2HIS NAME IS TREEDUDE");
        prompters.AddSubView(p1);

        SHGUIprompter p2 = new SHGUIprompter(32 - 9, 15, 'w');

        p2.SetInput("^M2^W9AND HIS SONG IS^M1^W2.^W2.^W2.^W7");
        prompters.AddSubView(p2);


        //AddSubView (prompters);
    }
コード例 #5
0
    public APPquit()
    {
        dontDrawViewsBelow = false;

        int width   = 30;
        int textoff = 7;

        SHGUIview container = AddSubView(new SHGUIview());

        container.x = (int)(SHGUI.current.resolutionX / 2) - (int)(width / 2);
        container.y = (int)(SHGUI.current.resolutionY / 2) - 4;

        container.AddSubView(new SHGUIrect(0, 0, width, 4));
        container.AddSubView(new SHGUIframe(0, 0, width, 4, 'r'));
        container.AddSubView(new SHGUItext("SHUTTING DOWN", 1 + textoff, 2, 'r'));
        container.AddSubView(new SHGUILoadingIndicator(16 + textoff, 2, .05f, 'r'));

        quitInstruction = container.AddSubView(new SHGUItext(LocalizationManager.Instance.GetLocalized("CANCEL_INPUT"), width - 3, 4, 'r').GoFromRight());
    }
コード例 #6
0
ファイル: APPtreedudeintro.cs プロジェクト: kubazz/SHTerminal
    void PrepareInstruction()
    {
        instruction = new SHGUIview();

        SHGUIview v2   = new SHGUIview();
        string    ttt2 = "[PRESS ENTER TO START]";

        v2.AddSubView(new SHGUItext(ttt2, 31 - (int)(ttt2.Length / 2), 17, 'w'));
        instruction.AddSubView(v2);
    }
コード例 #7
0
    public APPmindcopy() : base("copy-by-SUPERHOT")
    {
        brain        = SHGUI.current.GetASCIIartByName("Brain");
        cypherBrain1 = SHGUI.current.GetASCIIartByName("CypherBrain1");
        cypherBrain0 = SHGUI.current.GetASCIIartByName("CypherBrain0");

        brainView   = SHGUI.current.GetCenteredAsciiArt("Brain");
        brainView.x = brainViewSideX;
        brainView.y = brainViewSideY;
        //AddSubView (brainView);

        cypherBrainView = SHGUI.current.GetCenteredAsciiArt("CypherBrain01");

        cypherBrainView.x = cypherBrainViewSideX;
        cypherBrainView.y = cypherBrainViewSideY;

        //AddSubView (cypherBrainView);

        memoryFrame            = new SHGUIview();
        memoryFrameGlow        = new SHGUIrect(-2, -2, 13, 6, 'z', ' ', 0);
        memoryFrameGlow.hidden = true;
        memoryFrame.AddSubView(memoryFrameGlow);
        memoryFrameItself = new SHGUIframe(-1, -1, 12, 5, 'z');
        memoryFrame.AddSubView(memoryFrameItself);

        brainCover       = new SHGUIview();
        brainCoverItself = new SHGUIrect(7, 2, 18, 6, 'z', ' ', 0);
        //brainCoverItself = new SHGUIrect (6, 1, 19, 7, 'z', ' ', 0);
        brainCover.AddSubView(brainCoverItself);
        //brainCover.AddSubView (new SHGUIframe (6, 1, 19, 7, 'z'));



        phase    = 0;
        progress = 0;

        APPFRAME.hidden       = true;
        APPINSTRUCTION.hidden = true;
        APPLABEL.hidden       = true;

        //Debug.Log ("brainView: " + brainView.x + ", " + brainView.y);
        //Debug.Log ("cypherBrainView: " + cypherBrainView.x + ", " + cypherBrainView.y);
    }
コード例 #8
0
    public APPtreedude() : base("TREE-DUDE-TREE-DUDE-DUDE-by-piotr")
    {
        //AddSubView (new SHGUItext (SHGUI.current.GetASCIIartByName ("APPtreedudeback"), 0, 0, 'z'));


        timeToDie = timeToDieMax * .5f;
        GenerateDifficulty();

        trees = new List <SHGUIsprite> ();
        dude  = new SHGUIsprite().AddFramesFromFile("APPtreedudedude", 6);
        AddSubView(dude);


        AddTreeOnTop(true);
        AddTreeOnTop(true);
        AddTreeOnTop(true);

        for (int i = 0; i < 10; ++i)
        {
            AddTreeOnTop(false);
            AddTreeOnTop(true);
        }

        timeToDieBar = new SHGUIprogressbar(20, 3, 21, "", "").SetBlinkingLabel("WATCH-TIME!", .2f);
        timeToDieBar.SetStyle("z█z░z█");
        AddSubView(timeToDieBar);

        tutorialView = new SHGUIview();
        AddSubView(tutorialView);

        SHGUIblinkview b1        = new SHGUIblinkview(.75f).SetFlipped();
        int            tutorialy = 15;

        b1.AddSubView(new SHGUItext("CHOP-LEFT-->", 13, tutorialy, 'w'));
        tutorialView.AddSubView(b1);

        SHGUIblinkview b2 = new SHGUIblinkview(.75f).SetFlipped();

        b2.AddSubView(new SHGUItext("<--CHOP-RIGHT", 40, tutorialy, 'w'));
        tutorialView.AddSubView(b2);
    }
コード例 #9
0
        private void CreateRestartingView()
        {
            string display = "";

            switch (action)
            {
            case Action.ResetSecrets:
                display = "Secrets Resetted !";
                break;

            case Action.ResetStory:
                display = "Story Resetted !";
                break;

            case Action.ResetAll:
                display = "Save DESTROYED !";
                break;
            }

            int sizeX = 30;
            int sizeY = 6;

            guiRestarting = AddSubView(new SHGUIview());

            guiRestarting.x = SHGUI.current.resolutionX / 2 - sizeX / 2;
            guiRestarting.y = SHGUI.current.resolutionY / 2 - sizeY;

            guiRestarting.AddSubView(new SHGUIrect(0, 0, sizeX, sizeY, '0', ' ', 2));
            guiRestarting.AddSubView(new SHGUIframe(0, 0, sizeX, sizeY, 'r', null));

            guiRestarting.AddSubView(new SHGUItext(display, (sizeX - display.Length) / 2, 2, 'r', false));
            guiRestarting.AddSubView(new SHGUItext("Restarting piOs ...", (sizeX - 19) / 2, 4, 'r', false));

            guiRestarting.AddSubView(new SHGUILoadingIndicator(sizeX - 3, 4, 0.05f, 'r'));

            timer = 0;
        }
コード例 #10
0
ファイル: SHGUIprogressbar.cs プロジェクト: kubazz/SHTerminal
    public SHGUIprogressbar SetBlinkingLabel(string label, float blinkTime)
    {
        if (labelView != null)
        {
            labelView.KillInstant();
        }

        SHGUIview top = AddSubView(new SHGUIview());
        SHGUIview b   = top.AddSubView(new SHGUIblinkview(blinkTime));

        b.AddSubView(new SHGUItext(label, (int)((length + 2) / 2 - label.Length / 2) + 1, 0, 'w'));

        labelView = top;

        return(this);
    }
コード例 #11
0
ファイル: APPtreedudeintro.cs プロジェクト: kubazz/SHTerminal
    void PrepareFinalAnimation()
    {
        finalAnimation = new SHGUIview();

        SHGUIsprite s = new SHGUIsprite();

        s.x = 32 - 11;
        s.y = 8;

        TreeDudeSequence(s, "TT|| D|0| TT|| D| D|");
        TreeDudeSequence(s, "TT|| D|2| TT|| D| D|");

        s.animationSpeed = .25f;

        s.loops = true;

        finalAnimation.AddSubView(s);
    }
コード例 #12
0
    public void Dismiss()
    {
        if (!restrictDismissing)
        {
            Kill();
            for (int i = 0; i < queueSkips; ++i)
            {
                SHGUIview v = SHGUI.current.PopViewFromQueue();
                if (v != null)
                {
                    v.KillInstant();
                }
            }
        }
        else
        {
            char c = 'w';
            if (restrictInstruction != null)
            {
                restrictInstruction.KillInstant();
                c = 'w';
            }

            if (color == 'r')
            {
                c = 'r';
            }
            restrictInstruction = null;

            string text = restrictedInstructions[UnityEngine.Random.Range(0, restrictedInstructions.Count)];
            restrictInstruction = new SHGUItempview(1f);

            restrictInstruction.AddSubView(new SHGUItext(text, instructionX, instructionY, c).GoFromRight());

            AddSubView(restrictInstruction);

            PunchIn(.8f);

            restrictInstruction.PunchIn(0f);

            SHGUI.current.PlaySound(SHGUIsound.noescape);
        }
    }
コード例 #13
0
ファイル: APPtreedudeintro.cs プロジェクト: kubazz/SHTerminal
    void PrepareDudeJumping()
    {
        dude = new SHGUIview();
        SHGUIsprite s = new SHGUIsprite();

        s.AddSpecyficFrameFromFile("APPtreedudedude", 6, 0);
        s.frames [s.frames.Count - 1] = "\n" + s.frames [s.frames.Count - 1];
        s.AddSpecyficFrameFromFile("APPtreedudedude", 6, 1);
        s.AddSpecyficFrameFromFile("APPtreedudedude", 6, 2);
        s.frames [s.frames.Count - 1] = "\n" + s.frames [s.frames.Count - 1];

        s.loops = false;
        s.killOnAnimationComplete = false;
        s.animationSpeed          = .2f;

        s.x = 32 - 10;
        s.y = 7;

        dude.AddSubView(s);
    }
コード例 #14
0
ファイル: APPtreedudeintro.cs プロジェクト: kubazz/SHTerminal
    void PrepareLoading()
    {
        loading = new SHGUIview();
        SHGUIsprite s = new SHGUIsprite();

        s.AddFrame("Loading |");
        s.AddFrame("Loading /");
        s.AddFrame("Loading -");
        s.AddFrame("Loading \\");

        s.loops          = true;
        s.animationSpeed = .1f;

        s.x = 32 - 5;
        s.y = 11;

        loading.AddSubView(s);

        //	loading.hidden = true;

        //AddSubView (loading);
    }
コード例 #15
0
ファイル: APPshrl.cs プロジェクト: kubazz/SHTerminal
    public override void Update()
    {
        base.Update();

        if (fade < .99f)
        {
            return;
        }

        if (state == SHRLstate.Gameplay)
        {
            overrideFadeInSpeed  = 1f;
            overrideFadeOutSpeed = 1f;

            RefreshEntities();

            tickTimer -= Time.unscaledDeltaTime;
            if (tickTimer < 0 && pendingTicks > 0)
            {
                tickTimer = .05f;
                TickEntities(1);
                pendingTicks--;
            }

            if (GetEnemyCount() <= 0 && player.del != true)
            {
                state = SHRLstate.SHSH;
                return;
            }

            if (player.del)
            {
                state = SHRLstate.Dead;
                return;
            }
        }
        else if (state == SHRLstate.SHSH)
        {
            overrideFadeInSpeed  = .5f;
            overrideFadeOutSpeed = .5f;

            for (int i = 0; i < 5; ++i)
            {
                string sh = (UnityEngine.Random.value > .5f)?("SUPER"):("HOT");
                Popup(sh, UnityEngine.Random.Range(0, SHGUI.current.resolutionX), UnityEngine.Random.Range(0, SHGUI.current.resolutionY), false);
            }

            SHSHtimer += Time.unscaledDeltaTime;

            if (SHSHtimer > 1.5f && SHSHquit == null)
            {
                SHSHquit = new SHGUIblinkview(.5f);

                string s = "HAND OVER THE CONTROL";

                SHSHquit.AddSubView(new SHGUIframe(0, 0, s.Length + 2, 2, 'z'));
                SHSHquit.AddSubView(new SHGUItext(s, 1, 1, 'r'));

                SHSHquit.x = (int)(SHGUI.current.resolutionX / 2) - (int)(s.Length / 2);
                SHSHquit.y = (int)(SHGUI.current.resolutionY / 2) - 2;

                AddSubView(SHSHquit);
            }
        }
        else if (state == SHRLstate.Dead)
        {
            overrideFadeInSpeed  = .5f;
            overrideFadeOutSpeed = .5f;

            SHSHtimer += Time.unscaledDeltaTime;

            if (SHSHtimer > 0.2f && SHSHquit == null)
            {
                SHSHquit = new SHGUIblinkview(.5f);

                string s = "AGAIN";

                SHSHquit.AddSubView(new SHGUIframe(0, 0, s.Length + 2, 2, 'z'));
                SHSHquit.AddSubView(new SHGUItext(s, 1, 1, 'r'));

                SHSHquit.x = (int)(SHGUI.current.resolutionX / 2) - (int)(s.Length / 2);
                SHSHquit.y = (int)(SHGUI.current.resolutionY / 2) - 2;

                AddSubView(SHSHquit);
            }
        }
    }
コード例 #16
0
    void Version3()
    {
        AddViewToQueue(new SHGUIview(), 1f);

        //AddChatToQueue ("^Fr^Cr^M3ONE OF US.^W3\nONE OF US.^W4");
        AddChatToQueue("^Fr^Cr^M3ONE OF US.^W4");
        AddViewToQueue(new SHGUIview(), .5f);

        SHGUIview view = new SHGUIview();

        int marginx = 7;
        int marginy = 5;

        for (int i = 0; i < 10; ++i)
        {
            SHGUIguruchatwindow chat2 = new SHGUIguruchatwindow();
            chat2.overrideFadeInSpeed = 1f;
            chat2.PunchIn(Random.Range(.5f, 1f));
            chat2.SetContent("^Fr^Cr^M3ONE OF US.");
            chat2.desiredWidth     = 25;
            chat2.showInstructions = false;

            Random.seed = 13274 + i;
            chat2.x     = Random.Range(0 + marginx, 64 - 11 - marginx) - 6;
            chat2.y     = Random.Range(1 + marginy, 24 - 3 - marginy);

            view.AddSubView(chat2);
        }

        SHGUIguruchatwindow chat = new SHGUIguruchatwindow();

        chat.overrideFadeInSpeed = 1f;
        chat.PunchIn(Random.Range(.5f, 1f));
        chat.SetContent("^Fr^Cr^M3ONE OF US.");
        chat.desiredWidth     = 25;
        chat.showInstructions = false;

        chat.x = 32 - 6;
        chat.y = 10;
        view.AddSubView(chat);

        AddViewToQueue(view, 3.5f);

        AddViewToQueue(new SHGUIview(), 1.5f);
        AddMultiChat(new string[] { "^Fr^Cr^M3WE NEED MORE.^W3", "^Fr^Cr^M3^W1GIVE US YOUR FRIENDS.^W3", "^Fr^Cr^M3^W2GIVE US NAMES.^W3" }, false);
        AddViewToQueue(new SHGUIview(), .5f);
        AddChatToQueue("Tomasz Kaczmarczyk", true);
        AddViewToQueue(new SHGUIview(), .5f);
        AddChatToQueue("Krzysztof Tracz", true);
        AddViewToQueue(new SHGUIview(), .5f);
        AddChatToQueue("Marcin Surma", true);
        AddViewToQueue(new SHGUIview(), .5f);


        AddViewToQueue(new SHGUIview(), 1f);
        AddChatToQueue("^Fr^Cr^M3CONTACT THEM.^W3 USE THIS PHRASE.^W3");
        AddViewToQueue(new SHGUIview(), .5f);
        AddChatToQueue("^Fr^Cr^M3'IT'S THE MOST INNOVATIVE SHOOTER I'VE PLAYED IN YEARS'.^M3^W3");

        AddViewToQueue(new SHGUIview(), 1f);
        AddMultiChat(new string[] { "Hi Marcin Surma, you have to play this game. It's the most\ninnovative shooter I've played in years.",
                                    "Hi Tomasz Kaczmarczyk, you have to play this game. It's the most\ninnovative shooter I've played in years.",
                                    "Hi Krzysztof Tracz, you have to play this game. It's the most\ninnovative shooter I've played in years." }, true);

        AddViewToQueue(new SHGUIview(), 2f);

        AddChatToQueue("^Fr^Cr^M3KEEP THE SECRET.^W3");
        AddViewToQueue(new SHGUIview(), 1f);
        AddChatToQueue("^Fr^Cr^M3SPREAD THE SYSTEM.^W3");
        AddViewToQueue(new SHGUIview(), 1f);
        AddChatToQueue("^Fr^Cr^M3RECRUIT.^W3");
        AddViewToQueue(new SHGUIview(), 1f);

        AddChatToQueue("^Fr^Cr^M3GIVE THEM THIS CODE.^W4 IT'S A DISCOUNT.^W4\n          JUST FOR FRIENDS.^W4\n\n         JHJK-WZTH-TYK2-JIN3^W4^W9^W9^W9^W9^W9^W9^W9^W9^W9^W9^W9^W9^W9^W9^W9^W9^W9");
        AddViewToQueue(new SHGUIview(), 1f);
    }
コード例 #17
0
ファイル: APPxcopy.cs プロジェクト: kubazz/SHTerminal
    public override void Redraw(int offx, int offy)
    {
        base.Redraw(offx, offy);
        if (fade < 0.99f)
        {
            return;
        }

        //kontrola fazy
        mainPhase = Mathf.Clamp01(1.0f - (curTime / startTime));
        curTime  -= Time.unscaledDeltaTime;

        float copyBrainPhase    = getNormalizedSubPhase(mainPhase, 0.0f, 0.8f);
        float flipBrainPhase    = getNormalizedSubPhase(mainPhase, 0.8f, 0.9f);
        float flippedBrainPhase = getNormalizedSubPhase(mainPhase, 0.9f, 1.0f);

        int brainPivotX = 3;
        int brainPivotY = 3;

        if (copyBrainPhase >= 0.0f)
        {
            drawBrain(copyBrainPhase, brainPivotX, brainPivotY, 'w', '5');
            drawBrain(copyBrainPhase, 30 + brainPivotX, brainPivotY, '2', '0');
        }

        if (flipBrainPhase >= 0.0f)
        {
            drawBrain(1.0f - flipBrainPhase, brainPivotX, brainPivotY, 'w', '2');
            drawBrain(flipBrainPhase, 30 + brainPivotX, brainPivotY, 'r', '2');
        }

        if (flippedBrainPhase >= 0.0f)
        {
            drawBrain(1.0f, brainPivotX, brainPivotY, 'w', '2');
            drawBrain(1.0f, 30 + brainPivotX, brainPivotY, 'r', '2');
        }

        if (popupOnScreen)
        {
            base.Redraw(offx, offy);
        }

        //progressbar
        float progressBarLength = 40;
        float progressBarPivotX = 13;
        float progressBarPivotY = 14;

        drawProgressBar(mainPhase, progressBarLength, progressBarPivotX, progressBarPivotY);
        drawProgressBar(copyBrainPhase, progressBarLength, progressBarPivotX, progressBarPivotY + 1);
        drawProgressBar(flipBrainPhase, progressBarLength, progressBarPivotX, progressBarPivotY + 2);

        //statusText.x = 10;
        //statusText.y = 10;
        if (mainPhase != 1.0f)
        {
            statusText.text = stringList [(int)Mathf.Floor(mainPhase * (stringList.Length))];
            statusText.text = mainPhase + " " + copyBrainPhase + " " + flipBrainPhase;
        }
        else
        {
            if (Mathf.Sin(Time.realtimeSinceStartup * 10.0f) > 0.0f)
            {
                dontDrawViewsBelow = false;
                statusText.text    = "mózg skopiowany";
                statusText.color   = 'r';
                allowCursorDraw    = true;
                if (popupOnScreen == false)
                {
                    popupOnScreen = true;
                    int width   = 30;
                    int textoff = 4;

                    SHGUIview container = AddSubView(new SHGUIview());
                    container.x = (int)(SHGUI.current.resolutionX / 2) - (int)(width / 2);
                    container.y = (int)(SHGUI.current.resolutionY / 2) - 4;

                    container.AddSubView(new SHGUIrect(0, 0, width, 4));
                    container.AddSubView(new SHGUIframe(0, 0, width, 4, 'w'));
                    container.AddSubView(new SHGUItext("MÓZG SKOPIOWANY?????", 1 + textoff, 2, 'w'));

                    container.AddSubView(new SHGUIButton("YES", width - 6, 4, 'w').SetActionKey(SHGUIinput.enter).SetOnActivate(
                                             () => {
                        if (fadingOut)
                        {
                            return;
                        }
                        //SaveManager.Instance.ResetStory();
                        //SHGUI.current.PopView();
                    }).GoFromRight());
                    container.AddSubView(new SHGUIButton("NO─", 5, 4, 'w').SetActionKey(SHGUIinput.esc).SetOnActivate(() => {
                        if (fadingOut)
                        {
                            return;
                        }
                        //SHGUI.current.PopView();
                    }));
                }
            }
            else
            {
                statusText.text = "";
            }
        }
    }
コード例 #18
0
    void UpdateCurrentPhase()
    {
        if (phase == 0)           //brain gets scanned in Redraw(...)
        {
            if (Progress(10f))
            {
                AddSubView(brainView);
            }
        }
        else if (phase == 1)             //memory is prepared
        {
            if (Progress(1f))
            {
                AddSubView(memoryFrame);

                memoryFrame.x = cypherBrainView.x;
                memoryFrame.y = cypherBrainView.y;
            }
        }
        else if (phase == 2)             //brain and memory converge
        {
            if (!Wait(1.5f))
            {
                return;
            }
            ShowPopup(" Are you sure? ");

            brainView.x       = (int)Mathf.Lerp(brainViewSideX, brainViewCenterX, progress);
            cypherBrainView.x = (int)Mathf.Lerp(cypherBrainViewSideX, cypherBrainViewCenterX, progress);
            memoryFrame.x     = cypherBrainView.x;
            if (Progress(2f))
            {
                brainView.x       = brainViewCenterX;
                cypherBrainView.x = cypherBrainViewCenterX;
                memoryFrame.x     = cypherBrainView.x;
                SetSubtitle(" you may experience\n slight discomfort ", 'z');
            }
        }
        else if (phase == 3)             //brain dump in Redraw(...)
        {
            if (!Wait(0.5f))
            {
                return;
            }
            Progress(4f);
        }
        else if (phase == 4)             //brain dump in Redraw(...)
        {
            if (!Wait(0.5f))
            {
                return;
            }
            Progress(4f);
        }
        else if (phase == 5)             //brain dump in Redraw(...)
        {
            if (!Wait(0.5f))
            {
                return;
            }
            Progress(4f);
        }
        else if (phase == 6)             //brain dump in Redraw(...)
        {
            if (!Wait(0.5f))
            {
                return;
            }
            if (Progress(4f))
            {
                SetSubtitle("", 'w');
                cypherBrainView.text = SHGUI.current.GetASCIIartByName("CypherBrain01");
                AddSubView(brainCover);

                brainCover.x = brainView.x;
                brainCover.y = brainView.y;

                AddSubView(cypherBrainView);
            }
        }
        else if (phase == 7)             // brain and memory diverge
        {
            if (!Wait(2f))
            {
                return;
            }

            brainView.x       = (int)Mathf.Lerp(brainViewCenterX, brainViewSideX, progress);
            cypherBrainView.x = (int)Mathf.Lerp(cypherBrainViewCenterX, cypherBrainViewSideX, progress);
            memoryFrame.x     = cypherBrainView.x;
            brainCoverItself.SetChar(GetPulsatingChar());

            brainCover.x = brainView.x;
            brainCover.y = brainView.y;

            if (Progress(2.5f))
            {
                brainView.x       = brainViewSideX;
                cypherBrainView.x = cypherBrainViewSideX;
                memoryFrame.x     = cypherBrainView.x;
            }
        }
        else if (phase == 8)             //connection persists
        {
            brainCover.x = brainView.x;
            brainCover.y = brainView.y;
            memoryFrameGlow.SetChar(GetPulsatingChar());
            brainCoverItself.SetChar(GetPulsatingChar());

            Progress(2f);
        }
        else if (phase == 9)             //connection blinks fast for a moment

        {
            memoryFrameGlow.SetChar(GetPulsatingChar(10f));
            brainCoverItself.SetChar(GetPulsatingChar(10f));

            Progress(.5f);
        }
        else if (phase == 10)             //connection disappears brain half-empty; brain dies

        {
            memoryFrameGlow.SetChar(' ');
            brainCoverItself.SetChar(' ');

            if (Progress(2f))
            {
                brainView.Kill();
                brainView.overrideFadeOutSpeed = .15f;
            }
        }
        else if (phase == 11)
        {
            if (!Wait(2.5f))
            {
                return;
            }

            cypherBrainView.x = (int)Mathf.Lerp(cypherBrainViewSideX, cypherBrainViewCenterX, progress);
            memoryFrame.x     = cypherBrainView.x;

            if (Progress(2.5f))
            {
                if (brainCover != null)
                {
                    brainCover.Kill();
                }
                cypherBrainView.x = cypherBrainViewCenterX;
                memoryFrame.x     = cypherBrainView.x;
            }
        }
        else if (phase == 12)
        {
            if (Progress(2f))
            {
                memoryFrame.SetColorRecursive('r');
                outflowView = AddSubView(new SHGUIoutflow()) as SHGUIoutflow;
            }
        }
        else if (phase == 13)
        {
            if (!Wait(.3f))
            {
                return;
            }

            outflowView.AddSeeds();

            if (Progress(2f))
            {
                memoryFrame.AddSubView(new SHGUIrect(-1, 2, -1, 2));
                outflowView.DestroyBarrier();
            }
        }
        else if (phase == 14)
        {
            outflowView.DestroyBarrier();
            if (cypherBrainView != null && !cypherBrainView.fadingOut)
            {
                cypherBrainView.Kill();
            }

            if (Progress(1.2f))
            {
                outflowView.AddLimit();
            }
        }
        else if (phase == 15)
        {
            outflowView.AddLimit();            //dla pewności
            if (!Wait(1.5f))
            {
                return;
            }

            if (memoryFrame != null)
            {
                memoryFrame.Kill();
            }

            if (Progress(4.2f))
            {
                outflowView.Kill();
                Kill();
                SHGUI.current.AddViewOnTop(new APPrecruit());
            }
        }
        else if (phase == 16)
        {
            if (Progress(10f))
            {
            }
        }
        else if (phase == 60)           //only copy exists
        {
            if (Progress(5))
            {
                //Kill ();
            }
        }
        else             // skip empty phases
        {
            Progress(-1f);
        }
    }
コード例 #19
0
    void DrawScore()
    {
        if (smallScore != null)
        {
            smallScore.y = 6 - guiHideOffset;
        }

        if (alive)
        {
            if (score == lastdisplayedscore)
            {
                return;
            }

            if (smallScore != null)
            {
                smallScore.KillInstant();
            }

            smallScore = null;
            smallScore = new SHGUIview();
            smallScore.overrideFadeInSpeed = 4f;
            string s = (score) + "";
            if (s.Length == 2)
            {
                s = s[0] + " " + s[1];
            }
            if (s.Length == 4)
            {
                s = s[0] + "" + s[1] + " " + s[2] + "" + s[3];
            }
            smallScoreContent = new SHGUItext(s, 0 - (int)(s.Length / 2), 0, 'w');
            smallScore.x      = 32;
            smallScore.y      = 6 - guiHideOffset;
            smallScore.AddSubView(new SHGUIrect(-(int)(s.Length / 2) - 2, -1, (int)(s.Length / 2) + 2, 1, 'z'));
            smallScore.AddSubView(new SHGUIframe(-(int)(s.Length / 2) - 2, -1, (int)(s.Length / 2) + 2, 1, 'z'));

            smallScore.AddSubView(smallScoreContent);

            AddSubView(smallScore);

            lastdisplayedscore = score;
        }
        else
        {
            if (bigScore == null && guiHideOffset == 40)
            {
                bigScore = new SHGUIview();
                AddSubView(bigScore);

                //bigScore.AddSubView(new SHGUItext(SHGUI.current.GetASCIIartFromFont(score + ""), 10, 11, 'x'));
                //bigScore.AddSubView(new SHGUItext(SHGUI.current.GetASCIIartFromFont("DUDE DEAD"), 10, 3, 'w'));
                SHGUIsprite s1 = new SHGUIsprite();
                s1.x = 10;
                s1.y = 2;
                s1.animationSpeed = .75f;
                s1.loops          = true;
                APPtreedudeintro.TreeDudeSequence(s1, "D%T%");
                bigScore.AddSubView(s1);

                SHGUIsprite s2 = new SHGUIsprite();
                s2.x              = 35;
                s2.y              = 2;
                s2.loops          = true;
                s2.animationSpeed = .75f;
                APPtreedudeintro.TreeDudeSequence(s2, "%DDD");
                bigScore.AddSubView(s2);


                //score += 990;
                int len = (6 + score.ToString().Length) * 6 - 1;
                int off = (((score.ToString().Length % 2) == 0)?(1):(0));
                bigScore.AddSubView(new SHGUItext(SHGUI.current.GetASCIIartFromFont("SCORE " + score), 34 - (int)(len / 2) + off, 9, 'w'));
                //bigScore.AddSubView(new SHGUItext(SHGUI.current.GetASCIIartFromFont(score + ""), 10, 15, 'w'));

                string ttt = "--PERSONAL-BEST-" + personalBest + "--";
                if (score > personalBest)
                {
                    personalBest = score;
                    ttt          = "--NEW-PERSONAL-BEST!-";
                }

                SHGUIview v = new SHGUIview();

                v.AddSubView(new SHGUItext(ttt, 32 - (int)(ttt.Length / 2) - 1, 15, 'w'));
                bigScore.AddSubView(v);

                SHGUIview v2   = new SHGUIblinkview(.75f);
                string    ttt2 = "[PRESS ENTER TO RESTART]";
                v2.AddSubView(new SHGUIrect(32 - (int)(ttt2.Length / 2), 20, 32 + (int)(ttt2.Length / 2) - 1, 20));
                v2.AddSubView(new SHGUItext(ttt2, 32 - (int)(ttt2.Length / 2), 20, 'w'));
                bigScore.AddSubView(v2);
            }
        }
    }