public static bool ConfuseScroll(Entity target) { var cell = new SelectCellDialog(0).Show(); if (cell != null) { var enemy = Program.Game.Entities.FirstOrDefault(e => e.HasComponent <FighterComponent>() && e.X == cell.X && e.Y == cell.Y); if (enemy != null) { MessageLog.Add($"{enemy.Name} is confused.", Color.LightBlue); enemy.GetComponent <FighterComponent>().ApplyStatus(new ConfusionEffect(ConfuseTurns)); return(true); } } MessageLog.Add($"Confuse scroll can not hit any monsters.", Color.Orange); return(false); }
public static bool FireballScroll(Entity target) { var cell = new SelectCellDialog(FireballRadius).Show(); if (cell != null) { MessageLog.Add("The fireball explodes!", Color.Red); var victims = Program.Game.Entities.Where(e => e.HasComponent <FighterComponent>() && e.DistanceTo(cell.X, cell.Y) <= FireballRadius); foreach (var victim in victims) { MessageLog.Add($"{victim.Name} is burned for {FireballDamage} HP!", Color.Red); victim.GetComponent <FighterComponent>().Damage(FireballDamage, null, ElementType.Fire); } return(true); } return(false); }