コード例 #1
0
    public override bool Use(ref Item i)
    {
        Item item;

        if (Systems.Inventory.HasItem((item = Resources.Load <Item>("Items/DirtyMustardWater")), 1))
        {
            Systems.Inventory.RemoveItem(Resources.Load <Item>("Items/PurificationTablet"), 4);
            Systems.Inventory.RemoveItem(item, 1);
            Systems.Inventory.AddItem(Resources.Load <Item>("Items/CleanMustardWater"), 1);

            _banner = GameObject.Find("GUI").GetComponent <GuiDisplayer>().GetBanner();
            string current = _banner.info.text;

            if (current.Contains(", and clean water"))
            {
                current = current.Replace(", and clean water", "");
                current = current.Replace(", ", ", and ");
            }
            current = current.Replace(", clean water", "");
            current = current.Replace(" clean water,", "");
            current = current.Replace("Find and", "Find");

            if (current == "Find ")
            {
                _banner.ChangeText("Talk to survivors");
            }
            //things left on list to find
            else
            {
                _banner.ChangeText(current);
            }
        }

        return(false);
    }
コード例 #2
0
    void OnTriggerEnter(Collider other)
    {
        if (!playerInCollider && other.CompareTag("Player"))
        {
            CallOnEnterCollider.Invoke();

            interactText.ChangeText(InteractionDisplayText);

            playerInCollider = true;
            timer            = .6f;
            blinkOn          = false;
        }
    }
コード例 #3
0
    private void MiniGameFinished()
    {
        Systems.Status.UnPause();

        SceneManager.UnloadSceneAsync(MiniGameSceneName);

        Systems.Objectives.Satisfy("WATERHEATEREVENT");
        camera.SetActive(true);
        canvi.SetActive(true);
        // sunlight.SetActive(true);
        levelMusic.SetActive(true);
        waterMusic.SetActive(false);


        _inventory.RemoveItem(MustardWater, 1);
        _inventory.AddItem(FilledWater, 1);

        Heater.SetActive(true);
        //_interact.Kill();

        UIManager.Instance.ToggleActive(theGUI);

        GameObject.Find("InventoryZip").GetComponent <AudioSource>().Play();

        _interact.Kill();

        Spot.SetActive(false);
        if (Systems.Objectives.Check("LatrineTalk"))
        {
            if (Systems.Inventory.HasItem(Resources.Load <Item>("Items/Rope"), 1) && !Systems.Inventory.HasItem(Resources.Load <Item>("Items/Shovel"), 1))
            {
                _canvas.ChangeText("Find a shovel");
            }
            else if (!Systems.Inventory.HasItem(Resources.Load <Item>("Items/Rope"), 1) && Systems.Inventory.HasItem(Resources.Load <Item>("Items/Shovel"), 1))
            {
                _canvas.ChangeText("Find a rope");
            }
            if (!Systems.Inventory.HasItem(Resources.Load <Item>("Items/Rope"), 1) && !Systems.Inventory.HasItem(Resources.Load <Item>("Items/Shovel"), 1))
            {
                _canvas.ChangeText("Find a shovel and a rope");
            }
        }
        else
        {
            _canvas.ChangeText(words);
        }

        //Destroy(gameObject);
        //Destroy(this);
    }
コード例 #4
0
    // everything that happens during the earthquake
    private IEnumerator ShakeIt()
    {
        Instantiate(dustStormPrefab, new Vector3(100, 10, -65), Quaternion.identity);

        foreach (Clobberer c in clobberers)
        {
            c.enabled = true;
        }

        int shakes = 1;

        while (true)
        {
            shakecamera(ShakeDuration, ShakeAmplitude, ShakeFrequency);
            // camera.ShakeCamera(duration, amplitude, frequency, false);
            StartCoroutine(FlapDoors(ShakeDuration));
            yield return(new WaitForSeconds(ShakeDuration));

            // if the player is in the safezone, and the earthquake has gone long enough, stop it
            if (_inSafeZone && shakes >= _minimumShakes)
            {
                break;
            }

            shakes++;
        }

        StopQuake();
        //foreach (Clobberer c in clobberers)
        //{
        //    c.enabled = false;
        //}

        frontDoor.GetComponent <Clobberer>().enabled = false;
        //added 189
        backDoor.GetComponent <Clobberer>().enabled = false;
        //added 193
        bedroomDoor.GetComponent <Clobberer>().enabled    = false;
        bedroomDoor.GetComponent <Clobberer>().aftershock = true;

        _informationCanvas.ChangeText(textAfterQuake);
        Systems.Objectives.Satisfy("SURVIVEQUAKE");
        Systems.Objectives.Register(QuakeManager.Instance.leaveHouse, () => _leaveSatisfied = true);

        enableDoors.SetActive(false); // allow player to exit house

        quakes++;
    }
