Beispiel #1
0
    public void turnOnToolTip(int whatButton, Vector3 position)
    {
        toolTip.gameObject.SetActive(true);
        toolTip.GetComponent <RectTransform>().localPosition = position;
        StoryMission mission = missionManager.allStoryMissions[missionManager.dungeonLevelThresholds[whatLevel - 1] - 4 + whatButton];


        toolTip.updateRewards(mission.goldReward, mission.skillPointReward, mission.itemRewards, mission.bossInfo, MiscData.completedMissions.Contains(mission.missionID));
    }
Beispiel #2
0
    void addRewards()
    {
        PlayerProperties.playerScript.loadPrevItems();
        buildingUnlocker?.unlockDialogues();
        if (MiscData.missionID != null)
        {
            if (MiscData.finishedMission == false)
            {
                StoryMission mission = storyMissionDatabase[MiscData.missionID];
                returnNotifications.updateRewards(0, 0, null, mission.missionIcon, true, false);
            }
            else
            {
                if (!MiscData.completedMissions.Contains(MiscData.missionID))
                {
                    MiscData.completedMissions.Add(MiscData.missionID);
                    StoryMission compMission = storyMissionDatabase[MiscData.missionID];
                    HubProperties.storeGold             += compMission.goldReward;
                    PlayerUpgrades.numberMaxSkillPoints += compMission.skillPointReward;
                    PlayerUpgrades.numberSkillPoints    += compMission.skillPointReward;

                    foreach (GameObject item in compMission.itemRewards)
                    {
                        GameObject spawnedItem = Instantiate(item);
                        spawnedItem.transform.SetParent(GameObject.Find("PresentItems").transform);

                        if (PlayerItems.inventoryItemsIDs.Count < PlayerItems.maxInventorySize)
                        {
                            PlayerItems.inventoryItemsIDs.Add(spawnedItem.name);
                            PlayerProperties.playerInventory.itemList.Add(spawnedItem);
                        }
                        else
                        {
                            HubProperties.vaultItems.Add(spawnedItem.name);
                            FindObjectOfType <GoldenVault>().vaultItems.Add(spawnedItem);
                        }
                    }

                    returnNotifications.updateRewards(compMission.goldReward, compMission.skillPointReward, compMission.itemRewards, compMission.missionIcon, false, false);
                }
                else
                {
                    StoryMission mission = storyMissionDatabase[MiscData.missionID];
                    returnNotifications.updateRewards(0, 0, null, mission.missionIcon, false, true);
                }
                SaveSystem.SaveGame();
            }
        }
    }
Beispiel #3
0
    void Awake()
    {
        for (int i = 0; i < missionIDs.Count; i++)
        {
            if (i < bossManagers.Count && bossManagers[i] != null)
            {
                bossDict.Add(missionIDs[i], bossManagers[i]);
            }

            if (missions[i] != null)
            {
                missionDict.Add(missionIDs[i], missions[i]);
            }
        }

        currMission = missionDict[MiscData.missionID];
        FindObjectOfType <RoomTemplates>().setMaxRoomCount();
    }
Beispiel #4
0
    public void loadMissionIcons(int whichDungeonLevel, string sceneName)
    {
        missionManager = FindObjectOfType <HubMissionLoader>();

        sceneToLoad = sceneName;
        whatLevel   = whichDungeonLevel;

        int completedAmount = 0;

        for (int i = 0; i < minorBossButtons.Length; i++)
        {
            // Set mission to the first + sequentially going upward mission
            StoryMission mission = missionManager.allStoryMissions[missionManager.dungeonLevelThresholds[whatLevel - 1] - 4 + i];

            // Set the button sprite to whatever the mission sprite is
            minorBossButtons[i].GetComponent <Image>().sprite = mission.missionIcon;

            // Adjusting the star display
            for (int k = 0; k < 14; k++)
            {
                // Accesses image objects and sets them to active depending on the difficulty level
                if (k < mission.difficulty)
                {
                    minorBossButtons[i].GetComponentInChildren <GridLayoutGroup>().transform.GetChild(k).gameObject.SetActive(true);
                }
                else
                {
                    minorBossButtons[i].GetComponentInChildren <GridLayoutGroup>().transform.GetChild(k).gameObject.SetActive(false);
                }
            }

            // if mission already completed, set completed image to active
            if (MiscData.completedMissions.Contains(mission.missionID))
            {
                minorBossButtons[i].GetComponentsInChildren <Image>()[1].enabled = true;
                lockedImageIcons[i].enabled = false;
                minorBossButtons[i].enabled = true;
                completedAmount++;
            }
            else
            {
                minorBossButtons[i].GetComponentsInChildren <Image>()[1].enabled = false;

                if (completedAmount >= i)
                {
                    minorBossButtons[i].GetComponent <Image>().color = Color.white;
                    lockedImageIcons[i].enabled = false;
                    minorBossButtons[i].enabled = true;
                }
                else
                {
                    minorBossButtons[i].GetComponent <Image>().color = Color.grey;
                    lockedImageIcons[i].enabled = true;
                    minorBossButtons[i].enabled = false;
                }
            }

            // Set the title to the name of the boss
            minorBossButtons[i].GetComponentInChildren <Text>().text = mission.bossName;
        }

        StoryMission bossMission = missionManager.allStoryMissions[missionManager.dungeonLevelThresholds[whatLevel - 1] - 1];

        finalBossButton.GetComponent <Image>().sprite = bossMission.missionIcon;
        for (int i = 0; i < 14; i++)
        {
            if (i < bossMission.difficulty)
            {
                finalBossButton.GetComponentInChildren <GridLayoutGroup>().transform.GetChild(i).gameObject.SetActive(true);
            }
            else
            {
                finalBossButton.GetComponentInChildren <GridLayoutGroup>().transform.GetChild(i).gameObject.SetActive(false);
            }
        }

        if (MiscData.completedMissions.Contains(bossMission.missionID))
        {
            finalBossButton.GetComponentsInChildren <Image>()[1].enabled = true;
            lockedImageIcons[3].enabled = false;
        }
        else
        {
            finalBossButton.GetComponentsInChildren <Image>()[1].enabled = false;

            // If all previous three boss quests are complete, allow the player to challenge the final boss of the level
            if (completedAmount >= 3)
            {
                lockedImageIcons[3].enabled = false;
                finalBossButton.GetComponent <Image>().color = Color.white;
            }
            else
            {
                lockedImageIcons[3].enabled = true;
                finalBossButton.GetComponent <Image>().color = Color.grey;
                finalBossButton.enabled = false;
            }
        }


        finalBossButton.GetComponentInChildren <Text>().text = bossMission.bossName;
    }