using UnityEngine; using System.Collections; using System.Collections.Generic; namespace YLBattle { /// /// buff /// public partial class LogicFighter { /// /// 已获得buff 【tid,iid】 /// private Dictionary mBuffs_Data = new Dictionary(); /// /// buff相关属性 /// private int[] mBuffProperty = new int[(int)EBuffEffect.EBUFF_EFFECT_MAX]; /// /// 增加buff /// /// 模板TID /// 实例IID public int GetLastBuff(string tid, int iid) { int lastIID = -1; if (this.mBuffs_Data.ContainsKey(tid)) { lastIID = this.mBuffs_Data[tid]; this.mBuffs_Data[tid] = iid; } else { this.mBuffs_Data.Add(tid, iid); } return lastIID; } /// /// 获取所以buff /// /// 已获得buff 【tid,iid】 public Dictionary GetAllBuff() { return this.mBuffs_Data; } /// /// 获取指定buff效果 /// /// buff效果索引 /// 对应数值 public int GetBuffEffectProperty(EBuffEffect indx) { return this.mBuffProperty[(int)indx]; } /// /// 修改指定buff效果值 /// /// buf效果索引 /// 修改值 public void ModifyBuffEffectProperty(EBuffEffect indx, int val) { this.mBuffProperty[(int)indx] += val; } /// /// 设置指定buff效果值 /// /// buff效果索引 /// 新值 public void SetBuffEffectProperty(EBuffEffect indx, int val) { this.mBuffProperty[(int)indx] = val; } #region 2017-09-24 /// /// 获得自身正在生效的buff类型(Tid)的执行参数 /// 格式{"iid1;parm|iid2;parm"} /// 备足:parm存在逗号',' /// /// //public List GetBuffEffectParm(EBuffEffect eid) //{ // List result = new List(); // foreach (LogicFighterBuff buff in this.mBuffs_Data.Values) // { // if (buff.Effect == eid) // { // result.Add(buff); // if (eid == EBuffEffect.EBUFF_EFFECT_Shield) // continue; // if (eid == EBuffEffect.EBUFF_EFFECT_TAUNT) // continue; // } // } // return result; //} /// /// 检测同类型的Buff(根据Layer数值判断)是否可叠加【二级检测】 /// /// /// //public bool CheckBuffLayer(string BuffTid) //{ // /** // * 类型冲突,主要是参考bufftid....(非effect) // * ///A:如果是大于1,则为同款[叠加] // * ///B:如果为等于1,则为[替换],参数[更新] // */ // if (this.mBuffs_Layer.ContainsKey(BuffTid)) // { // if (this.mBuffs_Layer[BuffTid] + 1 > mBuffs_MaxLayer[BuffTid]) // { // LogHelper.Log("**********************模板TID:"+BuffTid+" 当前层:"+this.mBuffs_Layer[BuffTid]+"最大层:"+mBuffs_MaxLayer[BuffTid].ToString()); // return false; // } // } // return true; //} /// /// 检测冲突【优先检测】 /// /// /// //public int CheckBuffChongTu(string chongtu) //{ // int resultIID = -1; // /** // * 冲突 // * A:同ID的buff,根据layer数值来判断是否可叠加 // * B:不同的ID的buff,根据chongtu数值判断是否可替换 // * {替换:无视上一个buff的层数,直接替换} // */ // if (chongtu == "" || chongtu == string.Empty || chongtu.Trim().Length <= 0) // { // return resultIID; // } // if (this.mBuffs_ChongTu.ContainsKey(chongtu)) // { // resultIID= this.mBuffs_ChongTu[chongtu]; // this.mBuffs_ChongTu.Remove(chongtu); // } // return resultIID; //} /// /// 获得自身正在生效的buff类型(Tid)的层 /// /// /// //public int GetBuffLayer(string tid) //{ // int result = -1; // if (this.mBuffs_Layer.ContainsKey(tid)) // { // result = this.mBuffs_Layer[tid]; // } // return result; //} /// /// 获得自身正在生效的buff类型(Tid)的触发参数 /// 格式{"iid1;parm|iid2;parm"} /// 备足:parm存在逗号',' /// /// //public string GetBuffTriggerParm(EBuffEffect eid) //{ // string result = "-1"; // foreach (LogicFighterBuff buff in this.mBuffs_Data.Values) // { // if (buff.Effect == eid) // { // return buff.TriggerParm; // } // } // return result; //} /// /// 更新buff【外部】触发参数 /// 供BUFF外部【角色/技能/其他】调用 /// /// /// //public void ModifyBuffTriggerParm(int iid, string parm) //{ // if (this.mBuffs_Data.ContainsKey(iid)) // { // this.mBuffs_Data[iid].TriggerParm = parm; // } //} /// /// 更新buff【外部】执行参数 /// 供BUFF外部【角色/技能/其他】调用 /// /// /// //public LogicFighterBuff ModifyBuffEffectParm(int iid, string parm) //{ // if (this.mBuffs_Data.ContainsKey(iid)) // { // this.mBuffs_Data[iid].EffectParm = parm; // return this.mBuffs_Data[iid]; // } // return null; //} ///// ///// 获取指定buff效果 ///// ///// buff效果索引 ///// 对应数值 //public int GetBuffEffectProperty(EBuffEffect indx) //{ // return this.mBuffProperty[(int)indx]; //} ///// ///// 修改指定buff效果值 ///// ///// buf效果索引 ///// 修改值 //public void ModifyBuffEffectProperty(EBuffEffect indx, int val) //{ // this.mBuffProperty[(int)indx] += val; //} ///// ///// 设置指定buff效果值 ///// ///// buff效果索引 ///// 新值 //public void SetBuffEffectProperty(EBuffEffect indx, int val) //{ // this.mBuffProperty[(int)indx] = val; //} #endregion } }