コード例 #5
0
    public void AddCarbon()
    {
        if (made)
        {
            if (Systems.Inventory.HasItem(mulch, 1) && Systems.Inventory.HasItem(paper, 1))
            {
                carbon.SetActive(true);
                Systems.Objectives.Satisfy("COMPOSTFINISHED");
                Systems.Objectives.Satisfy("HasBuiltCompostingSystem");
                if (GameObject.Find("BruceAlert") != null)
                {
                    GameObject.Find("BruceAlert").GetComponent <FlatFollow>().appear();
                }
                _banner.ChangeText("Talk to Bruce");
                Systems.Inventory.RemoveItem(mulch, 1);
                Systems.Inventory.RemoveItem(paper, 1);

                CorgiMinigame.SetActive(true);
                Frank.SetActive(false);


                _interact.ToggleVisibility(false);
                circle.SetActive(false);
                Destroy(cube);
            }
            else
            {
                cube.GetComponent <InteractWithObject>().SetInteractText("You need to gather more carbon material");
            }
        }
    }
コード例 #6
0
 public void Update()
 {
     if (_satisfied)
     {
         _canvas.ChangeText("Find Ahmad's vehicle");
     }
 }
コード例 #7
0
 private void OnTriggerEnter(Collider other)
 {
     QuakeManager.Instance.TriggerCountdown(2f);
     _canvas.ChangeText("Have a look around...");
     Logger.Instance.Log("Player has left the house");
     Destroy(gameObject);
 }
コード例 #8
0
    private void MiniGameFinished()
    {
        Systems.Status.UnPause();

        SceneManager.UnloadSceneAsync(MiniGameSceneName);

        Systems.Objectives.Satisfy("TOILETEVENT");
        camera.SetActive(true);
        vcam.SetActive(true);
        canvi.SetActive(true);
        sunlight.SetActive(true);
        levelMusic.SetActive(true);
        toiletMusic.SetActive(false);

        _inventory.RemoveItem(Bucket, 2);
        _inventory.RemoveItem(Bag, 1);
        _inventory.RemoveItem(Sawdust, 1);
        // _inventory.RemoveItem( Sanitizer, 1);
        // _inventory.RemoveItem( ToiletPaper, 1);

        UIManager.Instance.ToggleActive(theGUI);

        _canvi = GameObject.Find("GUI").GetComponent <GuiDisplayer>().GetBanner();
        _canvi.ChangeText("Talk to Ahmad");

        Buckets.SetActive(true);
        Spot.SetActive(false);
        //Destroy(gameObject);
        //Destroy(this);

        Systems.Status.AffectRelief(100);
        GameObject.Find("MeterDing").GetComponent <AudioSource>().Play();

        Systems.Status.SpeedUpWarmthLoss();
    }
コード例 #9
0
    private IEnumerator EnableTheWater()
    {
        yield return(new WaitForSeconds(7f));

        Water1.SetActive(false);
        //Pot.SetActive(false);
        Water.SetActive(true);

        Systems.Objectives.Satisfy("PotWithWater");

        _canvas.ChangeText(words);
        GameObject.Find("LocationsOfInterest").GetComponent <HintController>().StartThisTask("GetWater");

        if (GameObject.Find("MariaAlert") != null)
        {
            GameObject.Find("MariaAlert").GetComponent <FlatFollow>().appear();
        }
        BruceController.transform.position = new Vector3(-205, 0, -175);
        if (GameObject.Find("BrucePointer") != null)
        {
            GameObject.Find("BrucePointer").GetComponent <FlatFollow>().appear();
        }
        if (GameObject.Find("BruceAlert") != null)
        {
            GameObject.Find("BruceAlert").GetComponent <FlatFollow>().appear();
        }
    }
