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

130 lines
4.7 KiB
C#

using CodeStage.AntiCheat.ObscuredTypes;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Skill_PhantomFrenzy : ProjectileBase
{
[Header("공격 애니메이션")]
public string attackAnimationName = "ass_skill3_attack";
[Header("공격 횟수")]
public int AttackCount = 7;
[Header("공격 거리")]
public float AttackDistance = 10f;
[Header("이동속도")]
public float m_speed = 3.5f;
public GameObject go_attack;
public Skill_PhantomFrenzy_Blade[] arr_blades;
public Projectile_StopAndColliderControl[] blades;
public override void Set(ProjectileData _data)
{
_data.eStartPos = eProjectileStartPos.Target;
base.Set(_data);
transform.eulerAngles = Vector3.zero;
for (int i = 0; i < blades.Length; i++)
blades[i].Set(_data);
for (int i = 0; i < arr_blades.Length; i++)
arr_blades[i].Set();
StartCoroutine(Co_Off(2f));
//StartCoroutine(Co_Update());
}
//// 아래는 순간이동 후 공격인데, 이펙트와 애님이 마땅한 게 없음(트레일)
//IEnumerator Co_Update()
//{
// go_attack.SetActive(false);
// var shooter = m_ProjecTileData.shooter;
// OptionInfo.Ins.Set_PCMove(shooter, false);
// shooter.Set_CurAnim(eAnim.Skill);
// ObscuredInt attackTimes = AttackCount; // 공격 횟수 설정
// attackTimes.RandomizeCryptoKey();
// Actor target = m_ProjecTileData.target;
// shooter.Set_AfterImage(true);
// float t = 0f;
// bool[] playanim = new bool[AttackCount];
// bool[] attackeffect = new bool[AttackCount];
// while (attackTimes > 0)
// {
// t += Time.deltaTime * m_speed;
// shooter.Set_Warp(Vector3.Lerp(shooter.Get_position(), target.Get_position(), t));
// shooter.transform.LookAt(target.Get_position());
// var animindex = AttackCount - attackTimes;
// if (!playanim[animindex])
// {
// playanim[animindex] = true;
// shooter.AnimationPlay(attackAnimationName);
// }
// if (!attackeffect[animindex] && t >= 0.5f)
// {
// attackeffect[animindex] = true;
// InGameInfo.Ins.Show_Effect("Effect_Skill_PhantomFrenzy", shooter.Get_position());
// transform.position = target.Get_position(); // 공격 컬라이더를 타겟 위치로
// go_attack.SetActive(true);
// }
// if (t >= 0.9f)
// {
// t = 0f;
// // 남은 공격 횟수 감소
// --attackTimes;
// attackTimes.RandomizeCryptoKey();
// var nexttarget = ActorInfo.Ins.Get_Far_EnemyActor_orNull(shooter.IsEnemy(), shooter.Get_position(), AttackDistance);
// if (!DSUtil.CheckNull(nexttarget))
// target = nexttarget;
// if (DSUtil.CheckNull(target)) break;
// go_attack.SetActive(false);
// }
// yield return null;
// }
// // 이동 활성화 및 대기 상태로 전환
// OptionInfo.Ins.Set_PCMove(shooter, true);
// shooter.Play_Idle();
// shooter.Set_Target(true);
// shooter.Set_AfterImage(false);
// Off(true);
//}
//// 아래는 단순 이동이라 빠른 느낌 내기가 힘듬
//IEnumerator Co_Update()
//{
// // 이동 비활성화
// OptionInfo.Ins.PCMove = false;
// var shooter = m_ProjectTileData.shooter;
// ObscuredInt attackTimes = AttackCount; // 공격 횟수 설정
// attackTimes.RandomizeCryptoKey();
// Actor target = m_ProjectTileData.target;
// while (attackTimes > 0)
// {
// bool moveCompleted = false;
// // 목표 지점으로 이동 (이동 완료 시 moveCompleted = true)
// shooter.MoveToTarget(target, 0.5f, 100f, () => moveCompleted = true);
// // 공격 애니메이션 실행
// shooter.AnimationPlay(attackAnimationName);
// // 이동 완료 대기
// while (!moveCompleted || shooter.isPlaying()) yield return null;
// // 남은 공격 횟수 감소
// --attackTimes;
// attackTimes.RandomizeCryptoKey();
// target = ActorInfo.Ins.Get_Far_EnemyActor_orNull(shooter.IsEnemy(), shooter.Get_position(), AttackDistance);
// if (DSUtil.CheckNull(target)) break;
// }
// // 이동 활성화 및 대기 상태로 전환
// OptionInfo.Ins.PCMove = true;
// shooter.Play_Idle();
//}
}