2025-01-20 06:47:44 +00:00
|
|
|
using System.Collections;
|
|
|
|
|
using UnityEngine;
|
2024-12-15 01:39:39 +00:00
|
|
|
|
|
|
|
|
public class Skill_MultiShot : ProjectileBase
|
|
|
|
|
{
|
2025-01-20 06:47:44 +00:00
|
|
|
[Header("지속 시간")]
|
|
|
|
|
public float lifetime = 10f;
|
2025-05-08 00:54:46 +00:00
|
|
|
[Header("투사체 프리팹")]
|
|
|
|
|
public string arrowprefab = "Projectile_Skill_MultiShot";
|
2025-01-20 06:47:44 +00:00
|
|
|
[Header("추가 화살 갯수")]
|
|
|
|
|
public int addarrow = 2;
|
|
|
|
|
[Header("데미지 감소량")]
|
|
|
|
|
public double reducedmg = 0.2d;
|
2024-12-15 01:39:39 +00:00
|
|
|
|
|
|
|
|
public override void Set(ProjectileData _data)
|
|
|
|
|
{
|
|
|
|
|
base.Set(_data);
|
2025-01-20 06:47:44 +00:00
|
|
|
m_LifeTime = lifetime;
|
2025-05-08 00:54:46 +00:00
|
|
|
_data.shooter.Buff_or_Debuff(eCC.MultiShot, m_LifeTime, reducedmg, addarrow, 0f, arrowprefab);
|
2025-01-20 06:47:44 +00:00
|
|
|
StartCoroutine(Co_Update());
|
|
|
|
|
}
|
2024-12-15 01:39:39 +00:00
|
|
|
|
2025-01-20 06:47:44 +00:00
|
|
|
IEnumerator Co_Update()
|
|
|
|
|
{
|
|
|
|
|
while (m_LifeTime > 0f)
|
|
|
|
|
{
|
|
|
|
|
yield return null;
|
|
|
|
|
m_LifeTime -= Time.deltaTime;
|
2025-01-28 06:46:25 +00:00
|
|
|
if (DSUtil.CheckNull(m_ProjecTileData.shooter)) break;
|
2025-01-20 06:47:44 +00:00
|
|
|
transform.position = m_ProjecTileData.shooter.Get_Center_position();
|
|
|
|
|
}
|
2024-12-15 01:39:39 +00:00
|
|
|
|
2025-01-20 06:47:44 +00:00
|
|
|
Off(true);
|
2024-12-15 01:39:39 +00:00
|
|
|
}
|
|
|
|
|
}
|