コード例 #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         myflowchart.SetBooleanVariable("player_in_range", true);
     }
 }
コード例 #2
0
    // Sets Up Initial the current values for the player
    private void setInitialPlayerAttributes()
    {
        // Sets up the current attributres for the player
        variableFlowchart.SetIntegerVariable("happiness", happiness);

        if (happiness <= 99)
        {
            curMood = 0;
        }
        else if (happiness >= 100 && happiness <= 199)
        {
            curMood = 1;
        }
        else if (happiness >= 200 && happiness <= 299)
        {
            curMood = 2;
        }
        else if (happiness >= 300 && happiness <= 399)
        {
            curMood = 3;
        }

        //moodValue = happiness % 100;

        variableFlowchart.SetIntegerVariable("curMood", curMood);
        variableFlowchart.SetIntegerVariable("weather", weather);
        variableFlowchart.SetStringVariable("currentDay", currentDay);
        variableFlowchart.SetStringVariable("nextDay", nextDay);
        variableFlowchart.SetBooleanVariable("isOnBreak", isOnBreak);
        variableFlowchart.SetBooleanVariable("dadWorkingToday", dadWorkingToday);
    }
コード例 #3
0
    // Update is called once per frame
    void Update()
    {
        if (isOnDialogArea)
        {
            if (Input.GetKeyDown(KeyCode.Space) && fc.GetBooleanVariable("Var") == false)
            {
                if (character.tag == "Character")
                {
                    fc.ExecuteBlock(character.GetComponent <CharDialog>().character.dialog);
                }
                else if (character.tag == "Item")
                {
                    fc.ExecuteBlock(character.GetComponent <ItemColected>().item.dialog);
                    character.GetComponent <Interact>().OnFocus();
                }
            }
        }

        if (Input.GetKeyDown(KeyCode.I))
        {
            fc.SetBooleanVariable("Var", true);
            PlayerMove.canvas.SetActive(true);
            PlayerMove.textarea.SetActive(false);
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            if (PlayerMove.canvas.activeSelf)
            {
                PlayerMove.canvas.SetActive(false);
                PlayerMove.textarea.SetActive(false);
                fc.SetBooleanVariable("Var", false);
            }
        }
    }
コード例 #4
0
 // Update is called once per frame
 void Update()
 {
     if (bossAI.behaviour == AIWolfShaman.BehaviourStates.pacified && !bossStatus.slain && !bossStatus.unconscious)
     {
         flow.SetBooleanVariable("TrueWinPossible", true);
     }
     else
     {
         flow.SetBooleanVariable("TrueWinPossible", false);
     }
     if (bossStatus.slain || bossStatus == null)
     {
         notFailCanvas.SetActive(true);
         prettyMuchWinCanvas.SetActive(false);
         winCanvas.SetActive(false);
     }
     else if (bossStatus.unconscious)
     {
         prettyMuchWinCanvas.SetActive(true);
         winCanvas.SetActive(false);
     }
     if ((bossStatus.unconscious || bossStatus.slain || bossStatus == null) && (playerStatus.unconscious || playerStatus.slain))
     {
         winCanvas.SetActive(false);
         failCanvas.SetActive(false);
         notFailCanvas.SetActive(false);
         watCanvas.SetActive(true);
         prettyMuchWinCanvas.SetActive(false);
     }
     if (!bossStatus.unconscious)
     {
         prettyMuchWinCanvas.SetActive(false);
     }
 }
コード例 #5
0
    void OnTriggerEnter()
    {
        flowchart.SetBooleanVariable(inNPCRange, true); //"inDingoRange"

        UICanvas.SetActive(true);
        UIDialogButtonText.SetActive(true);
    }
コード例 #6
0
ファイル: OceanDarkness.cs プロジェクト: sagittaeri/conductor
 public void CheckForCloseToSeahorse(GameObject thing)
 {
     if (IsCloseTo(thing))
     {
         flowchart.SetBooleanVariable("hasFoundSwordfish", true);
     }
 }
