public void InitializeMeltGrid()
    {
        int[] tempStats;
        MeltableList.Clear();
        SelectedToMeltList.Clear();
        MeltableList = CharectorStats.heroesThatCanMelt(CharectorStats.getTempHero(), xpToBeAdded, SelectedToMeltList);

        if (GridButtonGameObjs.Count > 0)
        {
            foreach (GameObject button in GridButtonGameObjs)
            {
                Destroy(button.gameObject);
            }
            GridButtonGameObjs.Clear();
        }
        for (int i = 0; i < MeltableList.Count; i++)
        {
            tempStats = CharectorStats.UnlockedCharector(MeltableList[i]);
            GameObject button = Instantiate(buttonTemplate) as GameObject;
            GridButtonGameObjs.Add(button);
            button.SetActive(true);
            button.GetComponent <EnhanceListButton>().SetText(CharectorStats.HeroName(tempStats[1]));
            button.GetComponent <EnhanceListButton>().SetHeroNum(tempStats[0]);
            button.GetComponent <EnhanceListButton>().SetIndex(i);
            button.transform.SetParent(buttonTemplate.transform.parent, false);
        }
    }
Exemplo n.º 2
0
    public void UpdateSlider(int xpToBeAdded)
    {
        if (!gridMan.isMaxedActually)
        {
            bounds = GetBounds();
        }

        current += xpToBeAdded;
        if (!gridMan.isMaxedActually)
        {
            if (heroCloneToPass[1] < heroLevelCap && (accumHeroXp + xpToBeAdded < CharectorStats.XpOfMaxLevel(CharectorStats.getTempHero())))
            {
                xpBar.SetActive(true);
                AddSubtractXP();
                tempMaxReduced?.Invoke();
            }
            else if (heroCloneToPass[1] < heroLevelCap && (accumHeroXp + xpToBeAdded >= CharectorStats.XpOfMaxLevel(CharectorStats.getTempHero())))
            {
                xpBar.SetActive(false);
                currentLvlText.text = CharectorStats.findCurrentMaxLevel(CharectorStats.getTempHero()).ToString();
                tempMax?.Invoke();
            }
            else if (heroCloneToPass[1] >= heroLevelCap && xpToBeAdded < 0)
            {
                xpBar.SetActive(true);
                AddSubtractXP();
                tempMaxReduced?.Invoke();
            }
        }
        accumHeroXp += xpToBeAdded;
    }
Exemplo n.º 3
0
 private void OnEnable()
 {
     heroesChosenSuccessfully = false;
     selectHeroesButton.GetComponent <Button>().onClick.AddListener(OnSelectClick);
     meltBackButton.GetComponent <Button>().interactable = false;
     currentHeroArray = CharectorStats.setTempHero(CharectorStats.getTempHero());
     selectedHeroTier = CharectorStats.HeroTier(currentHeroArray[0]);
     determineRequirements();
     AGT.GetComponent <Text>().text = heroRequirements.goldReq.ToString();
     setIconsNeedFilled();
 }
Exemplo n.º 4
0
 public void CloneHero()
 {
     heroCloneToPass = CharectorStats.setTempHero(CharectorStats.getTempHero());
     accumHeroXp     = heroCloneToPass[2];
     if (!gridMan.isMaxedActually)
     {
         bounds  = GetBounds();
         current = accumHeroXp - bounds[0];
     }
     heroLevelCap = CharectorStats.findCurrentMaxLevel(CharectorStats.getTempHero());
 }
 public void DisplayStats()
 {
     int[] heroStats = CharectorStats.setTempHero(CharectorStats.getTempHero()); //displays stats of hero picked from tile but not necessarily selected
     objects[0].GetComponent <Text>().text = heroStats[2].ToString();            //XP
     objects[1].GetComponent <Text>().text = heroStats[5].ToString();            //health
     objects[2].GetComponent <Text>().text = heroStats[4].ToString();            //dmg
     objects[3].GetComponent <Text>().text = heroStats[7].ToString();            //agi
     objects[4].GetComponent <Text>().text = heroStats[6].ToString();            //crit
     objects[5].GetComponent <Text>().text = heroStats[8].ToString();            //def
     objects[6].GetComponent <Text>().text = heroStats[9].ToString();            //xptonext
     objects[7].GetComponent <Text>().text = heroStats[1].ToString();            //level
 }
    public void MeltHeros()
    {
        CharectorStats.meltHero(SelectedToMeltList, xpToBeAdded);
        int tempHero = CharectorStats.getTempHero();

        if (isMaxedTemp)
        {
            CharectorStats.updateHero(tempHero, CharectorStats.XpOfMaxLevel(tempHero), CharectorStats.findCurrentMaxLevel(tempHero));
            xpslide.reduceTempMax();
        }
        PlayServices.Instance.SaveData();
        OnEnable();
    }
    public void OpenPanel()
    {
        int tempHero = CharectorStats.getTempHero();

        if (CharectorStats.HeroIsMaxLvl(tempHero))
        {
            chosenPanel = Panels[1]; //1 is tier up panel
        }
        else
        {
            chosenPanel = Panels[0]; //0 is melt panel
        }
        if (chosenPanel != null)
        {
            chosenPanel.gameObject.SetActive(true);
        }
    }
    private void OnEnable()
    {
        isMaxedActually = false;
        int[] temp = CharectorStats.setTempHero(CharectorStats.getTempHero());
        if (CharectorStats.HeroIsMaxLvl(CharectorStats.getTempHero()))
        {
            isMaxedActually = true;
        }
        MeltPrestButtonDisplay();
        xpslide.tempMax        += tempMaxHit;
        xpslide.tempMaxReduced += tempMaxReduced;

        if (!isMaxedActually)
        {
            xpslide.CloneHero();
            xpslide.UpdateSlider(0);
            xpslide.SetCurrentAndBoundText();
        }
        xpToBeAdded = 0;
        InitializeMeltGrid();
        xpslide.SetHeroNameText();
        //need to remove selectedButtons if refreshing panel
        ClearSelectedGameObjs();
    }
Exemplo n.º 9
0
 public void ascendHero() //MAKE UNCLICKABLE UNLESS HEORESCHOSENSUCCESSFUL = TRUE
 {
     CharectorStats.buyHeroUpgrade(CharectorStats.getTempHero());
     confirmPanel.SetActive(false);
     gameObject.SetActive(false);
 }
 //these methods can also contain positional logic for displays
 private void SetToTemp()
 {
     disableObjects();
     transform.GetChild(CharectorStats.setTempHero(CharectorStats.getTempHero())[0]).gameObject.SetActive(true);
 }
Exemplo n.º 11
0
 public void SetHeroNameText()
 {
     int[] nameTemp = CharectorStats.setTempHero(CharectorStats.getTempHero());
     heroText.text = CharectorStats.HeroName(nameTemp[0]);
 }
Exemplo n.º 12
0
 void SetHero()
 {
     CharectorStats.SetCurrentHero(CharectorStats.getTempHero());
     Debug.Log("Hero is now: " + CharectorStats.SetCurrentHero(CharectorStats.GetCurrentHero())[0] + CharectorStats.HeroName(CharectorStats.SetCurrentHero(CharectorStats.GetCurrentHero())[0]));
     PlayServices.Instance.SaveData();
 }