Example #1
0
        public void Use(List <HexCell> cells)
        {
            HexCell cell = cells[0];

            if (cell.Type == HexTileType.Wall)
            {
//                _moveCells = GetMoveTargets(cell);
//                Active.Prepare(this, _moveCells);
                _theWall = cell;
                Active.Prepare(this, GetMoveTargets(cell));
                AnimationPlayer.Add(new MoveTo(ParentCharacter.CharacterObject.transform, cell.transform.position, 0.13f));
            }
            else
            {
//                int removeAfterIndex = _moveCells.FindIndex(c => c == cell);
//                List<HexCell> realMoveCells = _moveCells.GetRange(0, removeAfterIndex);
                ParentCharacter.MoveTo(cell);
                List <HexCell> realMoveCells = _theWall.GetLine(_theWall.GetDirection(cell), _theWall.GetDistance(cell));

                List <Character> targets = realMoveCells.SelectMany(c => ParentCharacter.DefaultGetBasicAttackCells(c))
                                           .ToList().WhereOnlyEnemiesOf(Owner).GetCharacters().Distinct().ToList();
                targets.ForEach(t => ParentCharacter.Attack(this, t, new Damage(ParentCharacter.AttackPoints.Value, DamageType.Physical)));
                Finish();
            }
        }
Example #2
0
        public void Use(List <HexCell> cells)
        {
            HexCell targetCell = cells[0];

            if (targetCell.CharacterOnCell != null)
            {
                _characterToTake = targetCell.CharacterOnCell;
                Active.Prepare(this, GetTargetCells());
            }
            else if (_targetCell == null)
            {
                _targetCell = targetCell;
                Active.Prepare(this, _targetCell.GetNeighbors(Radius).FindAll(c => c.IsFreeToStand));
            }
            else
            {
                ParentCharacter.MoveTo(_targetCell);
                _characterToTake.MoveTo(targetCell);

                ParentCharacter.Attack(this, _characterToTake, new Damage(Damage, DamageType.Physical));
                _targetCell.GetNeighbors(Radius).WhereOnlyEnemiesOf(Owner).GetCharacters()
                .ForEach(c => ParentCharacter.Attack(this, c, new Damage(Damage, DamageType.Physical)));

                _targetCell = null;
                Finish();
            }
        }
Example #3
0
        private void Use(Character targetCharacter)
        {
            HexDirection direction = ParentCharacter.ParentCell.GetDirection(targetCharacter.ParentCell);
            HexCell      moveCell  = targetCharacter.ParentCell.GetCell(direction, TargetCellOffset);

            targetCharacter.PhysicalDefense.Value = targetCharacter.PhysicalDefense.RealValue - 15;
            ParentCharacter.MoveTo(moveCell);
            var damage = new Damage(Damage, DamageType.Physical);

            ParentCharacter.Attack(this, targetCharacter, damage);
            Finish();
        }
Example #4
0
        private void Use(Character targetCharacter)
        {
            HexDirection direction = ParentCharacter.ParentCell.GetDirection(targetCharacter.ParentCell);
            HexCell      moveCell  = targetCharacter.ParentCell.GetCell(direction, 2);

            ParentCharacter.MoveTo(moveCell);
            var damage = new Damage(ParentCharacter.AttackPoints.Value, DamageType.Physical);

            ParentCharacter.Attack(this, targetCharacter, damage);
            Active.PlayAudio("giri");
            Finish();
        }
Example #5
0
        private void Use(HexCell cell)
        {
            List <HexCell> targetCells = ParentCharacter.ParentCell.GetArea(cell, Width);

            ParentCharacter.MoveTo(cell);
            targetCells.WhereOnlyEnemiesOf(Owner).GetCharacters().ForEach(c =>
            {
                ParentCharacter.Attack(this, c, new Damage(Damage, DamageType.Magical));
                c.Effects.Add(new Silent(SilentDuration, c, Name));
            });
            Finish();
        }
Example #6
0
 public void Use(List <HexCell> cells)
 {
     if (cells[0].CharacterOnCell != null)
     {
         Active.Prepare(this, cells[0].GetNeighbors(MaxDistanceFromTarget).FindAll(c => c.IsFreeToStand));
     }
     else
     {
         ParentCharacter.MoveTo(cells[0]);
         ParentCharacter.HasFreeAttackUntilEndOfTheTurn = true;
         Finish();
     }
 }
        public void Use(List <HexCell> cells)
        {
            HexCell cell = cells[0];

            if (cell.Type == HexTileType.Wall)
            {
                Active.Prepare(this, GetMoveTargets(cell));
                AnimationPlayer.Add(new MoveTo(ParentCharacter.CharacterObject.transform, cell.transform.position, 0.13f));
            }
            else
            {
                ParentCharacter.MoveTo(cell);
                Finish();
            }
        }
Example #8
0
File: Dash.cs Project: tojatos/NKM
        private void DashTo(HexCell cell)
        {
            ParentCharacter.MoveTo(cell);
            _hasDashed = true;
            List <HexCell> cellRange = ParentCharacter.ParentCell.GetNeighbors(AbilityHitRange, SearchFlags.StopAtWalls | SearchFlags.StraightLine).WhereOnlyEnemiesOf(Owner);

            if (cellRange.Count > 0)
            {
                Active.Prepare(this, cellRange);
            }
            else
            {
                Finish();
            }
        }
Example #9
0
        public override void Use(HexCell cell)
        {
            ParentCharacter.MoveTo(cell);
            _hasDashed = true;
            List <HexCell> cellRange = ParentCharacter.ParentCell.GetNeighbors(AbilityHitRange, true, false, true);

            cellRange.RemoveNonEnemies();
            var canUseAbility = Active.Prepare(this, cellRange);

            if (canUseAbility)
            {
                return;
            }

            MessageLogger.DebugLog("Nie ma nikogo w zasięgu umiejętności!");
            OnUseFinish();
        }