コード例 #1
0
ファイル: Item.cs プロジェクト: bauervision/Scavengers
    private void HandleMessageDisplay()
    {
        string message      = "";
        string guideMessage = "";
        float  baseDuration = 2f;

        if (myType == ItemType.Main)
        {
            message = "Great job! Now just locate the heart of the island!";
            Notificatons.ShowNotification(message, baseDuration);
            guideMessage = "You have found the mysyterious Mountain Blood, now you are trying to locate the heart of the island.  See if you can find anything similiar to the Mountain Blood around the island. Maybe...the same color, or texture...";
            Guide.instance.UpdateGuide(guideMessage);
            InteractionManager.DisableHalo();
        }
        if (myType == ItemType.IslandHeart)
        {
            if (InteractionManager.foundMountainBlood)
            {
                guideMessage = "At last! You have found the Island Heart and the Mountain Blood! Before you enter the heart, be sure that you are done with the island. Is there anything else you might like to find before you leave?";
                Guide.instance.UpdateGuide(guideMessage);
            }
        }
        if (myType == ItemType.Gem)//certain items have an array of messages to display
        {
            message = gemText[InteractionManager.instance.levelGemCount - 1];
            Notificatons.ShowNotification(message, baseDuration);
        }
        else if (myType == ItemType.Crystal1 || myType == ItemType.Crystal2)
        {
            message = crystalText[InteractionManager.instance.levelBonusItemScore - 1];
            Notificatons.ShowNotification(message, 3f);
        }
        else if (myType == ItemType.Shroom)
        {
            message = shroomText[(int)myShroomType - 1]; // account for the 'None' option
            Notificatons.ShowNotification(message, 4f);
            //signal to the Launcher which to seed to fire
            Launcher.seedIndex = (int)myShroomType - 1;// again, account for 'None'
        }
        else if (myType == ItemType.Chest)
        {
            // check to see if the player is poisoned, if they are NOT, and we drew to give a potion
            // then push the index 1 past to not waste a potion
            // TODO: not tested
            if (!InteractionManager.instance.speedReduced && myMysteryIndex == 1)
            {
                myMysteryIndex++;
            }

            message = $"You found a Mystery Chest which contained.....{mysteryText[myMysteryIndex]}";
            Notificatons.ShowNotification(message, baseDuration);
        }
        else if (myCollectible != CollectibleType.None)
        {
            message = collectibleText[(int)myCollectible];
            Notificatons.ShowNotification(message, 3f);

            if (InteractionManager.foundMountainBlood)
            {
                guideMessage = "Since you have already found the Mountain Blood, keep searching for more of these rare items, I'm sure there is much to be found!";
            }
            else
            {
                guideMessage = "You are still exploring and have yet to locate the Mountain Blood, but collecting items like this will go a long way to boost your experience, keep looking everywhere!";
            }

            Guide.instance.UpdateGuide(guideMessage);;
        }
        else if ((myType != ItemType.IslandHeart) && (myType != ItemType.Main))
        {
            message = messages[(int)myType];
            Notificatons.ShowNotification(message, baseDuration);
        }
    }
コード例 #2
0
 private void Start()
 {
     instance = this;
 }