Example #1
0
        private void OnTriggerEnter2D(Collider2D trigger)
        {
            if (AutoStart)
            {
                DialogueDisplayer.ShowDialogue(DialogueStorage.GetDialogueByID(DialogueID));
                return;
            }

            if (trigger.tag == PlayerBehaviour.kPlayerTag && trigger.isTrigger)
            {
                ActionPerformer.Instance.SetAction(_dialogueAction, gameObject);
            }
        }
Example #2
0
        private static void InitDialogueAction()
        {
            InteractiveAction action = (GameObject obj) =>
            {
                var trigger = obj.GetComponent <DialogTrigger>();

                var dialogue = DialogueStorage.GetDialogueByID(trigger.DialogueID);
                DialogueDisplayer.ShowDialogue(dialogue);
            };

            var dialogueAction = new ActionBase("action.id.dialogue", (GameObject owner) => { return(true); }, action);

            _actions.Add("action.id.dialogue", dialogueAction);
        }
Example #3
0
        private static void InitQuests()
        {
            ActionRequirement req = (GameObject owner) =>
            {
                var containsitem = PlayerInventory.Instance.GetItems().Count(i => i.ItemID == "genericitem.id.toybear") > 0;
                return(containsitem);
            };

            InteractiveAction action = (GameObject obj) =>
            {
                var dialogue = DialogueStorage.GetDialogueByID("dialogue.id.thanks");
                PlayerInventory.Instance.RemoveItemFromInventory("genericitem.id.toybear");

                DialogueDisplayer.ShowDialogue(dialogue);
            };

            var newQuest = new Quest("quest.id.gettovault", "Find your way to vault", req, action);

            _quests.Add(newQuest.ID, newQuest);
        }
Example #4
0
        private static void InitQuests()
        {
            var gettovault = new Quest("quest.id.gettovault", "Find your way to vault", (GameObject owner) => { return(true); }, (GameObject owner) => { DialogueDisplayer.ShowDialogue(DialogueStorage.GetDialogueByID("dialogue.id.vault")); });

            var getbear = new Quest("quest.id.getbear", "Find some toy for a kid", (GameObject owner) =>
            {
                return(PlayerInventory.Instance.GetItems().Count(i => i.ItemID == "genericitem.id.toybear") > 0);
            },
                                    (GameObject obj) =>
            {
                PlayerInventory.Instance.RemoveItemFromInventory("genericitem.id.toybear");
                DialogueDisplayer.ShowDialogue(DialogueStorage.GetDialogueByID("dialogue.id.kidend"));
            });

            var getnails = new Quest("quest.id.getnails", "Find nails", (GameObject owner) =>
            {
                return(PlayerInventory.Instance.GetItems().Count(i => i.ItemID == "genericitem.id.nails") > 0);
            },
                                     (GameObject obj) =>
            {
                PlayerInventory.Instance.RemoveItemFromInventory("genericitem.id.nails");

                DialogueDisplayer.ShowDialogue(DialogueStorage.GetDialogueByID("dialogue.id.scholarend"));
            });

            var getlock = new Quest("quest.id.getlock", "Get something with lock", (GameObject owner) =>
            {
                return(PlayerInventory.Instance.GetItems().Count(i => i.ItemID == "genericitem.id.chain") > 0);
            },
                                    (GameObject obj) =>
            {
                PlayerInventory.Instance.RemoveItemFromInventory("genericitem.id.chain");

                DialogueDisplayer.ShowDialogue(DialogueStorage.GetDialogueByID("dialogue.id.lockpicktought"));
            });

            _quests.Add(gettovault.ID, gettovault);
            _quests.Add(getlock.ID, getlock);
            _quests.Add(getbear.ID, getbear);
            _quests.Add(getnails.ID, getnails);
        }