public void Begin() { m_timer = 2.5f; m_skill.GetValidTargets(m_targets); m_skill.Owner.Move(m_skill.Center, 0); m_manager.Service.PlayQuakeAnimation(m_skill.Center.x, m_skill.Center.y, m_skill.Radius, .2f); for (int i = 0; i < m_targets.Count; i++) { GameplayEntity target = m_targets[i]; float delay = .2f + Vector2Int.Distance(m_skill.Center, target.Visual.GridPosition) * .1f; target.Status.Damage(1); target.PlayHealthBarAnimation(delay); target.Visual.PlayTakeDamageAnimation(delay); if (target.Status.Health <= 0) { m_manager.Pathfinder.NavGraph.SetGridType(target.Visual.GridPosition, EntityType.None); target.Visual.PlayDeathAnimation(delay + .15f); } } }
private void PushBack(GameplayEntity entity, Vector2Int location, int damage, float delay) { entity.Status.Damage(damage); entity.Visual.Leap(location, delay); entity.Visual.PlayTakeDamageAnimation(delay); entity.PlayHealthBarAnimation(delay); m_manager.Pathfinder.NavGraph.SetGridType(entity.Visual.GridPosition, EntityType.None); if (entity.Status.Health <= 0) { entity.Visual.PlayDeathAnimation(delay + .3f); } else { m_manager.Pathfinder.NavGraph.SetGridType(location, entity.Visual.Type); } }
private IEnumerator AttackRoutine() { yield return new WaitForSeconds(.2f); m_attacker.Move(m_attacker.Visual.GridPosition, .3f); m_attacker.Move(m_target.Visual.GridPosition, 0); yield return new WaitForSeconds(.3f); m_target.PlayHealthBarAnimation(0); m_target.Visual.PlayTakeDamageAnimation(); m_target.Visual.InstantiateSlash(m_target.Visual.GridPosition.x, m_target.Visual.GridPosition.y); yield return new WaitForSeconds(.1f); if (m_target.Status.Health <= 0) { m_manager.Pathfinder.NavGraph.SetGridType(m_target.Visual.GridPosition, EntityType.None); m_target.Visual.PlayDeathAnimation(); } yield return new WaitForSeconds(1.5f); ShouldEnd = true; }