Project_WL/Assets/Script/Character/Projectile/Skill/Skill_MultiShot.cs

36 lines
1.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections;
using UnityEngine;
public class Skill_MultiShot : ProjectileBase
{
[Header("지속 시간")]
public float lifetime = 10f;
[Header("투사체 프리팹")]
public string arrowprefab = "Projectile_Skill_MultiShot";
[Header("추가 화살 갯수")]
public int addarrow = 2;
[Header("데미지 감소량")]
public double reducedmg = 0.2d;
public override void Set(ProjectileData _data)
{
base.Set(_data);
if (WL.Combat.Weapon.WLRapidShot.TakeMulti(this, _data)) return; // WL #975 훅(1줄) — 활 기본 스킬: 주력과 같은 모으기 → 앞쪽 부채꼴 화살 10발 × 3회(0.5 초 간격 · WLRapidShot.json multi) · 원본 버프(일반 공격 화살 추가) 건너뜀
m_LifeTime = lifetime;
_data.shooter.Buff_or_Debuff(eCC.MultiShot, m_LifeTime, reducedmg, addarrow, 0f, arrowprefab);
StartCoroutine(Co_Update());
}
IEnumerator Co_Update()
{
while (m_LifeTime > 0f)
{
yield return null;
m_LifeTime -= Time.deltaTime;
if (DSUtil.CheckNull(m_ProjecTileData.shooter)) break;
transform.position = m_ProjecTileData.shooter.Get_Center_position();
}
Off(true);
}
}