| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using TableConfig; |
| | | using UnityEngine; |
| | | using Snxxz.UI; |
| | | //用于主界面的BUFF数据接收 |
| | | public class ObjBuff |
| | | { |
| | | public int ClearType; |
| | | public int ObjID; |
| | | public int BuffType; |
| | | public int SkillID; |
| | | public int LastTime; |
| | | public DateTime _dattTime; |
| | | public string ImagKey; |
| | | public string BuffName; |
| | | public string BuffConent; |
| | | public int Layer; |
| | | public int SkillTypeID; |
| | | } |
| | | |
| | | public class PlayerBuffDatas : Model, IBeforePlayerDataInitialize, IPlayerLoginOk |
| | | { |
| | | public int PkType = 0;//PK对象选择 |
| | | public delegate void OnObjAddBuff(); |
| | | public static event OnObjAddBuff Even_ObjAddBuf;//关于Buff的增加 |
| | | public delegate void OnObjDelBuff(); |
| | | public static event OnObjDelBuff Even_ObjDelBuff;//关于Buff的减少 |
| | | public Dictionary<int, ObjBuff> _BuffDic = new Dictionary<int, ObjBuff>();//buff字典 |
| | | VipModel m_VipModel; |
| | | VipModel vipModel { get { return m_VipModel ?? (m_VipModel = ModelCenter.Instance.GetModel<VipModel>()); } } |
| | | public override void Init() |
| | | { |
| | | PlayerDatas.Instance.OnSwitchAttackMode += OnSwitchAttackMode; |
| | | vipModel.OnVipTimeEvent += OnVipTimeEven; |
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent; |
| | | PlayerDatas.Instance.OnRoleAttrRefresh += WorldLVBuff; |
| | | OperationTimeHepler.Instance.operationStartEvent += operationStartEvent; |
| | | OperationTimeHepler.Instance.operationEndEvent += operationEndEvent; |
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent += operationTimeUpdateEvent; |
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent; |
| | | } |
| | | public override void UnInit() |
| | | { |
| | | PlayerDatas.Instance.OnSwitchAttackMode -= OnSwitchAttackMode; |
| | | vipModel.OnVipTimeEvent -= OnVipTimeEven; |
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= PlayerDataRefreshInfoEvent; |
| | | PlayerDatas.Instance.OnRoleAttrRefresh -= WorldLVBuff; |
| | | OperationTimeHepler.Instance.operationStartEvent -= operationStartEvent; |
| | | OperationTimeHepler.Instance.operationEndEvent -= operationEndEvent; |
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent -= operationTimeUpdateEvent; |
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent; |
| | | } |
| | | |
| | | private void OnFuncStateChangeEvent(int onFuncID) |
| | | { |
| | | if (onFuncID == (int)FuncOpenEnum.WorldLv) |
| | | { |
| | | WorldLVBuff(); |
| | | } |
| | | } |
| | | |
| | | private void operationTimeUpdateEvent(Operation obj) |
| | | { |
| | | if (obj == Operation.MultipleExp) |
| | | { |
| | | AddoperationStartEvent(); |
| | | if (Even_ObjAddBuf != null) |
| | | { |
| | | Even_ObjAddBuf(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void OnPlayerLoginOk() |
| | | { |
| | | OnVipTimeEven(); |
| | | WorldLVBuff(); |
| | | AddoperationStartEvent(); |
| | | } |
| | | private void operationStartEvent(Operation arg1, int arg2)//关于多倍经验 |
| | | { |
| | | if (arg1 == Operation.MultipleExp && arg2 == 0) |
| | | { |
| | | AddoperationStartEvent(); |
| | | if (Even_ObjAddBuf != null) |
| | | { |
| | | Even_ObjAddBuf(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void AddoperationStartEvent() |
| | | { |
| | | bool IsBool = OperationTimeHepler.Instance.SatisfyOpenCondition(Operation.MultipleExp); |
| | | if (IsBool) |
| | | { |
| | | int seconds = OperationTimeHepler.Instance.GetOperationSurplusTime(Operation.MultipleExp); |
| | | OperationBase operation = null; |
| | | OperationTimeHepler.Instance.TryGetOperationTime(Operation.MultipleExp, out operation); |
| | | int multipleF = 0; |
| | | if (operation != null) |
| | | { |
| | | multipleF = (operation as OperationMultiExp).multiple / 10000; |
| | | } |
| | | var skillconfig = ConfigManager.Instance.GetTemplate<SkillConfig>(20048); |
| | | if (_BuffDic.ContainsKey(20048)) |
| | | { |
| | | _BuffDic[20048].LastTime = seconds; |
| | | _BuffDic[20048]._dattTime = DateTime.Now; |
| | | _BuffDic[20048].BuffConent = string.Format(skillconfig.BuffDescription, (multipleF - 1) * 100); |
| | | if (multipleF == 2) |
| | | { |
| | | _BuffDic[20048].BuffName = Language.Get("ExpActivity_Text2"); |
| | | } |
| | | else if (multipleF == 3) |
| | | { |
| | | _BuffDic[20048].BuffName = Language.Get("ExpActivity_Text3"); |
| | | } |
| | | else if (multipleF == 5) |
| | | { |
| | | _BuffDic[20048].BuffName = Language.Get("ExpActivity_Text4"); |
| | | } |
| | | else |
| | | { |
| | | _BuffDic[20048].BuffName = skillconfig.SkillName; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | ObjBuff _ObjBuff = new ObjBuff(); |
| | | _ObjBuff.BuffType = skillconfig.SkillType; |
| | | _ObjBuff.SkillID = 20048; |
| | | _ObjBuff.LastTime = seconds; |
| | | _ObjBuff._dattTime = DateTime.Now; |
| | | if (multipleF == 2) |
| | | { |
| | | _ObjBuff.BuffName = Language.Get("ExpActivity_Text2"); |
| | | } else if (multipleF == 3) |
| | | { |
| | | _ObjBuff.BuffName = Language.Get("ExpActivity_Text3"); |
| | | } else if (multipleF == 5) |
| | | { |
| | | _ObjBuff.BuffName = Language.Get("ExpActivity_Text4"); |
| | | } |
| | | else |
| | | { |
| | | _ObjBuff.BuffName = skillconfig.SkillName; |
| | | } |
| | | _ObjBuff.ImagKey = skillconfig.IconName; |
| | | _ObjBuff.BuffConent = string.Format(skillconfig.BuffDescription, (multipleF-1) * 100); |
| | | _ObjBuff.SkillTypeID = skillconfig.SkillTypeID; |
| | | _ObjBuff.Layer = 0; |
| | | _BuffDic.Add(20048, _ObjBuff); |
| | | } |
| | | } |
| | | } |
| | | private void operationEndEvent(Operation arg1, int arg2) |
| | | { |
| | | if (arg1== Operation.MultipleExp && arg2==0) |
| | | { |
| | | if (_BuffDic.ContainsKey(20048)) |
| | | { |
| | | _BuffDic.Remove(20048); |
| | | if (Even_ObjDelBuff != null) |
| | | Even_ObjDelBuff(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | private void PlayerDataRefreshInfoEvent(PlayerDataRefresh _type) |
| | | { |
| | | switch (_type) |
| | | { |
| | | case PlayerDataRefresh.VIPLv: |
| | | OnVipTimeEven(); |
| | | break; |
| | | case PlayerDataRefresh.ExpPoint: |
| | | WorldLVBuff(); |
| | | break; |
| | | case PlayerDataRefresh.LV: |
| | | AddoperationStartEvent(); |
| | | break; |
| | | } |
| | | |
| | | } |
| | | |
| | | private void OnVipTimeEven() |
| | | { |
| | | if (vipModel.GetVipPrivilegeCnt(VipPrivilegeType.KillMonsterExpUp) == 3000) |
| | | { |
| | | var skillconfig = ConfigManager.Instance.GetTemplate<SkillConfig>(20044); |
| | | //var _timeSpan = vipModel.vipOverdue - TimeUtility.ServerNow; |
| | | if (_BuffDic.ContainsKey(20044)) |
| | | { |
| | | _BuffDic[20044].LastTime = 0; |
| | | _BuffDic[20044]._dattTime = DateTime.Now; |
| | | } |
| | | else |
| | | { |
| | | ObjBuff _ObjBuff = new ObjBuff(); |
| | | _ObjBuff.BuffType = skillconfig.SkillType; |
| | | _ObjBuff.SkillID = 20044; |
| | | _ObjBuff.LastTime = 0; |
| | | _ObjBuff._dattTime = DateTime.Now; |
| | | _ObjBuff.ImagKey = skillconfig.IconName; |
| | | _ObjBuff.BuffName = skillconfig.SkillName; |
| | | _ObjBuff.BuffConent = skillconfig.BuffDescription; |
| | | _ObjBuff.SkillTypeID = skillconfig.SkillTypeID; |
| | | _ObjBuff.Layer = 0; |
| | | _BuffDic.Add(20044, _ObjBuff); |
| | | } |
| | | if (Even_ObjAddBuf != null) |
| | | Even_ObjAddBuf(); |
| | | } |
| | | else |
| | | { |
| | | if (_BuffDic.ContainsKey(20044)) |
| | | { |
| | | _BuffDic.Remove(20044); |
| | | if (Even_ObjDelBuff != null) |
| | | Even_ObjDelBuff(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void OnSwitchAttackMode(E_AttackMode obj) |
| | | { |
| | | PkType = (int)obj; |
| | | } |
| | | |
| | | public void OnBeforePlayerDataInitialize() |
| | | { |
| | | _BuffDic.Clear(); |
| | | PkType = 0; |
| | | } |
| | | public void ObjAddBuff(H0605_tagObjAddBuff info)//buff增加 |
| | | { |
| | | int _Type = ConfigManager.Instance.GetTemplate<SkillConfig>(info.SkillID).SkillType; |
| | | if (TypeJudgment(_Type) && info.ObjID == PlayerDatas.Instance.baseData.PlayerID && ConfigManager.Instance.GetTemplate<SkillConfig>(info.SkillID).BuffDisplay == 0) |
| | | { |
| | | |
| | | if (_BuffDic.ContainsKey((int)info.SkillID)) |
| | | { |
| | | var ObjBuff = _BuffDic[(int)info.SkillID]; |
| | | ObjBuff.ClearType = (int)info.BuffType; |
| | | ObjBuff.ObjID = (int)info.ObjID; |
| | | ObjBuff.BuffType = _Type; |
| | | ObjBuff.SkillID = (int)info.SkillID; |
| | | ObjBuff.LastTime = ((int)info.LastTime / 1000); |
| | | ObjBuff._dattTime = DateTime.Now; |
| | | ObjBuff.ImagKey = ConfigManager.Instance.GetTemplate<SkillConfig>(info.SkillID).IconName; |
| | | ObjBuff.BuffName = ConfigManager.Instance.GetTemplate<SkillConfig>(info.SkillID).SkillName; |
| | | ObjBuff.BuffConent = ConfigManager.Instance.GetTemplate<SkillConfig>(info.SkillID).BuffDescription; |
| | | ObjBuff.SkillTypeID = ConfigManager.Instance.GetTemplate<SkillConfig>(info.SkillID).SkillTypeID; |
| | | ObjBuff.Layer = (int)info.Layer; |
| | | } |
| | | else |
| | | { |
| | | ObjBuff _ObjBuff = new ObjBuff(); |
| | | _ObjBuff.ClearType = (int)info.BuffType; |
| | | _ObjBuff.ObjID = (int)info.ObjID; |
| | | _ObjBuff.BuffType = _Type; |
| | | _ObjBuff.SkillID = (int)info.SkillID; |
| | | _ObjBuff.LastTime = ((int)info.LastTime / 1000); |
| | | _ObjBuff._dattTime = DateTime.Now; |
| | | _ObjBuff.ImagKey = ConfigManager.Instance.GetTemplate<SkillConfig>(info.SkillID).IconName; |
| | | _ObjBuff.BuffName = ConfigManager.Instance.GetTemplate<SkillConfig>(info.SkillID).SkillName; |
| | | _ObjBuff.BuffConent = ConfigManager.Instance.GetTemplate<SkillConfig>(info.SkillID).BuffDescription; |
| | | _ObjBuff.SkillTypeID = ConfigManager.Instance.GetTemplate<SkillConfig>(info.SkillID).SkillTypeID; |
| | | _ObjBuff.Layer = (int)info.Layer; |
| | | _BuffDic.Add((int)info.SkillID, _ObjBuff); |
| | | } |
| | | if (Even_ObjAddBuf != null) |
| | | Even_ObjAddBuf(); |
| | | } |
| | | } |
| | | |
| | | public void ObjDelBuff(int _BuffID)//buff减少 |
| | | { |
| | | if (_BuffDic.ContainsKey(_BuffID)) |
| | | { |
| | | _BuffDic.Remove(_BuffID); |
| | | if (Even_ObjDelBuff != null) |
| | | Even_ObjDelBuff(); |
| | | } |
| | | } |
| | | |
| | | public void ClearBuff(int BuffType, int playerId)//按类型清除Buff |
| | | { |
| | | if (BuffType == 9) |
| | | { |
| | | return; |
| | | } |
| | | if (playerId != PlayerDatas.Instance.baseData.PlayerID) |
| | | { |
| | | return; |
| | | } |
| | | List<int> _ClearBuffType = new List<int>(); |
| | | foreach (int key in _BuffDic.Keys) |
| | | { |
| | | if (_BuffDic[key].ClearType == BuffType) |
| | | { |
| | | _ClearBuffType.Add(key); |
| | | } |
| | | |
| | | } |
| | | for (int i = 0; i < _ClearBuffType.Count; i++) |
| | | { |
| | | _BuffDic.Remove(_ClearBuffType[i]); |
| | | } |
| | | if (Even_ObjDelBuff != null) |
| | | { |
| | | Even_ObjDelBuff(); |
| | | } |
| | | |
| | | } |
| | | |
| | | bool TypeJudgment(int _buffType) |
| | | { |
| | | string[] _BuffList = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("BuffType").Numerical1.Split('|'); |
| | | for (int i = 0; i < _BuffList.Length; i++) |
| | | { |
| | | if (_buffType == int.Parse(_BuffList[i])) |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public bool BuffCover(int _itemId) |
| | | { |
| | | var configItem = ConfigManager.Instance.GetTemplate<ItemConfig>(_itemId); |
| | | var skillconfig = ConfigManager.Instance.GetTemplate<SkillConfig>(configItem.AddSkill1); |
| | | if (skillconfig != null && skillconfig.SkillType == 9) |
| | | { |
| | | if (_BuffDic.ContainsKey(configItem.AddSkill1)) |
| | | { |
| | | return false; |
| | | } |
| | | foreach (var key in _BuffDic.Keys) |
| | | { |
| | | if (_BuffDic[key].BuffType == 9 && _BuffDic[key].SkillTypeID == skillconfig.SkillTypeID) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | private void WorldLVBuff()//关于世界等级的Buff |
| | | { |
| | | // return; |
| | | int getWorldLV = 0; |
| | | int worldExpRate = 0; |
| | | getWorldLV = (int)PlayerDatas.Instance.worldLv; |
| | | worldExpRate = Mathf.FloorToInt(UIHelper.ReplacePercentage((int)PlayerDatas.Instance.worldExpRate, 2)); |
| | | |
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.WorldLv)) |
| | | { |
| | | return; |
| | | } |
| | | if (getWorldLV != 0 && worldExpRate>0) |
| | | { |
| | | var skillconfig = ConfigManager.Instance.GetTemplate<SkillConfig>(20047); |
| | | if (_BuffDic.ContainsKey(20047)) |
| | | { |
| | | _BuffDic[20047].LastTime = 0; |
| | | _BuffDic[20047]._dattTime = DateTime.Now; |
| | | _BuffDic[20047].BuffConent = string.Format(skillconfig.BuffDescription, worldExpRate); |
| | | } |
| | | else |
| | | { |
| | | ObjBuff _ObjBuff = new ObjBuff(); |
| | | _ObjBuff.BuffType = skillconfig.SkillType; |
| | | _ObjBuff.SkillID = 20047; |
| | | _ObjBuff.LastTime = 0; |
| | | _ObjBuff._dattTime = DateTime.Now; |
| | | _ObjBuff.ImagKey = skillconfig.IconName; |
| | | _ObjBuff.BuffName = skillconfig.SkillName; |
| | | _ObjBuff.BuffConent = string.Format(skillconfig.BuffDescription, worldExpRate); |
| | | _ObjBuff.SkillTypeID = skillconfig.SkillTypeID; |
| | | _ObjBuff.Layer = 0; |
| | | _BuffDic.Add(20047, _ObjBuff); |
| | | } |
| | | if (Even_ObjAddBuf != null) |
| | | Even_ObjAddBuf(); |
| | | } |
| | | } |
| | | |
| | | public bool BastBuff(int Item)//判断身上是否有更好的经验BUff |
| | | { |
| | | var configItem = ConfigManager.Instance.GetTemplate<ItemConfig>(Item); |
| | | var skillconfig = ConfigManager.Instance.GetTemplate<SkillConfig>(configItem.AddSkill1); |
| | | int SkillTypeID = int.Parse(ConfigManager.Instance.GetTemplate<FuncConfigConfig>("IntroductionItem").Numerical2); |
| | | DesignDebug.Log("请德龙睁开眼睛说话........."); |
| | | if (skillconfig.SkillTypeID == SkillTypeID) |
| | | { |
| | | int buffLv = 0; |
| | | foreach (var key in _BuffDic.Keys) |
| | | { |
| | | var skillCon = ConfigManager.Instance.GetTemplate<SkillConfig>(key); |
| | | if (skillCon.SkillTypeID == SkillTypeID && skillCon.SkillLV> buffLv) |
| | | { |
| | | buffLv = skillCon.SkillLV; |
| | | } |
| | | } |
| | | if (buffLv > skillconfig.SkillLV) |
| | | { |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using Snxxz.UI;
|
| | | //用于主界面的BUFF数据接收
|
| | | public class ObjBuff
|
| | | {
|
| | | public int ClearType;
|
| | | public int ObjID;
|
| | | public int BuffType;
|
| | | public int SkillID;
|
| | | public int LastTime;
|
| | | public DateTime _dattTime;
|
| | | public string ImagKey;
|
| | | public string BuffName;
|
| | | public string BuffConent;
|
| | | public int Layer;
|
| | | public int SkillTypeID;
|
| | | }
|
| | |
|
| | | public class PlayerBuffDatas : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | public int PkType = 0;//PK对象选择
|
| | | public delegate void OnObjAddBuff();
|
| | | public static event OnObjAddBuff Even_ObjAddBuf;//关于Buff的增加
|
| | | public delegate void OnObjDelBuff();
|
| | | public static event OnObjDelBuff Even_ObjDelBuff;//关于Buff的减少
|
| | | public Dictionary<int, ObjBuff> _BuffDic = new Dictionary<int, ObjBuff>();//buff字典
|
| | | VipModel m_VipModel;
|
| | | VipModel vipModel { get { return m_VipModel ?? (m_VipModel = ModelCenter.Instance.GetModel<VipModel>()); } }
|
| | | public override void Init()
|
| | | {
|
| | | PlayerDatas.Instance.OnSwitchAttackMode += OnSwitchAttackMode;
|
| | | vipModel.OnVipTimeEvent += OnVipTimeEven;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent;
|
| | | PlayerDatas.Instance.OnRoleAttrRefresh += WorldLVBuff;
|
| | | OperationTimeHepler.Instance.operationStartEvent += operationStartEvent;
|
| | | OperationTimeHepler.Instance.operationEndEvent += operationEndEvent;
|
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent += operationTimeUpdateEvent;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | | }
|
| | | public override void UnInit()
|
| | | {
|
| | | PlayerDatas.Instance.OnSwitchAttackMode -= OnSwitchAttackMode;
|
| | | vipModel.OnVipTimeEvent -= OnVipTimeEven;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= PlayerDataRefreshInfoEvent;
|
| | | PlayerDatas.Instance.OnRoleAttrRefresh -= WorldLVBuff;
|
| | | OperationTimeHepler.Instance.operationStartEvent -= operationStartEvent;
|
| | | OperationTimeHepler.Instance.operationEndEvent -= operationEndEvent;
|
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent -= operationTimeUpdateEvent;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
|
| | | }
|
| | |
|
| | | private void OnFuncStateChangeEvent(int onFuncID)
|
| | | {
|
| | | if (onFuncID == (int)FuncOpenEnum.WorldLv)
|
| | | {
|
| | | WorldLVBuff();
|
| | | } |
| | | }
|
| | |
|
| | | private void operationTimeUpdateEvent(Operation obj)
|
| | | {
|
| | | if (obj == Operation.MultipleExp)
|
| | | {
|
| | | AddoperationStartEvent();
|
| | | if (Even_ObjAddBuf != null)
|
| | | {
|
| | | Even_ObjAddBuf();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | OnVipTimeEven();
|
| | | WorldLVBuff();
|
| | | AddoperationStartEvent();
|
| | | }
|
| | | private void operationStartEvent(Operation arg1, int arg2)//关于多倍经验
|
| | | {
|
| | | if (arg1 == Operation.MultipleExp && arg2 == 0)
|
| | | {
|
| | | AddoperationStartEvent();
|
| | | if (Even_ObjAddBuf != null)
|
| | | {
|
| | | Even_ObjAddBuf();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void AddoperationStartEvent()
|
| | | {
|
| | | bool IsBool = OperationTimeHepler.Instance.SatisfyOpenCondition(Operation.MultipleExp);
|
| | | if (IsBool)
|
| | | {
|
| | | int seconds = OperationTimeHepler.Instance.GetOperationSurplusTime(Operation.MultipleExp);
|
| | | OperationBase operation = null;
|
| | | OperationTimeHepler.Instance.TryGetOperationTime(Operation.MultipleExp, out operation);
|
| | | int multipleF = 0;
|
| | | if (operation != null)
|
| | | {
|
| | | multipleF = (operation as OperationMultiExp).multiple / 10000;
|
| | | }
|
| | | var skillconfig = ConfigManager.Instance.GetTemplate<SkillConfig>(20048);
|
| | | if (_BuffDic.ContainsKey(20048))
|
| | | {
|
| | | _BuffDic[20048].LastTime = seconds;
|
| | | _BuffDic[20048]._dattTime = DateTime.Now;
|
| | | _BuffDic[20048].BuffConent = string.Format(skillconfig.BuffDescription, (multipleF - 1) * 100);
|
| | | if (multipleF == 2)
|
| | | {
|
| | | _BuffDic[20048].BuffName = Language.Get("ExpActivity_Text2");
|
| | | }
|
| | | else if (multipleF == 3)
|
| | | {
|
| | | _BuffDic[20048].BuffName = Language.Get("ExpActivity_Text3");
|
| | | }
|
| | | else if (multipleF == 5)
|
| | | {
|
| | | _BuffDic[20048].BuffName = Language.Get("ExpActivity_Text4");
|
| | | }
|
| | | else
|
| | | {
|
| | | _BuffDic[20048].BuffName = skillconfig.SkillName;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | ObjBuff _ObjBuff = new ObjBuff();
|
| | | _ObjBuff.BuffType = skillconfig.SkillType;
|
| | | _ObjBuff.SkillID = 20048;
|
| | | _ObjBuff.LastTime = seconds;
|
| | | _ObjBuff._dattTime = DateTime.Now;
|
| | | if (multipleF == 2)
|
| | | {
|
| | | _ObjBuff.BuffName = Language.Get("ExpActivity_Text2");
|
| | | } else if (multipleF == 3)
|
| | | {
|
| | | _ObjBuff.BuffName = Language.Get("ExpActivity_Text3");
|
| | | } else if (multipleF == 5)
|
| | | {
|
| | | _ObjBuff.BuffName = Language.Get("ExpActivity_Text4");
|
| | | }
|
| | | else
|
| | | {
|
| | | _ObjBuff.BuffName = skillconfig.SkillName;
|
| | | }
|
| | | _ObjBuff.ImagKey = skillconfig.IconName; |
| | | _ObjBuff.BuffConent = string.Format(skillconfig.BuffDescription, (multipleF-1) * 100);
|
| | | _ObjBuff.SkillTypeID = skillconfig.SkillTypeID;
|
| | | _ObjBuff.Layer = 0;
|
| | | _BuffDic.Add(20048, _ObjBuff);
|
| | | }
|
| | | }
|
| | | }
|
| | | private void operationEndEvent(Operation arg1, int arg2)
|
| | | {
|
| | | if (arg1== Operation.MultipleExp && arg2==0)
|
| | | {
|
| | | if (_BuffDic.ContainsKey(20048))
|
| | | {
|
| | | _BuffDic.Remove(20048);
|
| | | if (Even_ObjDelBuff != null)
|
| | | Even_ObjDelBuff();
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | private void PlayerDataRefreshInfoEvent(PlayerDataRefresh _type)
|
| | | {
|
| | | switch (_type)
|
| | | {
|
| | | case PlayerDataRefresh.VIPLv:
|
| | | OnVipTimeEven();
|
| | | break;
|
| | | case PlayerDataRefresh.ExpPoint:
|
| | | WorldLVBuff();
|
| | | break;
|
| | | case PlayerDataRefresh.LV:
|
| | | AddoperationStartEvent();
|
| | | break;
|
| | | }
|
| | |
|
| | | }
|
| | | |
| | | private void OnVipTimeEven()
|
| | | {
|
| | | if (vipModel.GetVipPrivilegeCnt(VipPrivilegeType.KillMonsterExpUp) == 3000)
|
| | | {
|
| | | var skillconfig = ConfigManager.Instance.GetTemplate<SkillConfig>(20044);
|
| | | //var _timeSpan = vipModel.vipOverdue - TimeUtility.ServerNow;
|
| | | if (_BuffDic.ContainsKey(20044))
|
| | | {
|
| | | _BuffDic[20044].LastTime = 0;
|
| | | _BuffDic[20044]._dattTime = DateTime.Now;
|
| | | }
|
| | | else
|
| | | {
|
| | | ObjBuff _ObjBuff = new ObjBuff();
|
| | | _ObjBuff.BuffType = skillconfig.SkillType;
|
| | | _ObjBuff.SkillID = 20044;
|
| | | _ObjBuff.LastTime = 0;
|
| | | _ObjBuff._dattTime = DateTime.Now;
|
| | | _ObjBuff.ImagKey = skillconfig.IconName;
|
| | | _ObjBuff.BuffName = skillconfig.SkillName;
|
| | | _ObjBuff.BuffConent = skillconfig.BuffDescription;
|
| | | _ObjBuff.SkillTypeID = skillconfig.SkillTypeID;
|
| | | _ObjBuff.Layer = 0;
|
| | | _BuffDic.Add(20044, _ObjBuff);
|
| | | }
|
| | | if (Even_ObjAddBuf != null)
|
| | | Even_ObjAddBuf();
|
| | | }
|
| | | else
|
| | | {
|
| | | if (_BuffDic.ContainsKey(20044))
|
| | | {
|
| | | _BuffDic.Remove(20044);
|
| | | if (Even_ObjDelBuff != null)
|
| | | Even_ObjDelBuff();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnSwitchAttackMode(E_AttackMode obj)
|
| | | {
|
| | | PkType = (int)obj;
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | _BuffDic.Clear();
|
| | | PkType = 0;
|
| | | }
|
| | | public void ObjAddBuff(H0605_tagObjAddBuff info)//buff增加
|
| | | {
|
| | | int _Type = ConfigManager.Instance.GetTemplate<SkillConfig>(info.SkillID).SkillType;
|
| | | if (TypeJudgment(_Type) && info.ObjID == PlayerDatas.Instance.baseData.PlayerID && ConfigManager.Instance.GetTemplate<SkillConfig>(info.SkillID).BuffDisplay == 0)
|
| | | {
|
| | |
|
| | | if (_BuffDic.ContainsKey((int)info.SkillID))
|
| | | {
|
| | | var ObjBuff = _BuffDic[(int)info.SkillID];
|
| | | ObjBuff.ClearType = (int)info.BuffType;
|
| | | ObjBuff.ObjID = (int)info.ObjID;
|
| | | ObjBuff.BuffType = _Type;
|
| | | ObjBuff.SkillID = (int)info.SkillID;
|
| | | ObjBuff.LastTime = ((int)info.LastTime / 1000);
|
| | | ObjBuff._dattTime = DateTime.Now;
|
| | | ObjBuff.ImagKey = ConfigManager.Instance.GetTemplate<SkillConfig>(info.SkillID).IconName;
|
| | | ObjBuff.BuffName = ConfigManager.Instance.GetTemplate<SkillConfig>(info.SkillID).SkillName;
|
| | | ObjBuff.BuffConent = ConfigManager.Instance.GetTemplate<SkillConfig>(info.SkillID).BuffDescription;
|
| | | ObjBuff.SkillTypeID = ConfigManager.Instance.GetTemplate<SkillConfig>(info.SkillID).SkillTypeID;
|
| | | ObjBuff.Layer = (int)info.Layer;
|
| | | }
|
| | | else
|
| | | {
|
| | | ObjBuff _ObjBuff = new ObjBuff();
|
| | | _ObjBuff.ClearType = (int)info.BuffType;
|
| | | _ObjBuff.ObjID = (int)info.ObjID;
|
| | | _ObjBuff.BuffType = _Type;
|
| | | _ObjBuff.SkillID = (int)info.SkillID;
|
| | | _ObjBuff.LastTime = ((int)info.LastTime / 1000);
|
| | | _ObjBuff._dattTime = DateTime.Now;
|
| | | _ObjBuff.ImagKey = ConfigManager.Instance.GetTemplate<SkillConfig>(info.SkillID).IconName;
|
| | | _ObjBuff.BuffName = ConfigManager.Instance.GetTemplate<SkillConfig>(info.SkillID).SkillName;
|
| | | _ObjBuff.BuffConent = ConfigManager.Instance.GetTemplate<SkillConfig>(info.SkillID).BuffDescription;
|
| | | _ObjBuff.SkillTypeID = ConfigManager.Instance.GetTemplate<SkillConfig>(info.SkillID).SkillTypeID;
|
| | | _ObjBuff.Layer = (int)info.Layer;
|
| | | _BuffDic.Add((int)info.SkillID, _ObjBuff);
|
| | | }
|
| | | if (Even_ObjAddBuf != null)
|
| | | Even_ObjAddBuf();
|
| | | }
|
| | | }
|
| | |
|
| | | public void ObjDelBuff(int _BuffID)//buff减少
|
| | | {
|
| | | if (_BuffDic.ContainsKey(_BuffID))
|
| | | {
|
| | | _BuffDic.Remove(_BuffID);
|
| | | if (Even_ObjDelBuff != null)
|
| | | Even_ObjDelBuff();
|
| | | }
|
| | | }
|
| | |
|
| | | public void ClearBuff(int BuffType, int playerId)//按类型清除Buff
|
| | | {
|
| | | if (BuffType == 9)
|
| | | {
|
| | | return;
|
| | | } |
| | | if (playerId != PlayerDatas.Instance.baseData.PlayerID)
|
| | | {
|
| | | return;
|
| | | }
|
| | | List<int> _ClearBuffType = new List<int>();
|
| | | foreach (int key in _BuffDic.Keys)
|
| | | {
|
| | | if (_BuffDic[key].ClearType == BuffType)
|
| | | {
|
| | | _ClearBuffType.Add(key);
|
| | | }
|
| | |
|
| | | }
|
| | | for (int i = 0; i < _ClearBuffType.Count; i++)
|
| | | {
|
| | | _BuffDic.Remove(_ClearBuffType[i]);
|
| | | }
|
| | | if (Even_ObjDelBuff != null)
|
| | | {
|
| | | Even_ObjDelBuff();
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | bool TypeJudgment(int _buffType)
|
| | | {
|
| | | string[] _BuffList = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("BuffType").Numerical1.Split('|');
|
| | | for (int i = 0; i < _BuffList.Length; i++)
|
| | | {
|
| | | if (_buffType == int.Parse(_BuffList[i]))
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool BuffCover(int _itemId)
|
| | | {
|
| | | var configItem = ConfigManager.Instance.GetTemplate<ItemConfig>(_itemId);
|
| | | var skillconfig = ConfigManager.Instance.GetTemplate<SkillConfig>(configItem.AddSkill1);
|
| | | if (skillconfig != null && skillconfig.SkillType == 9)
|
| | | {
|
| | | if (_BuffDic.ContainsKey(configItem.AddSkill1))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | foreach (var key in _BuffDic.Keys)
|
| | | {
|
| | | if (_BuffDic[key].BuffType == 9 && _BuffDic[key].SkillTypeID == skillconfig.SkillTypeID)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | private void WorldLVBuff()//关于世界等级的Buff
|
| | | {
|
| | | // return;
|
| | | int getWorldLV = 0;
|
| | | int worldExpRate = 0;
|
| | | getWorldLV = (int)PlayerDatas.Instance.worldLv;
|
| | | worldExpRate = Mathf.FloorToInt(UIHelper.ReplacePercentage((int)PlayerDatas.Instance.worldExpRate, 2));
|
| | |
|
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.WorldLv))
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (getWorldLV != 0 && worldExpRate>0)
|
| | | {
|
| | | var skillconfig = ConfigManager.Instance.GetTemplate<SkillConfig>(20047);
|
| | | if (_BuffDic.ContainsKey(20047))
|
| | | {
|
| | | _BuffDic[20047].LastTime = 0;
|
| | | _BuffDic[20047]._dattTime = DateTime.Now;
|
| | | _BuffDic[20047].BuffConent = string.Format(skillconfig.BuffDescription, worldExpRate);
|
| | | }
|
| | | else
|
| | | {
|
| | | ObjBuff _ObjBuff = new ObjBuff();
|
| | | _ObjBuff.BuffType = skillconfig.SkillType;
|
| | | _ObjBuff.SkillID = 20047;
|
| | | _ObjBuff.LastTime = 0;
|
| | | _ObjBuff._dattTime = DateTime.Now;
|
| | | _ObjBuff.ImagKey = skillconfig.IconName;
|
| | | _ObjBuff.BuffName = skillconfig.SkillName;
|
| | | _ObjBuff.BuffConent = string.Format(skillconfig.BuffDescription, worldExpRate);
|
| | | _ObjBuff.SkillTypeID = skillconfig.SkillTypeID;
|
| | | _ObjBuff.Layer = 0;
|
| | | _BuffDic.Add(20047, _ObjBuff);
|
| | | }
|
| | | if (Even_ObjAddBuf != null)
|
| | | Even_ObjAddBuf();
|
| | | }
|
| | | }
|
| | |
|
| | | public bool BastBuff(int Item)//判断身上是否有更好的经验BUff
|
| | | {
|
| | | var configItem = ConfigManager.Instance.GetTemplate<ItemConfig>(Item);
|
| | | var skillconfig = ConfigManager.Instance.GetTemplate<SkillConfig>(configItem.AddSkill1);
|
| | | int SkillTypeID = int.Parse(ConfigManager.Instance.GetTemplate<FuncConfigConfig>("IntroductionItem").Numerical2);
|
| | | DebugEx.Log("请德龙睁开眼睛说话.........");
|
| | | if (skillconfig.SkillTypeID == SkillTypeID)
|
| | | {
|
| | | int buffLv = 0;
|
| | | foreach (var key in _BuffDic.Keys)
|
| | | {
|
| | | var skillCon = ConfigManager.Instance.GetTemplate<SkillConfig>(key);
|
| | | if (skillCon.SkillTypeID == SkillTypeID && skillCon.SkillLV> buffLv)
|
| | | {
|
| | | buffLv = skillCon.SkillLV;
|
| | | }
|
| | | }
|
| | | if (buffLv > skillconfig.SkillLV)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | else
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | }
|