Exemplo n.º 1
0
    void Update()
    {
        if (qtState == QTState.Ongoing)
        {
            // succeed QTE (press right button)
            if (
                (QTEButton == Action.punch && characterActions.Punch) ||
                (QTEButton == Action.kick && characterActions.Kick)
                )
            {
                qtState    = QTState.Done;
                qtResponse = QTResponse.Success;

                if (System.String.IsNullOrEmpty(blockWhenSuccess))
                {
                    Continue();
                }
                else
                {
                    flowChart.ExecuteBlock(blockWhenSuccess);
                }
            }

            // fail QTE (press wrong button)
            if (
                (QTEButton == Action.punch && characterActions.Kick) ||
                (QTEButton == Action.kick && characterActions.Punch)
                )
            {
                qtState    = QTState.Done;
                qtResponse = QTResponse.Fail;
                flowChart.ExecuteBlock(blockWhenFailed);
            }
        }
    }
Exemplo n.º 2
0
    private IEnumerator StateChange()
    {
        qtState = QTState.Delay;

        // Wait for the Delay if any delay at all.
        yield return(new WaitForSeconds(DelayTimer));

        // This line below is only for Debug Purposes
        Debug.Log(QTEButton.ToString());

        // Shrink the QTE Button
        StartCoroutine(ScaleOverTime(CountTimer));

        qtState = QTState.Ongoing;
        yield return(new WaitForSeconds(CountTimer));

        // If the timer is over and the event isn't over? Fix it! because most likely they failed.
        if (qtState == QTState.Ongoing)
        {
            qtResponse = QTResponse.Fail;
            qtState    = QTState.Done;

            flowChart.ExecuteBlock(blockWhenFailed);
        }
    }
Exemplo n.º 3
0
        public void TestQT()
        {
            /*
             * string strqt = @"
             *
             *      QT CTU186
             *
             * GQ 0165 0200    RP 0170 0200    KK 3512 3605    RE 0000 0200
             *
             * SR 0161 0200    TC 1489 1435    TL 3396 3028    SC 0000 0253
             * ";
             * FormatPNR format = new FormatPNR();
             * QT_Queue qt = format.FormatQT(strqt);
             * string err = string.Empty;
             * string pnrcontent = @"     CTU186 SCHEDULE CHG  (  0000  )  (  0000  )
             *
             **ELECTRONIC TICKET PNR**
             *
             * 1.赵恩宇 HVVNFY
             *
             * 2.  G52638 G   WE15OCT  KWECKG UN1   1525 1610          E      S
             *
             * 3.  G52638 G   WE15OCT  KWECKG TK1   1700 1745          E      S
             *
             * 4.CTU/T CTU/T 028-85512345/CTU HUA LONG AIR SERVICE CO.,LTD/YANGHONG ABCDEFG
             *
             * 5.REM 1014 1758 T0565
             *
             * 6.TL/2300/14OCT14/CTU295
             *
             * 7.SSR FOID G5 HK1 NI511129197011014039/P1
             *
             * 8.SSR ADTK 1E BY CTU14OCT14/1859 OR CXL G52638 G15OCT
             *
             * 9.SSR TKNE G5 HK1 KWECKG 2638 G15OCT 9872900692422/1/P1
             *
             * 10.OSI G5 CTCT15184422090  ";
             * string strPnr = format.GetPNR(pnrcontent, out err);
             */

            BootStrapper.Boot();
            IPidService pidService = ObjectFactory.GetInstance <IPidService>();
            PIDInfo     pid        = new PIDInfo();

            pid.CarrierCode = "ctuadmin";
            pid.IP          = "210.14.138.30";
            pid.Port        = 2237;
            pid.Office      = "ctu186";
            QTResponse response = pidService.SendQT(pid);
            //List<string> tkList = new List<string>() {
            //    "876-2329295351",
            //    "876-2330330542",
            //    "7842119018923",
            //    "876-2330343865",
            //    "876-2330365214",
            //    "876-2330372379"
            //};
            //OpenTicketResponse response = pidService.ScanOpenTicket("210.14.138.30", "2237", "ctu186", tkList);
        }
