예제 #1
0
 protected override bool ExeOnTarget(BaseEntity tar)
 {
     CTimer.Instance.AddTimer(() => {
         action.Execute();
     }, delay);
     return(true);
 }
예제 #2
0
 private void ExecuteAction(BaseAction action)
 {
     if (action != null)
     {
         action.Execute();
     }
 }
예제 #3
0
        private static void ExecuteMenuItemAction(ObjectBuilderContext context, View parent, dynamic menuItemMetadata)
        {
            BaseAction action = context.Build(parent, menuItemMetadata.Action);

            if (action != null)
            {
                action.Execute();
            }
        }
예제 #4
0
 protected override bool ExeOnTarget(BaseEntity tar)
 {
     if (tar.IsAlive())
     {
         onSuccess.Execute();
     }
     else
     {
         onFailure.Execute();
     }
     return(true);
 }
예제 #5
0
        public bool Interact()
        {
            var scenario  = currScenario;
            var character = BaseAction.FindCharacter(scenario, MapElements.HERO);
            var type      = interactionFinder.FindInteractionType(character.Position);

            ActionArg  actionArg = null;
            BaseAction action    = null;

            if (interactionCreator.CreateInteraction(type, character, out action, out actionArg) != true)
            {
                return(false);
            }

            action.Execute(scenario, actionArg);

            return(true);
        }
예제 #6
0
    private void QueueAction(BaseAction action)
    {
        if (action == null)
            return;

        if (currentAction == null && action.CooldownReady() && !action.IsDisabled())
        {
            currentAction = action;
            nextAction = null;
            currentAction.Execute();
        }
        else if (action.IsQueueable())
        {
            if (currentAction == action && currentAction.IsMultiStep())
            {
                currentAction.QueueNextStep();
                nextAction = null;
            }
            else
            {
                nextAction = action;

                if (currentAction != null && currentAction.IsMultiStep())
                {
                    currentAction.CancelNextStep();
                }
            }
        }
    }
예제 #7
0
    private void HandleCurrentAction()
    {
        if (currentAction == null && nextAction == null)
            return;

        if (currentAction != null && currentAction.IsActive())
        {
            currentAction.ActiveUpdate();
        }
        else if(currentAction == null || !currentAction.IsActive())
        {
            currentAction = null;

            if (nextAction != null && nextAction.CooldownReady())
            {
                if (!nextAction.IsDisabled())
                {
                    currentAction = nextAction;
                    currentAction.Execute();
                }

                nextAction = null;
            }
        }
    }
        public virtual void ExecuteAction(string name)
        {
            BaseAction _action = (BaseAction)GetAction(name);

            _action.Execute(_mode);
        }