コード例 #10
0
    // everything that happens during the earthquake
    private IEnumerator ShakeIt()
    {
        Instantiate(dustStormPrefab, new Vector3(100, 10, -65), Quaternion.identity);

        foreach (Clobberer c in clobberers)
        {
            c.enabled = true;
        }

        int shakes = 0;

        while (true)
        {
            camera.ShakeCamera(duration, amplitude, frequency, false);
            StartCoroutine(FlapDoors(duration));
            yield return(new WaitForSeconds(duration));

            // if the player is in the safezone, and the earthquake has gone long enough, stop it
            if (_inSafeZone && shakes >= _minimumShakes)
            {
                break;
            }

            shakes++;
        }

        StopQuake();
        foreach (Clobberer c in clobberers)
        {
            c.enabled = false;
        }
        _informationCanvas.ChangeText(textAfterQuake);

        enableDoors.SetActive(false); // allow player to exit house

        quakes++;
    }
コード例 #11
0
    public void ChangeBanners()
    {
        if (mulch && paper && wood)
        {
            print("I GOT ALL THREE!!!");
            _canvas.ChangeText(words);
            GameObject.Find("LocationsOfInterest").GetComponent <HintController>().AllTaskCompleted(GameObject.Find("Materials"));
            GameObject.Find("LocationsOfInterest").GetComponent <HintController>().StartThisTask("Compost");
        }
        if (!mulch && !paper && wood)
        {
            print("WOOD ONLY");
            _canvas.ChangeText(words1);
        }
        if (mulch && !paper && !wood)
        {
            print("MULCHHH ONLY");
            _canvas.ChangeText(words2);
        }
        if (!mulch && paper && !wood)
        {
            print("PAPER ONLY");
            _canvas.ChangeText(words3);
        }

        if (mulch && paper && !wood)
        {
            print("find wood");
            _canvas.ChangeText(words4);
        }
        if (!mulch && paper && wood)
        {
            print("find mulch");
            _canvas.ChangeText(words5);
        }
        if (mulch && !paper && wood)
        {
            print("find paper");
            _canvas.ChangeText(words6);
        }
        if (!mulch && !paper & !wood)
        {
            print("I have nothing");
            _canvas.ChangeText("Find carbon material and wood");
        }
    }
コード例 #12
0
    // Update is called once per frame
    void Update()
    {
        if (Systems.Inventory.HasItem(Wood, 1) && check == 0)
        {
            script.enabled = true;
            check          = 1;
        }

        words = "Build a fire and set up the pot to boil water";


        if (Systems.Inventory.HasItem(Resources.Load <Item>("Items/Wood"), 1) &&
            Systems.Inventory.HasItem(Resources.Load <Item>("Items/Pot"), 1))
        {
            _canvas.ChangeText(words);
        }
    }
コード例 #13
0
    private void OnTriggerExit(Collider other)
    {
        Debug.Log("CHANGE TO TWO");
        QuakeManager.Instance.TriggerCountdown(2f);
        aftershock = true;
        _canvas.ChangeText("Talk to survivors");
        Systems.Objectives.Satisfy("LEAVEHOUSE");
        //Systems.Objectives.Register("TOILETTALK", () => _satisfied = true); Redundant with MissionBucket
        if (GameObject.Find("TablePointer") != null)
        {
            GameObject.Find("TablePointer").GetComponent <FlatFollow>().disappear();
        }
        //Logger.Instance.Log("Player has left the house");
        LogToServer logger = GameObject.Find("Logger").GetComponent <LogToServer>();

        logger.sendToLog("Player left the house", "LOCATION");
        Destroy(gameObject);
    }
コード例 #14
0
    private void MiniGameFinished()
    {
        Systems.Status.UnPause();
        MiniGameMusic.SetActive(false);
        LevelMusic.SetActive(true);
        DrainPipe.SetActive(false);
        BarrelEnd.SetActive(true);
        Particles.SetActive(false);
        Storm.SetActive(true);
        _canvas.ChangeText(BewareTheStorm);
        SchoolEntrance.enabled = true;
        Systems.Status.SpeedUpWarmthLoss();

        SceneManager.UnloadSceneAsync(MiniGameSceneName);

        Systems.Objectives.Satisfy("BARRELSETUP");
        camera.SetActive(true);
        vcam.SetActive(true);
        canvi.SetActive(true);
        sunlight.SetActive(true);
        //levelAudio.SetActive(true);
    }
