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; }
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 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(); }