| | |
| | | endlessPortList = JsonDataCenter.GetList<endless_port>(); |
| | | portConfigList = new List<EndlessPortConfig>(); |
| | | portDic = new Dictionary<int, List<EndlessPortConfig>>(); |
| | | InitPortList(portConfigList, endlessPortList); |
| | | } |
| | | |
| | | private static void InitPortList(List<EndlessPortConfig> list, List<endless_port> srcList) |
| | | /// <summary> |
| | | /// 更新关卡数据的时候也重新初始化一次 |
| | | /// </summary> |
| | | public static void InitPortList() |
| | | { |
| | | maxLevel = 0; |
| | | int? preLevel = null; |
| | | portConfigList.Clear(); |
| | | portDic.Clear(); |
| | | |
| | | foreach (endless_port data in srcList) |
| | | foreach (endless_port data in endlessPortList) |
| | | { |
| | | if (!GameConfig.IsNewbie && data.level < 0) continue; |
| | | |
| | |
| | | } |
| | | |
| | | param.DropTotalWeight = totalWeight; |
| | | list.Add(param); |
| | | |
| | | portConfigList.Add(param); |
| | | |
| | | if (!portDic.ContainsKey(param.PortLevel)) |
| | | portDic.Add(param.PortLevel, new List<EndlessPortConfig>()); |
| | | |
| | | |
| | | portDic[param.PortLevel].Add(param); |
| | | } |
| | | } |
| | |
| | | |
| | | for (int i = 0; i < waveData.Count; ++i) |
| | | { |
| | | ret += waveData[i].Config.amount; |
| | | int count = waveData[i].Config.amount; |
| | | endless_enemy enemyData = EndlessEnemyData.GetDataById(waveData[i].Config.enemy_id); |
| | | |
| | | // WTF... |
| | | if (enemyData.resource == 103) |
| | | count *= 2; |
| | | |
| | | ret += count; |
| | | } |
| | | |
| | | return ret; |