private void AttackTarget() { Unit targetUnit = this.UnitsMap.Get(this.Target); if (targetUnit != null) { SimulateAttack(false, this.Target, this.DeltaHealth, this.Knockback, true); KnockbackHandler handler = new KnockbackHandler(this.UnitsMap); handler.Execute(this.BoardController, this.Unit.GetPosition(), targetUnit.GetPosition(), this.Knockback); targetUnit?.Health.ReduceHealth(this.DeltaHealth); } this.IsActive(false); Logcat.I(this, "Telekinesis blast executed"); }
public override void Execute() { Logcat.I(this, $"Nanobots called"); Unit targetUnit = this.UnitsMap.Get(this.Target); SimulateAttack(false, this.Target, this.DeltaHealth, this.Knockback, false); KnockbackHandler handler = new KnockbackHandler(this.UnitsMap); handler.Execute(this.BoardController, this.Unit.GetPosition(), targetUnit.GetPosition(), this.Knockback); targetUnit.Health.IncreaseHealth(this.DeltaHealth); Logcat.I(this, $"Nanobots unit healed"); this.IsActive(false); }
private void OnCollisionEnter(Collision collision) { var go = collision.gameObject; if (_onSkill && go.CompareTag("Enemy")) { EnemyHealth eh = go.GetComponent <EnemyHealth>(); KnockbackHandler kbh = go.GetComponent <KnockbackHandler>(); kbh.HandleKnockBack(transform.position, _knockbackForce); eh.DealDamage(damage); if (_stopPlayerOnEnemyCollision) { playerRb.velocity = Vector3.zero; } } }
private void AttackPosition(Point target) { Unit targetUnit = this.Unit.UnitsMap.Get(target); if (targetUnit == null) { return; } if ((targetUnit is EnemyUnit) && ((EnemyUnit)targetUnit).GetSpawnedUnitType() == UnitType.NEOSATAN_LEG) { return; } KnockbackHandler handler = new KnockbackHandler(this.UnitsMap); handler.Execute(this.BoardController, this.Unit.GetPosition(), targetUnit.GetPosition(), this.Knockback); targetUnit?.Health.ReduceHealth(this.DeltaHealth); //// Logcat.I($"attacking position {target}, is a unit in the position? {targetUnit != null}"); }
public override void Execute() { if (!this.ValidateAction(this.Target)) { return; } Unit targetUnit = this.UnitsMap.Get(this.Target); if (targetUnit != null) { SimulateAttack(false, this.Target, this.DeltaHealth, this.Knockback, true); KnockbackHandler handler = new KnockbackHandler(this.UnitsMap); handler.Execute(this.BoardController, this.Unit.GetPosition(), targetUnit.GetPosition(), this.Knockback); targetUnit?.Health.ReduceHealth(this.DeltaHealth); } this.IsActive(false); Logcat.I(this, "Crush Action executed"); }
private void Start() { handler = new KnockbackHandler(map); }
private void OnEnable() { unit = GetComponent <Unit>(); handler = new KnockbackHandler(unit.UnitsMap); Selector.CancelledAction += OnActionCancelled; }
private void PullUnit(KnockbackHandler handler, Unit enemyUnit) { handler.InverseKnockback(this.BoardController, this.Unit.GetPosition(), enemyUnit.GetPosition(), this.Knockback); }