Example #1
0
    public void LevelUp()
    {
        Researcher researcher = GameController.instance.researcher;

        level           += 1;
        experienceNeeded = CalculateExperienceNeeded();
        EventManager.TriggerEvent(OnLevelEvent);
        GainExperience(1);
        panel.SetPanel();
        levelPanel.SetPanel();
        // unlock new inventory slots
        if (level == 4)
        {
            PlayGameScript.UnlockAchievement(GPGSIds.achievement_student);
        }
        else if (level == 10)
        {
            PlayGameScript.UnlockAchievement(GPGSIds.achievement_scientific_worker);
        }
        else if (level == 16)
        {
            PlayGameScript.UnlockAchievement(GPGSIds.achievement_scholar);
        }
        if (level % 8 == 0)
        {
            var messabox = GameController.instance.buttons.messageBox;
            messabox.Show("Inventory capacity is increased");
            inventory.capacity += 2;
        }
    }
Example #2
0
    public IEnumerator UnlockTalent(int id)
    {
        timeToWait    = GameController.instance.talentTree.talents[id].timeToResearch / (ResearchSpeed / 100);
        researchable  = GameController.instance.talentTree.talents[id];
        isResearching = true;
        while (timeToWait > 0)
        {
            timeToWait--;
            yield return(new WaitForSeconds(1));
        }
        GameController.instance.talentTree.talents[id].isUnlocked = true;
        GameController.instance.talentTree.talents[id].isSelected = false;
        isResearching = false;
        view.holders[id].ChangeHolderPicture(true);
        view.holders[id].onResearch.Play();
        view.onResearch.Play();
        GameController.instance.audio.MakeSound(view.onResearchSound);
        EventManager.TriggerEvent("OnResearch", 1);
        player.GainExperience(50 * id);
        if (!tutorial.isTutorialCompleted)
        {
            GameController.instance.buttons.ShowCancel();
            tutorial.ContinueTutorial();
        }
        List <int> allIDs = new List <int>();

        foreach (Talent t in GameController.instance.talentTree.talents)
        {
            allIDs.Add(t.id);
        }
        if (id == allIDs.Max())
        {
            PlayGameScript.UnlockAchievement(GPGSIds.achievement_mad_scientist);
        }
    }
 public override void OnSell()
 {
     foreach (Manufactory sObject in GameController.instance.roomOverseer.GetAllSceneObjects().Where(x => x.GetComponent <Manufactory>() != null))
     {
         sObject.resourcePerTime *= productionMultiplier;
     }
     PlayGameScript.UnlockAchievement(GPGSIds.achievement_man_of_honor);
 }
Example #4
0
    public override void OnSell()
    {
        List <Talent>   empty           = new List <Talent>();
        Characteristics characteristics = new Characteristics(0, 0, 0, 0, healingAmount);
        Recipe          medkit          = new Recipe("Medkit", empty, characteristics, true, Resources.Load <Sprite>("Icons/Recipe/medkit"));

        GameController.instance.player.inventory.Set(medkit, 1, true);
        PlayGameScript.UnlockAchievement(GPGSIds.achievement_man_of_honor);
    }
Example #5
0
    public void GenerateReport()
    {
        revenue.Add(0);
        staticExpences.Add(0);
        activeExpences.Add(0);
        itemsProduced.Add(0);
        dates.Add(GameController.instance.time.date);
        investments.Add(GameController.instance.player.resources.money);
        int productivityEfficiency = Mathf.RoundToInt(GetProductivity() * 100);

        PlayGameScript.AddToLeaderboard(GPGSIds.leaderboard_productivity_factor, productivityEfficiency);
        PlayGameScript.AddToLeaderboard(GPGSIds.leaderboard_healed_humans, GetHealedAmount());

        if (productivityEfficiency >= 75)
        {
            PlayGameScript.UnlockAchievement(GPGSIds.achievement_finally_some_good_management);
        }
    }
Example #6
0
    public Constructible Build(int id, Constructible[] objectsArray, Cell cell, bool playEffects = true)
    {
        Constructible selectedObject = objectsArray[id];

        if (selectedObject.gameObject.tag == "Room")
        {
            EventManager.TriggerEvent("OnBuildRoom", 1);
            if (onRoomBuild != null)
            {
                if (playEffects)
                {
                    ParticleSystem particle = Instantiate(onRoomBuild, cell.transform.position, Quaternion.identity);
                    particle.gameObject.SetActive(true);
                    particle.Play();
                }
                PlayGameScript.UnlockAchievement(GPGSIds.achievement_builder);
            }
        }
        else
        {
            EventManager.TriggerEvent("OnBuildObject", 1);
            PlayGameScript.IncrementAchievement(GPGSIds.achievement_a_new_beginning, 1);
            if (onObjectBuild != null)
            {
                if (playEffects)
                {
                    ParticleSystem particle = Instantiate(onObjectBuild, cell.transform.position, Quaternion.identity);
                    particle.gameObject.SetActive(true);
                    particle.Play();
                }
            }
        }
        if (playEffects)
        {
            GameController.instance.player.GainExperience(100 * GameController.instance.roomOverseer.rooms.Count);
            GameController.instance.player.finances.AddToActiveExpences(selectedObject.description.buyPrice);
            GameController.instance.audio.MakeSound(onBuildSounds[Random.Range(0, onBuildSounds.Length)]);
        }
        Constructible toReturn = Instantiate(selectedObject, new Vector3(cell.transform.position.x, cell.transform.position.y, cell.transform.position.z - 0.5f), cell.transform.rotation);

        StartCoroutine(Camera.main.gameObject.GetComponent <CameraController>().FocusCamera(toReturn.transform.position));

        return(toReturn);
    }
Example #7
0
    public void CompleteTutorial()
    {
        isTutorialCompleted = true;

        if (dialogue.dialogueName == "General")
        {
            Debug.Log("UNLOCK ACHIEV");
            PlayGameScript.UnlockAchievement(GPGSIds.achievement_youve_lasted_so_far_heh);
        }
        if (tPanel.gameObject.activeInHierarchy)
        {
            tPanel.Hide();
        }
        if (objectsToClose.Count > 0)
        {
            foreach (GameObject g in objectsToClose)
            {
                g.SetActive(false);
            }
        }
    }
Example #8
0
 public override void OnSell()
 {
     reward.RewardPlayer();
     PlayGameScript.UnlockAchievement(GPGSIds.achievement_man_of_honor);
 }
Example #9
0
 public override void OnSell()
 {
     GameController.instance.player.hasAutoClicker = true;
     PlayGameScript.UnlockAchievement(GPGSIds.achievement_man_of_honor);
 }
Example #10
0
 public override void OnSell()
 {
     GameController.instance.player.resources.AddSecondChance(1);
     PlayGameScript.UnlockAchievement(GPGSIds.achievement_man_of_honor);
 }