示例#1
0
    public void test()
    {
        for (int j = 0; j < playerInventory.Length; j++)
        {
            if (playerInventory[j].gameObject.transform.childCount == 0)
            {
                Transform panel = playerInventory[j].transform;

                GameObject      a    = Instantiate(defaultPotion);
                potionAttribute test = a.AddComponent <potionAttribute>();
                a.GetComponent <UnityEngine.UI.Image>().sprite = potions["Potion of Healing"].img;
                a.name = potions["Potion of Healing"].ingredientName;
                test.setAttribute("Rejuvenation");
                a.transform.SetParent(panel.transform, false);

                Transform panel2 = playerInventory[j + 1].transform;

                GameObject          b     = Instantiate(defaultIngredient);
                ingredientAttribute test2 = b.AddComponent <ingredientAttribute>();
                test2 = ingredients["Torched Perunika"];
                b.GetComponent <UnityEngine.UI.Image>().sprite = test2.img;
                b.name = test2.ingredientName;
                b.transform.SetParent(panel2.transform, false);

                Transform panel3 = playerInventory[j + 2].transform;

                GameObject          c     = Instantiate(defaultIngredient);
                ingredientAttribute test3 = c.AddComponent <ingredientAttribute>();
                test3 = ingredients["Ethereal Billberry"];
                c.GetComponent <UnityEngine.UI.Image>().sprite = test3.img;
                c.name = test3.ingredientName;
                c.transform.SetParent(panel3.transform, false);

                Transform panel4 = playerInventory[j + 3].transform;

                GameObject      d     = Instantiate(defaultPotion);
                potionAttribute test4 = d.AddComponent <potionAttribute>();
                d.GetComponent <UnityEngine.UI.Image>().sprite = potions["Decoction of Clarity"].img;
                d.name = potions["Decoction of Clarity"].ingredientName;
                test4.setAttribute("Awakening");
                d.transform.SetParent(panel4.transform, false);

                Transform panel5 = playerInventory[j + 4].transform;

                GameObject      e     = Instantiate(defaultPotion);
                potionAttribute test5 = e.AddComponent <potionAttribute>();
                e.GetComponent <UnityEngine.UI.Image>().sprite = potions["Brew of Blessing"].img;
                e.name = potions["Brew of Blessing"].ingredientName;
                test5.setAttribute("Awakening");
                e.transform.SetParent(panel5.transform, false);
                break;
            }
        }
    }
示例#2
0
    public void test()
    {
        for (int j = 0; j < playerInventory.Length; j++)
        {
            if (playerInventory[j].gameObject.transform.childCount == 0)
            {
                Transform panel = playerInventory[j].transform;

                GameObject      a    = Instantiate(defaultPotion);
                potionAttribute test = a.AddComponent <potionAttribute>();
                a.GetComponent <UnityEngine.UI.Image>().sprite = potions["Potion of Healing"].img;
                a.name = potions["Silver Water"].ingredientName;
                test.setAttribute("Awakening");
                a.transform.SetParent(panel.transform, false);

                Transform panel2 = playerInventory[j + 1].transform;

                GameObject          b     = Instantiate(defaultIngredient);
                ingredientAttribute test2 = b.AddComponent <ingredientAttribute>();
                test2 = ingredients["Torched Perunika"];
                b.GetComponent <UnityEngine.UI.Image>().sprite = test2.img;
                b.name = test2.ingredientName;
                b.transform.SetParent(panel2.transform, false);

                Transform panel3 = playerInventory[j + 2].transform;

                GameObject          c     = Instantiate(defaultIngredient);
                ingredientAttribute test3 = c.AddComponent <ingredientAttribute>();
                test3 = ingredients["Dwarf Billberry"];
                c.GetComponent <UnityEngine.UI.Image>().sprite = test3.img;
                c.name = test3.ingredientName;
                c.transform.SetParent(panel3.transform, false);

                break;
            }
        }
    }
