public void increaseLevel() { int currentLevelIndex = levels.IndexOf(currentLevel); if (currentLevelIndex < levels.Count - 1) { CurrentLevel = levels[currentLevelIndex + 1]; } }
private bool canUpdateCat() { if (cat != null) { CatData monsterData = cat.GetComponent <CatData>(); CatLevel nextLevel = monsterData.getNextLevel(); if (null != nextLevel) //更高的等级存在 { return(gameManager.Gold >= nextLevel.cost); } } return(false); }
public CatDynamicStatsRealized getRealizedStatsFromLevel(CatLevel level) { //TODO we have algorithm as linear, if it was different we would do a different algo here float percentageToMaxLevel = level.getPercentageToMaxLevel(); CatDynamicStatsRealized realizedStats = new CatDynamicStatsRealized(); realizedStats.maxHealth = (uint)Mathf.Lerp(baseMaxHealth, maxMaxHealth, percentageToMaxLevel); realizedStats.speed = getRealizedSpeedFromLevel(level, percentageToMaxLevel); realizedStats.attackDamage = (uint)Mathf.Lerp(baseAttackDamage, maxAttackDamage, percentageToMaxLevel); // realizedStats.attackCooldown = (uint)Mathf.Lerp(baseAttackCooldown, maxAttackCooldown, percentageToMaxLevel); // realizedStats.range = (uint)Mathf.Lerp(baseRange, maxRange, percentageToMaxLevel); realizedStats.projectileSpeed = Mathf.Lerp(baseProjectileSpeed, maxProjectileSpeed, percentageToMaxLevel); return(realizedStats); }
public void Init() { goldfishes = new Goldfishes(3, 50000, 1, googleAchievementIds[0], "Goldfishes"); list.Add(goldfishes); getSuperCats = new GetSuperCats[] { new GetSuperCats(0, 4, 10, googleAchievementIds[1], "GetSuperCats1"), new GetSuperCats(1, 8, 20, googleAchievementIds[2], "GetSuperCats2"), new GetSuperCats(2, 12, 30, googleAchievementIds[3], "GetSuperCats3") }; list.AddRange(getSuperCats); level = new Level(4, 50, 20, googleAchievementIds[4], "Level"); list.Add(level); getGameSessions = new GetGameSessions[] { new GetGameSessions(0, 500, 10, googleAchievementIds[5], "GetGameSessions1"), new GetGameSessions(1, 1000, 20, googleAchievementIds[6], "GetGameSessions2"), new GetGameSessions(2, 2500, 30, googleAchievementIds[7], "GetGameSessions3") }; list.AddRange(getGameSessions); league = new League(5, Core.gameplay.leagues.Length, 2, googleAchievementIds[8], "League"); list.Add(league); tournamentWonFriends = new TournamentWonFriends[] { new TournamentWonFriends(0, 4, 25, googleAchievementIds[9], "TournamentWonFriends1"), new TournamentWonFriends(1, 8, 50, googleAchievementIds[10], "TournamentWonFriends2"), new TournamentWonFriends(2, 12, 75, googleAchievementIds[11], "TournamentWonFriends3") }; list.AddRange(tournamentWonFriends); combo = new Combo(6, 30, 10, googleAchievementIds[12], "Combo"); list.Add(combo); inviteFriends = new InviteFriends[] { new InviteFriends(0, 10, 10, achievements.googleAchievementIds[13], "InviteFriends1"), new InviteFriends(1, 25, 20, googleAchievementIds[14], "InviteFriends2"), new InviteFriends(2, 50, 30, googleAchievementIds[15], "InviteFriends3") }; list.AddRange(inviteFriends); catLevel = new CatLevel(7, 10, 20, googleAchievementIds[16], "CatLevel"); list.Add(catLevel); useSausages = new UseSausages[] { new UseSausages(0, 25, 1, googleAchievementIds[17], "UseSausages1"), new UseSausages(1, 50, 2, googleAchievementIds[18], "UseSausages2"), new UseSausages(2, 100, 3, googleAchievementIds[19], "UseSausages3") }; list.AddRange(useSausages); millionaire = new Goldfishes(3, 1000000, 1, googleAchievementIds[20], "Millionaire", hide: true); chosenOne = new GetGameSessions(3, 7777, 1, googleAchievementIds[21], "ChosenOne", hide: true); great8 = new LegendaryPlace(3, 8, googleAchievementIds[22], "Great8", hide: true); honored = new Honored(3, googleAchievementIds[23], "Honoured", hide: true); patron = new Revenue(3, 10, googleAchievementIds[24], "Patron", hide: true); }
void OnEnable() { CurrentLevel = levels[0]; }
public float getRealizedSpeedFromLevel(CatLevel level, float percentageToMaxLevel) { return(Mathf.Lerp(baseSpeed, maxSpeed, percentageToMaxLevel)); }