/// <summary> /// Adds the buff. /// </summary> /// <param name="buffID">Buff identifier.</param> /// <param name="buffTypeNum">Buff type number.</param> /// <param name="buffLastTypeNum">Buff last type number.</param> /// <param name="buffTime">Buff time.</param> /// <param name="tempBuffValue">Temp buff value.</param> /// <param name="buffOverlapType">Buff overlap type.</param> public void addBuff(int buffID, BuffConnection buffTypeNum, int buffLastTypeNum, int buffTime, int tempBuffValue, int buffOverlapType) { buff tempbuff = new buff(buffID, buffTypeNum, (BuffLastType)buffLastTypeNum, buffTime, tempBuffValue, (BuffOverlapType)buffOverlapType); //如果是回复持续回合数的技能(比如易伤、虚弱),以新的buff替换原有buff if (tempbuff.buffOverlapType == BuffOverlapType.BuffCountRecover) { for (int i = 0; i < buffList.Count; i++) { if (buffID == buffList[i].buffID) { buffList[i] = tempbuff; return; } } } if (tempbuff.buffOverlapType == BuffOverlapType.BuffValueAdd) { } buffList.Add(tempbuff); }
/// <summary> /// Gets the add buff identifier from magic core. /// </summary> /// <param name="buffid">Buffid.</param> public void playerGiveBuff(BuffConnection buff, int bufftime, int buffvalue) { switch (buff) { //case 1: //伤害免疫50% // addBuff(1, 11, 0, 1, 5, 1); // break; //case 2: //缓慢回复 // addBuff(2, 2, 1, bufftime, buffvalue, 2); // break; //case 3: //嘲讽 // addBuff(3, 6, 0, 1, 1, 1); // break; //case 4: //增加攻击力 // addBuff(4, 0, 1, bufftime, buffvalue, 2); // break; //case 5: //降低攻击力 //addBuff(5, 1, 1, bufftime, buffvalue, 2); //break; case BuffConnection.Poison: //毒 addBuff(6, BuffConnection.Poison, 1, bufftime, buffvalue, 2); break; case BuffConnection.EasilyInjured: //易伤 addBuff(7, BuffConnection.EasilyInjured, 1, bufftime, 5, 1); break; case BuffConnection.Weak: //虚弱 addBuff(8, BuffConnection.Weak, 1, bufftime, 1, 1); break; default: break; } }
public buff(int _buffID, BuffConnection _buffType, BuffLastType _buffLastType, int _buffTime, int _buffValue, BuffOverlapType _buffOverlapType) { this.buffID = _buffID; this.buffType = _buffType; this.buffLastType = _buffLastType; this.buffTime = _buffTime; this.buffValue = _buffValue; this.buffOverlapType = _buffOverlapType; }
/// <summary> /// 删除对应的buff /// </summary> /// <param name="bt"></param> public void clearBuff(BuffConnection bt) { for (int i = 0; i < buffList.Count; i++) { if (buffList[i].buffType == bt) { buffList.RemoveAt(i); --i; } } }
/// <summary> /// Checks the weak buff. /// </summary> /// <returns><c>true</c>, if weak buff was checked, <c>false</c> otherwise.</returns> public int checkBuff(BuffConnection bt) { int r = -1; for (int i = 0; i < buffList.Count; i++) { if (buffList[i].buffType == bt) { i = buffList[i].buffTime; } } return(r); }