public void Chilled(float speedMultiplier) { FrostDebuff fd = new FrostDebuff(5, 0, speedMultiplier, moveForce, rotationalForce); if (buffList.Count == 0) { buffList.Add(fd); return; } foreach (IBuffable b in buffList) { if (b.Type == "Chilled") { FrostDebuff fdOld = b as FrostDebuff; if (fdOld.SpeedMultiplier < fd.SpeedMultiplier) { buffList.Remove(b); buffList.Add(fd); } else { fdOld.FinishTime = fd.FinishTime; } } } }
public void Swift(float speedMultiplier) { SwiftBuff sb = new SwiftBuff(5, 0, speedMultiplier, moveForce, rotationalForce); if (buffList.Count == 0) { buffList.Add(sb); return; } foreach (IBuffable b in buffList) { if (b.Type == "Swift") { FrostDebuff sbOld = b as FrostDebuff; if (sbOld.SpeedMultiplier < sb.SpeedMultiplier) { buffList.Remove(b); buffList.Add(sb); } else { sbOld.FinishTime = sb.FinishTime; } } } }