Example #1
0
    public override void Execute(BattleObject obj, GameAction action)
    {
        string button       = (string)GetArgument("button", obj, action);
        int    bufferWindow = (int)GetArgument("bufferWindow", obj, action, 0);
        bool   pressed      = (bool)GetArgument("pressed", obj, action, true);

        bool value = obj.GetInputBuffer().KeyBuffered(button, bufferWindow, pressed);

        action.cond_list.Add(value);
        action.cond_depth++;
    }
Example #2
0
    public override void Execute(BattleObject obj, GameAction action)
    {
        string button  = (string)GetArgument("button", obj, action);
        bool   pressed = (bool)GetArgument("pressed", obj, action, true);

        bool buttonHeld = obj.GetInputBuffer().GetKey(button);

        //GetKey returns true if the button is held. If we're looking for a release (pressed is false) we need to invert it
        bool value;

        if (pressed)
        {
            value = buttonHeld;
        }
        else
        {
            value = !buttonHeld;
        }

        action.cond_list.Add(value);
        action.cond_depth++;
    }