2024-12-15 01:39:39 +00:00
|
|
|
using CodeStage.AntiCheat.ObscuredTypes;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
2024-12-28 00:20:09 +00:00
|
|
|
using UnityEngine.SceneManagement;
|
2024-12-15 01:39:39 +00:00
|
|
|
|
|
|
|
|
public enum eSummon { Golem, Worm }
|
|
|
|
|
|
|
|
|
|
public class SummonActor : MyActor
|
|
|
|
|
{
|
|
|
|
|
public eSummon SummonType;
|
|
|
|
|
float LifeTime, MaxLifeTime;
|
|
|
|
|
ObscuredInt projctile_amount = 1;
|
|
|
|
|
|
|
|
|
|
public void Set(bool isEnemy, Actor owner, float _time, float _attackrate, float _hprate, int projctileamount)
|
|
|
|
|
{
|
|
|
|
|
gameObject.SetActive(true);
|
2025-01-23 22:16:18 +00:00
|
|
|
m_HUDUI = InGameInfo.Ins.Get_HUDUI();
|
|
|
|
|
m_HUDUI.gameObject.SetActive(true);
|
|
|
|
|
m_HUDUI.Set_HPSlider(1d, 1d);
|
2024-12-15 01:39:39 +00:00
|
|
|
OwnerActor = owner;
|
|
|
|
|
|
|
|
|
|
projctile_amount = projctileamount; projctile_amount.RandomizeCryptoKey();
|
|
|
|
|
m_Auto = true;
|
|
|
|
|
MaxLifeTime = LifeTime = _time;
|
|
|
|
|
m_Enemy = owner.IsEnemy();
|
|
|
|
|
m_ServerData = owner.Get_ServerData();
|
|
|
|
|
Set_Stat(true);
|
|
|
|
|
m_Stat.Set_Stat(true, eStat.BaseDmg, m_Stat.Get_Stat(eStat.BaseDmg) * _attackrate);
|
|
|
|
|
m_Stat.Set_Stat(true, eStat.HP, m_Stat.Get_Stat(eStat.HP) * _hprate);
|
|
|
|
|
m_NavMeshAgent.speed = owner.Get_MoveSpeed();
|
2024-12-16 06:28:42 +00:00
|
|
|
m_NavStopDistance = f_FindEnemyRange = SummonType == eSummon.Golem ? 1.5f : 3.5f;
|
2024-12-15 01:39:39 +00:00
|
|
|
|
|
|
|
|
Set_Warp(owner.Get_position() + Vector3.forward);
|
2024-12-16 06:28:42 +00:00
|
|
|
InGameInfo.Ins.Show_Effect(SummonType == eSummon.Golem ? "Effect_Summoning_Golem" : "Effect_Summoning", transform.position);
|
2024-12-15 01:39:39 +00:00
|
|
|
Set(isEnemy, owner, owner.Get_ServerData(), 0, true);
|
|
|
|
|
|
|
|
|
|
Set_Coroutine(() =>
|
|
|
|
|
{
|
|
|
|
|
IsStop = false;
|
|
|
|
|
}, 1f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Update()
|
|
|
|
|
{
|
|
|
|
|
base.Update();
|
|
|
|
|
|
2024-12-28 00:20:09 +00:00
|
|
|
#if UNITY_EDITOR
|
|
|
|
|
if (SceneManager.GetActiveScene().name == "StatTest")
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2024-12-15 01:39:39 +00:00
|
|
|
if (LifeTime > 0f)
|
|
|
|
|
{
|
|
|
|
|
LifeTime -= Time.deltaTime;
|
|
|
|
|
m_HUDUI.Set(LifeTime / MaxLifeTime);
|
|
|
|
|
if (LifeTime <= 0f)
|
|
|
|
|
{
|
|
|
|
|
Set_Die();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (DSUtil.CheckNull(OwnerActor))
|
|
|
|
|
{
|
|
|
|
|
Set_Die();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-08 22:22:31 +00:00
|
|
|
if (!IsStop && (!isTarget || m_Target.IsDead()) && Vector3.Distance(OwnerActor.Get_position(), Get_position()) > 2)
|
2024-12-15 01:39:39 +00:00
|
|
|
{ // 마녀 따라다니기
|
|
|
|
|
Follow_PC();
|
|
|
|
|
}
|
|
|
|
|
else if (CurAnim == eAnim.Run && m_NavMeshAgent.velocity == Vector3.zero)
|
|
|
|
|
Play_Idle();
|
|
|
|
|
|
|
|
|
|
if (CurAnim == eAnim.Attack && !isPlaying())
|
|
|
|
|
Play_Idle();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void After_Die()
|
|
|
|
|
{
|
|
|
|
|
base.After_Die();
|
|
|
|
|
Off();
|
2024-12-16 06:28:42 +00:00
|
|
|
InGameInfo.Ins.Show_Effect(SummonType == eSummon.Golem ? "Effect_Summoning_Golem" : "Effect_Summoning", transform.position);
|
2024-12-15 01:39:39 +00:00
|
|
|
}
|
|
|
|
|
}
|