39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
using System.Collections;
|
|
using UnityEngine;
|
|
|
|
public class Skill_ExplosionArea : ProjectileBase
|
|
{
|
|
[Header("스킬 판정 범위")]
|
|
public float area = 4f;
|
|
|
|
public override void Set(ProjectileData _data)
|
|
{
|
|
_data.eStartPos = eProjectileStartPos.ShooterCenter;
|
|
base.Set(_data);
|
|
transform.eulerAngles = new Vector3(90f, 0f);
|
|
Set_ReduceCoolTime_byStep(1);
|
|
|
|
StartCoroutine(Co_ExplosionArea());
|
|
}
|
|
|
|
IEnumerator Co_ExplosionArea()
|
|
{
|
|
var explosionarea = area + (IsStep(2) ? Get_AwakenData(2, 1) : 0f);
|
|
yield return null;
|
|
var enemies = Get_Enemies();
|
|
var knockCount = 0;
|
|
for (int i = 0; i < enemies.Count; i++)
|
|
{
|
|
if (Vector3.Distance(transform.position, enemies[i].Get_position()) <= area)
|
|
{
|
|
++knockCount;
|
|
enemies[i].Get_Damage(Get_DamageInfo());
|
|
if (IsStep(3)) enemies[i].Stun_AfterKnockBack(Get_AwakenData(3, 1));
|
|
}
|
|
}
|
|
if (knockCount >= 15) ServerInfo.Ins.m_ServerData.Add_TitleCondition(63); // 칭호 : 접근금지명령
|
|
|
|
yield return new WaitForSeconds(1f);
|
|
Off();
|
|
}
|
|
} |