Ejemplo n.º 1
0
    protected override void UseAction(Action _action, float _time)
    {
        switch (_action.Type)
        {
        case ActionType.AIMoveForward:
            _currentAction = new AAMoveForward(this);
            _currentAction.UseAction(_action, _time);
            _currentTaskIndex = _action.IValue;
            break;

        case ActionType.AIRotate:
            _currentAction = new AARotate(this);
            _currentAction.UseAction(_action, _time);
            _currentTaskIndex = _action.IValue;
            break;

        case ActionType.AIMoveTo:
            _currentAction = new AAMoveTo(this);
            _currentAction.UseAction(_action, _time);
            _currentTaskIndex = _action.IValue;
            break;

        case ActionType.AIWait:
            _currentAction = new AAWait();
            _currentAction.UseAction(_action, _time);
            _currentTaskIndex = _action.IValue;
            break;

        case ActionType.AIRotateDir:
            _currentAction = new AARotateDir(this);
            _currentAction.UseAction(_action, _time);
            _currentTaskIndex = _action.IValue;
            break;

        case ActionType.SetTask:
            _currentTask = _action.Task;
            break;

        case ActionType.UnsetTask:
            _currentTask = null;
            break;

        case ActionType.SpliceFuture:
            _history.SpliceOffPossibleFuture();
            break;

        case ActionType.AIMoveForwardUnset:
        case ActionType.AIMoveToUnset:
        case ActionType.AIRotateUnset:
        case ActionType.AIWaitUnset:
        case ActionType.AIRotateDirUnset:
            _currentAction = null;
            break;
        }
        if (_combat != null && _action != null)
        {
            SetAction(_combat.UseAction(_action), true);
        }
    }
Ejemplo n.º 2
0
    protected override void UseAction(Action _action, float _time)
    {
        IAtomicAction _aa = GetAAFromAction(_action);

        _currentAA = _aa;
        if (_currentAA != null)
        {
            _currentAA.UseAction(_action, _time);
        }
    }