public bool execute() { bool forcewait = false; ConversationLine l; if (node != null) { if (node is DialogueConversationNode) { while (current_line < node.getLineCount() && !forcewait) { l = node.getLine(current_line); if (ConditionChecker.check(l.getConditions())) { forcewait = true; Game.Instance.Talk(l, l.getName()); } current_line++; } if (!forcewait && additional_effects != null && additional_effects.effects.Count > 0) { forcewait = additional_effects.execute(); } } else if (node is OptionConversationNode) { if (this.child == -2) { if (isTracePending) { EndTrace(); } Game.Instance.showOptions(this); forcewait = true; } else if (showOption) { l = node.getLine(child); Game.Instance.Talk(l, l.getName()); forcewait = true; showOption = false; } else { if (additional_effects != null) { forcewait = additional_effects.execute(); } else { forcewait = false; } } } } return(forcewait); }
public bool execute() { bool forcewait = false; ConversationLine l; if (node != null) { switch (node.getType()) { case ConversationNodeViewEnum.DIALOGUE: while (current_line < node.getLineCount() && !forcewait) { l = node.getLine(current_line); if (ConditionChecker.check(l.getConditions())) { forcewait = true; Game.Instance.talk(l.getText(), l.getName()); } current_line++; } if (!forcewait && additional_effects != null && additional_effects.effects.Count > 0) { forcewait = additional_effects.execute(); } break; case ConversationNodeViewEnum.OPTION: if (this.child == -2) { Game.Instance.showOptions(this); forcewait = true; } else { if (additional_effects != null) { forcewait = additional_effects.execute(); } else { forcewait = false; } } break; } } return(forcewait); }
public bool execute() { var forceWait = exitEffects.execute(); if (!forceWait) { // Last run Game.Instance.GameState.EndChangeAmbitAsExtensions(trace); trace?.Completed(); } return(forceWait); }
public bool execute() { if (exitEffects == null) { Game.Instance.GameState.BeginChangeAmbit(); targetOnExit = Game.Instance.GameState.GetChapterTarget(Game.Instance.GameState.CurrentTarget); exitEffects = toRun.ExitMb.GetExitEffects(out exit); } var forceWait = exitEffects.execute(); if (!forceWait) { Game.Instance.GameState.EndChangeAmbit(); toRun.ExitMb.TrackExit(exit, targetOnExit); } return(forceWait); }
public bool execute() { var forceWait = exitEffects.execute(); if (!forceWait) { // Last run Game.Instance.GameState.EndChangeAmbitAsExtensions(); try { toRun.ExitMb.TraceExit(exits, targetOnExit); } catch (Exception ex) { Debug.Log("Error while tracing the exit! (" + ex.Message + ", " + ex.StackTrace + ")"); } } return(forceWait); }
public bool execute() { bool forcewait = false; ConversationLine l; if (node != null) { if (node is DialogueConversationNode) { if (!string.IsNullOrEmpty(initializedDialogNode)) { if (GUIManager.Instance.InteractWithDialogue() == InteractuableResult.REQUIRES_MORE_INTERACTION) { forcewait = true; if (TrackerAsset.Instance.Started) { TrackerAsset.Instance.Completable.Progressed(initializedDialogNode, CompletableTracker.Completable.DialogFragment, 1f); } } else if (TrackerAsset.Instance.Started) { TrackerAsset.Instance.Completable.Completed(initializedDialogNode, CompletableTracker.Completable.DialogFragment); } } while (current_line < node.getLineCount() && !forcewait) { l = node.getLine(current_line); if (ConditionChecker.check(l.getConditions())) { forcewait = true; Game.Instance.Talk(l); initializedDialogNode = conversation.getId() + "." + nodeIndex + "." + current_line; if (TrackerAsset.Instance.Started) { TrackerAsset.Instance.Completable.Initialized(initializedDialogNode, CompletableTracker.Completable.DialogFragment); } } current_line++; } if (!forcewait && additional_effects != null && additional_effects.effects.Count > 0) { forcewait = additional_effects.execute(); } } else if (node is OptionConversationNode) { if (this.child == -2) { if (isTracePending) { EndTrace(); } var order = Game.Instance.showOptions(this); var orderedOptions = order.Select(o => node.getLine(o).getText()).ToArray(); var correct = order.Select(o => node.getLine(o).getXApiCorrect()).ToArray(); startTime = Time.realtimeSinceStartup; forcewait = true; } else if (showOption) { l = node.getLine(child); Game.Instance.Talk(l); forcewait = true; showOption = false; } else { if (additional_effects != null) { forcewait = additional_effects.execute(); } else { forcewait = false; } } } } return(forcewait); }