public override IEnumerator RunAnimation(CharacterBase sender, MainSystem sys) { yield return(EffectAnim.Landmine(sender.Position)); var enemies = sys.CollectNeighborEnemies(sender.Loc); var damageAnims = new List <DamageWait>(); damageAnims.Add(new DamageWait(sender, Math.Max(1, sender.Hp - 1), sys)); for (int i = 0; i < enemies.Length; i++) { damageAnims.Add(new DamageWait(enemies[i], 99, sys)); } while (true) { bool finished = true; foreach (var d in damageAnims) { finished = finished && d.AnimationFinished; } if (finished) { break; } yield return(null); } }