Beispiel #1
0
        public override void Cast(Cell source, Cell target, Action onCastEnd = null,
                                  bool endTurn = false)
        {
            Transform attackFx = EffectsManager.Attack(source);

            attackFx.DOJump(target.Position.ToWorldPosition(),
                            Random.Range(minJump, maxJump), 1,
                            Random.Range(minDuration, maxDuration))
            .OnComplete(delegate {
                Destroy(attackFx.gameObject);
                EffectsManager.Boom(target);
                if (target.Type == CellType.Agent && target.Agent != null)
                {
                    target.Agent.LoseHealth(power);
                }

                onCastEnd?.Invoke();
            });
        }