コード例 #7
0
ファイル: GameManager.cs プロジェクト: itemic/bad-manor
        /// <summary>
        /// Unity trigger for onLevelLoad events.
        /// </summary>
        /// <param name="level"></param>
        private void OnLevelWasLoaded(int level)
        {
            if (_saveGame == null)
            {
                return;
            }
            Flowchart  characFlowchart = null;
            Flowchart  itemFlowchart   = null;
            GameObject c1 = GameObject.Find("Char-Flowcharts");
            GameObject c2 = GameObject.Find("Item-Flowchart");

            characFlowchart = c1.GetComponent <Flowchart>();
            itemFlowchart   = c2.GetComponent <Flowchart>();

            Debug.LogWarning("TAKE ON UNITY");
            itemFlowchart.SetBooleanVariable("IsPluggedIn", _saveGame.IsPluggedIn);
            Debug.LogWarning("TAKE ON UNITY");
            itemFlowchart.SetBooleanVariable("IsBelt", _saveGame.IsBelt);
            Debug.LogWarning("TAKE ON UNITY");
            itemFlowchart.SetBooleanVariable("IsMachine", _saveGame.IsMachine);
            Debug.LogWarning("TAKE ON UNITY");
            characFlowchart.SetStringVariable("CURRENT_STATE", _saveGame.CURRENT_STATE);
            Debug.LogWarning("TAKE ON UNITY");
            characFlowchart.SetIntegerVariable("RNG", _saveGame.RNG);
            Debug.LogWarning("TAKE ON UNITY");
            ScoreManager = _saveGame.ScoreManager;
            Debug.LogWarning("TAKE ON UNITY");
            ScoreManager._stopwatch = new Stopwatch();
            Debug.LogWarning("TAKE ON UNITY");
            ScoreManager.resume();
            Debug.LogWarning("TAKE ON UNITY");
        }
コード例 #8
0
ファイル: Narrator.cs プロジェクト: nemui/ggj2019
    void Awake()
    {
        introFlowchart = GameObject.Find("IntroFlowchart").GetComponent <Flowchart>();
        talkFlowchart  = GameObject.Find("TalksFlowchart").GetComponent <Flowchart>();
        //infoDump.firstTime = true;
        if (infoDump.firstTime)
        {
            introFlowchart.enabled = true;
            infoDump.firstTime     = false;
        }
        else
        {
            talkFlowchart.enabled = true;
            talkFlowchart.SetIntegerVariable("DroneSpeed", infoDump.droneSpeed);
            talkFlowchart.SetIntegerVariable("PhobosPower", infoDump.phobosPower);
            talkFlowchart.SetIntegerVariable("DeimosPower", infoDump.deimosPower);
            talkFlowchart.SetIntegerVariable("FuelRegen", infoDump.fuelRegen);

            talkFlowchart.SetBooleanVariable("HasQInfo", infoDump.hasQInfo);
            talkFlowchart.SetBooleanVariable("HasQAdvice", infoDump.hasQAdvice);
            talkFlowchart.SetStringVariable("WeaponsStatus", infoDump.weaponSystemStatus);

            talkFlowchart.SetBooleanVariable("TalkedToQ", infoDump.talkedToQ);
            talkFlowchart.SetBooleanVariable("TalkedToAresa", infoDump.talkedToAresa);
            talkFlowchart.SetBooleanVariable("TalkedToPD", infoDump.talkedToPD);
        }
    }
コード例 #9
0
 public void Reset()
 {
     _questionIndex  = 0;
     _dollStateIndex = -1;
     initDic();
     SummaryWindow.ReSet();
     Flowchart.SetBooleanVariable("testFinish", false);
     Flowchart.ExecuteBlock("Reset");
 }
コード例 #10
0
 public void SetSexHeroiToFlowChart()
 {
     flowchart.SetBooleanVariable("HeroIsMale", heroiIsMale);
     if (heroiIsMale)
     {
         flowchart.SetStringVariable("Article", "o");
     }
     else
     {
         flowchart.SetStringVariable("Article", "a");
     }
 }
コード例 #11
0
ファイル: QuestItem.cs プロジェクト: axl-parangan/thesisRPG
 // Update is called once per frame
 void Update()
 {
     if (flowchart.GetBooleanVariable(questcomplete))
     {
         transform.parent.gameObject.SetActive(false);
     }
     if (flowchart.GetBooleanVariable("End"))
     {
         pc.canMove = true;
         flowchart.SetBooleanVariable("End", false);
         pause.enabled = true;
         pause.gameObject.SetActive(true);
     }
 }