示例#3
0
    public void addIngredients(int i)
    {
        for (int j = 0; j <= playerInventory.Length - 1; j++)
        {
            if (playerInventory[j].gameObject.transform.childCount == 0 && i == 1)
            {
                Transform panel = playerInventory[j].transform;

                GameObject          a    = Instantiate(defaultIngredient);
                ingredientAttribute test = a.AddComponent <ingredientAttribute>();
                if (Random.Range(0, 100) > 50)
                {
                    test = ingredients["Torched Perunika"];
                }
                else
                {
                    test = ingredients["Ethereal Billberry"];
                }
                a.GetComponent <UnityEngine.UI.Image>().sprite = test.img;
                a.name = test.ingredientName;
                a.transform.SetParent(panel.transform, false);

                modal.SetActive(true);
                modal.GetComponentInChildren <SpriteRenderer>().sprite = test.img;
                scavenging.Fade();

                bool added1 = false;
                for (int k = 0; k < ingredientPages.transform.childCount; k++)
                {
                    if (ingredientPages.transform.GetChild(k).transform.FindChild("title").GetComponent <Text>().text != (test.ingredientName))
                    {
                        added1 = false;
                    }
                    else
                    {
                        added1 = true;
                        k      = ingredientPages.transform.childCount - 1;
                    }
                }
                if (!added1)
                {
                    addIngredientPage(test.ingredientName);
                }
                break;
            }
            else if (playerInventory[j].gameObject.transform.childCount == 0 && i == 2)
            {
                Transform panel = playerInventory[j].transform;

                GameObject          a    = Instantiate(defaultIngredient);
                ingredientAttribute test = a.AddComponent <ingredientAttribute>();
                if (Random.Range(0, 100) > 50)
                {
                    test = ingredients["Dwarf Billberry"];
                }
                else
                {
                    test = ingredients["Blooming Fern"];
                }
                a.GetComponent <UnityEngine.UI.Image>().sprite = test.img;
                a.name = test.ingredientName;
                a.transform.SetParent(panel.transform, false);

                modal.SetActive(true);
                modal.GetComponentInChildren <SpriteRenderer>().sprite = test.img;
                scavenging.Fade();

                bool added1 = false;
                for (int k = 0; k < ingredientPages.transform.childCount; k++)
                {
                    if (ingredientPages.transform.GetChild(k).transform.FindChild("title").GetComponent <Text>().text != (test.ingredientName))
                    {
                        added1 = false;
                    }
                    else
                    {
                        added1 = true;
                        k      = ingredientPages.transform.childCount - 1;
                    }
                }
                if (!added1)
                {
                    addIngredientPage(test.ingredientName);
                }
                break;
            }
            else if (playerInventory[j].gameObject.transform.childCount == 0 && i == 3)
            {
                Transform panel = playerInventory[j].transform;

                GameObject          a    = Instantiate(defaultIngredient);
                ingredientAttribute test = a.AddComponent <ingredientAttribute>();
                if (Random.Range(0, 100) > 50)
                {
                    test = ingredients["Bog Billberry"];
                }
                else
                {
                    test = ingredients["Violet Perunika"];
                }
                a.GetComponent <UnityEngine.UI.Image>().sprite = test.img;
                a.name = test.ingredientName;
                a.transform.SetParent(panel.transform, false);

                modal.SetActive(true);
                modal.GetComponentInChildren <SpriteRenderer>().sprite = test.img;
                scavenging.Fade();

                bool added1 = false;
                for (int k = 0; k < ingredientPages.transform.childCount; k++)
                {
                    if (ingredientPages.transform.GetChild(k).transform.FindChild("title").GetComponent <Text>().text != (test.ingredientName))
                    {
                        added1 = false;
                    }
                    else
                    {
                        added1 = true;
                        k      = ingredientPages.transform.childCount - 1;
                    }
                }
                if (!added1)
                {
                    addIngredientPage(test.ingredientName);
                }

                break;
            }
            else if (playerInventory[j].gameObject.transform.childCount == 0 && i == 4)
            {
                Transform panel = playerInventory[j].transform;

                GameObject          a    = Instantiate(defaultIngredient);
                ingredientAttribute test = a.AddComponent <ingredientAttribute>();
                if (Random.Range(0, 100) > 50)
                {
                    test = ingredients["Divine Perunika"];
                }
                else
                {
                    test = ingredients["Midnight Fern"];
                }
                a.GetComponent <UnityEngine.UI.Image>().sprite = test.img;
                a.name = test.ingredientName;
                a.transform.SetParent(panel.transform, false);

                modal.SetActive(true);
                modal.GetComponentInChildren <SpriteRenderer>().sprite = test.img;
                scavenging.Fade();

                bool added1 = false;
                for (int k = 0; k < ingredientPages.transform.childCount; k++)
                {
                    if (ingredientPages.transform.GetChild(k).transform.FindChild("title").GetComponent <Text>().text != (test.ingredientName))
                    {
                        added1 = false;
                    }
                    else
                    {
                        added1 = true;
                        k      = ingredientPages.transform.childCount - 1;
                    }
                }
                if (!added1)
                {
                    addIngredientPage(test.ingredientName);
                }
                break;
            }
            else if (playerInventory[j].gameObject.transform.childCount == 0 && i == 5)
            {
                Transform panel = playerInventory[j].transform;

                GameObject          a    = Instantiate(defaultIngredient);
                ingredientAttribute test = a.AddComponent <ingredientAttribute>();
                if (Random.Range(0, 100) > 50)
                {
                    test = ingredients["Tormented Fern"];
                }
                else
                {
                    test = ingredients["Midnight Fern"];
                }
                a.GetComponent <UnityEngine.UI.Image>().sprite = test.img;
                a.name = test.ingredientName;
                a.transform.SetParent(panel.transform, false);

                modal.SetActive(true);
                modal.GetComponentInChildren <SpriteRenderer>().sprite = test.img;
                scavenging.Fade();

                bool added1 = false;
                for (int k = 0; k < ingredientPages.transform.childCount; k++)
                {
                    if (ingredientPages.transform.GetChild(k).transform.FindChild("title").GetComponent <Text>().text != (test.ingredientName))
                    {
                        added1 = false;
                    }
                    else
                    {
                        added1 = true;
                        k      = ingredientPages.transform.childCount - 1;
                    }
                }
                if (!added1)
                {
                    addIngredientPage(test.ingredientName);
                }
                break;
            }
        }
    }