Exemplo n.º 4
0
 void OnTriggerExit2D(Collider2D other)
 {
     if (qtState == QTState.Done)
     {
         qtState    = QTState.Ready;
         qtResponse = QTResponse.Null;
     }
 }
Exemplo n.º 5
0
    private IEnumerator StateChange()
    {
        qtState = QTState.Ongoing;
        yield return(new WaitForSeconds(CountTimer));

        // If the timer is over and the event isn't over? Fix it! because most likely they failed.
        if (qtState == QTState.Ongoing)
        {
            qtResponse = QTResponse.Fail;
        }
    }
Exemplo n.º 6
0
    // Update is called once per frame
    void Update()
    {
        if (qtState == QTState.Ongoing)
        {
            if (Input.anyKeyDown)                                   //we press ANY key during the OnGoing state
            {
                qtState    = QTState.Done;
                qtResponse = QTResponse.Success;

                DisplayBox.GetComponent <Text>().text = "WIN";
                //PassBox.GetComponent<Text>().text = "WIN";
                StopCoroutine(StateChange());
                gameManager.EndGame(IMiniGame.MiniGameResult.WIN);
            }
        }
    }
Exemplo n.º 7
0
 void Update()
 {
     //lmao
     if (qtState == QTState.Ongoing)
     {
         if (Input.GetButtonDown("Stab"))
         {
             Destroy(gameObject);
             qtResponse = QTResponse.Success;
             StopCoroutine(StateChange());
         }
         else if (qtResponse == QTResponse.Fail)
         {
             transform.localScale = new Vector3(-transform.localScale.x, transform.localScale.y, transform.localScale.z);
         }
     }
 }
Exemplo n.º 8
0
    // Update is called once per frame
    void Update()
    {
        if (qtState == QTState.Ongoing)
        {
            if (InputManager.Instance.GetButton(InputManager.MiniGameButtons.BUTTON1))                                 //we press ANY key during the OnGoing state
            {
                anim.SetTrigger("jumptrigger");


                DisplayBox.GetComponent <Text>().text = "WIN";
                //PassBox.GetComponent<Text>().text = "WIN";
                qtState    = QTState.Done;
                qtResponse = QTResponse.Success;
                StopCoroutine(StateChange());
                gameManager.EndGame(IMiniGame.MiniGameResult.WIN);
            }
        }
    }
Exemplo n.º 9
0
    void Update()
    {
        if (qtState == QTState.Ongoing)
        {
            if (Input.GetKeyDown(QTEButton))
            {
                qtState    = QTState.Done;
                qtResponse = QTResponse.Success;

                if (System.String.IsNullOrEmpty(blockWhenSuccess))
                {
                    Continue();
                }
                else
                {
                    flowChart.ExecuteBlock(blockWhenSuccess);
                }
            }
        }
    }
Exemplo n.º 10
0
    private IEnumerator StateChange()
    {
        qtState = QTState.Delay;
        yield return(new WaitForSeconds(DelayTimer));                     // Wait for the Delay

        DisplayBox.GetComponent <Text>().text = "QUICK! PRESS A BUTTON!"; //shows text to JUMP
        soundAudio.clip = alarm;
        soundAudio.Play();
        EnemyIMG.SetActive(true);
        qtState = QTState.Ongoing;
        yield return(new WaitForSeconds(CountTimer));

        if (qtState == QTState.Ongoing)                             //count.timer gets to 0
        {
            qtResponse = QTResponse.Fail;
            //PassBox.GetComponent<Text>().text = "FAIL";
            gameManager.EndGame(IMiniGame.MiniGameResult.LOSE);
            qtState = QTState.Done;
            DisplayBox.GetComponent <Text>().text = string.Empty;
        }
    }