コード例 #15
0
    private void MiniGameFinished()
    {
        //Place1.SetActive(false);

        PitLatrine.SetActive(true);
        House.SetActive(true);
        Player.SetActive(true);
        Systems.Status.UnPause();

        SceneManager.UnloadSceneAsync(MiniGameSceneName);


        Systems.Objectives.Satisfy("BuiltLatrine");
        camera.SetActive(true);
        canvi.SetActive(true);
        sunlight.SetActive(true);
        levelMusic.SetActive(true);
        latrineMusic.SetActive(false);

        _inventory.RemoveItem(Rope, 1);
        _inventory.RemoveItem(Shovel, 1);

        _interact.Kill();
        _canvas.ChangeText("Find shelter");

        Systems.Status.AffectRelief(100);
        GameObject.Find("MeterDing").GetComponent <AudioSource>().Play();

        Systems.Status.SpeedUpWarmthLoss();

        //Place2.SetActive(false);
        UIManager.Instance.ToggleActive(theGUI);
        Destroy(Place1);
        Destroy(Place2);
        Destroy(this);
    }
コード例 #16
0
    private IEnumerator StartCutScene()
    {
        //if the sanitation is built, wait for four seconds and trigger "In the meantime..." slide
        yield return(new WaitForSeconds(1.5f));

        MiniGameClose.SetActive(false);
        if (GameObject.Find("Music") != null)
        {
            GameObject.Find("Music").GetComponent <AudioSource>().Pause();
        }
        InTheMeantimeCanvas.SetActive(true);

        //then trigger the video
        yield return(new WaitForSeconds(3f));

        Systems.Status.Pause();
        VideoBackground.SetActive(true);
        VideoDisplayer.SetActive(true);
        Video.SetActive(true);
        Video.GetComponent <VideoPlayer>().Play();

        InTheMeantimeCanvas.SetActive(false);
        yield return(new WaitForSeconds(63f));

        //turn off the video
        Systems.Status.UnPause();
        VideoBackground.SetActive(false);
        VideoDisplayer.SetActive(false);
        Video.SetActive(false);
        if (GameObject.Find("Music") != null)
        {
            GameObject.Find("Music").GetComponent <AudioSource>().Play();
        }
        MiniGameClose.SetActive(true);

        //change banner to "Look for Tsu"
        _canvas.ChangeText("Look for Tsu");

        yield return(new WaitForSeconds(3f));

        //Tsu's dialogue appears
        script.Interact();
        bark.Play();

        //Tsu's dot appears
        if (GameObject.Find("TsuPointer") != null)
        {
            GameObject.Find("TsuPointer").GetComponent <FlatFollow>().appear();
        }

        GameObject.Find("TrePointer").GetComponent <FlatFollow>().appear();
        GameObject.Find("MoPointer").GetComponent <FlatFollow>().appear();

        //Ahmad starts walking to Tsu
        scriptAhmad.enabled = true;
        Ahmad.GetComponent <SphereCollider>().isTrigger = false;
        _interact = Ahmad.GetComponent <InteractWithObject>();
        Destroy(_interact);
        print("move the maira");

        ////Maria starts moving towards Tsu
        scriptMaria.enabled = true;
        if (GameObject.Find("MariaAlert").activeInHierarchy)
        {
            GameObject.Find("MariaAlert").SetActive(false);
        }
        Maria.GetComponent <SphereCollider>().enabled = false;
        ////Maria.GetComponent<InteractWithMaria>().Kill();
        Maria.GetComponent <InteractWithMaria>().enabled = false;

        ////Bruce starts walking to Tsu
        scriptBruce.enabled = true;
        BruceNav.enabled    = true;
        if (GameObject.Find("BruceAlert").activeInHierarchy)
        {
            GameObject.Find("BruceAlert").SetActive(false);
        }
        BruceCont.GetComponent <SphereCollider>().enabled     = false;
        BruceCont.GetComponent <InteractWithObject>().enabled = false;
    }
コード例 #17
0
 public void Change()
 {
     _canvas.ChangeText(words);
 }
