| | |
| | | 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; |
| | | |
| | | public Action<string, BattleField> onBattleFieldCreate; |
| | | |
| | | public Action<string, BattleField> onBattleFieldDestroy; |
| | | public Action onBattleFieldDestroy; |
| | | |
| | | public bool isWaitServerStory = false; //主线等服务端回报 0425 |
| | | |
| | |
| | | { |
| | | 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); |
| | | |
| | | 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; |
| | |
| | | |
| | | GameObject.DestroyImmediate(battleField.battleRootNode.gameObject); |
| | | |
| | | onBattleFieldDestroy?.Invoke(battleField.guid, battleField); |
| | | onBattleFieldDestroy?.Invoke(); |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | return null; |
| | | } |
| | | |
| | | //发进入战斗包 |
| | | 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) |
| | | { |
| | | // 连续频繁发包,触发提示 |
| | | float currentTime = Time.time; |
| | | if (currentTime - lastTime < turnCoolDown) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("BattleCoolDown"); |
| | | return; |
| | | } |
| | | 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); |
| | | } |
| | | |
| | | // 获取当前正在显示的战斗场景名称,如果没有则返回空字符串 |
| | | public string GetActiveBattleName() |
| | | { |
| | | foreach (var kvp in battleFields) |
| | | { |
| | | BattleField battleField = kvp.Value; |
| | | if (battleField == null) |
| | | continue; |
| | | |
| | | var battleName = battleField.ToString(); |
| | | if (BattleConst.battleNameToWinName.ContainsKey(battleName) |
| | | && UIManager.Instance.IsOpened(BattleConst.battleNameToWinName[battleName])) |
| | | return battleName; |
| | | } |
| | | 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; |
| | | } |
| | | } |