2024-12-27 23:19:08 +00:00
|
|
|
using CodeStage.AntiCheat.ObscuredTypes;
|
2025-01-13 02:40:17 +00:00
|
|
|
using System;
|
2025-01-02 17:53:08 +00:00
|
|
|
using System.Collections;
|
2024-12-15 01:39:39 +00:00
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.AI;
|
|
|
|
|
using UnityEngine.ResourceManagement.AsyncOperations;
|
2025-01-13 02:40:17 +00:00
|
|
|
using Random = UnityEngine.Random;
|
2024-12-15 01:39:39 +00:00
|
|
|
|
|
|
|
|
public class PCActor : MyActor
|
|
|
|
|
{
|
2024-12-31 05:30:00 +00:00
|
|
|
public Transform[] tfs_weapon; // 0 실드, 1 오른손
|
2024-12-15 01:39:39 +00:00
|
|
|
|
2025-02-18 05:59:11 +00:00
|
|
|
bool isUI;
|
2024-12-15 01:39:39 +00:00
|
|
|
float t_RecoverHPTime = 10f, t_RecoverMPTime = 10f, t_autoskill = 0.5f;
|
|
|
|
|
float t_HP = 0f, t_MP = 0f;
|
|
|
|
|
ObscuredFloat[] arr_magicCoolTime = new ObscuredFloat[] { 0f, 0f, 0f, 0f, 0f, 0f };
|
|
|
|
|
ObscuredFloat[] arr_magicMaxCoolTime = new ObscuredFloat[] { 0f, 0f, 0f, 0f, 0f, 0f };
|
|
|
|
|
SkillListTableData[] arr_magicData = new SkillListTableData[6];
|
|
|
|
|
SkillCard[] arr_PCSkillCard;
|
2025-01-13 23:43:30 +00:00
|
|
|
public int JoystickStatus = 0; // 0 조이스틱 x, 1 조이스틱 + run 애님, 2 조이스틱만
|
2024-12-15 01:39:39 +00:00
|
|
|
ObscuredFloat m_AvoidCoolTime;
|
|
|
|
|
protected ClassConfigTableData m_ClassData;
|
|
|
|
|
|
2025-02-11 00:15:02 +00:00
|
|
|
protected override void OnDestroy()
|
|
|
|
|
{
|
|
|
|
|
base.OnDestroy();
|
2025-02-23 03:53:51 +00:00
|
|
|
if (!m_Enemy && !isUI)
|
|
|
|
|
{
|
|
|
|
|
MyValue.MyPC = null;
|
2025-03-12 05:13:36 +00:00
|
|
|
if (!DSUtil.CheckNull(MyValue.m_RealCamera))
|
2025-03-23 00:23:25 +00:00
|
|
|
MyValue.m_RealCamera.Set_Target(null);
|
2025-02-23 03:53:51 +00:00
|
|
|
}
|
2025-02-11 00:15:02 +00:00
|
|
|
}
|
|
|
|
|
|
2024-12-15 01:39:39 +00:00
|
|
|
protected override void Update()
|
|
|
|
|
{
|
|
|
|
|
if (!DSUtil.CheckNull(arr_PCSkillCard) && arr_PCSkillCard.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < arr_magicCoolTime.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
if (DSUtil.CheckNull(arr_magicData[i]) || arr_magicData[i].e_SkillType == eSkillType.Passive) continue;
|
|
|
|
|
|
|
|
|
|
arr_magicCoolTime[i] -= Time.deltaTime;
|
|
|
|
|
if (arr_magicCoolTime[i] <= 0f) arr_magicCoolTime[i] = 0f;
|
|
|
|
|
arr_magicCoolTime[i].RandomizeCryptoKey();
|
|
|
|
|
|
|
|
|
|
if (!IsEnemy())
|
|
|
|
|
arr_PCSkillCard[i].Set_CoolTime(arr_magicCoolTime[i], arr_magicMaxCoolTime[i], i);
|
|
|
|
|
|
|
|
|
|
if (m_Auto && !IsDead() && !DSUtil.CheckNull(arr_magicData[i]) && arr_magicCoolTime[i] <= 0f && t_autoskill <= 0f && !IsCC() && CurAnim < eAnim.Skill &&
|
2025-02-08 22:22:31 +00:00
|
|
|
isTarget && Vector3.Distance(Get_position(), m_Target.Get_position()) <= arr_magicData[i].f_SkillRange)
|
2024-12-15 01:39:39 +00:00
|
|
|
{
|
|
|
|
|
if (Use_Skill(arr_magicData[i], m_Auto, i))
|
|
|
|
|
{
|
|
|
|
|
arr_magicCoolTime[i] = arr_magicMaxCoolTime[i];
|
|
|
|
|
t_autoskill = Random.Range(2f, 3f);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
t_autoskill -= Time.deltaTime;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
t_HP += Time.deltaTime;
|
|
|
|
|
if (t_HP >= t_RecoverHPTime)
|
|
|
|
|
{
|
|
|
|
|
t_HP = 0f;
|
|
|
|
|
if (!DSUtil.CheckNull(m_Stat))
|
|
|
|
|
{
|
|
|
|
|
var hpper = (float)(m_Stat.Get_Stat(eStat.HP) / m_Stat.Get_Stat(eStat.MaxHP));
|
|
|
|
|
if (hpper <= m_Stat.Get_Stat(eStat.HeroBuffHP))
|
|
|
|
|
m_Stat.Set_Stat(true, eStat.HP, m_Stat.Get_Stat(eStat.FinalHPRegen) + m_Stat.Get_Stat(eStat.HP_REGEN) * m_Stat.Get_Stat(eStat.HeroBuff_HP_REGEN_Multiplier));
|
|
|
|
|
else
|
|
|
|
|
m_Stat.Set_Stat(true, eStat.HP, m_Stat.Get_Stat(eStat.FinalHPRegen));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
t_MP += Time.deltaTime;
|
|
|
|
|
if (t_MP >= t_RecoverMPTime + (dic_ccData.ContainsKey(eCC.MPRecoverTime) && dic_ccData[eCC.MPRecoverTime].CCTime > 0 ? dic_ccData[eCC.MPRecoverTime].CCDmg : 0))
|
|
|
|
|
{
|
|
|
|
|
t_MP = 0f;
|
|
|
|
|
if (!DSUtil.CheckNull(m_Stat))
|
|
|
|
|
m_Stat.Set_Stat(true, eStat.MP, m_Stat.Get_Stat(eStat.FinalMPRegen));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_AvoidCoolTime > 0f)
|
|
|
|
|
{
|
|
|
|
|
m_AvoidCoolTime -= Time.deltaTime;
|
|
|
|
|
m_AvoidCoolTime.RandomizeCryptoKey();
|
2025-01-14 05:12:32 +00:00
|
|
|
if (!DSUtil.CheckNull(NewGameUI.Ins)) NewGameUI.Ins.m_BattleUI.Set_Avoid(m_AvoidCoolTime);
|
2024-12-15 01:39:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Update_Move();
|
|
|
|
|
|
2025-01-13 23:43:30 +00:00
|
|
|
if (JoystickStatus > 0 || IsStop || IsDead()) return;
|
2024-12-15 01:39:39 +00:00
|
|
|
|
|
|
|
|
base.Update();
|
|
|
|
|
|
|
|
|
|
// 2023. 02. 19. 정인호. 포탈찾는 로직(원래는 스테이지에 있었는데, 마녀의 기억으로 바껴서 이 로직 필요없어짐)
|
|
|
|
|
//if (m_Target == null && m_AutoTarget && MobInfo.Ins.m_PortalMgr != null && MobInfo.Ins.m_PortalMgr.go_portal.activeInHierarchy && m_NavMeshAgent.stoppingDistance > 0f)
|
|
|
|
|
//{
|
|
|
|
|
// Set_AutoBraking(false);
|
|
|
|
|
// Set_Path(MobInfo.Ins.m_PortalMgr.go_portal.transform.position);
|
|
|
|
|
//}
|
|
|
|
|
}
|
|
|
|
|
public override void Set(bool isEnemy, Actor owner, ServerData sdata, int _id, bool _isstop, bool _ui = false)
|
|
|
|
|
{
|
2025-01-26 18:16:16 +00:00
|
|
|
m_Role = eRole.PC;
|
2025-01-14 05:12:32 +00:00
|
|
|
if (DSUtil.CheckNull(arr_PCSkillCard) && !DSUtil.CheckNull(NewGameUI.Ins))
|
|
|
|
|
arr_PCSkillCard = NewGameUI.Ins.m_BattleUI.skillCards;
|
2024-12-15 01:39:39 +00:00
|
|
|
if (!DSUtil.CheckNull(arr_PCSkillCard))
|
|
|
|
|
{ // 스킬 설정
|
|
|
|
|
for (int i = 0; i < arr_PCSkillCard.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
var skillData = table_skilllist.Ins.Get_Data_orNull(sdata.Get_EquipSkillID(i));
|
|
|
|
|
arr_PCSkillCard[i].Set(skillData);
|
|
|
|
|
arr_PCSkillCard[i].Set_CardType(eUICardType.Use);
|
|
|
|
|
|
|
|
|
|
dic_MagicData.Add(i, new UseMagicInfo { m_uiIndex = i, m_SkillTableData = skillData, });
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-23 00:36:04 +00:00
|
|
|
|
2024-12-15 01:39:39 +00:00
|
|
|
base.Set(isEnemy, owner, sdata, _id, _isstop, _ui);
|
2025-04-02 04:15:38 +00:00
|
|
|
Change_Class(table_classconfig.Ins.Get_Data_orNull(_id), _ui);
|
2024-12-15 01:39:39 +00:00
|
|
|
|
|
|
|
|
isSurviveTime = false;
|
|
|
|
|
}
|
2025-02-18 05:59:11 +00:00
|
|
|
public void Set_UIPC() { isUI = true; }
|
2024-12-15 01:39:39 +00:00
|
|
|
public override void ReSet()
|
|
|
|
|
{
|
|
|
|
|
base.ReSet();
|
|
|
|
|
Set_Stat(true);
|
2025-02-21 04:45:42 +00:00
|
|
|
// 테스트 스탯
|
2025-02-21 04:46:10 +00:00
|
|
|
//m_Stat.Set_Stat(true, eStat.CRI, 1f);
|
|
|
|
|
//m_Stat.Set_Stat(true, eStat.M_CRI, 1f);
|
2025-02-21 04:45:42 +00:00
|
|
|
//////////////
|
2024-12-15 01:39:39 +00:00
|
|
|
|
|
|
|
|
t_autoskill = Random.Range(2f, 3f);
|
|
|
|
|
m_Auto = m_ServerData.Get_Common(eCommon.Auto) == 1;
|
|
|
|
|
for (int i = 0; i < arr_magicCoolTime.Length; i++)
|
|
|
|
|
arr_magicCoolTime[i] = 0f;
|
|
|
|
|
for (int i = 0; i < arr_magicData.Length; i++)
|
|
|
|
|
arr_magicData[i] = table_skilllist.Ins.Get_Data_orNull(m_ServerData.Get_EquipSkillID(i));
|
|
|
|
|
for (int i = 0; i < arr_magicMaxCoolTime.Length; i++)
|
|
|
|
|
arr_magicMaxCoolTime[i] = arr_magicData[i] != null ? arr_magicData[i].Get_CoolTime(m_Stat.Get_Stat(eStat.COOLTIME_Multiplier)) : 0f;
|
|
|
|
|
|
|
|
|
|
t_HP = t_MP = 0f;
|
|
|
|
|
m_bImmortal = m_bCanDodge = false;
|
|
|
|
|
|
|
|
|
|
if (!m_Enemy)
|
|
|
|
|
{
|
|
|
|
|
MyValue.MyPC = this;
|
|
|
|
|
|
|
|
|
|
//// 카메라 위치 잡기
|
|
|
|
|
//var curStageData = InGameInfo.Ins.Get_CurStageData();
|
|
|
|
|
//var viewcam = LoadMapMgr.Ins.Get_ViewCamera("ViewCamera");
|
|
|
|
|
//var maincam = Camera.main;
|
|
|
|
|
//if (InGameInfo.Ins.IsGameMode(eGameMode.Lobby) && viewcam != null)
|
|
|
|
|
//{
|
|
|
|
|
// InGameTouchInfo.Ins.m_RealCamera.enabled = false;
|
|
|
|
|
// maincam.fieldOfView = viewcam.fieldOfView;
|
|
|
|
|
// maincam.backgroundColor = viewcam.backgroundColor;
|
|
|
|
|
// maincam.transform.position = viewcam.transform.position;
|
|
|
|
|
// maincam.transform.rotation = viewcam.transform.rotation;
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
|
if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "StatTest" ||
|
|
|
|
|
UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "Settings")
|
|
|
|
|
return;
|
|
|
|
|
#endif
|
|
|
|
|
LoadMapMgr.Ins.Get_PortalPos(MyValue.MyChoiceMapData, Set_Warp);
|
2025-01-25 21:04:01 +00:00
|
|
|
var dgData = MyValue.MyChoiceMapData.Get_DungeonMapData_orNull();
|
2025-02-04 00:25:38 +00:00
|
|
|
if (!DSUtil.CheckNull(dgData))
|
2025-01-25 21:04:01 +00:00
|
|
|
{
|
2025-02-04 00:25:38 +00:00
|
|
|
if (dgData.e_DungeonType == eDungeon.d2_Maze)
|
|
|
|
|
LoadMapMgr.Ins.Set_MazeMap(MyValue.MyChoiceMapData.n_PortalIndex);
|
|
|
|
|
if (dgData.e_DungeonType == eDungeon.d2_Maze || dgData.e_DungeonType == eDungeon.d4_Wave)
|
|
|
|
|
LoadMapMgr.Ins.Set_MazeNextPortal(MyValue.MyChoiceMapData.n_PortalIndex, false);
|
2025-01-25 21:04:01 +00:00
|
|
|
}
|
2024-12-15 01:39:39 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
LoadMapMgr.Ins.Get_PortalPos(MyValue.MyChoiceMapData, Set_Warp); // TODO 정인호 : PvP 일 경우 적 위치 잡기
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-13 04:40:04 +00:00
|
|
|
public override void On_Regen(bool reincarnation = false, float healrate = 1f)
|
2024-12-15 01:39:39 +00:00
|
|
|
{
|
2025-02-13 04:40:04 +00:00
|
|
|
base.On_Regen(reincarnation, healrate);
|
2024-12-15 01:39:39 +00:00
|
|
|
Del_Target(true);
|
|
|
|
|
Del_Magic();
|
|
|
|
|
Play_Idle();
|
|
|
|
|
ActorInfo.Ins.All_Stop(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override bool IsAvoidCoolTime() { return m_AvoidCoolTime > 0f; }
|
|
|
|
|
protected override void Set_AvoidCoolTime() { m_AvoidCoolTime = table_GlobalValue.Ins.Get_Int("f_AvoidCoolTime"); }
|
2025-03-07 06:50:46 +00:00
|
|
|
public void StartCam(Action<Vector3> actGetPos)
|
2024-12-15 01:39:39 +00:00
|
|
|
{
|
|
|
|
|
Camera.main.fieldOfView = 60f;
|
|
|
|
|
LoadMapMgr.Ins.Get_PortalPos(MyValue.MyChoiceMapData, portalpos =>
|
|
|
|
|
{
|
2025-03-09 23:46:04 +00:00
|
|
|
var mzd = LoadMapMgr.Ins.Get_MapZoneData(MyValue.MyChoiceMapData);
|
|
|
|
|
MyValue.m_RealCamera.Set_Target(transform, mzd.CamRot_Portal);
|
2025-03-07 06:50:46 +00:00
|
|
|
actGetPos?.Invoke(portalpos);
|
2025-01-27 02:05:25 +00:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
float Get_RealCamRotAround(Vector3 portalpos)
|
|
|
|
|
{
|
2025-03-09 23:46:04 +00:00
|
|
|
//Vector3 targetPosition = portalpos;
|
|
|
|
|
//Vector3 cameraPosition = portalpos - Vector3.forward; // 현재 카메라의 위치
|
2024-12-15 01:39:39 +00:00
|
|
|
|
2025-03-09 23:46:04 +00:00
|
|
|
//Vector3 relativePosition = targetPosition - cameraPosition;
|
|
|
|
|
//return Mathf.Atan2(relativePosition.x, relativePosition.z) * Mathf.Rad2Deg;
|
|
|
|
|
return 0f;
|
2024-12-15 01:39:39 +00:00
|
|
|
}
|
|
|
|
|
public override void Get_Damage(DamageInfo _dinfo)
|
|
|
|
|
{
|
|
|
|
|
//_dinfo.Damage = 1; // 테스트 : 마녀 안 죽게
|
|
|
|
|
base.Get_Damage(_dinfo);
|
|
|
|
|
if (!IsEnemy() && _dinfo.Damage >= Get_MaxHP() * 0.5d && !isSurviveTime)
|
|
|
|
|
StartCoroutine(Co_Survive(5f));
|
|
|
|
|
}
|
|
|
|
|
bool isSurviveTime = false;
|
|
|
|
|
IEnumerator Co_Survive(float _time)
|
|
|
|
|
{
|
|
|
|
|
isSurviveTime = true;
|
|
|
|
|
yield return new WaitForSeconds(_time);
|
|
|
|
|
if (!IsDead()) ServerInfo.Ins.m_ServerData.Add_Item(new ItemData(eItem.Title, 55, 1)); // 칭호 : 지난 세월이 보인
|
|
|
|
|
isSurviveTime = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Set_MagicCoolTime(float _time, int _index)
|
|
|
|
|
{
|
|
|
|
|
arr_magicCoolTime[_index] = _time;
|
|
|
|
|
arr_magicCoolTime[_index].RandomizeCryptoKey();
|
|
|
|
|
}
|
|
|
|
|
public override void Set_SkillCoolTime(bool add, int skillid, float rate)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < arr_magicData.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
if (arr_magicData[i].n_SkillID == skillid)
|
|
|
|
|
{
|
|
|
|
|
if (add)
|
|
|
|
|
arr_magicCoolTime[i] += arr_magicMaxCoolTime[i] * rate;
|
|
|
|
|
else
|
|
|
|
|
arr_magicCoolTime[i] -= arr_magicMaxCoolTime[i] * rate;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
protected override bool Check_MagicCoolTime(int _index) { return arr_magicCoolTime[_index] <= 0f; }
|
|
|
|
|
|
|
|
|
|
public void Init_UI(Transform _parent)
|
|
|
|
|
{
|
|
|
|
|
DSUtil.Set_Transform_withParent(transform, _parent);
|
|
|
|
|
transform.localEulerAngles = Vector3.up * 180f;
|
|
|
|
|
DSUtil.ChangeLayersRecursively(transform, "UI");
|
|
|
|
|
}
|
|
|
|
|
public override void BossRaidCard_AddDmg(double _dmg)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
public override void BossRaidCard_HP()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-02 02:40:44 +00:00
|
|
|
public void Set_Obj()
|
|
|
|
|
{
|
|
|
|
|
string animControllerPath;
|
|
|
|
|
if (InGameInfo.Ins.IsGameMode(eGameMode.Lobby))
|
|
|
|
|
{
|
|
|
|
|
transform.localScale = Vector3.one;
|
|
|
|
|
animControllerPath = "Assets/Res_Addr/Animations/pcanim_lobby.controller";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
transform.localScale = m_ClassData.f_Scale * Vector3.one;
|
|
|
|
|
animControllerPath = m_ClassData.s_AnimationController;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AddrResourceMgr.Ins.LoadObject<RuntimeAnimatorController>(animControllerPath, handle =>
|
|
|
|
|
{
|
|
|
|
|
m_animation.runtimeAnimatorController = handle.Result;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (!InGameInfo.Ins.IsGameMode(eGameMode.Lobby))
|
|
|
|
|
Change_Weapon();
|
|
|
|
|
}
|
|
|
|
|
public void Change_Weapon()
|
2024-12-15 01:39:39 +00:00
|
|
|
{
|
|
|
|
|
for (int i = 0; i < tfs_weapon.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
if (tfs_weapon[i].childCount > 0)
|
|
|
|
|
{
|
|
|
|
|
for (int j = 0; j < tfs_weapon[i].childCount; j++)
|
|
|
|
|
Destroy(tfs_weapon[i].GetChild(j).gameObject);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-02 02:40:44 +00:00
|
|
|
var wData = table_equipitemlist.Ins.Get_Data_orNull(m_ServerData.Get_EqiupmentEquip(eItem.WeaponCostume) > 0 ?
|
|
|
|
|
m_ServerData.Get_EqiupmentEquip(eItem.WeaponCostume) : m_ServerData.Get_EqiupmentEquip(eItem.Weapon));
|
|
|
|
|
m_AttackType = DSUtil.CheckNull(wData) ? eAttackType.Physics : wData.e_EquipAttribute;
|
2024-12-15 01:39:39 +00:00
|
|
|
|
2025-01-02 02:40:44 +00:00
|
|
|
for (int i = 0; i < 2; i++)
|
|
|
|
|
{
|
|
|
|
|
var prefab = i == 0 ? m_ClassData.s_WeaponLHPrefab : m_ClassData.s_WeaponRHPrefab;
|
|
|
|
|
if (!string.IsNullOrEmpty(prefab))
|
2024-12-15 01:39:39 +00:00
|
|
|
{
|
2025-01-02 02:40:44 +00:00
|
|
|
var fullpath = $"Assets/Res_Addr/Weapon/{prefab}.prefab";
|
2025-01-02 17:08:46 +00:00
|
|
|
switch (prefab)
|
|
|
|
|
{
|
|
|
|
|
case "Shield":
|
|
|
|
|
Make_Weapon(fullpath, tfs_weapon[0], Vector3.zero, Vector3.one);
|
|
|
|
|
break;
|
|
|
|
|
case "Mace":
|
|
|
|
|
Make_Weapon(fullpath, tfs_weapon[1], new Vector3(0.168f, -0.031f, -0.126f), Vector3.one);
|
|
|
|
|
break;
|
|
|
|
|
case "Elven_Sword_01":
|
2025-01-02 17:53:08 +00:00
|
|
|
Make_Weapon(fullpath, tfs_weapon[2], Vector3.zero, Vector3.one);
|
2025-01-02 17:08:46 +00:00
|
|
|
break;
|
2025-01-14 05:12:32 +00:00
|
|
|
case "Dagger1":
|
|
|
|
|
Make_Weapon(fullpath, tfs_weapon[3], Vector3.zero, Vector3.one);
|
|
|
|
|
break;
|
|
|
|
|
case "Dagger2":
|
|
|
|
|
Make_Weapon(fullpath, tfs_weapon[4], Vector3.zero, Vector3.one);
|
|
|
|
|
break;
|
2025-05-05 22:09:51 +00:00
|
|
|
case "Orb":
|
2025-01-17 22:50:44 +00:00
|
|
|
Make_Weapon(fullpath, tfs_weapon[5], Vector3.zero, Vector3.one);
|
|
|
|
|
break;
|
2025-05-05 22:09:51 +00:00
|
|
|
case "Bow":
|
|
|
|
|
Make_Weapon(fullpath, tfs_weapon[6], Vector3.zero, Vector3.one);
|
|
|
|
|
break;
|
2025-01-02 17:08:46 +00:00
|
|
|
}
|
2024-12-15 01:39:39 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-02 17:08:46 +00:00
|
|
|
void Make_Weapon(string fullpath, Transform tfparent, Vector3 localpos, Vector3 scale, bool ui = false)
|
2024-12-15 01:39:39 +00:00
|
|
|
{
|
|
|
|
|
AddrResourceMgr.Ins.LoadObject<GameObject>(fullpath, handle =>
|
|
|
|
|
{
|
|
|
|
|
if (handle.IsDone && handle.Status == AsyncOperationStatus.Succeeded)
|
|
|
|
|
{
|
|
|
|
|
var w = DSUtil.Get_Clone(handle.Result);
|
|
|
|
|
AddrResourceMgr.Ins.Set_AddressableReleaseSelf(w);
|
|
|
|
|
DSUtil.Set_Transform_withParent(w.transform, tfparent, localpos, scale);
|
|
|
|
|
if (ui) DSUtil.ChangeLayersRecursively(w.transform, "UI");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-02 04:15:38 +00:00
|
|
|
public void Change_Class(ClassConfigTableData classdata, bool _ui)
|
|
|
|
|
{
|
2025-04-02 23:29:27 +00:00
|
|
|
m_ID = classdata.n_ClassID;
|
2025-04-02 04:15:38 +00:00
|
|
|
m_ClassData = classdata;
|
|
|
|
|
m_NavStopDistance = m_ClassData.f_AttackRange;
|
|
|
|
|
Set_Obj();
|
|
|
|
|
|
|
|
|
|
if (!_ui)
|
|
|
|
|
{
|
|
|
|
|
ReSet();
|
|
|
|
|
Set_MoveSpeed(true, m_Stat.Get_Stat(eStat.FinalMoveSpeed));
|
|
|
|
|
}
|
|
|
|
|
f_FindEnemyRange = table_GlobalValue.Ins.Get_Float("f_PC_FindEnemyRange") + (float)m_Stat.Get_Stat(eStat.AttackRange_Up);
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-15 01:39:39 +00:00
|
|
|
protected override void Set_Script()
|
|
|
|
|
{
|
|
|
|
|
CameraShake.Ins.VibrateForTime(0.1f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float move_dist = 0f;
|
|
|
|
|
public override void Run_byJoystick(Vector3 _pos)
|
|
|
|
|
{
|
|
|
|
|
if (m_bCanDodge)
|
|
|
|
|
{
|
|
|
|
|
if (!IsDead() && CurAnim != eAnim.Dodge)
|
|
|
|
|
{
|
|
|
|
|
transform.LookAt(transform.position + _pos);
|
|
|
|
|
Play_Dodge();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//if (IsDead() || CurAnim >= eAnim.Skill1 || IsCC())
|
2025-02-11 00:15:02 +00:00
|
|
|
if (CurAnim == eAnim.Dodge || IsDead() || IsCC())
|
2024-12-15 01:39:39 +00:00
|
|
|
return;
|
2025-01-13 23:43:30 +00:00
|
|
|
|
|
|
|
|
if (JoystickStatus != 2)
|
|
|
|
|
Play_RunAnim();
|
2024-12-15 01:39:39 +00:00
|
|
|
|
|
|
|
|
Del_Magic();
|
|
|
|
|
Del_Target();
|
|
|
|
|
|
|
|
|
|
transform.LookAt(Get_position() + _pos);
|
|
|
|
|
if (m_NavMeshAgent.isOnNavMesh)
|
|
|
|
|
{
|
|
|
|
|
m_NavMeshAgent.ResetPath();
|
|
|
|
|
m_NavMeshAgent.stoppingDistance = 0f;
|
|
|
|
|
|
|
|
|
|
var before = Get_position();
|
|
|
|
|
m_NavMeshAgent.speed = m_NavSpeed;
|
|
|
|
|
var mov = Get_MoveSpeed() * Time.deltaTime * _pos;
|
|
|
|
|
m_NavMeshAgent.Move(mov);
|
|
|
|
|
var after = Get_position();
|
|
|
|
|
move_dist += Vector3.Distance(before, after);
|
|
|
|
|
if (move_dist >= 1f)
|
|
|
|
|
{
|
|
|
|
|
move_dist -= 1f;
|
|
|
|
|
m_ServerData.Add_TitleCondition(74, 75); // 칭호 : 발로 걷는, 발로 뛰는
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Set_AutoBraking(bool _active)
|
|
|
|
|
{
|
2025-02-11 00:15:02 +00:00
|
|
|
if (CurAnim == eAnim.Dodge || IsDead() || IsCC()) return;
|
2024-12-15 01:39:39 +00:00
|
|
|
|
|
|
|
|
if (_active)
|
|
|
|
|
{
|
|
|
|
|
IsStop = false;
|
|
|
|
|
Play_Idle();
|
|
|
|
|
m_NavMeshAgent.stoppingDistance = m_NavStopDistance;
|
|
|
|
|
m_NavMeshAgent.angularSpeed = 300f;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
IsStop = true;
|
|
|
|
|
Del_Target();
|
|
|
|
|
m_NavMeshAgent.ResetPath();
|
|
|
|
|
m_NavMeshAgent.stoppingDistance = 0f;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-13 23:43:30 +00:00
|
|
|
public override void Set_JoystickStatus(int status)
|
|
|
|
|
{
|
2025-05-03 23:06:28 +00:00
|
|
|
if (IsMainPC())
|
|
|
|
|
{
|
|
|
|
|
if (JoystickStatus == 2 && status < 3) return;
|
|
|
|
|
JoystickStatus = status == 3 ? 0 : status;
|
|
|
|
|
}
|
2025-01-13 23:43:30 +00:00
|
|
|
}
|
|
|
|
|
|
2024-12-15 01:39:39 +00:00
|
|
|
public bool Check_Path(Vector3 pos)
|
|
|
|
|
{
|
|
|
|
|
if (!IsCC())
|
|
|
|
|
{
|
|
|
|
|
NavMeshPath path = new NavMeshPath();
|
|
|
|
|
if (m_NavMeshAgent.isOnNavMesh && m_NavMeshAgent.CalculatePath(pos, path))
|
|
|
|
|
return path.status == NavMeshPathStatus.PathComplete;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Set_Die()
|
|
|
|
|
{
|
|
|
|
|
base.Set_Die();
|
|
|
|
|
ActorInfo.Ins.All_Stop(true);
|
2025-03-17 00:08:46 +00:00
|
|
|
//NewGameUI.Ins.m_GuideQuestUI.Add_GuideQuest(ePurpose.DieOrQuit);
|
2025-02-02 05:19:34 +00:00
|
|
|
DungeonInfo.Ins.Sub_WaveLife();
|
2025-03-04 23:42:24 +00:00
|
|
|
MonsterSimpleInfo.Ins.Set_DelLockTarget(true);
|
2024-12-15 01:39:39 +00:00
|
|
|
}
|
|
|
|
|
|
2025-01-13 02:40:17 +00:00
|
|
|
protected override IEnumerator Co_ScaleControl(bool returntoOriginalScale, float targetscale, Action actComplete = null)
|
|
|
|
|
{
|
|
|
|
|
if (returntoOriginalScale) targetscale = m_ClassData.f_Scale;
|
|
|
|
|
Vector3 target = Vector3.one * targetscale;
|
|
|
|
|
|
|
|
|
|
float t = 0f;
|
|
|
|
|
while (t < 1f)
|
|
|
|
|
{
|
|
|
|
|
yield return null;
|
|
|
|
|
t += Time.deltaTime;
|
|
|
|
|
transform.localScale = Vector3.Lerp(transform.localScale, target, t);
|
|
|
|
|
}
|
|
|
|
|
transform.localScale = Vector3.one * targetscale;
|
|
|
|
|
actComplete?.Invoke();
|
|
|
|
|
}
|
2025-01-15 22:32:07 +00:00
|
|
|
|
|
|
|
|
protected override void Weapon_OnOff(bool active)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < tfs_weapon.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
if (tfs_weapon[i].childCount > 0)
|
|
|
|
|
{
|
|
|
|
|
for (int j = 0; j < tfs_weapon[i].childCount; j++)
|
|
|
|
|
tfs_weapon[i].GetChild(j).gameObject.SetActive(active);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-05-01 21:41:01 +00:00
|
|
|
|
|
|
|
|
public override void Play_Attack(int _attack, float _as, Action actsuccess = null)
|
|
|
|
|
{
|
|
|
|
|
base.Play_Attack(_attack, _as, () =>
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(m_ClassData.s_SlashPrefab))
|
|
|
|
|
Set_Coroutine(() =>
|
|
|
|
|
{
|
|
|
|
|
InGameInfo.Ins.Show_Effect(m_ClassData.s_SlashPrefab, Get_position(), transform.eulerAngles);
|
|
|
|
|
}, m_ClassData.f_SlashStartDelay);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
2024-12-15 01:39:39 +00:00
|
|
|
}
|