示例#1
0
        public override void Heal()
        {
            var cells = AllyCells
                        .Where(x => x.Unit.CurrentHealth < x.Unit.Data.Health)
                        .ToList();
            var random = new Random().Next(0, cells.Count);

            BattleUnitsView.TargetCell = cells[random];
            ProjectileSpawner.CreateHealProjectile(base.Heal);
        }
        public void SetTargets()
        {
            if (ActiveUnit.Data.AttackType == AttackType.Heal)
            {
                AllyCells
                .Where(x => x.Unit.CurrentHealth < x.Unit.Data.Health)
                .ToList()
                .ForEach(x => x.SetTargetIcon(true));
            }

            EnemyCells.ForEach(x => x.SetTargetIcon(true));
        }
示例#3
0
        private void Turn()
        {
            if (ActiveUnit.Data.AttackType == AttackType.Heal)
            {
                var count = AllyCells.Count(x => x.Unit.CurrentHealth < x.Unit.Data.Health);
                if (count != 0)
                {
                    ActiveCell.Behaviour.Heal();
                    return;
                }
            }

            ActiveCell.Behaviour.Attack();
        }