| | |
| | | } |
| | | } |
| | | |
| | | public int fightGuideID; |
| | | public int fightGuideMainLevelLimit; |
| | | public int fightGuideNoClickSeconds; |
| | | |
| | | public Action<string, BattleField> onBattleFieldCreate; |
| | | |
| | | public Action<string, BattleField> onBattleFieldDestroy; |
| | |
| | | { |
| | | var config = FuncConfigConfig.Get("AutoGuaji"); |
| | | speedGear = JsonMapper.ToObject<float[]>(config.Numerical4); |
| | | |
| | | config = FuncConfigConfig.Get("FightGuide"); |
| | | fightGuideID = int.Parse(config.Numerical1); |
| | | fightGuideMainLevelLimit = int.Parse(config.Numerical2); |
| | | fightGuideNoClickSeconds = int.Parse(config.Numerical3); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | redTeamList.Add(storyTeam); |
| | | |
| | | CreateBattleField(string.Empty, MapID, FuncLineID, extendData, redTeamList, blueTeamList); |
| | | HB424_tagSCTurnFightInit vNetData = new HB424_tagSCTurnFightInit(); |
| | | vNetData.MapID = (uint)MapID; |
| | | vNetData.FuncLineID = (uint)FuncLineID; |
| | | |
| | | CreateBattleField(string.Empty, vNetData, extendData, redTeamList, blueTeamList); |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | Debug.LogError("DistributeNextPackage: 分发包异常 " + ex); |
| | | } |
| | | |
| | | if (queue.Count <= 0) |
| | | { |
| | | battleReportDict.Remove(guid); |
| | | battlePackRelationList.Remove(guid); |
| | | } |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | public BattleField CreateBattleField(string guid, int MapID, int FuncLineID, JsonData extendData, List<TeamBase> redTeamList, List<TeamBase> blueTeamList) |
| | | public BattleField CreateBattleField(string guid, HB424_tagSCTurnFightInit vNetData, JsonData extendData, List<TeamBase> redTeamList, List<TeamBase> blueTeamList) |
| | | { |
| | | BattleField battleField = null; |
| | | |
| | | int MapID = (int)vNetData.MapID; |
| | | int FuncLineID = (int)vNetData.FuncLineID; |
| | | |
| | | bool isCreate = true; |
| | | if (battleFields.TryGetValue(guid, out battleField)) |
| | |
| | | } |
| | | |
| | | if (isCreate) |
| | | { |
| | | { |
| | | battleField = BattleFieldFactory.CreateBattleField(guid, MapID, FuncLineID, extendData, redTeamList, blueTeamList); |
| | | |
| | | if (string.IsNullOrEmpty(guid)) |
| | |
| | | |
| | | |
| | | |
| | | battleField.Init(MapID, FuncLineID, extendData, redTeamList, blueTeamList); |
| | | battleField.Init(MapID, FuncLineID, extendData, redTeamList, blueTeamList, vNetData.TurnMax); |
| | | |
| | | return battleField; |
| | | } |
| | |
| | | |
| | | return null; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 检查是否有非主线战斗(如竞技场、白骨等)正在进行 |
| | | /// </summary> |
| | | /// <returns>如果有任何非主线战斗且未结束,则返回true</returns> |
| | | public bool IsOtherBattleInProgress() |
| | | { |
| | | foreach (var kvp in battleFields) |
| | | { |
| | | BattleField battleField = kvp.Value; |
| | | // 检查战场是否有效且尚未结束 |
| | | if (battleField == null || battleField.IsBattleFinish) |
| | | continue; |
| | | // MapID 1 (StoryBattleField) 和 2 (StoryBossBattleField) 都是主线 |
| | | if (battleField.MapID == 1 || battleField.MapID == 2) |
| | | continue; |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | } |