diff --git a/Assets/PerfectWorld/Scripts/ModelFiles/CECComboSkillState.cs b/Assets/PerfectWorld/Scripts/ModelFiles/CECComboSkillState.cs index d731ddb812..411ed87d43 100644 --- a/Assets/PerfectWorld/Scripts/ModelFiles/CECComboSkillState.cs +++ b/Assets/PerfectWorld/Scripts/ModelFiles/CECComboSkillState.cs @@ -1,32 +1,36 @@ using System.Collections.Generic; using UnityEngine; -public class CECComboSkillState +namespace BrewMonster { - public static CECComboSkillState instance; - public static CECComboSkillState Instance { - get - { - if (instance == null) - { - instance = new CECComboSkillState(); - } - return instance; - } - - set => instance = value; - } - private Dictionary m_inherentSkillMap = new Dictionary(); - - public CECSkill GetInherentSkillByID(uint skillID) + public class CECComboSkillState { - if (m_inherentSkillMap.TryGetValue(skillID, out CECSkill skill)) + public static CECComboSkillState instance; + public static CECComboSkillState Instance { - return skill; + get + { + if (instance == null) + { + instance = new CECComboSkillState(); + } + return instance; + } + + set => instance = value; } - else + private Dictionary m_inherentSkillMap = new Dictionary(); + + public CECSkill GetInherentSkillByID(uint skillID) { - return null; + if (m_inherentSkillMap.TryGetValue(skillID, out CECSkill skill)) + { + return skill; + } + else + { + return null; + } } } -} +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Skills/EC_HostSkillModel.cs b/Assets/PerfectWorld/Scripts/Skills/EC_HostSkillModel.cs index c224b26d1b..210af74067 100644 --- a/Assets/PerfectWorld/Scripts/Skills/EC_HostSkillModel.cs +++ b/Assets/PerfectWorld/Scripts/Skills/EC_HostSkillModel.cs @@ -18,7 +18,8 @@ namespace BrewMonster.Scripts.Skills set => instance = value; } - + Dictionary m_allProfSkills = new Dictionary(); + Dictionary> m_allRankProfSkills = new Dictionary>(); public void Initialize() { // Çå¿ÕËùÓм¼ÄÜ£¬·ÀÖ¹ÒòΪ¶à¸ö½ÇÉ«µÇ¼µ¼ÖÂÖØ¸´¼ÓÔØ¼¼ÄÜ @@ -89,35 +90,31 @@ namespace BrewMonster.Scripts.Skills bool isSameClass = (cls == playerCls || cls == 255); bool isProvidedByNPC = npcSkills.Contains(curID); - /*if (isSameClass && isProvidedByNPC) + if (isSameClass && isProvidedByNPC) { - m_allProfSkills[curID] = pSkill; + m_allProfSkills[(int)curID] = pSkill; if (!m_allRankProfSkills.ContainsKey(pSkill.GetRank())) m_allRankProfSkills[pSkill.GetRank()] = new List(); - m_allRankProfSkills[pSkill.GetRank()].Add(curID); + m_allRankProfSkills[pSkill.GetRank()].Add((int)curID); } - else - { - pSkill.Destroy(); - }*/ } // --- B3: Sắp xếp skill trong từng rank theo thứ tự hiển thị --- - /*foreach (var kvp in m_allRankProfSkills) + foreach (var kvp in m_allRankProfSkills) { kvp.Value.Sort((lhs, rhs) => { - var lSkill = GNET.ElementSkill.Create(lhs, 1); - var rSkill = GNET.ElementSkill.Create(rhs, 1); + var lSkill = ElementSkill.Create((uint)lhs, 1); + var rSkill = ElementSkill.Create((uint)rhs, 1); bool result; - if (lSkill.GetType() == GNET.ElementSkill.TYPE_PASSIVE && - rSkill.GetType() != GNET.ElementSkill.TYPE_PASSIVE) + if (lSkill.GetType() == (byte)skill_type.TYPE_PASSIVE && + rSkill.GetType() != (byte)skill_type.TYPE_PASSIVE) { result = false; } - else if (lSkill.GetType() != GNET.ElementSkill.TYPE_PASSIVE && - rSkill.GetType() == GNET.ElementSkill.TYPE_PASSIVE) + else if (lSkill.GetType() != (byte)skill_type.TYPE_PASSIVE && + rSkill.GetType() == (byte)skill_type.TYPE_PASSIVE) { result = true; } @@ -126,12 +123,9 @@ namespace BrewMonster.Scripts.Skills result = lSkill.GetShowOrder() < rSkill.GetShowOrder(); } - lSkill.Destroy(); - rSkill.Destroy(); - return result ? -1 : 1; }); - }*/ + } } diff --git a/Assets/PerfectWorld/Scripts/Skills/ElementSkill.cs b/Assets/PerfectWorld/Scripts/Skills/ElementSkill.cs index 1a317aaeb8..2974edc45c 100644 --- a/Assets/PerfectWorld/Scripts/Skills/ElementSkill.cs +++ b/Assets/PerfectWorld/Scripts/Skills/ElementSkill.cs @@ -1,5 +1,7 @@ using System.Collections.Generic; +using System.Linq; using System.Runtime.InteropServices; +using Unity.VisualScripting; namespace BrewMonster.Scripts.Skills { @@ -112,7 +114,28 @@ namespace BrewMonster.Scripts.Skills public static uint NextSkill(uint id = 0) { //TODO: Implement this - return 0; + var map = SkillStub.GetMap(); + + // if map is empty, return 0 + if (map.Count == 0) + return 0; + + // If start == 0, return the first entry’s value + if (id == 0) + { + var first = map.First(); + return first.Value.GetId(); + } + + // Try to find 'start' key + var keys = map.Keys.OrderBy(k => k).ToList(); + int index = keys.IndexOf(id); + + if (index == -1 || index + 1 >= keys.Count) + return 0; // no next skill + + var nextKey = keys[index + 1]; + return map[nextKey].GetId(); } public static ElementSkill Create(uint id, int n) { @@ -138,7 +161,6 @@ namespace BrewMonster.Scripts.Skills // ������Ч�ͷž���: <-0.001����Ŀ�� -0.001-0.001 Ĭ�Ϲ������룬>0.001 �ͷž��� public virtual float GetPrayRange(float range, float prayplus) { return 0; } - // �������漶�� public virtual int GetRank() { return 0; } // ѧϰn������Ҫ�����Ҽ��� diff --git a/Assets/Scenes/a61.unity b/Assets/Scenes/a61.unity new file mode 100644 index 0000000000..318196ac31 Binary files /dev/null and b/Assets/Scenes/a61.unity differ diff --git a/Assets/Scenes/a61.unity.meta b/Assets/Scenes/a61.unity.meta new file mode 100644 index 0000000000..9897459ab1 --- /dev/null +++ b/Assets/Scenes/a61.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2099d0c0fdfc641509729652b0ed485f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectSettings/EditorSettings.asset b/ProjectSettings/EditorSettings.asset index f7d9bf9d04..697855b302 100644 --- a/ProjectSettings/EditorSettings.asset +++ b/ProjectSettings/EditorSettings.asset @@ -18,7 +18,7 @@ EditorSettings: m_EtcTextureNormalCompressor: 2 m_EtcTextureBestCompressor: 4 m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref - m_ProjectGenerationRootNamespace: + m_ProjectGenerationRootNamespace: BrewMonster m_EnableTextureStreamingInEditMode: 1 m_EnableTextureStreamingInPlayMode: 1 m_EnableEditorAsyncCPUTextureLoading: 0