Beispiel #1
0
        private static void InitDialogueActions()
        {
            _actions.Add("dialogue.id.childgroup_one", () =>
            {
                GameObject.Find("ChildrenPolilogue").GetComponentInChildren <DialogTrigger>().AutoStart = false;
                QuestController.StartQuest("quest.id.gettovault");
                SwapNPCPosition("ChildrenPolilogue", "ChildrenPolilogueFinished");
            });

            _actions.Add("dialogue.id.genny", () =>
            {
                SwapNPCPosition("GennyTalk", "GennyTrade");
            });

            _actions.Add("dialogue.id.kidstart", () =>
            {
                QuestController.StartQuest("quest.id.getbear");
            });

            _actions.Add("dialogue.id.kidend", () =>
            {
                SwapNPCPosition("ScholarMad", "Scholar");
            });

            _actions.Add("dialogue.id.scholar", () =>
            {
                QuestController.StartQuest("quest.id.getnails");
            });

            _actions.Add("dialogue.id.lockpickteach", () =>
            {
                SwapNPCPosition("GennyStart", "GennyTalk");
                QuestController.StartQuest("quest.id.getlock");
            });

            _actions.Add("dialogue.id.scholarend", () =>
            {
                PlayerInventory.Instance.TryAddItemToInventory(ItemsData.GetItemById("genericitem.id.lockpick"));
                //var girlposition = GameObject.Find("GirlPosition");
                //var girl = GameObject.Find("LostGirl");

                SwapNPCPosition("Picker", "PickerTeacher");

                //girl.transform.position = girlposition.transform.position;
            });

            _actions.Add("dialogue.id.madscholar", () =>
            {
                SwapNPCPosition("KidBusy", "Kid");
            });

            _actions.Add("dialogue.id.lockpicktought", () =>
            {
                PlayerQuirks.ModifySkill(EPlayerSkills.Lockpicking, 20);
            });
        }
Beispiel #2
0
        private static void InitContainerAction()
        {
            InteractiveAction action = (GameObject obj) =>
            {
                ProcessBarController.StartProcessWithCompletion(3f * PlayerQuirks.GetSkill(EPlayerSkills.Scavanging),
                                                                Resources.Load <Sprite>("Sprites/Actions/action.id.container"), () =>
                {
                    var container = obj.GetComponent <Container>();
                    ContainerUI.ShowForContainer(container);
                }, Color.green);
            };

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

            _actions.Add("action.id.container", containerAction);
        }
Beispiel #3
0
        private static void InitHideAction()
        {
            ActionRequirement openActionRequirement = (GameObject owner) =>
            {
                return(!PlayerQuirks.Attacked && PlayerQuirks.GetSkill(EPlayerSkills.Hiding) > 0);
            };

            InteractiveAction action = (GameObject obj) =>
            {
                var doorway = obj.GetComponent <Hideout>();

                ProcessBarController.StartProcessWithCompletion(3f * PlayerQuirks.GetSkill(EPlayerSkills.Hiding), doorway.Action.ActionImage, () =>
                {
                    PlayerBehaviour.CurrentPlayer.Renderer.enabled = false;
                    PlayerQuirks.Hidden = true;
                }, Color.grey);
            };

            var openDoorAction = new ActionBase(Hideout.kHideAction, openActionRequirement, action);

            _actions.Add(Hideout.kHideAction, openDoorAction);
        }
Beispiel #4
0
        private static void InitDragAction()
        {
            var undrag = new ActionBase("action.id.undrag", (GameObject obj) => { return(true); },
                                        (GameObject obj) => { RopeDragController.Unbind(obj);
                                                              PlayerQuirks.Drags = false; });

            ActionRequirement openActionRequirement = (GameObject owner) =>
            {
                return(PlayerInventory.Instance.GetItems().Any(i => i.ItemID == "genericitem.id.rope") && !PlayerQuirks.Drags);
            };
            InteractiveAction action = (GameObject obj) =>
            {
                ProcessBarController.StartProcessWithCompletion(3f * PlayerQuirks.GetSkill(EPlayerSkills.Hiding), Resources.Load <Sprite>("Sprites/Actions/action.id.drag"), () =>
                {
                    RopeDragController.Bind(obj);
                }, Color.yellow);
            };

            var drag = new ActionBase("action.id.drag", openActionRequirement, action);

            _actions.Add(drag.ActionID, drag);
            _actions.Add(undrag.ActionID, undrag);
        }
Beispiel #5
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     PlayerQuirks.ModifySkill(EPlayerSkills.Scavanging, 3);
 }