2025-02-20 00:40:21 +00:00
|
|
|
using System;
|
2024-12-15 01:39:39 +00:00
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class BossMobActor : MobActor
|
|
|
|
|
{
|
|
|
|
|
public List<GameObject> list_indicator;
|
|
|
|
|
|
2025-02-19 00:06:35 +00:00
|
|
|
protected bool CanUseSkill1, CanUseSkill2;
|
|
|
|
|
protected float CoolTime_Skill1, CoolTime_Skill2;
|
|
|
|
|
|
2024-12-15 01:39:39 +00:00
|
|
|
int m_attackIndex = 0, m_maxAttackIndex;
|
|
|
|
|
float m_attackspeed;
|
|
|
|
|
|
|
|
|
|
protected override void Awake()
|
|
|
|
|
{
|
|
|
|
|
base.Awake();
|
|
|
|
|
Init();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Init()
|
|
|
|
|
{
|
|
|
|
|
list_indicator.ForEach(f => f.SetActive(false));
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-19 00:06:35 +00:00
|
|
|
protected override void Update()
|
2024-12-15 01:39:39 +00:00
|
|
|
{
|
2025-02-19 00:06:35 +00:00
|
|
|
base.Update();
|
|
|
|
|
if (IsDead()) return;
|
2024-12-15 01:39:39 +00:00
|
|
|
}
|
|
|
|
|
|
2025-02-19 00:06:35 +00:00
|
|
|
public override void Del_Target(bool forcedel = false)
|
2024-12-15 01:39:39 +00:00
|
|
|
{
|
2025-02-19 00:06:35 +00:00
|
|
|
base.Del_Target(forcedel);
|
|
|
|
|
if (!isTarget) Init();
|
2024-12-15 01:39:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Indicator(int a)
|
|
|
|
|
{
|
|
|
|
|
base.Indicator(a);
|
|
|
|
|
var index = 0;
|
|
|
|
|
if (isPlaying(eAnim.Attack2)) index = 1;
|
|
|
|
|
else if (isPlaying(eAnim.Attack3)) index = 2;
|
|
|
|
|
list_indicator[index].SetActive(a == 0);
|
|
|
|
|
|
|
|
|
|
if (a == 1)
|
|
|
|
|
{ // 데미지 투사체 생성
|
|
|
|
|
m_animation.speed = m_attackspeed;
|
|
|
|
|
|
2024-12-25 01:44:44 +00:00
|
|
|
var startpos = Get_CenterPositionFoward();
|
2025-02-09 06:50:27 +00:00
|
|
|
if (ProjectileInfo.ProjectileInfoOn)
|
2024-12-15 01:39:39 +00:00
|
|
|
{
|
|
|
|
|
if (index == 0)
|
|
|
|
|
ProjectileInfo.Ins.Shoot_Projectile(m_MonsterTableData.s_Porjectile1, this, m_Target, 1f, startpos, m_MonsterTableData.f_ProjectileLifeTime1);
|
|
|
|
|
else if (index == 1)
|
|
|
|
|
ProjectileInfo.Ins.Shoot_Projectile(m_MonsterTableData.s_Porjectile2, this, m_Target, 1f, startpos, m_MonsterTableData.f_ProjectileLifeTime2);
|
|
|
|
|
else
|
|
|
|
|
ProjectileInfo.Ins.Shoot_Projectile(m_MonsterTableData.s_Porjectile3, this, m_Target, 1f, startpos, m_MonsterTableData.f_ProjectileLifeTime3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Set_Coroutine_withCancel(() =>
|
|
|
|
|
{
|
|
|
|
|
Change_MobStatus(eMobStatus.PatrolWait);
|
|
|
|
|
++m_attackIndex;
|
|
|
|
|
if (m_attackIndex >= m_maxAttackIndex) m_attackIndex = 0;
|
|
|
|
|
}, 0.95f - m_animation.GetCurrentAnimatorStateInfo(0).normalizedTime);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-19 00:06:35 +00:00
|
|
|
public override void Get_Damage(DamageInfo _dinfo)
|
|
|
|
|
{
|
|
|
|
|
base.Get_Damage(_dinfo);
|
|
|
|
|
if (!CanUseSkill1) CanUseSkill1 = (Get_HP() / Get_MaxHP()) <= 0.9;
|
|
|
|
|
if (!CanUseSkill2) CanUseSkill2 = (Get_HP() / Get_MaxHP()) <= 0.7;
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-15 01:39:39 +00:00
|
|
|
protected override void Set_Die()
|
|
|
|
|
{
|
|
|
|
|
base.Set_Die();
|
|
|
|
|
Init();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void On_NavMeshAgent()
|
|
|
|
|
{
|
|
|
|
|
base.On_NavMeshAgent();
|
|
|
|
|
Init();
|
|
|
|
|
}
|
2025-02-20 00:40:21 +00:00
|
|
|
|
|
|
|
|
protected virtual float Get_Skill1Dmg() { return 1f; }
|
|
|
|
|
protected virtual Vector3 Get_Skill1Pos() { return Get_CenterPositionFoward(); }
|
2025-02-20 01:00:59 +00:00
|
|
|
protected virtual void Set_Skill1Projectile(ProjectileBase pb) { }
|
2025-02-20 00:40:21 +00:00
|
|
|
protected virtual void BossProjectile2(string s)
|
|
|
|
|
{
|
|
|
|
|
if (ProjectileInfo.ProjectileInfoOn)
|
|
|
|
|
ProjectileInfo.Ins.Shoot_Projectile(m_MonsterTableData.s_Porjectile2, this, m_Target, Get_Skill1Dmg(), Get_Skill1Pos(),
|
2025-02-20 01:00:59 +00:00
|
|
|
m_MonsterTableData.f_ProjectileLifeTime2, pb => { Set_Skill1Projectile(pb); });
|
2025-02-20 00:40:21 +00:00
|
|
|
}
|
|
|
|
|
protected virtual float Get_Skill2Dmg() { return 1f; }
|
|
|
|
|
protected virtual Vector3 Get_Skill2Pos() { return Get_CenterPositionFoward(); }
|
2025-02-20 01:00:59 +00:00
|
|
|
protected virtual void Set_Skill2Projectile(ProjectileBase pb) { }
|
2025-02-20 00:40:21 +00:00
|
|
|
protected virtual void BossProjectile3(string s)
|
|
|
|
|
{
|
|
|
|
|
if (ProjectileInfo.ProjectileInfoOn)
|
|
|
|
|
ProjectileInfo.Ins.Shoot_Projectile(m_MonsterTableData.s_Porjectile3, this, m_Target, Get_Skill2Dmg(), Get_Skill2Pos(),
|
2025-02-20 01:00:59 +00:00
|
|
|
m_MonsterTableData.f_ProjectileLifeTime3, pb => { Set_Skill2Projectile(pb); });
|
2025-02-20 00:40:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void Run_byUseSkill(float range, float speed, Action<bool> moveend)
|
|
|
|
|
{
|
|
|
|
|
StartCoroutine(Co_Run_byUseSkill(range, speed, moveend));
|
|
|
|
|
}
|
|
|
|
|
IEnumerator Co_Run_byUseSkill(float range, float speed, Action<bool> moveend)
|
|
|
|
|
{
|
|
|
|
|
if (!DSUtil.CheckNull(m_Target))
|
|
|
|
|
{
|
|
|
|
|
Change_MobStatus(eMobStatus.Skill);
|
|
|
|
|
transform.LookAt(m_Target.transform);
|
|
|
|
|
AnimationPlay(MyValue.Get_AnimName(eAnim.Run));
|
|
|
|
|
m_NavMeshAgent.stoppingDistance = 0.1f;
|
|
|
|
|
|
|
|
|
|
var direction = (Get_position() - m_Target.Get_position()).normalized;
|
|
|
|
|
var targetPos = m_Target.Get_position() + direction * range;
|
|
|
|
|
Set_Path(Get_TeleportPostion(m_Target, range));
|
|
|
|
|
|
|
|
|
|
while (!Complete_Destination())
|
|
|
|
|
{
|
|
|
|
|
m_NavMeshAgent.speed = speed;
|
|
|
|
|
yield return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_NavMeshAgent.stoppingDistance = m_NavStopDistance;
|
|
|
|
|
m_NavMeshAgent.speed = Get_MoveSpeed();
|
|
|
|
|
|
|
|
|
|
moveend(true);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
moveend(false);
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-15 01:39:39 +00:00
|
|
|
}
|