Ejemplo 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");
        }
    }