165 lines
6.5 KiB
C#
165 lines
6.5 KiB
C#
using System;
|
|
using System.Collections;
|
|
using UnityEngine;
|
|
|
|
public class Boss_GolemChild : BossMobActor
|
|
{
|
|
[Header("스킬1 쿨타임")]
|
|
public float Skill1CoolTime = 8f;
|
|
[Header("스킬1 바위 데미지")]
|
|
public float Skill1Dmg = 3.8f;
|
|
[Header("스킬1 바위 폭파 광역 데미지")]
|
|
public float Skill1AreaDmg = 1.2f;
|
|
[Header("스킬1 인디케이터")]
|
|
public string Skill1Indicator = "Golem_Child_Skill1_Indicator";
|
|
public string Skill1AfterIndicator = "Golem_Child_Skill1After_Indicator";
|
|
public Transform tf_Skill1Pos;
|
|
[Header("---------------------------------------")]
|
|
public bool Perforation_Line;
|
|
[Header("스킬2 쿨타임")]
|
|
public float Skill2CoolTime = 8f;
|
|
[Header("스킬2 차징시간")]
|
|
public float Skill2ChargingTime = 1f;
|
|
[Header("스킬2 데미지")]
|
|
public float Skill2Dmg = 3f;
|
|
[Header("스킬2 인디케이터")]
|
|
public string Skill2Indicator = "Golem_Child_Skill2_Indicator";
|
|
|
|
ProjectileBase pb_skill1after, pb_Lock, pb_LockExp;
|
|
|
|
public override void Set(MonsterTableData mobtable, Vector3 pos, Action<int> actDie, int order, float noDmgTime = 0f)
|
|
{
|
|
base.Set(mobtable, pos, actDie, order, noDmgTime);
|
|
|
|
Load_Indicator(Skill1Indicator, 0);
|
|
Load_Indicator(Skill1AfterIndicator, 2);
|
|
Load_Indicator(Skill2Indicator, 1);
|
|
|
|
Load_Projectile("FieldBoss/Golem_Child_Skill1After", Skill1AreaDmg, Vector3.zero, 3f, pb_skill1after, pb => pb_skill1after = pb);
|
|
Load_Projectile("FieldBoss/Golem_Child_Lock", Skill1Dmg, tf_Skill1Pos.position, 10f, pb_Lock, pb => pb_Lock = pb);
|
|
Load_Projectile("FieldBoss/Golem_Child_LockExp", Skill1AreaDmg, Vector3.zero, 10f, pb_LockExp, pb => pb_LockExp = pb);
|
|
|
|
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());
|
|
}
|
|
|
|
// 바위가 생성되고 집어던지는 스킬
|
|
//IEnumerator Co_Skill1()
|
|
//{
|
|
// Change_MobStatus(eMobStatus.Skill);
|
|
// AnimationPlay("boss_skill1");
|
|
// dic_indicator[0].SetActive(true);
|
|
|
|
// // 투척 지점(타겟 위치)에 인디케이터 생성, 타겟이 없으면 앞으로 5m
|
|
// var targetPos = isTarget ? m_Target.Get_position() : Get_PositionFoward_OnNavMesh(5f);
|
|
// dic_indicator[0].transform.position = targetPos;
|
|
// pb_Lock.transform.position = tf_Skill1Pos.position;
|
|
// pb_Lock.gameObject.SetActive(true);
|
|
|
|
// // 투척 지점 보여준 뒤 인디케이터 끄고 던짐
|
|
// yield return new WaitForSeconds(1f);
|
|
// dic_indicator[0].SetActive(false);
|
|
// (pb_Lock as Projectile_Curved).Launch_Curved(tf_Skill1Pos.position, targetPos + Vector3.up, 1f, 7.5f, true, () =>
|
|
// {
|
|
// var pd = pb_LockExp.Get_ProjectTileData();
|
|
// pd.LifeTime = 1f;
|
|
// pb_LockExp.Set(pd);
|
|
// pb_LockExp.transform.position = targetPos + Vector3.up;
|
|
// });
|
|
|
|
// yield return new WaitForSeconds(1f);
|
|
// Check_Battle();
|
|
// Init(true, false);
|
|
//}
|
|
// 이펙트로 생성된 바위가 지정된 위치에 떨어지고 광역 피해를 입힘
|
|
IEnumerator Co_Skill1()
|
|
{
|
|
Change_MobStatus(eMobStatus.Skill);
|
|
AnimationPlay("boss_skill1");
|
|
|
|
// 투척 지점(타겟 위치)에 인디케이터 생성, 타겟이 없으면 앞으로 5m
|
|
var targetPos = isTarget ? m_Target.Get_position() : Get_PositionFoward_OnNavMesh(5f);
|
|
dic_indicator[0].SetActive(true);
|
|
dic_indicator[0].transform.position = targetPos;
|
|
|
|
yield return new WaitForSeconds(0.5f);
|
|
AnimationPlay("boss_skill1loop");
|
|
InGameInfo.Ins.Show_Effect("Effect_GolemChildSkill1Loop", this, eEffectLocation.Bottom, 6f);
|
|
|
|
yield return new WaitForSeconds(1.5f);
|
|
dic_indicator[0].SetActive(false);
|
|
|
|
yield return new WaitForSeconds(0.5f);
|
|
dic_indicator[2].SetActive(true);
|
|
dic_indicator[2].transform.position = dic_indicator[0].transform.position;
|
|
|
|
yield return new WaitForSeconds(2.0f);
|
|
// 후속타 발사!
|
|
var pd = pb_skill1after.Get_ProjectTileData();
|
|
pd.LifeTime = 3f;
|
|
pb_skill1after.Set(pd);
|
|
pb_skill1after.transform.position = dic_indicator[2].transform.position;
|
|
|
|
yield return new WaitForSeconds(2.0f);
|
|
Check_Battle();
|
|
Init(true, false);
|
|
}
|
|
protected override float Get_Skill1Dmg() { return Skill1Dmg; }
|
|
protected override void Set_Skill1Projectile(ProjectileBase pb)
|
|
{
|
|
pb.transform.position = dic_indicator[0].transform.position;
|
|
var collider = pb.GetComponent<Collider>();
|
|
collider.enabled = false;
|
|
CoroutineMgr.Ins.Set_Coroutine(() => { collider.enabled = true; }, 2f);
|
|
}
|
|
|
|
IEnumerator Co_Skill2()
|
|
{
|
|
Change_MobStatus(eMobStatus.Skill);
|
|
AnimationPlay("boss_skill2charging");
|
|
InGameInfo.Ins.Show_Effect("Effect_GolemChildSkill2", this, eEffectLocation.Bottom, Skill2ChargingTime);
|
|
|
|
dic_indicator[1].SetActive(true);
|
|
|
|
// 투척 지점(타겟 위치)에 인디케이터 생성, 타겟이 없으면 앞으로 5m
|
|
var targetPos = isTarget ? m_Target.Get_position() : Get_PositionFoward_OnNavMesh(5f);
|
|
dic_indicator[1].transform.position = targetPos;
|
|
|
|
yield return new WaitForSeconds(Skill2ChargingTime);
|
|
dic_indicator[1].SetActive(false);
|
|
AnimationPlay("boss_skill2attack");
|
|
|
|
yield return new WaitForSeconds(1.5f);
|
|
Init(false, true);
|
|
Check_Battle();
|
|
yield return new WaitForSeconds(3.5f);
|
|
|
|
// 추가 데미지
|
|
ProjectileInfo.Ins.Shoot_Projectile("FieldBoss/Golem_Child_Skill2After", this, m_Target, Get_Skill2Dmg(), targetPos, 3f);
|
|
}
|
|
|
|
protected override float Get_Skill2Dmg() { return Skill2Dmg; }
|
|
protected override void Set_Skill2Projectile(ProjectileBase pb)
|
|
{ pb.transform.position = dic_indicator[1].transform.position; }
|
|
} |