/// <summary> /// Remove a Debuff from the Monster /// </summary> /// <returns>Whether or not the Debuff existed before removal</returns> public bool RemoveDebuff(Debuff debuff) { bool retBool = Debuffs.ContainsKey(debuff); Debuffs.Remove(debuff); return(retBool); }
/// <summary> /// 回合结束 /// </summary> public void TurnEnd() { TurnEndEvent?.Invoke(); List <string> temp = new List <string>(); foreach (var item in Debuffs) { item.Value.BuffDecrease(1); if (item.Value.BuffLastTurn == 0) { item.Value.BuffEnd(this); temp.Add(item.Key); } } foreach (var item in temp) { Debuffs.Remove(item); } }
/// <summary> /// 回合结束 /// </summary> public void TurnEnd() { if (TurnEndEvent != null) { TurnEndEvent(); } List <string> temp = new List <string>(); foreach (var item in Debuffs) { item.Value.BuffLastTurn--; if (item.Value.BuffLastTurn == 0) { item.Value.BuffEnd(this); temp.Add(item.Key); } } foreach (var item in temp) { Debuffs.Remove(item); } }