Beispiel #1
0
        public void EndDialog()
        {
            var cam = GetObject.RPGCamera;

            cam.cameraMode = Rm_RPGHandler.Instance.DefaultSettings.DefaultCameraMode;
            if (cam.cameraMode != CameraMode.Manual)
            {
                cam.transform.position = cam.desiredPosition;
            }

            DialogNpc = null;

            if (EvaluatingQuestDialog)
            {
                //todo: is this the right place?!
                if (!string.IsNullOrEmpty(PostQuestEvaluationNodeID))
                {
                    DialogNodeChain = OldNodeChain;
                    if (DialogNodeChain != null)
                    {
                        DialogNodeChain.Goto(PostQuestEvaluationNodeID);
                    }
                }
                else
                {
                    DialogNodeChain = null;
                    GetObject.PlayerMono.Controller.Interacting = false;
                }

                OldNodeChain          = null;
                EvaluatingQuestDialog = false;
            }
            else if (EvaluatingQuestCompleteDialog)
            {
                //todo: is this the right place?!
                QuestHandler.Instance.CompleteQuest(EvaluatingQuestID);
                if (!string.IsNullOrEmpty(PostQuestEvaluationNodeID))
                {
                    DialogNodeChain = OldNodeChain;
                    if (DialogNodeChain != null)
                    {
                        DialogNodeChain.Goto(PostQuestEvaluationNodeID);
                    }
                }
                else
                {
                    DialogNodeChain = null;
                    GetObject.PlayerMono.Controller.Interacting = false;
                }
                OldNodeChain = null;
                EvaluatingQuestCompleteDialog = false;
            }
            else
            {
                if (dialogQuestCondition != null)
                {
                    dialogQuestCondition.IsDone = true;
                    RPG.Events.OnQuestStatusUpdate();
                    var deliverCondition = dialogQuestCondition as DeliverCondition;
                    if (deliverCondition != null)
                    {
                        GetObject.PlayerCharacter.Inventory.RemoveItem(deliverCondition.ItemToDeliverID);
                    }
                    dialogQuestCondition = null;
                }

                DialogNodeChain = null;
                GetObject.PlayerMono.Controller.Interacting = false;
            }

            CheckForUpdate();
        }
Beispiel #2
0
 public void ChooseResponse(PlayerResponseNode response)
 {
     DialogNodeChain.Goto(response.ID);
     CheckForUpdate();
 }