Exemplo n.º 1
0
    public override void Tick()
    {
        powerbar.Tick();

        if (powerbar.OutOfRange())
        {
            powerbar.SetAccuracy();
            game.SetState(new PreStrikingState(game));
        }
    }
Exemplo n.º 2
0
    public bool Strike(string[] arr)
    {
        string errorMessage = "Strike power [accuracy]";

        if (game.GetState() is IdleState && arr.Length < 3)
        {
            Powerbar powerbar = game.GetPowerbar();
            float    power    = 1f;
            float    accuracy = 0f;
            if (arr.Length == 1)
            {
                power = Floatify(arr[0]);
            }
            if (arr.Length == 2)
            {
                accuracy = Floatify(arr[1]);
            }
            powerbar.SetPower(power);
            powerbar.SetAccuracy(accuracy);
            game.GetCursorGraphics().Disable();
            game.SetState(new StrikingState(game));
            return(true);
        }
        Reply(errorMessage);
        return(true);
    }