Esempio n. 1
0
    private void replay(string line)
    {
        float multiplier = 1;

        if (isFacingLeft() != faceLeft)
        {
            multiplier = -1;
        }

        string[] values = line.Split(' ');
        recordingFrame = Convert.ToInt32(values[0]);

        // Replaying movements
        MaxInput.setHorizontal("Player2", Convert.ToSingle(values[1]) * multiplier);
        MaxInput.setVertical("Player2", Convert.ToSingle(values[2]));

        // Replaying actions
        if (values[3] == "True")
        {
            MaxInput.Square("Player2");
        }
        if (values[4] == "True")
        {
            MaxInput.Triangle("Player2");
        }
        if (values[5] == "True")
        {
            MaxInput.Circle("Player2");
        }
        if (values[6] == "True")
        {
            MaxInput.Cross("Player2");
            hold = true;
        }
        else if (values[6] == "False" && values[7] == "True" && hold)
        {
            if (characterManager.P2Character == "Dhalia")
            {
                if (P2Input.attacking)
                {
                    MaxInput.Cross("Player2");
                }
                else
                {
                    hold = false;
                }
            }
            //else MaxInput.Cross("Player2");
        }

        if (values[8] == "True")
        {
            MaxInput.RBumper("Player2");
        }
        if (values[9] == "True")
        {
            MaxInput.RTrigger("Player2");
        }
        if (values[10] == "True")
        {
            MaxInput.LBumper("Player2");
        }
        if (values[11] == "True")
        {
            MaxInput.LTrigger("Player2");
        }
        if (values[12] == "True")
        {
            MaxInput.LStick("Player2");
        }
    }
Esempio n. 2
0
    // Quarter Circle Forward
    public void QCF()
    {
        // Step 1: Down movement
        if (AI.doingQCF == 1)
        {
            MaxInput.Crouch("Player2");
            AI.doingQCF   = 2;
            AI.delayTimer = .1f;
            AI.keepInput  = true;
        }
        // Step 2: Down Left/Right movement
        else if (AI.doingQCF == 2)
        {
            if (AI.faceLeft == true)
            {
                MaxInput.DownLeft("Player2");
            }
            else
            {
                MaxInput.DownRight("Player2");
            }
            AI.doingQCF   = 3;
            AI.delayTimer = .1f;
        }
        // Step 3: Left/Right movement
        else if (AI.doingQCF == 3)
        {
            MaxInput.DownMove("Player2");
            if (AI.faceLeft == true)
            {
                MaxInput.MoveLeft("Player2");
            }
            else
            {
                MaxInput.MoveRight("Player2");
            }
            AI.doingQCF   = 4;
            AI.delayTimer = .1f;
        }
        // Step 4: Pressing Attack button
        else if (AI.doingQCF == 4)
        {
            if (AI.keepAction == "Square")
            {
                MaxInput.Square("Player2");
            }
            if (AI.keepAction == "Triangle")
            {
                MaxInput.Triangle("Player2");
            }
            if (AI.keepAction == "Circle")
            {
                MaxInput.Circle("Player2");
            }
            if (AI.keepAction == "Cross")
            {
                MaxInput.Cross("Player2");
            }
            if (AI.keepAction == "RTrigger")
            {
                MaxInput.RTrigger("Player2");
            }
            if (AI.keepAction == "RBumper")
            {
                MaxInput.RBumper("Player2");
            }

            AI.doingQCF   = 0;
            AI.keepAction = "";
            AI.keepInput  = false;
        }
    }