99 lines
3.7 KiB
C#
99 lines
3.7 KiB
C#
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 Transform tf_Skill1Pos;
|
|
[Header("---------------------------------------")]
|
|
public bool Perforation_Line;
|
|
[Header("스킬2 쿨타임")]
|
|
public float Skill2CoolTime = 8f;
|
|
[Header("스킬2 차징시간")]
|
|
public float Skill2ChargingTime = 1f;
|
|
[Header("스킬2 지속시간")]
|
|
public float Skill2LifeTime = 15f;
|
|
[Header("스킬2 데미지")]
|
|
public float Skill2Dmg = 3f;
|
|
|
|
Projectile_Curved pc_Lock;
|
|
ProjectileBase pb_LockExp;
|
|
|
|
public override void Set(bool isEnemy, Actor owner, ServerData sdata, int _id, bool _stop, bool _ui = false)
|
|
{
|
|
base.Set(isEnemy, owner, sdata, _id, _stop, _ui);
|
|
|
|
if (DSUtil.CheckNull(go_indicator1)) IndicatorInfo.Ins.Make_Indicator(Skill1Indicator, go => { go_indicator1 = go; });
|
|
|
|
ProjectileInfo.Ins.Shoot_Projectile("FieldBoss/Golem_Child_Lock", this, m_Target, Skill1Dmg, tf_Skill1Pos.position, 10f,
|
|
pb => { pc_Lock = pb as Projectile_Curved; pc_Lock.gameObject.SetActive(false); });
|
|
ProjectileInfo.Ins.Shoot_Projectile("FieldBoss/Golem_Child_LockExp", this, m_Target, Skill1AreaDmg, tf_Skill1Pos.position, 10f,
|
|
pb => { pb_LockExp = pb; pb_LockExp.gameObject.SetActive(false); });
|
|
|
|
CoolTime_Skill1 = 1f;
|
|
CoolTime_Skill2 = 2f;
|
|
}
|
|
|
|
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");
|
|
go_indicator1.SetActive(true);
|
|
|
|
// 투척 지점(타겟 위치)에 인디케이터 생성, 타겟이 없으면 앞으로 5m
|
|
var targetPos = isTarget ? m_Target.Get_position() : Get_PositionFoward(5f);
|
|
go_indicator1.transform.position = targetPos;
|
|
pc_Lock.transform.position = tf_Skill1Pos.position;
|
|
pc_Lock.gameObject.SetActive(true);
|
|
|
|
// 투척 지점 보여준 뒤 인디케이터 끄고 던짐
|
|
yield return new WaitForSeconds(1f);
|
|
go_indicator1.SetActive(false);
|
|
pc_Lock.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_Skill2()
|
|
{
|
|
Change_MobStatus(eMobStatus.Skill);
|
|
AnimationPlay("boss_skill2");
|
|
InGameInfo.Ins.Show_Effect("Effect_MinotosSkill2", this, eEffectLocation.Bottom, Skill2LifeTime);
|
|
yield return new WaitForSeconds(0.5f);
|
|
Check_Battle();
|
|
Init(false, true);
|
|
}
|
|
}
|