public static int Load(int level) { _data = new WaveVirusData(); _nameRoll = new ChanceRoll(); _colorRoll = new ChanceRoll(); WaveIndex = 0; IsNextWave = true; int endValue = 0; if (level == 2 || level % 5 == 0) { _data.HasBoss = true; _curBossName = GetBossVirusName(level); } FillCache(level); FillVirusNames(level); FillNameRoll(); FillColorRoll(level); endValue = FillData(); if (_data.HasBoss) { WaveVirusItem boss = new WaveVirusItem(); boss.SplitLevel = SplitLevel.Level5; boss.ColorLevel = ColorLevel.Level0; boss.VirusName = _curBossName; _data.Data[1].Insert(0, boss); endValue += VirusTool.GetChildSplit(SplitLevel.Level5, boss.VirusName); } return(endValue); }
private static void FillColorRoll(int level) { _colorRoll = new ChanceRoll(); if (level == 1) { FillColorRoll(new List <float> { 0, 0, 0, 0, 0, 20, 30, 40, 100 }); } if (level >= 2 && level <= 5) { FillColorRoll(new List <float> { 10, 10, 10, 10, 10, 30, 60, 60, 80 }); } if (level > 5 && level <= 10) { FillColorRoll(new List <float> { 20, 20, 20, 20, 20, 30, 50, 50, 80 }); } if (level > 10) { List <float> vv = new List <float> { 20, 20, 20, 20, 20, 30, 50, 50, 80 }; for (int i = 0; i < vv.Count; i++) { vv[i] += level * 5; } FillColorRoll(vv); } }
private static void FillRoll(this ChanceRoll roll, List <float> raritys) { for (int i = 0; i < raritys.Count; i++) { roll.Add(raritys[i]); } }
private static ChanceRoll GetRoll(int level) { ChanceRoll roll = new ChanceRoll(); if (level == 1) { roll.FillRoll(new List <float> { 100, 10, 10, 50, 10, 80, 80, 10, 50 }); } if (level >= 2 && level <= 5) { roll.FillRoll(new List <float> { 80, 10, 10, 50, 10, 80, 80, 50, 50 }); } if (level > 5 && level <= 10) { roll.FillRoll(new List <float> { 100, 10, 10, 50, 10, 50, 50, 100, 50 }); } if (level > 10) { roll.FillRoll(new List <float> { 2500, 40, 40, 100, 10, 50, 50, 100, 50 }); } return(roll); }
public List <UnitParametrs> Roll(int level) { float rand; ChanceRoll roll = Chance[level]; List <UnitParametrs> units = new List <UnitParametrs>(); for (int i = 0; i < 5; i++) { rand = Random.Range(1, 101); int index = roll.Index(rand); units.Add(Units[index].RandomUnit()); } return(units); }
public static int Load(int level) { _data = new WaveVirusData(); _nameRoll = new ChanceRoll(); _colorRoll = new ChanceRoll(); WaveIndex = 0; IsNextWave = true; if (IGamerProfile.Instance != null) { string bossType = IGamerProfile.gameLevel.mapData[level - 1].bossData.BossType; _data.HasBoss = bossType == "" ? false : true; if (_data.HasBoss == true) { _curBossName = GetBossVirusName(bossType); } } else { if (level == 2 || level % 5 == 0) { _data.HasBoss = true; _curBossName = GetBossVirusName(level); } } FillCache(level); FillVirusNames(level); FillNameRoll(); FillColorRoll(level); int endValue = FillData(); if (_data.HasBoss) { WaveVirusItem boss = new WaveVirusItem(); boss.SplitLevel = SplitLevel.Level5; boss.ColorLevel = ColorLevel.Level0; boss.VirusName = _curBossName; _data.Data[MaxWave - 1].Insert(0, boss); endValue += VirusTool.GetChildSplit(SplitLevel.Level5, boss.VirusName); } return(endValue); }