private IEnumerator SpawnNeoSatan() { BossFightController.SetActive(true); if (DisableHUD) { MainHUD.SetActive(false); } // APPLY KNOCKBACK TO NEOSATAN SPAWN AREA foreach (Point item in LoadSpawnArea()) { handler.Execute(controller, NeoSatanSpawnPosition, item, 1); } handler.Execute(controller, new Point(this.NeoSatanSpawnPosition.x - 1, this.NeoSatanSpawnPosition.y, this.NeoSatanSpawnPosition.z), NeoSatanSpawnPosition, 1); do { yield return(null); } while (map.Contains(NeoSatanSpawnPosition)); ActivateSoulSphere(); // SPAWN NEO-SATAN NeoSatanReference = AIPlacementHelper.AddUnit(null, NeoSatanSpawnPosition, NeoSatan); BossFightController.GetComponent <BossFightController>().SetNeoSatanRef(NeoSatanReference); OnNeoSatanSpawn?.Invoke(); }
private IEnumerator Attack(CardinalDirections direction, Vector3 point) { yield return(new WaitForSeconds(delay)); Logcat.I(this, $"Shooting with direction {direction} vector {point}"); this.transform.localPosition += point; GetPointsInLine(direction)?.ForEach(p => UnitsMap.Get(p)?.Health?.ReduceHealth(this.DeltaHealth)); this.transform.localPosition -= point; KnockbackHandler handler = new KnockbackHandler(this.UnitsMap); handler.Execute(this.BoardController, Target, this.Unit.GetPosition(), this.Knockback); }
protected virtual void AttackPositions(Point point) { if (!UnitsMap.Contains(point)) { return; } Unit targetUnit = this.UnitsMap.Get(point); KnockbackHandler handler = new KnockbackHandler(this.UnitsMap); handler.Execute(this.BoardController, this.Unit.GetPosition(), targetUnit.GetPosition(), this.Knockback); targetUnit?.Health.ReduceHealth(this.DeltaHealth); }
public override void Execute() { if (this.UnitsMap.Contains(this.Target)) { Unit targetUnit = this.UnitsMap.Get(this.Target); 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, "Whelp attack action 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 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"); }
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 IEnumerator ApplyExplosion(Point[] targets, Point[] attackArea) { yield return(new WaitForSeconds(HighlightWaitTime)); foreach (Point item in targets) { if (UnitsMap.Contains(item)) { Unit targetUnit = UnitsMap.Get(item); targetUnit.Health.ReduceHealth(Damage); handler.Execute(controller, this.GetPosition(), targetUnit.GetPosition(), 1); } } controller.SwitchTilesFromActiveBoards(new HashSet <Point>(attackArea), Edu.Vfs.RoboRapture.TileAuxillary.TileStates.NORMAL); EnvironmentManager.EnvironmentCollection.Remove(WorldPosition); UnitsMap.Remove(this.GetPosition()); gameObject.SetActive(false); }