| | |
| | | { |
| | | ParseConfig(); |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerInit; |
| | | BattleManager.Instance.onBattleFieldCreate += OnCreateBattleField; |
| | | EventBroadcast.Instance.AddListener<string, SkillConfig, TeamHero>(EventName.BATTLE_CAST_SKILL, OnSkillCast); |
| | | |
| | | } |
| | | |
| | |
| | | { |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk; |
| | | BattleManager.Instance.onBattleFieldCreate -= OnCreateBattleField; |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= BeforePlayerInit; |
| | | |
| | | } |
| | | |
| | |
| | | void OnPlayerLoginOk() |
| | | { |
| | | //登录时有装备的处理 |
| | | } |
| | | |
| | | void BeforePlayerInit() |
| | | { |
| | | fightingHeroSkinID = 0; |
| | | heroGuid = ""; |
| | | } |
| | | |
| | | public void SaveAutoFightSetting() |
| | |
| | | |
| | | } |
| | | |
| | | #region 战斗 |
| | | #region 主线战斗(自动和手动) |
| | | |
| | | public void StartFight() |
| | | { |
| | |
| | | return; |
| | | } |
| | | |
| | | if (UIHelper.GetMoneyCnt(41) < PlayerDatas.Instance.baseData.UseHarmerCount) |
| | | if (!ItemLogicUtility.CheckCurrencyCount(41, PlayerDatas.Instance.baseData.UseHarmerCount, 2)) |
| | | { |
| | | if (storyBattleField.GetBattleMode() != BattleMode.Stop) |
| | | storyBattleField.HaveRest(); |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | void ChangeBattleModeEvent(BattleMode _battleMode) |
| | | { |
| | | if (_battleMode == BattleMode.Stop) |
| | | { |
| | | isAutoAttack = false; |
| | | } |
| | | OnFightEvent?.Invoke(false); |
| | | } |
| | | |
| | | |
| | | public int fightingHeroSkinID; //当前战斗的英雄皮肤ID |
| | | public string heroGuid; |
| | | public event Action<bool> OnFightEvent; //是否战斗通知 |
| | | |
| | | |
| | | /// <summary> |
| | | /// 技能释放 通知UI处理 |
| | | /// </summary> |
| | | /// <param name="guid">空为主线</param> |
| | | /// <param name="skillConfig">用于怒气等显示</param> |
| | | /// <param name="teamHero">战斗中的武将</param> |
| | | void OnSkillCast(string guid, SkillConfig skillConfig, TeamHero teamHero) |
| | | { |
| | | if (!string.IsNullOrEmpty(guid)) |
| | | return; |
| | | |
| | | |
| | | if (teamHero.NPCID != 0) |
| | | return; |
| | | fightingHeroSkinID = teamHero.SkinID; |
| | | heroGuid = teamHero.guid; |
| | | OnFightEvent?.Invoke(true); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |