173 lines
5.5 KiB
C#
173 lines
5.5 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Boss_Anubis : BossMobActor
|
|
{
|
|
[Header("스킬1 쿨타임")]
|
|
public float Skill1CoolTime = 18f;
|
|
[Header("스킬1 칼날 폭풍 데미지")]
|
|
public float Skill1Dmg = 2.2f;
|
|
[Header("스킬1 차징 시간")]
|
|
public float Skill1ChargingTime = 3f;
|
|
[Header("---------------------------------------")]
|
|
public bool Perforation_Line;
|
|
[Header("스킬2 쿨타임")]
|
|
public float Skill2CoolTime = 15f;
|
|
[Header("스킬2 차징시간")]
|
|
public float Skill2ChargingTime = 3f;
|
|
[Header("스킬2 공격 딜레이 시간")]
|
|
public float Skill2AttackDelay = 1f;
|
|
[Header("스킬2 데미지")]
|
|
public float Skill2Dmg = 2.8f;
|
|
[Header("스킬2 투사체 갯수")]
|
|
public int Skill2Count = 6;
|
|
[Header("스킬2 투사체 속도")]
|
|
public float Skill2Speed = 15f;
|
|
|
|
public override void Set(MonsterTableData mobtable, Vector3 pos, Action<int> actDie, int order, float noDmgTime = 0f)
|
|
{
|
|
base.Set(mobtable, pos, actDie, order, noDmgTime);
|
|
|
|
CoolTime_Skill1 = 1f;
|
|
CoolTime_Skill2 = 2f;
|
|
|
|
CoolTime_Skill1 = 10000f;
|
|
//CoolTime_Skill2 = 20000f;
|
|
}
|
|
|
|
protected override void Init(bool initSkill1CoolTime, bool initSkill2CoolTime)
|
|
{
|
|
base.Init(initSkill1CoolTime, initSkill2CoolTime);
|
|
if (initSkill1CoolTime) CoolTime_Skill1 = Skill1CoolTime;
|
|
if (initSkill2CoolTime) CoolTime_Skill2 = Skill2CoolTime;
|
|
}
|
|
|
|
protected override void Update()
|
|
{
|
|
base.Update();
|
|
if (IsDead() || IsStop) return;
|
|
|
|
if (UseSkillIndex == 1 && MobStatus != eMobStatus.Skill)
|
|
StartCoroutine(Co_Skill1());
|
|
else if (UseSkillIndex == 2 && MobStatus != eMobStatus.Skill)
|
|
StartCoroutine(Co_Skill2());
|
|
}
|
|
|
|
public override void Projectile(string s)
|
|
{
|
|
base.Projectile(s);
|
|
InGameInfo.Ins.Show_Effect("Effect_AnubisAttackSlash", Get_position(), transform.eulerAngles);
|
|
}
|
|
|
|
IEnumerator Co_Skill1()
|
|
{
|
|
Change_MobStatus(eMobStatus.Skill);
|
|
AnimationPlay("boss_skill1charging");
|
|
InGameInfo.Ins.Show_Effect("Effect_AnubisCharging", this, eEffectLocation.Bottom, Skill1ChargingTime);
|
|
|
|
// 차징 및 회전
|
|
float rotTime = 0f;
|
|
float rotSpeed = 1f;
|
|
bool endEffect = false;
|
|
while (rotTime < Skill1ChargingTime)
|
|
{
|
|
yield return null;
|
|
transform.Rotate(Vector3.up, rotSpeed);
|
|
rotTime += Time.deltaTime;
|
|
rotSpeed += Time.deltaTime * 10f;
|
|
if (!endEffect && rotTime >= Skill1ChargingTime - 0.2f)
|
|
{
|
|
endEffect = true;
|
|
InGameInfo.Ins.Show_Effect("Effect_Anubis_Skill1RotEnd", this);
|
|
}
|
|
}
|
|
|
|
// 모습 끄기
|
|
Model_OnOff(false);
|
|
AnimationPlay("boss_skill1attack");
|
|
m_NavMeshAgent.stoppingDistance = 0.2f;
|
|
|
|
float t = m_MonsterTableData.f_ProjectileLifeTime2;
|
|
while (t > 0f)
|
|
{
|
|
yield return null;
|
|
t -= Time.deltaTime;
|
|
if (isTarget)
|
|
{
|
|
Set_Path(m_Target.Get_position());
|
|
if (m_Target.IsDead()) break;
|
|
}
|
|
if (!isTarget || IsDead())
|
|
break;
|
|
}
|
|
InGameInfo.Ins.Show_Effect("Effect_Anubis_Skill1End", Get_position());
|
|
yield return new WaitForSeconds(0.2f);
|
|
|
|
Model_OnOff(true);
|
|
|
|
yield return new WaitForSeconds(0.2f);
|
|
m_NavMeshAgent.stoppingDistance = m_NavStopDistance;
|
|
Check_Battle();
|
|
Init(true, false);
|
|
}
|
|
IEnumerator Co_Skill2()
|
|
{
|
|
Change_MobStatus(eMobStatus.Skill);
|
|
|
|
// 차징 중
|
|
AnimationPlay("boss_skill2charging");
|
|
InGameInfo.Ins.Show_Effect("Effect_AnubisCharging2", this, eEffectLocation.Bottom, Skill2ChargingTime);
|
|
|
|
float t = 0f;
|
|
while (t < Skill2ChargingTime)
|
|
{
|
|
yield return null;
|
|
t += Time.deltaTime;
|
|
if (isTarget) transform.LookAt(m_Target.transform);
|
|
} // 차징 끝
|
|
|
|
yield return Co_ShootSkill2(Get_PositionBack(5f), 2); // 뒤로 이동
|
|
yield return Co_ShootSkill2(Get_PositionBack(5f), 2); // 뒤로 이동
|
|
|
|
//for (int i = 0; i < Skill2Count; i++)
|
|
//{
|
|
// if (isTarget) transform.LookAt(m_Target.transform);
|
|
// else break;
|
|
// AnimationPlay("boss_skill2attack");
|
|
// yield return new WaitForSeconds(Skill2AttackDelay);
|
|
//}
|
|
|
|
Check_Battle();
|
|
Init(false, true);
|
|
}
|
|
IEnumerator Co_ShootSkill2(Vector3 pos, int count)
|
|
{
|
|
int shootcount = -1;
|
|
JumpToPosition(pos, 0.25f, 0.35f, () => { shootcount = count; });
|
|
while (shootcount != 0)
|
|
{
|
|
yield return null;
|
|
if (shootcount > 0)
|
|
{
|
|
for (int i = 0; i < shootcount; i++)
|
|
{
|
|
if (isTarget) transform.LookAt(m_Target.transform);
|
|
AnimationPlay("boss_skill2attack");
|
|
yield return new WaitForSeconds(Skill2AttackDelay);
|
|
if (i == shootcount - 1)
|
|
shootcount = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
protected override float Get_Skill2Dmg() { return Skill2Dmg; }
|
|
protected override void Set_Skill2Projectile(ProjectileBase pb)
|
|
{
|
|
var pd = pb.Get_ProjectTileData();
|
|
pd.Speed = Skill2Speed;
|
|
}
|
|
} |