/// <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, BuffLastType buffLastTypeNum, int buffTime, int tempBuffValue, int buffOverlapType) { buff tempbuff = new buff(buffID, buffTypeNum, 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); }
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; }