protected override bool ExeOnTarget(BaseEntity tar) { CTimer.Instance.AddTimer(() => { action.Execute(); }, delay); return(true); }
private void ExecuteAction(BaseAction action) { if (action != null) { action.Execute(); } }
private static void ExecuteMenuItemAction(ObjectBuilderContext context, View parent, dynamic menuItemMetadata) { BaseAction action = context.Build(parent, menuItemMetadata.Action); if (action != null) { action.Execute(); } }
protected override bool ExeOnTarget(BaseEntity tar) { if (tar.IsAlive()) { onSuccess.Execute(); } else { onFailure.Execute(); } return(true); }
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); }
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(); } } } }
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); }