public override void OnExecute(IDialogueOwner dialogueOwner) { // TODO: Random edge chosen currently doesn't abbide the edge conditions (always succeeds) var edge = edges[UnityEngine.Random.Range(0, edges.Length)]; Finish(owner.nodes[edge.toNodeIndex]); }
public override void OnExecute(IDialogueOwner dialogueOwner) { var task = quest.val.GetTask(taskKey); switch (status) { case TaskStatus.InActive: task.ResetProgress(); break; case TaskStatus.Active: task.Activate(); break; case TaskStatus.Completed: task.Complete(true); break; case TaskStatus.Failed: task.Fail(); break; default: throw new ArgumentOutOfRangeException(); } Finish(true); }
protected override void SetDialogueCamera() { _dialogueOwner = GetComponent <IDialogueOwner>(); Assert.IsNotNull(_dialogueOwner, "No IDialogueOwner found on DialogueOwnerAutoFocus component."); Assert.IsNotNull(_dialogueOwner.dialogueCamera, "IDialogueOwner found, but it has no camera, can't auto focus."); dialogueCamera = _dialogueOwner.dialogueCamera; }
public override void OnExecute(IDialogueOwner dialogueOwner) { foreach (var quest in quests) { quest.val.DoAction(status); } Finish(true); }
public override void OnExecute(IDialogueOwner dialogueOwner) { if (_timerHelper == null) { _timerHelper = TimerUtility.GetTimer(); } _timerHelper.StartTimer(waitTime, null, OnTimerEnded); // Finish(true); // Finish once time is completed. }
public override void OnExecute(IDialogueOwner dialogueOwner) { var animator = PlayerManager.instance.currentPlayer.gameObject.GetComponent <Animator>(); if (animator != null) { animator.Play(animation.name); } Finish(true); }
public override void OnExecute(IDialogueOwner dialogueOwner) { if (camera == null) { DevdogLogger.LogWarning("The player's camera is not defined. Can't set position"); Finish(true); return; } camera.SetCameraPosition(position); Finish(true); }
public override void OnExecute(IDialogueOwner dialogueOwner) { // var factionManager = QuestSystemLoveHateBridgeManager.factionManager; FactionMember factionMember = null; switch (ownerType) { case DialogueOwnerType.Player: { var p = PlayerManager.instance.currentPlayer; factionMember = p.GetComponent <FactionMember>(); break; } case DialogueOwnerType.DialogueOwner: { var qg = QuestManager.instance.currentQuestGiver; if (qg != null) { factionMember = qg.transform.GetComponent <FactionMember>(); } break; } default: throw new ArgumentOutOfRangeException(); } if (factionMember != null) { var deed = Deed.GetNew(deedInfo.tag, factionMember.factionID, deedInfo.targetFactionID, deedInfo.impact, deedInfo.aggression, factionMember.GetPowerLevel(), deedInfo.traits); // int numPersonalityTraits = factionManager.factionDatabase.personalityTraitDefinitions.Length; // float[] traits = Traits.Allocate(numPersonalityTraits, true); // Optional values that describe personality of deed. QuestSystemLoveHateBridgeManager.factionManager.CommitDeed ( factionMember, deed, requiresSight, dimension, radius ); Deed.Release(deed); } Finish(true); }
/// <summary> /// OnExecute is called the moment the node is executed. /// </summary> public override void OnExecute(IDialogueOwner dialogueOwner) { if (removeItem) { InventoryManager.RemoveItem(item.ID, amount, false); } else { item.currentStackSize = amount; InventoryManager.AddItem(item); } // Finish needs to be called to let execution know when the node is completed. False waits for input, true does not. Finish(true); }
public void MoveToNextNode(ILocalIdentifier localIdentifier, IDialogueOwner owner) { var n = currentNode.GetNextNode(); if (n != null) { MoveToNextNode(localIdentifier, n, owner); } else { if (currentNode.isLeafNode) { // Got to end, stop. Stop(localIdentifier); } } }
public override void OnExecute(IDialogueOwner dialogueOwner) { if (DialogueManager.instance.currentDialogueOwner != null && DialogueManager.instance.currentDialogueOwner.transform != null) { var trigger = DialogueManager.instance.currentDialogueOwner.transform.GetComponent <VendorTrigger>(); if (trigger != null) { #if !INVENTORY_PRO_LEGACY trigger.OnTriggerUsed(PlayerManager.instance.currentPlayer); #else trigger.OnTriggerUsed(InventoryPlayerManager.instance.currentPlayer); #endif } } Finish(true); }
public override void OnExecute(IDialogueOwner dialogueOwner) { var inventoryItems = GetRows(); if (InventoryManager.CanAddItems(inventoryItems)) { foreach (var item in inventoryItems) { var i = UnityEngine.Object.Instantiate<InventoryItemBase>(item.item); i.currentStackSize = item.amount; InventoryManager.AddItem(i); } Finish(true); return; } Failed(QuestManager.instance.languageDatabase.inventoryIsFull); // Couldn't add items }
public override void OnExecute(IDialogueOwner dialogueOwner) { switch (type) { case ChangeValueType.Change: QuestSystemLoveHateBridgeManager.factionManager.ModifyPersonalAffinity(judgeFactionName, subjectFactionName, affinity); break; case ChangeValueType.Set: QuestSystemLoveHateBridgeManager.factionManager.SetPersonalAffinity(judgeFactionName, subjectFactionName, affinity); break; default: throw new ArgumentOutOfRangeException(); } Finish(true); }
public override void OnExecute(IDialogueOwner dialogueOwner) { switch (type) { case Type.Add: quest.val.ChangeTaskProgress(questTask, amount); break; case Type.Set: quest.val.SetTaskProgress(questTask, amount); break; default: throw new ArgumentOutOfRangeException(); } Finish(true); }
public bool StartDialogue(IDialogueOwner dialogueOwner, ILocalIdentifier localIdentifier, uint nodeStartIndex = 0) { if (CanStart(localIdentifier) == false) { return(false); } // Start dialog DialogueManager.instance.SetCurrentDialogue(this, dialogueOwner); status = DialogueStatus.Active; currentNodeIndex = nodeStartIndex; MoveToNextNode(localIdentifier, dialogueOwner); DevdogLogger.LogVerbose("Started dialogue"); return(true); }
public override void OnExecute(IDialogueOwner dialogueOwner) { if (DialogueManager.instance.currentDialogueOwner != null) { var fsm = DialogueManager.instance.currentDialogueOwner.transform.GetComponent <PlayMakerFSM>(); if (fsm != null) { fsm.SendEvent(eventName); } else { DevdogLogger.LogWarning("No FSM found on dialogue owner. Event not invoked."); } } else { DevdogLogger.LogWarning("Dialogue not opened through a dialogue owner. No object is set and no FSM can therefore be found."); } Finish(true); }
public override void OnExecute(IDialogueOwner dialogueOwner) { waitTime = 0; // Reset wait time incase the node is being replayed. if (_timerHelper == null) { _timerHelper = TimerUtility.GetTimer(); } if (audioInfo.audioClip.val != null) { waitTime += audioInfo.audioClip.val.length; } else { DevdogLogger.LogError("[WaitForAudioNode] - Audio clip is missing from node: " + index + ". Dialogue: " + dialogueOwner.dialogue.name + "."); } waitTime += additionalWaitTime; _timerHelper.StartTimer(waitTime, null, OnTimerEnded); // Finish(true); // Finish once time is completed. }
public virtual void SetCurrentDialogue(Dialogue dialogue, IDialogueOwner owner) { if (_currentDialogue != null) { _currentDialogue.OnCurrentNodeChanged -= NotifyCurrentDialogueNodeChanged; _currentDialogue.OnStatusChanged -= NotifyCurrentDialogueStatusChanged; } var before = _currentDialogue; _currentDialogue = dialogue; _currentDialogueOwner = owner; if (_currentDialogue != null) { _currentDialogue.OnCurrentNodeChanged += NotifyCurrentDialogueNodeChanged; _currentDialogue.OnStatusChanged += NotifyCurrentDialogueStatusChanged; } if (before != _currentDialogue) { NotifyCurrentDialogueChanged(before, _currentDialogue, _currentDialogueOwner); } }
private void OnCurrentDialogueChanged(Dialogue.Dialogue before, Dialogue.Dialogue after, IDialogueOwner owner) { FireEvent("OnCurrentDialogueChanged", after); }
/// <summary> /// Called before the node is executed, and before the (UI) events are fired. /// </summary> public virtual void OnEnter(IDialogueOwner dialogueOwner) { }
private void OnCurrentDialogueStatusChanged(DialogueStatus before, DialogueStatus after, Dialogue.Dialogue self, IDialogueOwner owner) { FireEvent("OnCurrentDialogueStatusChanged", after.ToString()); }
public override void OnExecute(IDialogueOwner dialogueOwner) { Finish(owner.nodes[goToNodeIndex]); }
public override void OnExecute(IDialogueOwner dialogueOwner) { variable.value = value; Finish(true); }
protected virtual void OnCurrentDialogueStatusChanged(DialogueStatus before, DialogueStatus after, Dialogue self, IDialogueOwner owner) { switch (after) { case DialogueStatus.InActive: window.Hide(); break; case DialogueStatus.Active: window.Show(); break; default: throw new ArgumentOutOfRangeException("after", after, null); } }
public override void OnExecute(IDialogueOwner dialogueOwner) { // No finish, we only finish IF the player sets a decision index. }
protected void MoveToNextNode(ILocalIdentifier localIdentifier, NodeBase node, IDialogueOwner owner) { currentNode.OnExit(); node.OnEnter(owner); currentNodeIndex = node.index; node.OnExecute(owner); }
public void MoveToNextNode(NodeBase node, IDialogueOwner owner) { MoveToNextNode(QuestManager.instance.localIdentifier, node, owner); }
public abstract void OnExecute(IDialogueOwner dialogueOwner);
public override void OnExecute(IDialogueOwner dialogueOwner) { Finish(true); }
public bool StartDialogue(IDialogueOwner dialogueOwner, uint nodeStartIndex = 0) { return(StartDialogue(dialogueOwner, QuestManager.instance.localIdentifier, nodeStartIndex)); }