示例#4
0
    public void setupDictionary()
    {
        /*
         * INGREDIENTS
         */
        ing1 = new ingredientAttribute("Midnight Fern", "Solitude", "They grow in the <b>isolated</b> shadowed cliffs of the <i>Yellow Ranges</i>, and draw in the holder to <b>introspection</b> and the desire for <b>solitude</b>.", Resources.Load <Sprite>("fern_midnight"));
        ing2 = new ingredientAttribute("Blooming Fern", "Luck", "An undying symbol of <b>good fortune</b> and <b>luck</b>, yet it should be plucked with care. Who knows what too much fortune can bring?", Resources.Load <Sprite>("fern_blooming"));
        ing3 = new ingredientAttribute("Tormented Fern", "Opposition", "Stunted in growth and never known to unfurl, its nature <b>reverses</b> properties like the clenched fist of <b>opposition</b>.", Resources.Load <Sprite>("fern_tormented"));
        ing4 = new ingredientAttribute("Ethereal Billberry", "Serenity", "Those who eat of this berry are overcome by a state of <b>serenity</b> and otherworldly one-ness with the world. They are found growing next to torched perunika in seeming <b>calm</b> and disregard.", Resources.Load <Sprite>("billberry_ethereal"));
        ing5 = new ingredientAttribute("Bog Billberry", "Poison", "Found only in the <i>Siyohrang Planregenmoore</i>, it has been dyed purple with <b>poison</b>. Yet, a good measure has <b>balancing effects</b> with other ingredients.", Resources.Load <Sprite>("billberry_bog"));
        ing6 = new ingredientAttribute("Dwarf Billberry", "Sweet", "Little <b>juicy sweet</b> berries of all things good and wonderful. They have <b>lovely scent</b> that entices all residents of the <i>boreal</i>.", Resources.Load <Sprite>("billberry_dwarf"));
        ing7 = new ingredientAttribute("Violet Perunika", "Love", "A strain with small petals of deep purple in the <i>Siyohrang Planregenmoore</i>. Their unlikely beauty amidst poison have driven people to relate it with <b>love</b> that wins over all obstacles.", Resources.Load <Sprite>("perunika_violet"));
        ing8 = new ingredientAttribute("Divine Perunika", "Sanctity", "It glows with a <b>saintly blue</b> like the lights of the Tenger Gardinur, and is the flower of the goddess of <b>virtue</b>. Their potent scent is mysteriously undefinable.", Resources.Load <Sprite>("perunika_divine"));
        ing9 = new ingredientAttribute("Torched Perunika", "Warmth", "They are said to be born from lightning in the storm-ridden <i>Tarandus Highland Taiga</i>. Their petals <b>promote warmth</b>, and is often used in internal healing.", Resources.Load <Sprite>("perunika_torched"));

        ingredients = new Dictionary <string, ingredientAttribute>()
        {
            { "Midnight Fern", ing1 },
            { "Blooming Fern", ing2 },
            { "Tormented Fern", ing3 },
            { "Ethereal Billberry", ing4 },
            { "Bog Billberry", ing5 },
            { "Dwarf Billberry", ing6 },
            { "Violet Perunika", ing7 },
            { "Divine Perunika", ing8 },
            { "Torched Perunika", ing9 }
        };

        /*
         * POTIONS
         * ING + ING
         */
        pot1 = new potionAttribute("Brew of Blessing", "Blessing, Fortune, Rejuvenation", "A brew made of the <b>fortitious flowering fern</b>, it entices the lady of fortune to smile kindly on whoever drinks it", Resources.Load <Sprite>("brew_of_blessing"));
        pot2 = new potionAttribute("Potion of Healing", "Soothing, Rejuvenation", "For the wounds that can be healed with the <b>warmth</b> of the hearth and heart. Can help calm a restless mind, and a little <b>love</b> makes a more soothing concoction.", Resources.Load <Sprite>("potion_of_healing"));
        pot3 = new potionAttribute("Animalcule", "Companionship, Soothing", "Born from the <b>sweetness</b> and <b>precious care</b> of the heart, they offer <b>companionship</b> from their bottle to ward away lonely days and nights.", Resources.Load <Sprite>("animalcule"));
        pot4 = new potionAttribute("Elixir of Dreams", "Dreams, Passion", "Once taken, the <b>fire of the heart</b> will be ignited and the lock undone on the wellspring of <b>desires</b>. The effects may vary person to person.", Resources.Load <Sprite>("elixir_of_dreams"));
        pot5 = new potionAttribute("Perfume of Allure", "Seduction, Dreams, Passion", "A fresh smelling spritzer that is known to make the wearer more <b>intriguing</b>.", Resources.Load <Sprite>("perfume_of_allure"));
        pot6 = new potionAttribute("Potion of Protection", "Immunity, Blessing", "A bitter, fizzy potion often used by military and those <b>seeking the protection</b> of the Gods.", Resources.Load <Sprite>("potion_of_protection"));
        pot7 = new potionAttribute("Silver Water", "Awakening, Reflection, Sleep", "It seems to sparkle like moonlight even where no light shines, and is said to connect to the hidden landscapes of the <b>unconscious</b>.", Resources.Load <Sprite>("silver_water"));
        pot8 = new potionAttribute("Decoction of Clarity", "Peace, Wisdom", "A harsh shot used to <b>stir the mind</b>. This decoction is created by extracting the essences of the ingredients to create a dense brew.", Resources.Load <Sprite>("decoction_of_clarity"));

        /*
         * SPECIAL POTIONS
         * POT + ING
         */
        spot1 = new potionAttribute("Balm of Realization", "Awakening", "A salve that, when rubbed on the eyelid, will allow the user to see that which was hidden. It is made with <b>clarity</b> under <b>deep calm</b>.", Resources.Load <Sprite>("balm_of_realization"));
        spot2 = new potionAttribute("Nightmare Crystal", "Nightmare", "The crystal, when placed in the north west corner of the bed, will capture bad spirits and prevent nightmares. Some say that Marowit dwells within the crystal and feasts upon them.", Resources.Load <Sprite>("nightmare_crystal"));
        spot3 = new potionAttribute("Midnight Moonlight", "Night", "A spirit that has been soaked in moonlight for 30 moons, purified in the 1000 year old well water, and sprinkled with aged berries.", Resources.Load <Sprite>("moonlight_midnight"));
        spot4 = new potionAttribute("Goddess' Protection", "Protection", "A <b>sanctified protection charm</b>. Often consumed by hunters before a dangerous expedition into the Siyohrang Planregenmoore.", Resources.Load <Sprite>("goddess_protection"));
        spot5 = new potionAttribute("Brownie Butler", "Helper", "When an animalcule has been cared for with lots and lots of <b>warmth</b>, they may evolve into a brownie out of love for their master, to ever <b>help</b> them. ", Resources.Load <Sprite>("brownie_butler"));
        spot6 = new potionAttribute("Eternal Love", "Love", "The quintessential love potion, used to create pure obsession (not actual love) in whoever ingests it. Well known to cause a lot of problems once it's effects wear off.", Resources.Load <Sprite>("eternal_love"));
        spot7 = new potionAttribute("Homunculus", "Soul", "A protective spirit born from an <b>animalcule</b> sensing the deep loneliness of its master, will replicate the creator's soul, sacrifice itself when the creator is in mortal danger.", Resources.Load <Sprite>("homunculus"));
        spot8 = new potionAttribute("Dream Catcher", "Dreams", "A viscous concoction that is primarily used by insomniacs to maintain a steady sleep pattern. Can be incorporated into a sleep schedule to maintain regular dreaming.", Resources.Load <Sprite>("dream_catcher"));
        spot9 = new potionAttribute("Steaming Elixir", "Awakening", "A powerful, hot brew. It's contents will shock the tongue of the consumer, waking them from even the deepest of sleeps.", Resources.Load <Sprite>("steaming_elixir"));

        potions = new Dictionary <string, potionAttribute>()
        {
            { "Brew of Blessing", pot1 },
            { "Potion of Healing", pot2 },
            { "Animalcule", pot3 },
            { "Elixir of Dreams", pot4 },
            { "Perfume of Allure", pot5 },
            { "Potion of Protection", pot6 },
            { "Silver Water", pot7 },
            { "Decoction of Clarity", pot8 },
            { "Balm of Realization", spot1 },
            { "Nightmare Crystal", spot2 },
            { "Midnight Moonlight", spot3 },
            { "Goddess' Protection", spot4 },
            { "Brownie Butler", spot5 },
            { "Eternal Love", spot6 },
            { "Homunculus", spot7 },
            { "Dream Catcher", spot8 },
            { "Steaming Elixir", spot9 }
        };
    }