コード例 #12
0
    //	Checks if there is an active dialogue element, creating a new boolean variable in a Scene named inDialogue is neccesary if you want to reuse the script.
    //  You also need to call the method after a say element in a block
    public void inDialogue()
    {
        var sayDialog = Fungus.SayDialog.GetSayDialog();

        dialogue = sayDialog.isActiveAndEnabled || EventSystem.current.IsPointerOverGameObject();
        flowchart.SetBooleanVariable("inDialogue", dialogue);
    }
コード例 #13
0
    IEnumerator TimerCountDown()
    {
        yield return(new WaitForSeconds(.1f));

        if (finishedTask)
        {
            yield break;
        }
        else
        {
            if (currentTimer > 0)
            {
                UpdateTimerText();
            }
            else
            {
                playerReference.maxElementCounter[questType] /= 2;

                if (playerReference.elementalList[questType] > playerReference.maxElementCounter[questType])
                {
                    playerReference.elementalList[questType] = playerReference.maxElementCounter[questType];
                }

                uiControllerReference.UpdateElement(questType);
                StartCoroutine(StopSideQuest1());
                quest1Pass = false; // QUEST FAILED
                flowchart.SetBooleanVariable("quest1Accepted", false);
            }
        }
    }
コード例 #14
0
    // called second
    void OnSceneLoaded(Scene scene, LoadSceneMode mode)
    {
        if (SceneManager.GetActiveScene().name == "Tutorial")
        {
            flow.SetBooleanVariable("firstTimePlayer", false);
        }

        if (SceneManager.GetActiveScene().name == "Game Cutscene")
        {
            flow = GameObject.FindGameObjectWithTag("Game Flowchart").GetComponent <Flowchart>();
        }
        //Debug.Log("OnSceneLoaded: " + scene.name);
        //Debug.Log(mode);
        ////if (!diedBool)
        ////{
        //    if (GameObject.Find("Start Point") && player)
        //    {
        //        player.transform.position = GameObject.Find("Start Point").transform.position;
        //    }


        //}
        //else
        //{
        //    diedBool = false;
        //}
    }
コード例 #15
0
ファイル: StoryController.cs プロジェクト: PinChiehYu/Yu
    private void ConditionsProcess(string name)
    {
        if (storyConditionsData == null)
        {
            return;
        }

        for (int i = 0; i < storyConditionsData.Conditions.Count; i++)
        {
            if (storyConditionsData.Conditions[i] == name)
            {
                storyConditionsData.Conditions.Remove(storyConditionsData.Conditions[i]);
            }
        }
        flowchart.SetBooleanVariable(HasFinishedConditions_BooleanVariable, storyConditionsData.CheckResult());
    }
コード例 #16
0
 public void CheckDate()
 {
     if (date == halloween)
     {
         flow.SetBooleanVariable("Halloween", true);
     }
 }
コード例 #17
0
ファイル: ButtonClicked.cs プロジェクト: csinrn/DragonEgg
    public void FirstEnterClicked()
    {
        InputField input   = GameObject.FindObjectOfType <InputField>();
        Text       textBox = input.GetComponentInChildren <Text>();

        // check if inputText == getEgg password , if yes, load dragon Scene
        // if not, show "wrong Password"
        if (passlist.pwarray[0].key == textBox.text)
        {
            dragon.GetEgg = true;

            //save dragon as getEgg == true
            dragon.Save();

            DontDestroyOnLoad(dragon);
            Flowchart flowchart = GameObject.FindObjectOfType <Flowchart>();
            flowchart.SetBooleanVariable("getEgg", true);
            print(flowchart.GetBooleanVariable("getEgg"));
        }
        else
        {
            input.text = "";
            GameObject.Find("Placeholder").GetComponent <Text>().text = "Wrong Password";
        }
    }