コード例 #18
0
    public override void DoOutcome(ref NPC n)
    {
        find = Find;

        _satisfied = false;

        if ((Systems.Objectives.Register(ObjectiveName, () => _satisfied = true)))
        {
            //this is the offending statement
            Systems.Objectives.Satisfy(ObjectiveName);
        }

        _banner = GameObject.Find("GUI").GetComponent <GuiDisplayer>().GetBanner();
        current = _banner.info.text;
        shorten = words.Replace("Find ", "");

        //no repeats
        if (current.Contains(shorten) || (ItemToFind != null && Systems.Inventory.HasItem(ItemToFind, 1)))
        {
            find = false;
        }
        //for any find task
        if (find)
        {
            // Find task
            if (words.Contains("Find") && current.Contains("Find"))
            {
                current = current.Replace(" and ", ", ");
                current = current + " and " + shorten;
                _banner.ChangeText(current);
            }
            // any task to replace entire banner
            else
            {
                _banner.ChangeText(words);
            }
        }
        //for any found task
        if (Found)
        {
            Debug.Log("Found item");



            //if there are three or more things
            if (current.Contains(" and " + shorten)) //if the found item is the last in the list
            {
                //remove the found item from the list
                current = current.Replace(" and " + shorten, "");
                //add "and" in place of commas
                current = current.Replace(", ", " and ");
            }
            //if the found item is not the last in the list
            else
            {
                current = current.Replace(shorten + ", ", "");    //if there are commas between the items
                current = current.Replace(shorten + " and ", ""); //if there is an and after the found item
            }
            //current = current.Replace(shorten, "");
            //current = current.Replace(" ,", "");
            current = current.Replace(", and ", " and ");
            current = current.Replace("Find and", "Find");

            //if there is nothing to find


            // found everything go to franks yard in L3
            if (Systems.Inventory.HasItem(Resources.Load <Item>("Items/CleanMustardWater"), 1) &&
                Systems.Inventory.HasItem(Resources.Load <Item>("Items/Rope"), 1) &&
                Systems.Inventory.HasItem(Resources.Load <Item>("Items/Shovel"), 1))
            {
                _banner.ChangeText("Find Frank's back yard");
            }

            /*
             * else if (Systems.Inventory.HasItem(Resources.Load<Item>("Items/Shovel"), 1))
             * {
             *  _banner.ChangeText("Find a rope");
             * }
             *
             * else if (Systems.Inventory.HasItem(Resources.Load<Item>("Items/Rope"), 1))
             * {
             *  _banner.ChangeText("Find a shovel");
             * }
             */

            //else if (Systems.Inventory.HasItem(Resources.Load<Item>("Items/DirtyMustardWater"), 1))
            //{
            //    _banner.ChangeText("Add tablets from inventory to clean water");
            //}
            //else if (Systems.Inventory.HasItem(Resources.Load<Item>("Items/Gun"), 1))
            //{
            //    _banner.ChangeText("Throw away the gun, then ask Zelda to enter the shelter");
            //}
            //else if (Systems.Inventory.HasItem(Resources.Load<Item>("Items/Gun"), 0))
            //{
            //    _banner.ChangeText("Enter the shelter");
            //}
            //else if (Systems.Inventory.HasItem(Resources.Load<Item>("Items/CleanMustardWater"), 1))
            //{
            //    _banner.ChangeText("Go talk to Zelda");
            //}

            //if (Systems.Inventory.HasItem(Resources.Load<Item>("Items/DirtyMustardWater"), 1))
            //{
            // _banner.ChangeText("Add tablets from inventory to clean water");
            //}
            //  if (Systems.Inventory.HasItem(Resources.Load<Item>("Items/CleanMustardWater"), 1) && Systems.Inventory.HasItem(Resources.Load<Item>("Items/Shovel"), 1))
            //  {
            //     _banner.ChangeText("Talk to Frank about building a pit latrine");
            // }
            //found everything for now but more things to find
            else if (current == "Find")
            {
                _banner.ChangeText("Talk to survivors");
            }
            //things left on list to find
            else
            {
                _banner.ChangeText(current);
            }
        }

        if (completeReset)
        {
            _banner.ChangeText(resetTo);
        }
    }