diff --git a/Assets/Ino_nerdnavis.txt b/Assets/Ino_nerdnavis.txt index d2ae51da6..f5e85bfb5 100644 --- a/Assets/Ino_nerdnavis.txt +++ b/Assets/Ino_nerdnavis.txt @@ -61,5 +61,7 @@ messageinfo 엄청 느린 버그 장비 스탯 추가 구현 - 일꾼 이속, RND_SKILL -일꾼 추가 - +일꾼 + - 일꾼이 아이템 줍기 + - 나의 일꾼 만들기 + - 서버 데이터 diff --git a/Assets/ResWork/Map/Content/BG/Terrain/Map01/Layer_01.terrainlayer b/Assets/ResWork/Map/Content/BG/Terrain/Map01/Layer_01.terrainlayer index 3af216700..75d076d2a 100644 --- a/Assets/ResWork/Map/Content/BG/Terrain/Map01/Layer_01.terrainlayer +++ b/Assets/ResWork/Map/Content/BG/Terrain/Map01/Layer_01.terrainlayer @@ -20,4 +20,3 @@ TerrainLayer: m_DiffuseRemapMax: {x: 1, y: 1, z: 1, w: 1} m_MaskMapRemapMin: {x: 0, y: 0, z: 0, w: 0} m_MaskMapRemapMax: {x: 1, y: 1, z: 1, w: 1} - m_SmoothnessSource: 1 diff --git a/Assets/ResWork/Map/Content/BG/Terrain/Map01/Layer_02.terrainlayer b/Assets/ResWork/Map/Content/BG/Terrain/Map01/Layer_02.terrainlayer index 4514356d9..559073ac6 100644 --- a/Assets/ResWork/Map/Content/BG/Terrain/Map01/Layer_02.terrainlayer +++ b/Assets/ResWork/Map/Content/BG/Terrain/Map01/Layer_02.terrainlayer @@ -20,4 +20,3 @@ TerrainLayer: m_DiffuseRemapMax: {x: 1, y: 1, z: 1, w: 1} m_MaskMapRemapMin: {x: 0, y: 0, z: 0, w: 0} m_MaskMapRemapMax: {x: 1, y: 1, z: 1, w: 1} - m_SmoothnessSource: 1 diff --git a/Assets/Script/Character/Actor.cs b/Assets/Script/Character/Actor.cs index dea8af30a..d586ca62f 100644 --- a/Assets/Script/Character/Actor.cs +++ b/Assets/Script/Character/Actor.cs @@ -626,6 +626,12 @@ public class Actor : MyCoroutine // 펫 부활 var pet = ActorInfo.Ins.Get_Actor(eRole.Pet); if (!DSUtil.CheckNull(pet)) pet.On_Regen(); + // 일꾼 이동 + if (!IsEnemy()) + { + var worker = ActorInfo.Ins.Get_Actor(eRole.Worker); + if (!DSUtil.CheckNull(worker)) worker.On_Regen(); + } // PC 부활 On_Regen(); break; diff --git a/Assets/Script/Character/PCActor.cs b/Assets/Script/Character/PCActor.cs index 921e75f5e..6f33ffeab 100644 --- a/Assets/Script/Character/PCActor.cs +++ b/Assets/Script/Character/PCActor.cs @@ -201,12 +201,13 @@ public class PCActor : MyActor protected override bool IsAvoidCoolTime() { return m_AvoidCoolTime > 0f; } protected override void Set_AvoidCoolTime() { m_AvoidCoolTime = table_GlobalValue.Ins.Get_Int("f_AvoidCoolTime"); } - public void StartCam() + public void StartCam(Action actGetPos) { Camera.main.fieldOfView = 60f; LoadMapMgr.Ins.Get_PortalPos(MyValue.MyChoiceMapData, portalpos => { MyValue.m_RealCamera.Set_Target(transform, Get_RealCamRotAround(portalpos)); + actGetPos?.Invoke(portalpos); }); } float Get_RealCamRotAround(Vector3 portalpos) diff --git a/Assets/Script/Character/WorkerActor.cs b/Assets/Script/Character/WorkerActor.cs index 5ee74d644..e85ffe016 100644 --- a/Assets/Script/Character/WorkerActor.cs +++ b/Assets/Script/Character/WorkerActor.cs @@ -1,5 +1,3 @@ -using System.Collections; -using System.Collections.Generic; using UnityEngine; public class WorkerActor : Actor @@ -8,19 +6,17 @@ public class WorkerActor : Actor DropItem go_finditem; float SeekTime = 5f, t; Actor m_Owner; + bool isOwner; byte Status = 0; // 0 아이들, 1 캐릭터 뒤로 이동 중, 2 아이템으로 이동 중 - protected override void Awake() - { - base.Awake(); - m_Stat = new ActorStatInfo(eRole.Fairy, ServerInfo.Ins.m_ServerData, null); - } - public override void Set(bool isEnemy, Actor owner, ServerData sdata, int _id, bool _stop, bool _ui = false) { base.Set(isEnemy, owner, sdata, _id, _stop); + m_Role = eRole.Worker; m_Owner = owner; + isOwner = m_Owner; + //m_Stat = new ActorStatInfo(m_Role, sdata, null); m_WorkerListTableData = table_worker.Ins.Get_Data_orNull(_id); if (!_ui) @@ -33,6 +29,11 @@ public class WorkerActor : Actor } } + public override void On_Regen(bool reincarnation = false, float healrate = 1) + { + Set_Warp(Get_Pos()); + } + Vector3 Get_Pos() { return DSUtil.Get_RandomPos_onNavMesh(m_Owner.Get_position(), 0f, 1f); @@ -65,7 +66,7 @@ public class WorkerActor : Actor } } - if (Status == 0 && Vector3.Distance(m_Owner.Get_position(), Get_position()) > 3f) + if (Status == 0 && isOwner && Vector3.Distance(m_Owner.Get_position(), Get_position()) > 3f) { // 캐릭터 근처로 옴 Play_Run(); Set_Path(Get_Pos()); diff --git a/Assets/Script/Info/ActorInfo.cs b/Assets/Script/Info/ActorInfo.cs index 21ea34503..5229b0b96 100644 --- a/Assets/Script/Info/ActorInfo.cs +++ b/Assets/Script/Info/ActorInfo.cs @@ -19,8 +19,13 @@ public class ActorInfo : MonoBehaviour List destroylst = new List { eRole.PC, eRole.Pet, eRole.Fairy, eRole.Mob, eRole.BattleNPC, eRole.OBJ, eRole.Farmer }; + Actor m_MyWorker; + public void Destroy_Mobs() { + if (!DSUtil.CheckNull(m_MyWorker)) + Destroy(m_MyWorker.gameObject); + foreach (var role in destroylst) { // dic_actor 딕셔너리에서 destroylst에 포함된 역할(eRole)에 해당하는 항목만 처리 @@ -101,8 +106,13 @@ public class ActorInfo : MonoBehaviour } public void Add_Actor(Actor actor, eRole role, int spawnerId, string prefabName) { // 생성한 액터 추가 - Check_ActorDic(spawnerId, role, prefabName); - dic_actor[role][spawnerId][prefabName].Add(actor); + if (role == eRole.Worker) + m_MyWorker = actor; + else + { + Check_ActorDic(spawnerId, role, prefabName); + dic_actor[role][spawnerId][prefabName].Add(actor); + } } public void All_Heal(float rate) @@ -179,6 +189,8 @@ public class ActorInfo : MonoBehaviour public Actor Get_Actor(eRole role, int spawnerId = 0) { + if (role == eRole.Worker) return m_MyWorker; + if (dic_actor.ContainsKey(role)) { foreach (var item in dic_actor[role][spawnerId]) diff --git a/Assets/Script/Info/InGameInfo.cs b/Assets/Script/Info/InGameInfo.cs index ee9c1050f..cba1992d0 100644 --- a/Assets/Script/Info/InGameInfo.cs +++ b/Assets/Script/Info/InGameInfo.cs @@ -183,7 +183,7 @@ public partial class InGameInfo : MyCoroutine IEnumerator Co_StartCam() { while (!MyValue.bMyPC) yield return null; - MyValue.MyPC.StartCam(); + MyValue.MyPC.StartCam(null); } #region HUD diff --git a/Assets/Script/Info/PCInfo.cs b/Assets/Script/Info/PCInfo.cs index eb9862255..d97b45d8b 100644 --- a/Assets/Script/Info/PCInfo.cs +++ b/Assets/Script/Info/PCInfo.cs @@ -4,7 +4,7 @@ using UnityEngine.ResourceManagement.AsyncOperations; public class PCInfo : MonoBehaviourSingletonTemplate { - public void Make_Actors(bool _IsEnemy, ServerData sdata, bool startcam = false) + public void Make_Actors(bool _IsEnemy, ServerData sdata) { var curMapData = MyValue.MyChoiceMapData; @@ -21,13 +21,14 @@ public class PCInfo : MonoBehaviourSingletonTemplate AddrResourceMgr.Ins.Set_AddressableReleaseSelf(pc.gameObject); pc.Set(_IsEnemy, null, sdata, pcid, true); pc.Set_MyPet(null); - if (startcam) (pc as PCActor).StartCam(); + (pc as PCActor).StartCam(pos => + { + // Pets -> 2024. 9. 21 펫은 한 마리로 변경 + dic_petbattle_deadcount[_IsEnemy][0] = dic_petbattle_deadcount[_IsEnemy][1] = 0; + Make_Pet(_IsEnemy, sdata, pc); // 펫 생성 + Make_Worker(sdata, pc); // 일꾼 생성 + }); ActorInfo.Ins.Add_Actor(pc, _IsEnemy ? eRole.EnemyPC : eRole.PC, 0, costumetable.s_Prefab); - - var chapter = curMapData.n_MapID; - // Pets -> 2024. 9. 21 펫은 한 마리로 변경 - dic_petbattle_deadcount[_IsEnemy][0] = dic_petbattle_deadcount[_IsEnemy][1] = 0; - Make_Pet(_IsEnemy, sdata, pc); } }); @@ -81,6 +82,21 @@ public class PCInfo : MonoBehaviourSingletonTemplate NewGameUI.Ins.arr_PetCard[0].Set_Empty(); } } + public void Make_Worker(ServerData sdata, Actor pc) + { + var workerid = sdata.Get_EqiupmentEquip(eItem.Worker); + if (workerid > 0) + { + var workerData = table_worker.Ins.Get_Data_orNull(workerid); + AddrResourceMgr.Ins.LoadObject($"Assets/Res_Addr/Worker/{workerData.s_Prefab}.prefab", handle => + { + var worker = DSUtil.Get_Clone(handle.Result, transform, null, workerData.f_Scale * Vector3.one); + ActorInfo.Ins.Add_Actor(worker, eRole.Worker, 0, ""); + AddrResourceMgr.Ins.Set_AddressableReleaseSelf(worker.gameObject); + worker.Set(false, pc, sdata, workerid, false); + }); + } + } public void Make_Farmer(int _id) { if (_id > 0) diff --git a/Assets/Script/Server/ServerClass.cs b/Assets/Script/Server/ServerClass.cs index 2a3328a2f..49b9bb5ef 100644 --- a/Assets/Script/Server/ServerClass.cs +++ b/Assets/Script/Server/ServerClass.cs @@ -2302,6 +2302,7 @@ public class SD_Equip [eItem.Pet] = table_GlobalValue.Ins.Get_Int("n_FirstEquipPet"), [eItem.Fairy] = 0, [eItem.Farmer] = 0, + [eItem.Worker] = 70001, }; foreach (var item in Equip) item.Value.RandomizeCryptoKey(); diff --git a/Assets/Script/UI/PC/PCUI.cs b/Assets/Script/UI/PC/PCUI.cs index 207e9591f..e987d029a 100644 --- a/Assets/Script/UI/PC/PCUI.cs +++ b/Assets/Script/UI/PC/PCUI.cs @@ -42,7 +42,7 @@ public class PCUI : BotMenuBase ActorInfo.Ins.Destroy_Mobs(); CoroutineMgr.Ins.Set_Coroutine(() => { - PCInfo.Ins.Make_Actors(false, ServerInfo.Ins.m_ServerData, true); + PCInfo.Ins.Make_Actors(false, ServerInfo.Ins.m_ServerData); }, 0.02f); } } diff --git a/Assets/Script/Util/MyEnum.cs b/Assets/Script/Util/MyEnum.cs index 912b99e13..4fb9e4488 100644 --- a/Assets/Script/Util/MyEnum.cs +++ b/Assets/Script/Util/MyEnum.cs @@ -2,7 +2,7 @@ public enum eGameMode { Lobby, Stage, MyFarm, Dungeon, Max } // list 순서 public enum eDungeon { None, d1_Mimic, d2_Maze, d3_Nightmare, d4_Wave } public enum eDifficult { Normal, Hard, NightMare, Hell, Max } public enum eUnlockCondition { None, BossKill, GetItem, SealBreaking, ChapterClear, } -public enum eRole { Mob, Pet, PC, Fairy, EnemyPC, Farmer, Summon, BattleNPC, OBJ, EnemyPet, EnemySummon } +public enum eRole { Mob, Pet, PC, Worker, Fairy, EnemyPC, Farmer, Summon, BattleNPC, OBJ, EnemyPet, EnemySummon } public enum eSubRol { None, Elite, Boss, Mimic, Summon } public enum eClassType { SwordMan, Archer, Fighter, Mage } public enum eSpawnerType { Random, Order, Phase, PhaseAllKill }