コード例 #18
0
    //When the hero arrives
    private void HeroArrival()
    {
        hero.SetActive(true);
        if (BL_Converse)
        {
            StartCoroutine(Entry());
            BL_Converse = false;
        }

        if (flowchart.GetBooleanVariable("bl_heroDialogue") == true)
        {
            CurrentState = InteractionState.Minigame;
            BL_Converse  = true;
            flowchart.SetBooleanVariable("bl_heroDialogue", false);
        }
    }
コード例 #19
0
ファイル: Narrator.cs プロジェクト: nemui/ggj2019
 public void WakedASystem()
 {
     if (++infoDump.wakedSystems == infoDump.systemCount)
     {
         introFlowchart.SetBooleanVariable("WakedAllSystems", true);
         infoDump.wakedSystems = 0;
     }
 }
コード例 #20
0
 private void Update()
 {
     if (FC.GetBooleanVariable("Activate"))
     {
         score++;
         FC.SetBooleanVariable("Activate", false);
     }
 }
コード例 #21
0
 public void EndGame()
 {
     if (!isBlockExecuting("Ending"))
     {
         flowChart.SetBooleanVariable("toEnd", true);
         flowChart.ExecuteBlock("Ending");
     }
 }
コード例 #22
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject == player && foundLeaf)
     {
         flowchart1.ExecuteBlock("Dialogue1");
         flowchart1.SetBooleanVariable("FirstTalk", true);
     }
 }
コード例 #23
0
ファイル: ButtonClicked.cs プロジェクト: csinrn/DragonEgg
    // when start btn clicked, show password panel in flowchart
    // if getEgg , load to dragon scene
    public void StartBtnClicked()
    {
        print("in StartBtn Clicked");
        DontDestroyOnLoad(dragon);

        Flowchart flowchart = GameObject.FindObjectOfType <Flowchart>();

        flowchart.SetBooleanVariable("Started", true);
    }
コード例 #24
0
    // Update is called once per frame
    void Update()
    {
        //ray在camera中間
        ray = Camera.main.ScreenPointToRay(new Vector3(Screen.width / 2, Screen.height / 2, 0));
        Vector3 forward = transform.TransformDirection(Vector3.forward) * 2;

        Debug.DrawRay(transform.position, forward, Color.yellow);


        if (Physics.Raycast(ray, out hit, raylength))              //out是被打到ㄉ
        {
            if (Input.GetMouseButtonUp(0))                         //按下滑鼠
            {
                if (hit.transform.gameObject.tag == "interactive") //可以使用的道具
                {
                    int index = (int)Enum.Parse(typeof(intereactiveIndex), hit.transform.gameObject.name);

                    //檢查點到東西的名稱,把ability的真假值改掉
                    //print(ability[index]); //debug
                    Destroy(hit.transform.gameObject);
                }
                else if (hit.transform.gameObject.tag == "clues") // 要蒐集的物件
                {
                    if (hit.transform.gameObject.name == "diary")
                    {
                        diary.gameObject.SetActive(true);
                    }
                }
                else if (hit.transform.gameObject.tag == "checking") //調查物件
                {
                    if (flowchart.GetBooleanVariable("talking") == false)
                    {
                        player.GetComponent <player_fungus_village>().send_messege(hit.transform.name);//用fungus顯示物品資訊
                    }
                    if (hit.transform.gameObject.name == "Target_Box")
                    {
                        print("拿到貨物");
                        Flowchart.BroadcastFungusMessage("check_targetbox");
                        flowchart.SetBooleanVariable("DoneBoxTask", true);
                    }
                }

                else if (hit.transform.gameObject.tag == "Door")
                {
                    hit.transform.gameObject.GetComponent <Door_controller>().hit();
                }
            }
        }

        if (diary.gameObject.activeSelf)
        {
            if (Input.anyKey)
            {
                diary.gameObject.SetActive(false);
            }
        }
    }
コード例 #25
0
    public void DragEnd()
    {
        Debug.Log("Drag End");

        if (Time.time - sliceTime < 0.5f)
        {
            Debug.Log("You sliced the belt!");
            Flowchart.SetBooleanVariable("beltcut", true);
        }
    }
