슈터를 따라다니는 투사체, 보스 스킬 사용 로직
This commit is contained in:
parent
020396d527
commit
9110c55e1c
|
|
@ -14,14 +14,38 @@ public class Boss_IceGolem : BossMobActor
|
|||
public float Skill1StunTime = 2f;
|
||||
[Header("스킬1 인디케이터")]
|
||||
public string Skill1Indicator = "IceGolem_Skill1_Indicator";
|
||||
|
||||
float m_skill1cooltime = 1f;
|
||||
[Header("------------------------------------")]
|
||||
public bool bbbbbbbbbbbbbbbbbbbbbbbb;
|
||||
[Header("스킬2 쿨타임")]
|
||||
public float Skill2CoolTime = 10f;
|
||||
[Header("스킬2 달려가는 속도")]
|
||||
public float Skill2Speed = 5f;
|
||||
[Header("스킬2 데미지")]
|
||||
public float Skill2Dmg = 3.5f;
|
||||
[Header("스킬2 넉백 시간")]
|
||||
public float Skill2KnockBackTime = 0.3f;
|
||||
[Header("스킬2 스턴 시간")]
|
||||
public float Skill2StunTime = 2f;
|
||||
[Header("스킬2 인디케이터")]
|
||||
public string Skill2Indicator = "IceGolem_Skill2_Indicator";
|
||||
|
||||
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; });
|
||||
//if (DSUtil.CheckNull(go_indicator2))
|
||||
// IndicatorInfo.Ins.Make_Indicator(Skill2Indicator, go => { go_indicator2 = go; });
|
||||
|
||||
CoolTime_Skill1 = 1f;
|
||||
CoolTime_Skill1 = 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()
|
||||
|
|
@ -29,25 +53,21 @@ public class Boss_IceGolem : BossMobActor
|
|||
base.Update();
|
||||
if (IsDead() || IsStop) return;
|
||||
|
||||
//if (CanUseSkill1)
|
||||
if (UseSkillIndex == 1)
|
||||
{
|
||||
if (m_skill1cooltime > 0f) m_skill1cooltime -= Time.deltaTime;
|
||||
if (m_skill1cooltime <= 0f)
|
||||
CoolTime_Skill1 = Skill1CoolTime;
|
||||
Run_byUseSkill(Skill1TargetRange, Skill1Speed, success =>
|
||||
{
|
||||
m_skill1cooltime = Skill1CoolTime;
|
||||
Run_byUseSkill(Skill1TargetRange, Skill1Speed, success =>
|
||||
AnimationPlay("boss_skill1start");
|
||||
go_indicator1.transform.position = Get_position();
|
||||
go_indicator1.SetActive(true);
|
||||
Jump(0.5f, 3f, 2f, 5f, () =>
|
||||
{
|
||||
AnimationPlay("boss_skill1start");
|
||||
go_indicator1.transform.position = Get_position();
|
||||
go_indicator1.SetActive(true);
|
||||
Jump(0.5f, 3f, 2f, 5f, () =>
|
||||
{
|
||||
go_indicator1.SetActive(false);
|
||||
AnimationPlay("boss_skill1attack");
|
||||
Change_MobStatus(eMobStatus.Attack);
|
||||
});
|
||||
Init(true, false);
|
||||
AnimationPlay("boss_skill1attack");
|
||||
Change_MobStatus(eMobStatus.Attack);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,13 @@ public class Boss_LusifActor : BossMobActor
|
|||
int Skill2Count;
|
||||
float Skill2DelayTime;
|
||||
|
||||
protected override void Init(bool initSkill1CoolTime, bool initSkill2CoolTime)
|
||||
{
|
||||
base.Init(initSkill1CoolTime, initSkill2CoolTime);
|
||||
if (initSkill1CoolTime) CoolTime_Skill1 = 5f;
|
||||
if (initSkill2CoolTime) CoolTime_Skill2 = 1.5f;
|
||||
}
|
||||
|
||||
public override void On_Regen(bool reincarnation = false, float healrate = 1)
|
||||
{
|
||||
base.On_Regen(reincarnation, healrate);
|
||||
|
|
@ -26,10 +33,8 @@ public class Boss_LusifActor : BossMobActor
|
|||
base.Update();
|
||||
if (IsDead()) return;
|
||||
|
||||
//if (CanUseSkill2)
|
||||
if (UseSkillIndex == 2)
|
||||
{
|
||||
if (Skill2Count == 0 && CoolTime_Skill2 > 0f) CoolTime_Skill2 -= Time.deltaTime;
|
||||
|
||||
if (Skill2Count > 0)
|
||||
{
|
||||
Skill2DelayTime -= Time.deltaTime;
|
||||
|
|
@ -40,7 +45,7 @@ public class Boss_LusifActor : BossMobActor
|
|||
AnimationPlay("boss_skill2");
|
||||
if (Skill2Count == 0)
|
||||
{
|
||||
CoolTime_Skill2 = 1.5f;
|
||||
Init(false, true);
|
||||
Change_MobStatus(eMobStatus.Attack);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,29 +1,52 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
public class BossMobActor : MobActor
|
||||
{
|
||||
protected GameObject go_indicator1, go_indicator2;
|
||||
protected bool CanUseSkill1, CanUseSkill2;
|
||||
protected float CoolTime_Skill1, CoolTime_Skill2;
|
||||
protected int UseSkillIndex = 0;
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
if (IsDead() || IsStop) return;
|
||||
if (IsDead()) return;
|
||||
|
||||
if (UseSkillIndex != 1 && CoolTime_Skill1 > 0f) CoolTime_Skill1 -= Time.deltaTime;
|
||||
if (UseSkillIndex != 2 && CoolTime_Skill2 > 0f) CoolTime_Skill2 -= Time.deltaTime;
|
||||
// 스킬 사용 결정
|
||||
if (UseSkillIndex == 0 && MobStatus != eMobStatus.Skill)
|
||||
{
|
||||
bool skill1Ready = CanUseSkill1 && CoolTime_Skill1 <= 0f;
|
||||
bool skill2Ready = CanUseSkill2 && CoolTime_Skill2 <= 0f;
|
||||
|
||||
if (skill1Ready && skill2Ready)
|
||||
UseSkillIndex = Random.Range(1, 3); // 1 또는 2 랜덤 선택
|
||||
else if (skill1Ready)
|
||||
UseSkillIndex = 1;
|
||||
else if (skill2Ready)
|
||||
UseSkillIndex = 2;
|
||||
}
|
||||
else
|
||||
UseSkillIndex = 0;
|
||||
|
||||
if (IsStop) return;
|
||||
}
|
||||
|
||||
void Init()
|
||||
protected virtual void Init(bool initSkill1CoolTime, bool initSkill2CoolTime)
|
||||
{
|
||||
if (!DSUtil.CheckNull(go_indicator1)) go_indicator1.SetActive(false);
|
||||
if (!DSUtil.CheckNull(go_indicator2)) go_indicator2.SetActive(false);
|
||||
UseSkillIndex = 0;
|
||||
}
|
||||
|
||||
public override void Del_Target(bool forcedel = false)
|
||||
{
|
||||
base.Del_Target(forcedel);
|
||||
Init();
|
||||
Init(false, false);
|
||||
}
|
||||
|
||||
public override void Get_Damage(DamageInfo _dinfo)
|
||||
|
|
@ -31,18 +54,22 @@ public class BossMobActor : MobActor
|
|||
base.Get_Damage(_dinfo);
|
||||
if (!CanUseSkill1) CanUseSkill1 = (Get_HP() / Get_MaxHP()) <= 0.9;
|
||||
if (!CanUseSkill2) CanUseSkill2 = (Get_HP() / Get_MaxHP()) <= 0.7;
|
||||
|
||||
// 테스트
|
||||
CanUseSkill1 = true;
|
||||
CanUseSkill2 = true;
|
||||
}
|
||||
|
||||
protected override void Set_Die()
|
||||
{
|
||||
base.Set_Die();
|
||||
Init();
|
||||
Init(true, true);
|
||||
}
|
||||
|
||||
protected override void On_NavMeshAgent()
|
||||
{
|
||||
base.On_NavMeshAgent();
|
||||
Init();
|
||||
Init(false, false);
|
||||
}
|
||||
|
||||
protected virtual float Get_Skill1Dmg() { return 1f; }
|
||||
|
|
@ -95,5 +122,4 @@ public class BossMobActor : MobActor
|
|||
else
|
||||
moveend(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
public class Projectile_FollowShooter : ProjectileBase
|
||||
{
|
||||
public override void Set(ProjectileData _data)
|
||||
{
|
||||
base.Set(_data);
|
||||
m_ShowTimeOverEffect = false; // 근접 공격은 시간 다 됐을 때 이펙트 표시 x
|
||||
transform.eulerAngles = Vector3.zero; // 근접 공격 판정은 회전 x
|
||||
StartCoroutine(Co_Update());
|
||||
}
|
||||
|
||||
IEnumerator Co_Update()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
transform.position = m_ProjecTileData.shooter.Get_position();
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6e5d0473a60828744bcfa5080dba954d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Reference in New Issue