| | |
| | | QuickSetting.Instance.SendPackage(); |
| | | } |
| | | } |
| | | |
| | | public readonly int[] speedIndexfuncIdArr = new int[] { 34, 35, 36 }; // 战斗倍数对应的功能ID |
| | | public readonly int passFuncId = 33; // 跳过战斗对应的功能ID |
| | | public int passRound; // 超过X回合可跳过 |
| | | public int fightGuideID; |
| | | public int fightGuideMainLevelLimit; |
| | | public int fightGuideNoClickSeconds; |
| | |
| | | fightGuideID = int.Parse(config.Numerical1); |
| | | fightGuideMainLevelLimit = int.Parse(config.Numerical2); |
| | | fightGuideNoClickSeconds = int.Parse(config.Numerical3); |
| | | |
| | | config = FuncConfigConfig.Get("BattleButton"); |
| | | passRound= int.Parse(config.Numerical1); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | protected void OnPlayerLoginOk() |
| | | { |
| | | long exAttr1 = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.ExAttr1); |
| | | long exAttr2 = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.ExAttr2); |
| | | long exAttr1 = PlayerDatas.Instance.baseData.ExAttr1; |
| | | long exAttr2 = PlayerDatas.Instance.baseData.ExAttr2; |
| | | |
| | | int MapID = 1; |
| | | int FuncLineID = (int)exAttr2; |
| | |
| | | return null; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 检查是否有非主线战斗(如竞技场、白骨等)正在进行 |
| | | /// </summary> |
| | | /// <returns>如果有任何非主线战斗且未结束,则返回true</returns> |
| | | public bool IsOtherBattleInProgress() |
| | | //发进入战斗包 |
| | | private float lastTime = 0f; |
| | | private float turnCoolDown = 0.5f; // 冷却时间 |
| | | public void SendTurnFight(uint mapID, uint funcLineID = 0, byte tagType = 0, uint tagID = 0, uint[] valueList = null) |
| | | { |
| | | foreach (var kvp in battleFields) |
| | | // 连续频繁发包,触发提示 |
| | | float currentTime = Time.time; |
| | | if (currentTime - lastTime < turnCoolDown) |
| | | { |
| | | 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; |
| | | SysNotifyMgr.Instance.ShowTip("BattleCoolDown"); |
| | | return; |
| | | } |
| | | return false; |
| | | lastTime = currentTime; |
| | | |
| | | CB410_tagCMTurnFight pack = new CB410_tagCMTurnFight(); |
| | | pack.MapID = mapID; |
| | | pack.FuncLineID = funcLineID; |
| | | pack.TagType = tagType; |
| | | pack.TagID = tagID; |
| | | if (!valueList.IsNullOrEmpty()) |
| | | { |
| | | pack.ValueList = valueList; |
| | | pack.ValueCount = (byte)valueList.Length; |
| | | } |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | |
| | | // 获取当前正在显示的战斗场景名称,如果没有则返回空字符串 |
| | |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | // 获取当前正在显示的战斗场景,如果没有则返回null |
| | | public BattleField GetActiveBattleFieldByName(string battleName) |
| | | { |
| | | foreach (var kvp in battleFields) |
| | | { |
| | | BattleField battleField = kvp.Value; |
| | | if (battleField == null) |
| | | continue; |
| | | |
| | | var name = battleField.ToString(); |
| | | if (name == battleName) |
| | | return battleField; |
| | | } |
| | | return null; |
| | | } |
| | | } |