コード例 #26
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.Q))
     {
         situation = !situation;
         Backpack.SetActive(situation);
         //開關背包
         if (situation)
         {
             flowchart.SetBooleanVariable("talking", true);
             maincamera.GetComponent <Camera_controller>().unlockMouse();
         }
         else
         {
             flowchart.SetBooleanVariable("talking", false);
             maincamera.GetComponent <Camera_controller>().lockMouse();
         }
     }
 }
コード例 #27
0
ファイル: GameFlow.cs プロジェクト: kurantoB/easy-youmu
    public void HandleContinue(Command sayCommand, BaseContinue bc)
    {
        string nextBlock = flowChart.GetStringVariable("NextBlock");

        if (!"Empty".Equals(nextBlock))
        {
            flowChart.StopAllBlocks();
            flowChart.ExecuteBlock(nextBlock);
            flowChart.SetStringVariable("NextBlock", "Empty");
            if (flowChart.GetStringVariable("ConvoStage").Equals("MidConvo"))
            {
                flowChart.SetBooleanVariable("BadTransition", true);
            }
            else if (flowChart.GetStringVariable("ConvoStage").Equals("ConfessionApproach"))
            {
                // good transition
                flowChart.SetStringVariable("ConvoStage", "MidConvo");
                flowChart.SetIntegerVariable("CommandIndex", 0);
                flowChart.SetStringVariable("CurrentBlock", nextBlock);
                TopicManager.instance.RegisterTopic(nextBlock);
                TopicManager.instance.ClearTopicRoll();
                TopicManager.instance.ActivateTopicRoll();
            }
        }
        else
        {
            if (flowChart.GetBooleanVariable("BadTransition"))
            {
                flowChart.StopAllBlocks();
                flowChart.ExecuteBlock("AbruptTopicChange");
                flowChart.SetBooleanVariable("BadTransition", false);
            }
            else
            {
                if (!sayCommand.ParentBlock.BlockName.Equals("AbruptTopicChange"))
                {
                    // Normal flow
                    flowChart.SetIntegerVariable("CommandIndex", (sayCommand.CommandIndex + 1));
                }
                bc();
            }
        }
    }
コード例 #28
0
    void Update()
    {
        travisScoreText.text = travisActualScore.ToString();
        dessyScoreText.text  = dessyActualScore.ToString();


        if (storyChart.GetBooleanVariable("TWin") == true)
        {
            if (storyChart.GetBooleanVariable("TravisPoint") == true)
            {
                Debug.Log("Travis get point");
                travisActualScore++;
                storyChart.SetBooleanVariable("TravisPoint", false);
            }
        }

        if (storyChart.GetBooleanVariable("DWin") == true)
        {
            if (storyChart.GetBooleanVariable("DessyPoint") == true)
            {
                Debug.Log("dessy get point");
                dessyActualScore++;
                storyChart.SetBooleanVariable("DessyPoint", false);
            }
        }

        if (storyChart.GetBooleanVariable("DecreasePoint") == true)
        {
            travisActualScore--;
            dessyActualScore--;
            storyChart.SetBooleanVariable("DecreasePoint", false);
        }

        if (storyChart.GetBooleanVariable("DisableRain") == true)
        {
            rainMaker.SetActive(false);
        }
        else
        {
            rainMaker.SetActive(true);
        }
    }
コード例 #29
0
    // Start is called before the first frame update
    void Start()
    {
        //kommer säkert behöva skriva en funktion för hur det funkar
        flowchart = GetComponent <Flowchart>();
        flowchart.SetBooleanVariable("HaveFlower", haveFlower);



        chr_Kawi.loveMeter.SetSize(0f);
        chr_Unkel.loveMeter.SetSize(0f);
    }
コード例 #30
0
    private void prepareFungusForConverstion(NpcController npc)
    {
        Customer info = npc.customerInfo;

        dialogFlowchart.SetStringVariable("openingLine", info.openingLine);
        dialogFlowchart.SetStringVariable("request", info.request);
        dialogFlowchart.SetBooleanVariable("ignoresYou", info.ignoresYou);
        dialogFlowchart.SetStringVariable("description", info.description);
        dialogFlowchart.SetStringVariable("exitLine", ExitLines.lines[Random.Range(0, ExitLines.lines.Length)]);
        dialogFlowchart.SendFungusMessage("initiateConversation");
    }